<!-- Default setup template -->
[% INCLUDE device_setup/common.tt %]

<div class="content-container fit-content">
<h2>[% data.type %] '[% data.UIname.replace('_',' ') %]'</h2>
<br>
<table class="device_setup">
[% FOR i IN data.tags -%]
[% IF i.id == 'type' %][% NEXT %][% END -%]
[% IF i.hide %][% NEXT %][% END -%]
<tr><th title="[% i.description %]">[% i.id.replace('_',' ').ucfirst %]</th>
<th>
[% IF i.values.size > 0 -%]
<select name="[% i.id %]" id="[% i.id %]" autocomplete=off onchange="[% IF i.change_reload %]change_type(this)[% ELSE %]change_val(this)[% END %]" class=textfield>
[% FOR j IN i.values -%]
<option value="[% j %]" [% IF i.value.upper == j.upper %]selected=selected[% END %]>[% j %]</option>
[% END -%]
</select>
[% ELSE -%]
[% IF i.readonly == 'Read-write' %]
[% IF i.id == 'comments' || i.id == 'spline' %]
<textarea  name="[% i.id %]" id="[% i.id %]" class=textfield onchange="[% IF i.change_reload %]change_type(this)[% ELSE %]change_spline(this)[% END %]" autocomplete=off>[% i.value.replace(',',"\n") %]</textarea>
[% ELSE %]
<input name="[% i.id %]" id="[% i.id %]" class=textfield [% IF i.id == 'tty' %]style="width:80%;"[% END %] type=text value="[% i.value %]" onchange="[% IF i.change_reload %]change_type(this)[% ELSE %]change_val(this)[% END %]" autocomplete=off>
[% IF i.id == 'tty' %]<button type=button style="float:right;" title="Find avaliable serial ports" onclick="find_tty()">?</button>[% END %]
[% END %]
[% ELSE %]
[% i.readonly_value %]
[% END %]
[% END -%]
</th>
</tr>
[% END -%]
<tr><td></td><td>
<button style="float:right;"><i class="fa fa-save"></i> Save</button>
</td></tr>
<tr><th></th><td><button class=textfield onclick="run_test()"><i class="fa fa-check"></i> Test '[% data.UIname.replace('_',' ') %]'</button></td></tr>
<tr><th></th><td><button class=textfield onclick="run_monitor()"><i class="fa fa-eye"></i> Monitor '[% data.UIname.replace('_',' ') %]'</button></td></tr>
[% FOR i IN data.ui_fn_names %]
<tr><th title="[% i.description %]">[% i.name.replace('_',' ').ucfirst %]</th><td><button class=textfield onclick="[% IF i.args %]run_args('[% data.class %]','[% data.name %]','[% i.name %]',[% i.args %])[% ELSE %]run_no_args('[% data.class %]','[% data.name %]','[% i.name %]')[% END %]"><i class="fa fa-play"></i> Run function</button></td></tr>
[% END %]
<tr><th colspan=2>Include '[% data.UIname.replace('_',' ') %]' in data logging:
<input type=checkbox [% IF data.enabled %]checked=checked[% END%] onchange="change_include(this)" id=include autocomplete=off>
</td></tr>
</table>

</div>
<!-- End default template -->
