1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-30 00:00:13 +01:00
VILLASweb/app/templates/components/widget-plot.hbs
Markus Grigull 0e83bbd686 Add table plot widget type
In the plot widget the plot type can be selected
Fix plot widget selecting signals
Fix widgets data observers
2017-01-31 22:12:24 +01:00

96 lines
2.8 KiB
Handlebars

<h4>{{widget.name}}</h4>
{{#if (eq plotType "table")}}
<table class="widgetPlot-signal-table" style="float: left; width: 150px;">
<tr>
<th>
Signal
</th>
</tr>
{{#each simulationModel.mapping as |signal|}}
<tr>
<td>
<a href="" {{action "selectTableSignal" signal}}>{{signal}}</a>
</td>
</tr>
{{/each}}
</table>
<div style="height: 100%; margin-left: 200px;">
{{flow-plot data=plotData options=plotOptions}}
</div>
{{/if}}
{{#if (eq plotType "multiple")}}
{{flow-plot data=plotData options=plotOptions}}
{{/if}}
{{#if isShowingModal}}
{{#modal-dialog attachment="middle center" translucentOverlay=true}}
<h1>Plot</h1>
<form class="form-widget-plot" {{action 'submitModal' on='submit'}} >
<table>
<tr>
<td>
<label for="name">Name</label>
</td>
<td>
{{input id='name' placeholder='Enter widget name' value=name}}
</td>
</tr>
<tr>
<td>
<label for="simulator">Simulator</label>
</td>
<td>
<select onchange={{action "selectSimulationModel" value="target.value"}} >
{{#each widget.visualization.project.simulation.models as |simulationModel|}}
<option value={{simulationModel.name}} selected={{eq simulationModelName simulationModel.name}}>{{simulationModel.name}}</option>
{{/each}}
</select>
</td>
</tr>
<tr>
<td>
<label for="type">Type</label>
</td>
<td>
<select onchange={{action "selectType" value="target.value"}} >
<option value="multiple" selected={{eq plotType "multiple"}}>Multiple</option>
<option value="table" selected={{eq plotType "table"}}>Table</option>
</select>
</td>
</tr>
{{#if (eq plotType "multiple")}}
<tr>
<td>
<label for="signals">Signals</label>
</td>
<td>
{{#each simulationModel.mapping as |signal|}}
{{input type='checkbox' name=signal checked=(mut (get checkedSignals signal))}}<label for={{signal}}> {{signal}}</label>
<br />
{{/each}}
</td>
</tr>
{{/if}}
{{#if (eq plotType "table")}}
{{/if}}
<tr>
<td colspan="2">
<button {{action 'cancelModal'}}>Cancel</button>
<button type="submit">Save</button>
<button {{action 'deleteModal'}}>Delete</button>
</td>
</tr>
</table>
</form>
{{#if errorMessage}}
<p><b>Error:</b> {{errorMessage}}</p>
{{/if}}
{{/modal-dialog}}
{{/if}}