1
{% extends "base.html" %}
2
{% block title %}Register info{% endblock %}
4
<h1>Register '{{ register.name }}' info</h1>
9
function write_register()
11
var value = document.getElementById("set_val_box").value;
12
window.location.href = "{{ url_for('write_register') }}?name={{ register.name }}&"+
13
'bank={{ register.bank }}&val='+value;
17
<table border="1" style="width:100%">
18
{% if 'description' in register %}
20
<th> Description </th>
21
<td> {{ register.description }} </td>
25
<th> Current value </th>
26
<td> {{ value }} </td>
28
{% if 'W' in register.mode %}
32
<input type="text" name="set_val_box" id="set_val_box" value="" />
33
<input type="button" value="set" onclick="write_register()">
39
<td>{{ register.bank }}</td>
42
<th>Default value</th>
43
<td>{{ register.defvalue }}</td>
49
{% for m in register.mode %}
55
{% if 'range' in register %}
4
<script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script>
5
<script src="{{ url_for('static', filename='check_err.js') }}"></script>
9
function updateRegister(bank, name) {
10
var pathToReadRegister = "{{ url_for('read_register_json') }}"
11
var completePath = pathToReadRegister + '?bank=' + bank +
14
$.getJSON(completePath, function(json){
16
$("#actVal").text(json.value)
20
function writeRegister(bank, name)
22
var value = document.getElementById("set_val_box").value;
26
var pathToReadRegister = "{{ url_for('write_register_json') }}"
27
var completePath = pathToReadRegister + '?bank=' + bank +
28
'&name=' + name + '&val=' + value;
30
$.getJSON(completePath,
33
updateRegister(bank, name)
38
<table class="infoTable">
39
<tr class="infoTable">
40
{% if 'description' in register %}
41
<td class="infoTable"> Description </td>
43
<td class="infoTable"> Value </td>
44
<td class="infoTable">Default value</td>
45
<td class="infoTable">Bank</td>
46
<td class="infoTable">Mode</td>
47
{% if 'range' in register %}
48
<td class="infoTable">Range</td>
50
{% if 'values' in register %}
51
<td class="infoTable">Values</td>
55
<tr class="infoTable">
56
{% if 'description' in register %}
57
<td class="infoTable"> {{ register.description }} </td>
59
<td class="infoTable">
61
<tr class="infoTable">
62
<td id="actVal" class="infoTable"> {{ value }} </td>
63
{% if 'R' in register.mode %}
65
<input type="button" value="update"
66
style="width:100%;height:100%"
67
onclick="updateRegister('{{ register.bank }}', '{{ register.name }}')">
71
{% if 'W' in register.mode %}
72
<tr class="infoTable">
74
<input type="text" name="set_val_box" id="set_val_box" value="" />
77
<input type="button" value="set"
78
style="width:100%;height:100%"
79
onclick="writeRegister('{{ register.bank }}', '{{ register.name }}')">
85
<td class="infoTable">{{ register.defvalue }}</td>
86
<td class="infoTable">{{ register.bank }}</td>
87
<td class="infoTable">
89
{% for m in register.mode %}
94
{% if 'range' in register %}
95
<td class="infoTable">
64
<td> {{ register.range.min }} </td>
97
<tr class="infoTable">
98
<td class="infoTable"> min </td>
99
<td class="infoTable"> max </td>
68
<td> {{ register.range.max }} </td>
101
<tr class="infoTable">
102
<td class="infoTable"> {{ register.range.min }} </td>
103
<td class="infoTable"> {{ register.range.max }} </td>
74
108
{% if 'values' in register %}
75
{% for v in register['values'] %}
109
<td class="infoTable">
112
{% for v in register['values'] %}
82
{% if 'description' in v %}
84
<th> description </th>
85
<td> {{ v.description }} </td>
90
<td> {{ v.min }} </td>
94
<td> {{ v.max }} </td>
98
<td> {{ v.value }} </td>
116
<tr class="infoTable">
117
<td class="infoTable"> Name </td>
118
<td class="infoTable"> {{v.name}} </td>
121
{% if 'description' in v %}
122
<tr class="infoTable">
123
<td class="infoTable"> Description </td>
124
<td class="infoTable"> {{ v.description }} </td>
127
<tr class="infoTable">
128
<td class="infoTable"> Min </td>
129
<td class="infoTable"> {{ v.min }} </td>
131
<tr class="infoTable">
132
<td class="infoTable"> Max </td>
133
<td class="infoTable"> {{ v.max }} </td>
135
<tr class="infoTable">
136
<td class="infoTable"> Value </td>
137
<td class="infoTable"> {{ v.value }} </td>