diff --git a/webgui/topics/Simulator/Properties.html b/webgui/topics/Simulator/Properties.html index fb3f90569..f20e9aca0 100644 --- a/webgui/topics/Simulator/Properties.html +++ b/webgui/topics/Simulator/Properties.html @@ -21,10 +21,16 @@ text-align: right; } </style> -<div class="ui-widget ui-widget-content ui-corner-all" data-bind="visible: hasGraphItems"> +<div class="ui-widget ui-widget-content ui-corner-all" data-bind="visible: hasGraphItems" style="padding-bottom: 1ex; margin-bottom: 1ex;"> <div class="ui-widget-header">Property Graph</div> <div style="height: 300px; width: 100%" data-bind="flotchart: { data: flotData, options: flotOptions, hover: graphHover }"></div> + <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"> + <div style="display: inline; float: left"> + <div data-bind="button: { icons: { primary : 'ui-icon-gear' }, text: true, label: 'Settings' }, click: settings"></div> + <div data-bind="button: { icons: startIcons, text: true, label: startLabel }, click: startPause "></div> + </div> + </div> </div> <div class=" ui-widget ui-widget-contentui-corner-all"> @@ -87,4 +93,4 @@ </script> <script type="text/html" id="inplace-editor-template"> <input style="width: 8em" > -</script> \ No newline at end of file +</script> diff --git a/webgui/topics/Simulator/Properties.js b/webgui/topics/Simulator/Properties.js index 9edc37e69..9fad9b4b8 100644 --- a/webgui/topics/Simulator/Properties.js +++ b/webgui/topics/Simulator/Properties.js @@ -11,7 +11,6 @@ define([ this.samples = []; this.sample = function(timeStamp) { - console.log(this.samples.length,this.maxSamples); while (this.samples.length >= this.maxSamples) { this.samples.shift(); } @@ -205,6 +204,30 @@ define([ self.root.isExpanded(true); self.properties = self.root.children; + self.startLabel = ko.pureComputed(function() { + return self.running() ? "Pause" : "Start"; + }); + + self.startIcons = ko.pureComputed(function() { + return self.running() ? { + primary : 'ui-icon-pause' + } : { + primary : 'ui-icon-play' + }; + }); + + self.settings = function() { + } + + self.running = ko.observable(false); + self.startPause = function() { + if( self.running() ) { + self.stop(); + } else { + self.start(); + } + } + self.flotOptions = ko.observable({ xaxes : [ { @@ -245,6 +268,7 @@ define([ }); self.propertySampler.start(); + self.running(true); self.toggleProp = function(prop) { @@ -298,7 +322,20 @@ define([ }, 100); } - self.update(++self.updateId); + self.start = function() { + self.update(++self.updateId); + self.propertySampler.start(); + self.running(true); + } + + self.stop = function() { + self.updateId++; + self.propertySampler.stop(); + self.running(false); + } + + self.start(); + } ViewModel.prototype.dispose = function() {