-
Notifications
You must be signed in to change notification settings - Fork 4
/
BackupCtrl_control_page.htm
151 lines (130 loc) · 3.89 KB
/
BackupCtrl_control_page.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="./widgets/jqwidgets/styles/jqx.base.css" type="text/css"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1"/>
<script type="text/javascript" src="./widgets/scripts/jquery-1.11.1.min.js">
</script>
<script type="text/javascript" src="./widgets/jqwidgets/jqxcore.js">
</script>
<script type="text/javascript" src="./widgets/jqwidgets/jqxslider.js">
</script>
<script type="text/javascript" src="./widgets/jqwidgets/jqxbuttons.js">
</script>
<script type="text/javascript" src="./widgets/jqwidgets/jqxscrollbar.js">
</script>
<script type="text/javascript" src="./widgets/jqwidgets/jqxpanel.js">
</script>
<script type="text/javascript">
MIN_DCDC_VOLTAGE = 1.66;
MAX_DCDC_VOLTAGE = 31.91;
$(document).ready(function() {
$('#jqxSlider').jqxSlider({ orientation: 'vertical',
height: 400, width: 30, mode: 'fixed',
min: 0, max: 65535, ticksFrequency: 5000, step: 1,
tooltip: true, value: 65535, showTickLabels: true, ticksPosition: 'bottom',
tickLabelFormatFunction: function(value)
{
if (value == 65536) return "";
return value;
}
});
$('#jqxSlider').on('change', function(event) {
Send_DCDC_DAC_code(event); });
setInterval(Timer_Callback, 500);
});
function Show_DAC_state(dac_code)
{
$('#DCDC_DAC_code').text(dac_code);
code = 0xFFFF - dac_code;
v = code * (MAX_DCDC_VOLTAGE - MIN_DCDC_VOLTAGE) / 0xFFFF + MIN_DCDC_VOLTAGE;
$('#DCDC_DAC_voltage').text(v.toFixed(3) + " V");
}
function Send_DCDC_DAC_code(event)
{
var dac_code = event.args.value;
Show_DAC_state(dac_code)
cmd = "SET_DCDC_DAC(" + dac_code + ")";
retMsg = "";
pcm.SendCommand(cmd, retMsg);
}
function Timer_Callback()
{
if (pcm.ReadVariable("!sys.DCDC_DAC_code"))
{
dac_code = pcm.LastVariable_vValue;
Show_DAC_state(dac_code);
$('#jqxSlider').jqxSlider({ value: dac_code });
}
}
</script>
<style>
html, body {
font-family: Verdana, sans-serif;
font-size: 12px;
line-height: 1
}
table td {
border: 1px solid #d4d4d4;
border-style: none;
text-align: left;
padding: 1px;
vertical-align: top;
font-family: Verdana, sans-serif;
font-size: 15px;
line-height: 1.5
}
.table1 {
border-style: solid;
border-width: thin;
}
</style>
</head>
<body>
<object id="pcm" height="0" width="0" classid="clsid:48A185F1-FFDB-11D3-80E3-00C04F176153">
</object>
<table>
<tr>
<td>
<div>
<a href="pcmaster:cmd:Reset_device()" title="Reset Device">Reset device</a>
</div></td>
</tr>
</table>
<br>
<br>
<br>
<table class="table1">
<tr>
<td>
<div style="margin:10px 50px;" id='jqxSlider'>
</div>
</td>
<td>
<div style="font-size: 12px;">
DCDC DAC code
</div>
<div style="font-size: 15px;font-weight: bold;" id='DCDC_DAC_code'>
???
</div>
<br>
<div style="font-size: 12px;">
DCDC voltage
</div>
<div style="font-size: 15px;font-weight: bold;" id='DCDC_DAC_voltage'>
???
</div>
</td>
</tr>
</table>
<div style="padding:10px">
<a href="pcmaster:cmd:ENABLE_DCDC()" title="Enable DCDC">Enable DCDC</a>
</div>
<div style="padding:10px">
<a href="pcmaster:cmd:DISABLE_DCDC()" title="Disable DCDC">Disable DCDC</a>
</div>
</body>
</html>