mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
WIP: add one-shot triggering system for plots #203
This commit is contained in:
parent
90becb2257
commit
c8e4e42589
3 changed files with 60 additions and 1 deletions
|
@ -33,6 +33,7 @@ import EditWidgetMinMaxControl from './edit-widget-min-max-control';
|
|||
import EditWidgetParametersControl from './edit-widget-parameters-control';
|
||||
import EditWidgetICControl from './edit-widget-ic-control';
|
||||
import EditWidgetPlotColorsControl from './edit-widget-plot-colors-control';
|
||||
import EditWidgetPlotModeControl from './edit-widget-plot-mode-control';
|
||||
//import EditWidgetHTMLContent from './edit-widget-html-content';
|
||||
|
||||
export default function CreateControls(widgetType = null, widget = null, sessionToken = null, files = null,ics = null, signals, handleChange) {
|
||||
|
@ -75,7 +76,8 @@ export default function CreateControls(widgetType = null, widget = null, session
|
|||
<EditWidgetPlotColorsControl key={2} widget={widget} controlId={'customProperties.lineColors'} signals={signals} handleChange={(e) => handleChange(e)} />,
|
||||
<EditWidgetTextControl key={3} widget={widget} controlId={'customProperties.ylabel'} label={'Y-Axis name'} placeholder={'Enter a name for the y-axis'} handleChange={(e) => handleChange(e)} />,
|
||||
<EditWidgetCheckboxControl key={4} widget={widget} controlId={'customProperties.showUnit'} input text="Show unit" handleChange={e => handleChange(e)} />,
|
||||
<EditWidgetMinMaxControl key={5} widget={widget} controlId="customProperties.y" handleChange={e => handleChange(e)} />
|
||||
<EditWidgetPlotModeControl key={5} widget={widget} controlId={'customProperties.mode'} input handleChange={e => handleChange(e)} />,
|
||||
<EditWidgetMinMaxControl key={6} widget={widget} controlId="customProperties.y" handleChange={e => handleChange(e)} />
|
||||
);
|
||||
break;
|
||||
case 'Table':
|
||||
|
|
56
src/widget/edit-widget/edit-widget-plot-mode-control.js
Normal file
56
src/widget/edit-widget/edit-widget-plot-mode-control.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* This file is part of VILLASweb.
|
||||
*
|
||||
* VILLASweb is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* VILLASweb is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with VILLASweb. If not, see <http://www.gnu.org/licenses/>.
|
||||
**********************************************************************************/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { Form } from 'react-bootstrap';
|
||||
|
||||
class EditWidgetPlotModeControl extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
widget: {},
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props, state){
|
||||
return {
|
||||
widget: props.widget,
|
||||
};
|
||||
}
|
||||
|
||||
handleModeChange(e){
|
||||
|
||||
this.props.handleChange({ target: { id: this.props.controlId, value: e.target.value } });
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<Form.Group controlId="mode">
|
||||
<Form.Label>Select mode</Form.Label>
|
||||
<Form.Control as="select" value={this.props.widget.customProperties.mode || ""} onChange={(e) => this.handleModeChange(e)}>
|
||||
<option key={0} value={"auto time-scrolling"}>Auto time-scrolling</option>
|
||||
<option key={1} value={"last samples"}>Last samples</option>
|
||||
</Form.Control>
|
||||
</Form.Group>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default EditWidgetPlotModeControl;
|
|
@ -91,6 +91,7 @@ class WidgetFactory {
|
|||
widget.customProperties.yUseMinMax = false;
|
||||
widget.customProperties.lineColors = [];
|
||||
widget.customProperties.showUnit = false;
|
||||
widget.customProperties.mode = 'auto time-scrolling';
|
||||
break;
|
||||
case 'Table':
|
||||
widget.minWidth = 200;
|
||||
|
|
Loading…
Add table
Reference in a new issue