summaryrefslogtreecommitdiff
path: root/src/containers/timeline/TimelineControlsContainer.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-18 16:52:11 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:06:04 +0200
commitf8f617c97fcb2df3dbefc9527d974151e367cb60 (patch)
treef6405aa54f73b66220f36e3a388725f71d023cfb /src/containers/timeline/TimelineControlsContainer.js
parent9f86ae6de969baa625e3341c796c64f63b5153ce (diff)
Implement basic experiment mode with timeline
The timeline doesn't trigger anything yet, but the visual element is in place and connected.
Diffstat (limited to 'src/containers/timeline/TimelineControlsContainer.js')
-rw-r--r--src/containers/timeline/TimelineControlsContainer.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/containers/timeline/TimelineControlsContainer.js b/src/containers/timeline/TimelineControlsContainer.js
new file mode 100644
index 00000000..e5c89060
--- /dev/null
+++ b/src/containers/timeline/TimelineControlsContainer.js
@@ -0,0 +1,22 @@
+import {connect} from "react-redux";
+import TimelineControlsComponent from "../../components/timeline/TimelineControlsComponent";
+
+const mapStateToProps = state => {
+ let sectionTicks = [];
+ if (state.currentExperimentId !== -1) {
+ const sectionIds = state.objects.path[state.objects.experiment[state.currentExperimentId].pathId].sectionIds;
+ sectionTicks = sectionIds.map(sectionId => state.objects.section[sectionId].startTick);
+ }
+
+ return {
+ currentTick: state.currentTick,
+ lastSimulatedTick: state.lastSimulatedTick,
+ sectionTicks,
+ };
+};
+
+const TimelineControlsContainer = connect(
+ mapStateToProps
+)(TimelineControlsComponent);
+
+export default TimelineControlsContainer;