-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
383 lines (333 loc) · 13.2 KB
/
index.html
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<!DOCTYPE html>
<html>
<head>
<title>OPC-MTConnect-Graco-UNB</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript" src="Agent.js"></script>
<script type="text/javascript" src="DataItem.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css"/>
<link rel="stylesheet" href="css/DataItem.css"/>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/mobile.css" media="(max-width: 939px)">
<script type = "text/javascript">
/*$(document).ready(function(){
$("#cams").load('noimage.html');
})*/
/* Controle MTConnect*/
$(document).ready(function(){
$('#startstream').click(function(){
var options = {
proxy: "http://localhost/opcmtcweb/proxy.php?url=",
url: "http://mtconnectgraco.sytes.net:8080",
interval: 1000
};
var agent = new Agent(options);
var $agent = $(agent);
$agent.bind('devices', function(e, doc){
$('td').empty();
Agent.dataItems(doc).each(function(){
var $this = $(this);
var name = $this.attr('name') || $this.attr('id');
if($("#"+ name).length){
$("<span></span>").DataItem('init', this).appendTo("#"+ name);
}
});
})
.bind('streams', function(e, doc){
Agent.dataItems(doc).each(function(){
var $this = $(this);
if($("#" + $this.attr('dataItemId')).length){
var $elem = $('[data-itemid="' + $this.attr('dataItemId') + '"]');
$elem.DataItem('update', this);
} else if ($("#" + $this.attr('name')).length){
var $elem = $('[data-itemid="' + $this.attr('name') + '"]');
$elem.DataItem('update', this);
}
});
})
.bind('errors', function(e, doc){
console.log(doc);
$('<div></div>')
.text( $(doc).find('Error').text() )
.dialog({
appendTo: 'body',
modal: true
})
;
});
agent.monitor();
});
});
/*Outros Controles*/
function loadvideo(cam){
$("#cams").attr('src',cam);
}
function loadcgi(inpt){
var valor = $(inpt).attr("value");
if(valor=="down"){
$("#commands").attr('src',"cnc_download.htm");
}
else if (valor=="up"){
$("#commands").attr('src',"cnc_upload3.htm");
}else if (valor=="mdi"){
$("#commands").attr('src',"cnc_wrmdiprog.htm");
}else if (valor=="del"){
$("#commands").attr('src',"cnc_delete.htm");
} else if (valor=="list"){
$("#commands").attr('src',"cnc_rdprogdir2.html");
$("#prgs").load("cgi-bin/read/cnc_rdprogdir2.cgi");
}
}
function opccommand(ipt){
var vlr = $(ipt).attr("value");
var imagem = "";
if(vlr=="AUTO"){
$.post("cgi-bin/write/auto.py");
imagem = "#iauto";
$("#iedit").attr('src',"img/off.png");
$("#imdi").attr('src',"img/off.png");
$("#ijog").attr('src',"img/off.png");
} else if (vlr=="EDIT"){
$.post("cgi-bin/write/edit.py");
imagem = "#iedit";
$("#iauto").attr('src',"img/off.png");
$("#imdi").attr('src',"img/off.png");
$("#ijog").attr('src',"img/off.png");
}else if (vlr=="MDI"){
$.post("cgi-bin/write/wmdi.py");
imagem = "#imdi";
$("#iauto").attr('src',"img/off.png");
$("#iedit").attr('src',"img/off.png");
$("#ijog").attr('src',"img/off.png");
}else if (vlr=="JOG"){
$.post("cgi-bin/write/jog.py");
imagem = "#ijog";
$("#iauto").attr('src',"img/off.png");
$("#iedit").attr('src',"img/off.png");
$("#imdi").attr('src',"img/off.png");
} else if (vlr=="CYCLE START"){
$.post("cgi-bin/write/cycstart.py");
$("#icystart").delay(3000).attr('src',"img/on.png").attr('src',"img/off.png");;
}else if (vlr=="CYCLE STOP"){
$.post("cgi-bin/write/cycstop.py");
imagem = "#icystop";
}else if (vlr=="COOL ON"){
$.post("cgi-bin/write/coolon.py");
imagem = "#icoolon";
$("#icooloff").attr('src',"img/off.png");
$("#icoolauto").attr('src',"img/off.png");
}else if (vlr=="COOL OFF"){
$.post("cgi-bin/write/cooloff.py");
imagem = "#icooloff";
$("#icoolon").attr('src',"img/off.png");
$("#icoolauto").attr('src',"img/off.png");
}else if (vlr=="COOL AUTO"){
$.post("cgi-bin/write/coolauto.py");
imagem = "#icoolauto";
$("#icoolon").attr('src',"img/off.png");
$("#icooloff").attr('src',"img/off.png");
}else if (vlr=="-Z"){
$.post("cgi-bin/write/zm.py");
}else if (vlr=="+Z"){
$.post("cgi-bin/write/zp.py");
} else if (vlr=="-X"){
$.post("cgi-bin/write/xm.py");
}else if (vlr=="+X"){
$.post("cgi-bin/write/xp.py");
}else if (vlr=="SING BLOCK"){
$.post("cgi-bin/write/singblk.py");
imagem = "#isgblk";
}else if (vlr=="BLOCK DEL"){
$.post("cgi-bin/write/blkdel.py");
imagem = "#iblkdel";
}else if (vlr=="DRY RUN"){
$.post("cgi-bin/write/dryrun.py");
imagem = "#idryrun";
}else if (vlr=="PROG TEST"){
$.post("cgi-bin/write/progtest.py");
imagem = "#ijprgtest";
}
$imag = $(imagem);
($imag.attr("src") == "img/off.png")? $imag.attr('src',"img/on.png"):$imag.attr('src',"img/off.png");
}
</script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="fundo" class="main-container">
<div id="side-left" class="control-left">
<img src="img/machineON.jpg" alt="Machine ON" class="maquina">
<!-- <div style="background-color:black;color:white;">
<h1>Conteudo OPC - Imagem dinamica</h1>
<p>Aqui escrevo todos os controles referentes ao serviço OPC - Imagem Imagem</P>
</div> -->
<div class="panel-led">
<h1>LEDs <h1>
<ul>
<li>
<img src="img/off.png" alt="On" id="imcalm"> MC ALM
</li>
<li>
<img src="img/off.png" alt="On" id="iauto"> AUTO
</li>
<li>
<img src="img/off.png" alt="On" id="imdi"> MDI
</li>
<li>
<img src="img/off.png" alt="On" id="isgblk"> SING BLK
</li>
<li>
<img src="img/off.png" alt="On" id="idryrun"> DRY RUN
</li>
<li>
<img src="img/off.png" alt="On" id="icoolon"> COOL ON
</li>
<li>
<img src="img/off.png" alt="On" id="icoolauto"> COOL AUTO
</li>
<li>
<img src="img/off.png" alt="On" id="icystop"> CYCLE STOP
</li>
</ul>
<ul>
<li>
<ul>
<li>
<img src="img/off.png" id="incalm"> NC ALM
</li>
<li>
<img src="img/off.png" id="iedit"> EDIT
</li>
<li>
<li><img src="img/off.png" id="ijog"> JOG
</li>
<li>
<img src="img/off.png" id="iblkdel"> BLK DEL
</li>
<li>
<img src="img/off.png" id="iprgtest"> PROG TEST
</li>
<li>
<img src="img/off.png" id="icooloff"> COOL OFF
</li>
<li>
<img src="img/off.png" id="icystart"> CYCLE START
</li>
<li>
<img src="img/off.png" id="idoorcld"> DOOR CLOSED
</li>
</ul>
</div>
<div class="panel-button">
<h1>OPERATION PANEL <h1>
<ul>
<li>
<input type="button" value="AUTO" onclick="opccommand(this)">
<input type="button" value="EDIT" onclick="opccommand(this)">
<input type="button" value="MDI" onclick="opccommand(this)">
<input type="button" value="JOG" onclick="opccommand(this)">
</li>
<li>
<input type="button" value="SING BLOCK" onclick="opccommand(this)">
<input type="button" value="BLOCK DEL" onclick="opccommand(this)">
<input type="button" value="DRY RUN" onclick="opccommand(this)">
<input type="button" value="PROG TEST" onclick="opccommand(this)">
</li>
<li>
<input type="button" value="-X" onclick="opccommand(this)">
<input type="button" value="+X" onclick="opccommand(this)">
<input type="button" value="-Z" onclick="opccommand(this)">
<input type="button" value="+Z" onclick="opccommand(this)">
</li>
<li>
<input type="button" value="COOL ON" onclick="opccommand(this)">
<input type="button" value="COOL OFF" onclick="opccommand(this)">
<input type="button" value="COOL AUTO" onclick="opccommand(this)">
</li>
<li>
<input type="button" value="CYCLE START" onclick="opccommand(this)">
<input type="button" value="CYCLE STOP" onclick="opccommand(this)">
</li>
<li>
<input type="button" value="RESET" onclick="opccommand(this)">
</li>
</ul>
</div>
</div><!-- fim .container .destaque -->
<div id="side-right" class="control-right">
<div class="mtcbutton">
<button id="startstream">Start Monitor</button>
</div>
<div class="mtcdisplay">
<h1>MACHINE STATUS</h1></br>
<table id="ms">
<tr><th>Availability</th><th>Execution</th> <th>Contr. Mode</th> <th>Emerg. Stop</th> <th>Part Count</th></tr>
<tr><td id='avail'>unavailable</td><td id='execution'>unavailable</td> <td id='mode'> unavailable</td><td id='estop'> unavailable</td><td id='part_count'>unavailable</td></tr>
</table></br>
<h1>PROCESS STATUS</h1></br>
<table id="ps">
<tr><th>Program</th><th>Block</th><th> Line</th></tr>
<tr><td id='program'>unavailable</td><td id='block'>unavailable</td><td id='line'>unavailable</td></tr>
<tr><th> Tool ID</th><th>Xact(mm)</th><th>Zact(mm)</th></tr>
<tr><td id='tool_id'>unavailable</td><td id='Xact'>unavailable</td><td id='Zact'>unavailable</td></tr>
<tr><th>Cact[Angle(º)]</th><th>Act Spdle Speed(rpm)</th><th>Xcom(mm)</th></tr>
<tr><td id='Cact'>unavailable</td><td id='S1speed'>unavailable</td><td id='Xcomm'>unavailable</td></tr>
<tr><th>Zcom(mm)</th><th>Rotary Mode</th><th>Ccom Pos.(º)</th></tr>
<tr><td id='Zcomm'>unavailable</td><td id='rfunc'>unavailable</td><td> - </td></tr>
<tr><th>Xload (%)</th> <th>Zload(%)</th><th>Cload(%)</th></tr>
<tr><td id='Xload'>unavailable</td><td id='Zload'>unavailable</td><td id='Cload'>unavailable</td></tr>
<tr><th>Spndle Load(%)</th><th>Act.Path Frt(mm/s)</th><th>Frt Override(%)</th></tr>
<tr><td id='S1load'>unavailable</td><td id='path_feedrate'>unavailable</td><td id='f_command'>unavailable</td></tr>
<tr> <th>Act.Path Pos.(mm)</th><th>-</th></td><th>-</th></tr>
<tr><td id='path_position'>unavailable</td><td>-</td></td><td>-</td></tr>
</table></br>
<h1>PROCESS CONDITION</h1></br>
<table id="pc">
<tr><th>System</th><th>Communications</th> <th>Motion Prog</th> <th>Logic Prog.</th></tr>
<tr><td id='system'>unavailable</td><td id='comm'>unavailable</td> <td id='motion'> unavailable</td><td id='logic'> unavailable</td></tr>
<tr><th>Hardware</th><th>Temperature</th> <th>Overload(X)</th> <th>Overtravel(X)</th></tr>
<tr><td id='hardware'>unavailable</td><td id='temp'>unavailable</td><td id='Xoverload'>unavailable</td><td id='Xtravel'>unavailable</td></tr>
<tr><th>Overload(Z)</th> <th>Overtravel(Z)</th><th>Overload(C)</th><th>Overtemp(C)</th></tr>
<tr><td id='Zoverload'>unavailable</td><td id='Ztravel'>unavailable</td> <td id='Coverload'> unavailable</td><td id='Ctemp'> unavailable</td></tr>
<tr><th>Overload(S1)</th><th>Overtemp(S1)</th><th>-</th> <th>-</th></tr>
<tr><td id='S1overload'>unavailable</td><td id='S1temp'>unavailable</td><td>-</td><td> -</td></tr>
</table>
</div>
<div class="dnc">
<form>
<input type="radio" name="comando" value="down" onclick="loadcgi(this)" Unchecked> NC Prog. Download
<input type="radio" name="comando" value="up" onclick="loadcgi(this)" Unchecked> NC Prog. Upload
<input type="radio" name="comando" value="mdi" onclick="loadcgi(this)" Unchecked> MDI
<input type="radio" name="comando" value="del" onclick="loadcgi(this)" Unchecked> Delete NC Prog.
<input type="radio" id="list" name="comando" value="list" onclick="loadcgi(this)" Unchecked> List NC Prog.
</form>
</div>
<iframe id = "commands" class="dncdisplay" name="dnc" src="initmsg.html">
**CLICK ON DNC FUNCTION**
</iframe>
<iframe id="cams" class="cameras" src="noimage.html">
</iframe>
<div class="activecam">
<button type="button" onclick="loadvideo('http://video.graco.unb.br/camera1.html')">CAM1</button>
<button type="button" onclick="loadvideo('http://video.graco.unb.br/camera2.html')">CAM2</button>
<button type="button" onclick="loadvideo('http://video.graco.unb.br/camera3.html')">CAM3</button>
<button type="button" onclick="loadvideo('http://video.graco.unb.br/camera4.html')">CAM4</button>
<button type="button" onclick="javascript:window.open('http://video.graco.unb.br')" target = "_blank" >ALL</button>
</div>
<div class="showmsg">
<p>Alarm/messages:</p></br>
<p id="message"></p>
</div>
<div id="prgs" class="listprogram">
<p>***List NC Programs***</p>
</div>
</div>
</div>
</body>
</html>