581 lines
24 KiB
HTML
581 lines
24 KiB
HTML
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
||
<link rel="stylesheet" href="../files/bootstrap.min.css">
|
||
<link rel="stylesheet" href="../files/layout.css">
|
||
<script src="../files/jquery-3.3.1.min.js"></script>
|
||
<script src="../files/popper.min.js"></script>
|
||
<script src="../files/bootstrap.min.js"></script>
|
||
<script src="./base.js"></script>
|
||
<title id="pt_v">iForte</title>
|
||
</head>
|
||
<body>
|
||
<!-- NAV WILL BE ADDED HERE BY FUNCTION IN BASE JS -->
|
||
<div class="fixed-top text-center device-label" id="pth">iForte</div>
|
||
<div class="container-fluid in">
|
||
<h1>Personality</h1>
|
||
<div class="row" id="boxes">
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>DMX/RDM settings <a class="cfg" onclick="open_modal(0);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>DMX address</li>
|
||
<li>DMX preset</li>
|
||
<li>DMX input</li>
|
||
<li>RDM label</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_dmxa_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dmxp_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dmxi_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_rdmn_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Ethernet settings <a class="cfg" onclick="open_modal(1);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Ethernet mode</li>
|
||
<li>Ethernet to DMX</li>
|
||
<li>ArtNet universe</li>
|
||
<li>MANet I/II universe</li>
|
||
<li>MaNet session ID</li>
|
||
<li>sACN universe</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_emod_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_ee2d_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_eanu_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_emau_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_emas_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_esau_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Pan/Tilt settings <a class="cfg" onclick="open_modal(2);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Pan reverse</li>
|
||
<li>Tilt reverse</li>
|
||
<li>Pan/Tilt feedback</li>
|
||
<li>Pan/Tilt mode</li>
|
||
<li>Pan/Tilt EMS</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_pr_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_tr_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_ptf_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_ptm_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_pte_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Blackout settings <a class="cfg" onclick="open_modal(3);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Blackout DMC</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_bldmc_v"></div>
|
||
</li>
|
||
</ul>
|
||
<h3>Active blackout while</h3>
|
||
<ul class="group">
|
||
<li>Pan/Tilt moving</li>
|
||
<li>Gobo wheel moving</li>
|
||
<li>Color wheel moving</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_blptm_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_blgwm_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_blprm_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Screen settings <a class="cfg" onclick="open_modal(4);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Display intensity</li>
|
||
<li>Screensaver delay</li>
|
||
<li>Touchscreen lock</li>
|
||
<li>Display orientation</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_dint_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dsd_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dtl_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dor_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Color settings <a class="cfg" onclick="open_modal(7);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Dimmer curve</li>
|
||
<li>High power mode</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_cdimc_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_hpwrm_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Date & time settings <a class="cfg" onclick="open_modal(5);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Date</li>
|
||
<li>Time</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_dtd_v"></div>.<div id="iforte_dtmo_v"></div>.<div id="iforte_dty_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_dth_v"></div>:<div id="iforte_dtmi_v"></div>:<div id="iforte_dts_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c">
|
||
<h2>Other settings <a class="cfg" onclick="open_modal(6);">
|
||
<img src="../files/settings.svg">
|
||
</a>
|
||
</h2>
|
||
<div class="box">
|
||
<ul class="group">
|
||
<li>Follow spot mode</li>
|
||
<li>LEDs output frequency (Hz)</li>
|
||
<li>Fan mode</li>
|
||
<li>Gobo indexing</li>
|
||
<li>Temperature unit</li>
|
||
<li>Display buttons</li>
|
||
</ul>
|
||
<ul class="group vals" id="">
|
||
<li>
|
||
<div id="iforte_fsmo_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_frq_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_fanm_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_gind_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_tmpu_v"></div>
|
||
</li>
|
||
<li>
|
||
<div id="iforte_btns_v"></div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6 col-xl-4 box-c" style="display: block;"><h2>Pressure test</h2><div class="box prst text-center"><span></span><span></span><span></span><button class="btn btn-success btn-block" id="pt_b">Start test</button></div></div>
|
||
<div class="col-md-6 col-xl-4 box-c" style="display: block;"><h2>Pressure test</h2><div class="box prst text-center"><span></span><span class="ptok">OK</span><span></span><button class="btn btn-block btn-success" id="pt_b">Start test</button></div></div>
|
||
<div class="col-md-6 col-xl-4 box-c" style="display: block;"><h2>Pressure test</h2><div class="box prst text-center"><span></span><span class="ptf">FAIL</span><span></span><button class="btn btn-block btn-success" id="pt_b">Start test</button></div></div>
|
||
<div class="col-md-6 col-xl-4 box-c" style="display: block;"><h2>Pressure test</h2><div class="box prst text-center"><span>Measuring Pressure</span><span>Remaining Time 04:37</span><span>42 °C / delta 3.34 hPa</span><button class="btn btn-block btn-danger" id="pt_b">Stop test</button></div></div>
|
||
|
||
</div>
|
||
</div>
|
||
<div id="cfg-modal" class="modal fade" tabindex="-1" role="dialog">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<img src="../files/settings.svg">
|
||
<h5 class="modal-title" id="m-t"></h5>
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
<div class="modal-body" id="m-b"></div>
|
||
<div class="modal-footer" id="m-f">
|
||
<button type="button" class="btn btn-primary sb">Save</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
var a_m = -1;
|
||
var m_t = ['DMX/RDM settings', 'Ethernet settings', 'Pan/Tilt settings', 'Blackout settings', 'Screen settings', 'Date & time settings', 'Other settings', 'Color settings', 'Lamp settings', ];
|
||
var addrs = ['set_dmx', 'eth_s', 'pt_s', 'bl_s', 'dis_s', 'ldt_s', 'oth_s', 'col_s', 'lamp_s', ];
|
||
var params = [
|
||
['iforte_dmxa', 'dmxp', 'dmxi', 'rdmn'],
|
||
['emod', 'ee2d', 'eanu', 'emau', 'emas', 'esau'],
|
||
['pr', 'tr', 'ptf', 'ptm', 'pte'],
|
||
['bldmc', 'blptm', 'blprm', 'blgwm', 'bltim'],
|
||
['dint', 'dsd', 'dtl', 'dor'],
|
||
['dtd', 'dtmo', 'dty', 'dth', 'dtmi', 'dts'],
|
||
['mics', 'fanm', 'tmpu', 'them', 'cpm', 'fannl', 'fsmo', 'btns', 'freq', 'freqa', 'gind', 'gwhm'],
|
||
['ccri', 'cdimc', 'hpwrm', 'ccalm', 'cmixm', 'chrwh', 'thefs', 'whip83z'],
|
||
['lonof', 'lpwr', 'ligde', 'llise', 'lonpon', 'lofvd', 'londp', 'lofdm'],
|
||
];
|
||
var frq = 0;
|
||
|
||
function open_modal(i) {
|
||
a_m = i;
|
||
mhdr_status('');
|
||
if (a_m < m_t.length) {
|
||
$('#m-t').html(m_t[a_m])
|
||
}
|
||
$('.sb').unbind();
|
||
$('#m-f').empty();
|
||
$('#m-f').append('<button type="button" class="btn btn-primary sb">Save</button>');
|
||
var off_on_l=['off','on'];
|
||
var h='';
|
||
if(a_m==0){
|
||
h+=c_txt('dmxa','DMX address','Please put DMX address from 1 to 512');
|
||
h+=c_opt('dmxp','DMX preset',[1],'Mode ',0,1,'');
|
||
h+=c_opt('dmxi','DMX input',['wired','wireless','wireless XLR out'],'',0,1,'Can not set wireless input now!');
|
||
h+=c_txt('rdmn','RDM label','Please insert label,max 32 characters')
|
||
} else if(a_m==1){
|
||
h+=c_rad('emod','Ethernet mode',['disable','ArtNet','gMA1','gMA2','sACN'],'','');
|
||
h+=c_rad('ee2d','Ethernet to DMX',off_on_l,'','');
|
||
h+=c_txt('eanu','ArtNet universe','Please put ArtNet universe from 0 to 255');
|
||
h+=c_txt('emau','MANet I/II universe','Please put MANet I / II universe from 1 to 256 (64 for MANet I)');
|
||
h+=c_txt('emas','MANet session ID','Please put MANet session ID from 1 to 32');
|
||
h+=c_txt('esau','sACN universe','Please put sACN universe from 1 to 32000')
|
||
} else if(a_m==2){
|
||
h+='<div class="row">';
|
||
h+=c_rad('pr','Pan reverse',off_on_l,'','col-6');
|
||
h+=c_rad('tr','Tilt reverse',off_on_l,'','col-6');
|
||
h+=c_rad('ptf','Pan / Tilt feedback',off_on_l,'','col-6');
|
||
h+=c_rad('ptm','Pan / Tilt Mode',['speed','time'],'','col-6');
|
||
h+=c_rad('pte','Pan / Tilt EMS',off_on_l,'','col-6');
|
||
h+='</div>'
|
||
} else if(a_m==3){
|
||
h+=c_rad('bldmc','Blackout DMC',off_on_l,'','');
|
||
h+='<h3>Active blackout while</h3>';
|
||
h+=c_rad('blptm','Pan/Tilt moving',off_on_l,'','');
|
||
h+=c_rad('blgwm','Gobo wheel moving',off_on_l,'','');
|
||
h+=c_rad('blprm','Color wheel moving',off_on_l,'','')
|
||
} else if(a_m==4){
|
||
h+=c_opt('dint','Display intensity',[10],'',0,1,'');
|
||
var dsd_dtl_l=['off','1 min','2 min','3 min','4 min','5 min','6 min','7 min','8 min','9 min','10 min'];
|
||
h+=c_opt('dsd','Screensaver delay',dsd_dtl_l,'',0,0,'');
|
||
h+=c_opt('dtl','Touchscreen lock',dsd_dtl_l,'',0,0,'');
|
||
h+=c_rad('dor','Display orientation',['normal','inverted','auto'],'')
|
||
} else if(a_m==5) {
|
||
h+='<div class="row">';
|
||
h+=c_txt('dtd','Day','','col-4');
|
||
h+=c_txt('dtmo','Month','','col-4');
|
||
h+=c_txt('dty','Year','','col-4');
|
||
h+=c_txt('dth','Hour','','col-4');
|
||
h+=c_txt('dtmi','Minute','','col-4');
|
||
h+=c_txt('dts','Second','','col-4');
|
||
h+='</div>';
|
||
h+='<button class="btn btn-primary btn-block uldt">Use local date & time</button>'
|
||
} else if(a_m==6){
|
||
h+=c_opt('fsmo','Follow spot mode',['off','soft','medium','hard'],'',0,0,'');
|
||
h+=c_rad('frqs','LEDs output frequency (Hz)',['300','600','1200','2400'],'','');
|
||
h+='<div class="form-group">';
|
||
h+='<label for="frqa" class="col-form-label">LEDs frequency adjust</label>';
|
||
h+='<div class="row">';
|
||
h+='<div class="col-7 col-sm-8"><input type="range" min="0" max="1663" class="form-control" id="frqa"></div>';
|
||
h+='<div class="col-5 col-sm-4 mt06 text-right" id="frq_bv"></div>';
|
||
h+='</div>';
|
||
h+='</div>';
|
||
h+=c_rad('fanm','Fan mode',['auto','high','quiet'],'','');
|
||
h+='<div class="form-group" id="fannl_fg">';
|
||
h+='<label for="fannl" class="col-form-label">Fan noise level</label>';
|
||
h+='<div class="row">';
|
||
h+='<div class="col-9 col-sm-10"><input type="range" min="0" max="100" class="form-control" id="fannl"></div>';
|
||
h+='<div class="col-3 col-sm-2 mt06 text-right">100 %</div>';
|
||
h+='</div>';
|
||
h+='</div>';
|
||
h+=c_opt('gind','Gobo indexing',['max. speed & shortcut','follow spd. & dir.','max. spd. & follow dir.'],'',0,0,'');
|
||
h+=c_rad('tmpu','Temperature unit',['°C','°F'],'','');
|
||
h+=c_rad('btns','Display buttons',off_on_l,'','')
|
||
} else if(a_m==7){
|
||
h+='<div class="row">';
|
||
h+=c_rad('cdimc','Dimmer curve',['linear','square law'],'','col-6');
|
||
h+=c_rad('hpwrm','High power mode',off_on_l,'','')
|
||
} else if(a_m==8){
|
||
h+=c_rad('lonof','Lamp status',off_on_l,'','');
|
||
h+='<div class="form-group" id="ligde_fg"> ';
|
||
h+='<label for="ligde" class="col-form-label">Lamp ignition delay</label>';
|
||
h+='<div class="row">';
|
||
h+='<div class="col-9 col-sm-10"><input type="range" min="0" max = "90" class="form-control" id="ligde"></div>';
|
||
h+='<div class="col-3 col-sm-2 mt06 text-right"></div>';
|
||
h+='</div>';
|
||
h+='</div>';
|
||
h+='<div class="row">';
|
||
h+=c_rad('llise','Lamp light sensor',off_on_l,'','col-6');
|
||
h+=c_rad('lonpon ','Lamp on power on',off_on_l,'','col-6');
|
||
h+=c_rad('lofvd','Lamp off via DMX',off_on_l,'','col-6');
|
||
h+=c_rad('londp','Lamp on if DMX present',off_on_l,'','col-6');
|
||
h+=c_rad('lofdm ','Lamp off if DMX missing',off_on_l,'','col-6');
|
||
h+='</div>'
|
||
}
|
||
|
||
$('#m-b').html(h);
|
||
$('#m-f').show();
|
||
copy_form_values(1);
|
||
if(a_m==8){
|
||
if($('#ligde_v').html()=='off'){
|
||
$('#ligde').val(0)}
|
||
}
|
||
$('#cfg-modal').modal();
|
||
$('.sb').bind('click',function(){
|
||
loader(1);
|
||
var p_add='';
|
||
if(a_m==6){
|
||
p_add='&frq='+frq
|
||
}
|
||
do_ajax(addrs[a_m],pv(params[a_m])+p_add,function (json){
|
||
if(json){
|
||
if(json['status']==0){
|
||
mhdr_status('suc');
|
||
copy_form_values(0);
|
||
if(a_m==0){
|
||
fill_values(json,['dmxf']);
|
||
ptit(json['pt'])
|
||
} else if(a_m==6){
|
||
if(json['fanm']=='quiet'){
|
||
$('#themq').show();
|
||
} else {
|
||
$('#themq').hide();
|
||
}
|
||
$('#frqs_v').html(frq_s(frq))
|
||
} else if(a_m==8){
|
||
if($('#ligde').val()==0) {
|
||
$('#ligde_v').html('off')
|
||
}
|
||
}
|
||
close_modal()
|
||
}
|
||
show_errors(json['status'],params[a_m]);loader(0)
|
||
}
|
||
})
|
||
});
|
||
if(a_m==5){
|
||
$('.uldt').bind('click',function(){
|
||
var date=new Date();
|
||
$('#dtd').val(date.getDate());
|
||
$('#dtmo').val(date.getMonth()+1);
|
||
$('#dty').val(date.getFullYear());
|
||
$('#dth').val(('0'+date.getHours()).slice(-2));
|
||
$('#dtmi').val(('0'+date.getMinutes()).slice(-2));
|
||
$('#dts').val(('0'+date.getSeconds()).slice(-2))
|
||
})
|
||
} else if(a_m==6){
|
||
$('#fannl').on('input change',function(){
|
||
$(this).parent().next().html($(this).val()+'%')
|
||
});
|
||
$('#fannl').change();
|
||
$('input[name=fanm]').on('change',function(){
|
||
if($('input[name=fanm]:checked').val()==2) {
|
||
$('#fannl_fg').show();
|
||
} else {
|
||
$('#fannl_fg').hide()
|
||
}
|
||
});
|
||
$('input[name=fanm]').change();
|
||
$('input[name=frqs]').eq(frq>>12).attr('checked','checked');
|
||
$('#frqa').val(frq & 0xfff);
|
||
$('input[name=frqs]').on('change',function(){
|
||
frq=$('input[name=frqs]:checked').val() << 12; frq |= 0x340;
|
||
$('#frqa').val(0x340);
|
||
$('#frq_bv').html(frq_s(frq) + ' Hz')
|
||
});
|
||
$('#frqa').on('input change', function() {
|
||
frq &= 0xf000;
|
||
frq |= $('#frqa').val();
|
||
$('#frq_bv').html(frq_s(frq) + ' Hz')
|
||
});
|
||
$('#frqa').change()
|
||
}
|
||
else if (a_m == 8) {
|
||
$('#ligde').on('input change', function() {
|
||
var o = $(this).parent().next();
|
||
if ($(this).val() == 0) o.html('off');
|
||
else o.html($(this).val() + 's')
|
||
});
|
||
$('#ligde').change()
|
||
}
|
||
}
|
||
|
||
function frq_s(frq) {
|
||
var f = 360000000000;
|
||
var k = (0x700) - (frq & 0xfff);
|
||
var arr = 465 + ((k >> 8) & 0x0f);
|
||
var x = k & 0xff;
|
||
f = f * (1 << (frq >> 12)) / (arr * (256 - x) + (arr + 1) * (x));
|
||
return Math.floor(f / 10000) + '.' + ('0000' + Math.floor(f % 10000)).slice(-4)
|
||
}
|
||
|
||
$(document).ready(function() {
|
||
var bussy = false;
|
||
|
||
function do_1s() {
|
||
bussy = true;
|
||
do_ajax('/ldt_s', {}, function(json) {
|
||
if (json) {
|
||
fill_values(json, ['dtd', 'dtmo', 'dty', 'dth', 'dtmi', 'dts'])
|
||
}
|
||
bussy = false
|
||
})
|
||
}
|
||
do_ajax('/status_i', {}, function(json) {
|
||
if (json) {
|
||
fill_values(json, ['dmxa', 'dmxp', 'dmxf', 'dmxi', 'pt', 'rdmn']);
|
||
ptit(json['pt'])
|
||
}
|
||
});
|
||
for (var i in addrs) {
|
||
if (i == 0) continue;
|
||
do_ajax('/' + addrs[i], {}, function(json, i) {
|
||
if (json) {
|
||
fill_values(json, params[i]);
|
||
if (i == 6) {
|
||
if (json['fanm'] == 'quiet') $('#themq').show();
|
||
frq = json['frq'];
|
||
$('#frqs_v').html(frq_s(frq))
|
||
} else if (i == 8) {
|
||
if (json['ligde'] == 0) $('#ligde_v').html('off')
|
||
}
|
||
}
|
||
}, i)
|
||
}
|
||
do_1s();
|
||
var pt_d = 5;
|
||
var pt_t = pt_t;
|
||
var ptl = $('.box.prst span');
|
||
var pt_b = $('#pt_b');
|
||
|
||
function press_w(json) {
|
||
if (!json) return;
|
||
if (json[' ts '] == 1) {
|
||
pt_d = 1;
|
||
ptl.eq(0).html(json['l1']);
|
||
ptl.eq(1).removeAttr('class').html(json['l2'].replace('\u007f', '°'));
|
||
ptl.eq(2).html(json['l3'].replace('\u007f', '°'));
|
||
if (pt_b.hasClass('btn-success')) {
|
||
pt_b.toggleClass('btn-danger btn-success');
|
||
pt_b.html('Stop test')
|
||
}
|
||
} else {
|
||
pt_d = 5;
|
||
if (pt_b.hasClass('btn-danger')) {
|
||
pt_b.toggleClass('btn-danger btn-success');
|
||
pt_b.html('Start test');
|
||
if (json['res'] > 0) {
|
||
ptl.eq(0).html('');
|
||
ptl.eq(2).html('');
|
||
if (json['res'] == 1) ptl.eq(1).addClass('ptok').html('OK');
|
||
else ptl.eq(1).addClass('ptf').html('FAIL')
|
||
} else if (json['ts'] == 0) ptl.html('')
|
||
}
|
||
}
|
||
}
|
||
|
||
function press_t() {
|
||
pt_t++;
|
||
if (pt_t < pt_d) return;
|
||
pt_t = 0;
|
||
do_ajax('/prst', {}, function(json) {
|
||
press_w(json)
|
||
})
|
||
}
|
||
$('#pt_b').click(function() {
|
||
var b = 1;
|
||
if (pt_b.hasClass('btn-danger')) b = 2;
|
||
else pt_d = 1;
|
||
var run = true;
|
||
if (!confirm('Are you sure you want to ' + (b == 1 ? 'run' : 'cancel') + ' a pressure test?')) run = false;
|
||
if (run) {
|
||
do_ajax('/prst', 'btn=' + b, function(json) {});
|
||
setTimeout(function() {
|
||
do_ajax('/prst', {}, function(json) {
|
||
press_w(json)
|
||
})
|
||
}, 200)
|
||
}
|
||
});
|
||
setInterval(function() {
|
||
if (!bussy) do_1s();
|
||
press_t()
|
||
}, 1000);
|
||
press_t()
|
||
});
|
||
</script>
|
||
</body>
|
||
</html> |