diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-21 15:10:15 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:06:04 +0200 |
| commit | 0439ccf76f9ccf68c7572deadf38d6a157c439e7 (patch) | |
| tree | e71d3ac9b2ab443d8c49342cc6c7708ba2a00788 /src/reducers | |
| parent | da861719c6433a1fc9346da958f0907e52d578ce (diff) | |
Implement last-simulated-tick and states fetching
Diffstat (limited to 'src/reducers')
| -rw-r--r-- | src/reducers/index.js | 3 | ||||
| -rw-r--r-- | src/reducers/interaction-level.js | 2 | ||||
| -rw-r--r-- | src/reducers/states.js | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/reducers/index.js b/src/reducers/index.js index a9b6bf34..17b75182 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -7,7 +7,7 @@ import {map} from "./map"; import {modals} from "./modals"; import {objects} from "./objects"; import {simulationList} from "./simulation-list"; -import {currentExperimentId, currentTick, isPlaying, loadMetric} from "./simulation-mode"; +import {currentExperimentId, currentTick, isPlaying, lastSimulatedTick, loadMetric} from "./simulation-mode"; import {states} from "./states"; const rootReducer = combineReducers({ @@ -21,6 +21,7 @@ const rootReducer = combineReducers({ currentDatacenterId, currentExperimentId, currentTick, + lastSimulatedTick, loadMetric, isPlaying, interactionLevel, diff --git a/src/reducers/interaction-level.js b/src/reducers/interaction-level.js index 282e5096..5a45fc68 100644 --- a/src/reducers/interaction-level.js +++ b/src/reducers/interaction-level.js @@ -6,11 +6,13 @@ import { GO_FROM_ROOM_TO_RACK } from "../actions/interaction-level"; import {OPEN_SIMULATION_SUCCEEDED} from "../actions/simulations"; +import {SET_CURRENT_DATACENTER} from "../actions/topology/building"; export function interactionLevel(state = {mode: "BUILDING"}, action) { switch (action.type) { case OPEN_EXPERIMENT_SUCCEEDED: case OPEN_SIMULATION_SUCCEEDED: + case SET_CURRENT_DATACENTER: return { mode: "BUILDING" }; diff --git a/src/reducers/states.js b/src/reducers/states.js index a9eb4ce8..d74c924c 100644 --- a/src/reducers/states.js +++ b/src/reducers/states.js @@ -22,7 +22,7 @@ function objectStates(type) { [action.tick]: Object.assign( {}, state[action.tick], - {[action.object.id]: action.object} + {[action.object[action.objectType + "Id"]]: action.object} ) } ); |
