prefix session storage T1 + fix freq and them/fannl

This commit is contained in:
2023-03-03 18:45:35 +01:00
parent d474d917eb
commit dce8889a21
5 changed files with 363 additions and 356 deletions

View File

@@ -10,7 +10,7 @@
<script src="../files/popper.min.js"></script>
<script src="../files/bootstrap.min.js"></script>
<script src="base.js"></script>
<title id="pt_v">Robin T1 Wash</title>
<title id="pt_v"></title>
</head>
<body>
@@ -31,7 +31,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth">Robin T1 Wash</div>
<div class="fixed-top text-center device-label" id="pth"></div>
<div class="container in">
<h1>Personality</h1>
<div class="row" id="boxes">
@@ -47,16 +47,16 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="dmxa_v">1</div>
<div id="t1_dmxa_v"></div>
</li>
<li>
<div id="dmxp_v">Mode 3</div>
<div id="t1_dmxp_v"></div>
</li>
<li>
<div id="dmxi_v">wired</div>
<div id="t1_dmxi_v"></div>
</li>
<li>
<div id="rdmn_v">Robin T1 Wash</div>
<div id="t1_rdmn_v"></div>
</li>
</ul>
</div>
@@ -75,22 +75,22 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="emod_v">disable</div>
<div id="t1_emod_v"></div>
</li>
<li>
<div id="ee2d_v">off</div>
<div id="t1_ee2d_v"></div>
</li>
<li>
<div id="eanu_v">0</div>
<div id="t1_eanu_v"></div>
</li>
<li>
<div id="emau_v">1</div>
<div id="t1_emau_v"></div>
</li>
<li>
<div id="emas_v">1</div>
<div id="t1_emas_v"></div>
</li>
<li>
<div id="esau_v">1</div>
<div id="t1_esau_v"></div>
</li>
</ul>
</div>
@@ -108,19 +108,19 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="pr_v">off</div>
<div id="t1_pr_v"></div>
</li>
<li>
<div id="tr_v">off</div>
<div id="t1_tr_v"></div>
</li>
<li>
<div id="ptf_v">on</div>
<div id="t1_ptf_v"></div>
</li>
<li>
<div id="ptm_v">speed</div>
<div id="t1_ptm_v"></div>
</li>
<li>
<div id="pte_v">on</div>
<div id="t1_pte_v"></div>
</li>
</ul>
</div>
@@ -134,7 +134,7 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="bldmc_v">off</div>
<div id="t1_bldmc_v"></div>
</li>
</ul>
<h3>Active blackout while</h3>
@@ -143,7 +143,7 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="blptm_v">off</div>
<div id="t1_blptm_v"></div>
</li>
</ul>
</div>
@@ -160,16 +160,16 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="dint_v">10</div>
<div id="t1_dint_v"></div>
</li>
<li>
<div id="dsd_v">5 min</div>
<div id="t1_dsd_v"></div>
</li>
<li>
<div id="dtl_v">off</div>
<div id="t1_dtl_v"></div>
</li>
<li>
<div id="dor_v">auto</div>
<div id="t1_dor_v"></div>
</li>
</ul>
</div>
@@ -187,19 +187,19 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="ccalm_v">on</div>
<div id="t1_ccalm_v"></div>
</li>
<li>
<div id="cmixm_v">cmy</div>
<div id="t1_cmixm_v"></div>
</li>
<li>
<div id="chrwh_v">off</div>
<div id="t1_chrwh_v"></div>
</li>
<li>
<div id="thefs_v">off</div>
<div id="t1_thefs_v"></div>
</li>
<li>
<div id="cdimc_v">square law</div>
<div id="t1_cdimc_v"></div>
</li>
</ul>
</div>
@@ -214,10 +214,10 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="dtd_v">13</div>.<div id="dtmo_v">05</div>.<div id="dty_v">2022</div>
<div id="t1_dtd_v"></div>.<div id="t1_dtmo_v"></div>.<div id="t1_dty_v"></div>
</li>
<li>
<div id="dth_v">11</div>:<div id="dtmi_v">09</div>:<div id="dts_v">21</div>
<div id="t1_dth_v"></div>:<div id="t1_dtmi_v"></div>:<div id="t1_dts_v"></div>
</li>
</ul>
</div>
@@ -235,20 +235,20 @@
</ul>
<ul class="group vals" id="">
<li>
<div id="mics_v">10</div>
<div id="t1_mics_v"></div>
</li>
<li>
<div id="them_v">off</div>
<div id="themq" class="pl03 dn" style="display: none;">(<div id="fannl_v">0</div>%)</div>
<div id="t1_them_v"></div>
<div id="t1_themq" class="pl03 dn" style="display: none;">(<div id="t1_fannl_v"></div>%)</div>
</li>
<li>
<div id="frqs_v">600.0000</div>
<div id="t1_frq_v"></div>
</li>
<li>
<div id="fanm_v">auto</div>
<div id="t1_fanm_v"></div>
</li>
<li>
<div id="tmpu_v">°C</div>
<div id="t1_tmpu_v"></div>
</li>
</ul>
</div>
@@ -268,131 +268,128 @@
</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 modal_id = -1;
var modal_titles = ['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 = [
['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'],
['ccri', 'cdimc', 'hpwrm', 'ccalm', 'cmixm', 'chrwh', 'thefs', 'whip83z'],
['lonof', 'lpwr', 'ligde', 'llise', 'lonpon', 'lofvd', 'londp', 'lofdm'],
['t1_dmxa', 't1_dmxp', 't1_dmxi', 't1_rdmn'],
['t1_emod', 't1_ee2d', 't1_eanu', 't1_emau', 't1_emas', 't1_esau'],
['t1_pr', 't1_tr', 't1_ptf', 't1_ptm', 't1_pte'],
['t1_bldmc', 't1_blptm', 't1_blprm', 't1_blgwm', 't1_bltim'],
['t1_dint', 't1_dsd', 't1_dtl', 't1_dor'],
['t1_dtd', 't1_dtmo', 't1_dty', 't1_dth', 't1_dtmi', 't1_dts'],
['t1_mics', 't1_fanm', 't1_tmpu', 't1_them', 't1_cpm', 't1_fannl', 't1_fsmo', 't1_btns', 't1_freq', 't1_freqa'],
['t1_ccri', 't1_cdimc', 't1_hpwrm', 't1_ccalm', 't1_mixm', 't1_chrwh', 't1_thefs', 't1_whip83z'],
['t1_lonof', 't1_lpwr', 't1_ligde', 't1_llise', 't1_lonpon', 't1_lofvd', 't1_londp', 't1_lofdm'],
];
var frq = 0;
function open_modal(i) {
a_m = i;
if (a_m < m_t.length) {
$('#m-t').html(m_t[a_m])
var t1_frq = sessionStorage.getItem('t1_frq');
var t1_them = sessionStorage.getItem('t1_them');
var t1_fannl = sessionStorage.getItem('t1_fannl');
modal_id = i;
if (modal_id < modal_titles.length) {
$('#m-t').html(modal_titles[modal_id])
}
$('.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', [3], 'Mode ', 0, 1, '');
h += c_opt('dmxi', 'DMX input', ['wired', 'wireless', 'wireless XLR out'], '', 0, 1,
if (modal_id == 0) {
h += c_txt('t1_dmxa', 'DMX address', 'Please put DMX address from 1 to 512');
h += c_opt('t1_dmxp', 'DMX preset', [3], 'Mode ', 0, 1, '');
h += c_opt('t1_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',
h += c_txt('t1_rdmn', 'RDM label', 'Please insert label,max 32 characters')
} else if (modal_id == 1) {
h += c_rad('t1_emod', 'Ethernet mode', ['disable', 'ArtNet', 'gMA1', 'gMA2', 'sACN'], '', '');
h += c_rad('t1_ee2d', 'Ethernet to DMX', off_on_l, '', '');
h += c_txt('t1_eanu', 'ArtNet universe', 'Please put ArtNet universe from 0 to 255');
h += c_txt('t1_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 += c_txt('t1_emas', 'MANet session ID', 'Please put MANet session ID from 1 to 32');
h += c_txt('t1_esau', 'sACN universe', 'Please put sACN universe from 1 to 32000')
} else if (modal_id == 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/Titl EMS', off_on_l, '', ' col-6');
h += c_rad('t1_pr', 'Pan reverse', off_on_l, '', ' col-6');
h += c_rad('t1_tr', 'Tilt reverse', off_on_l, '', ' col-6');
h += c_rad('t1_ptf', 'Pan/Tilt feedback', off_on_l, '', ' col-6');
h += c_rad('t1_ptm', 'Pan/Tilt Mode', ['speed', 'time'], '', ' col-6');
h += c_rad('t1_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, '', '');
} else if (modal_id == 3) {
h += c_rad('t1_bldmc', 'Blackout DMC', off_on_l, '', '');
h += '<h3>Active blackout while</h3>';
h += c_rad('blptm', 'Pan/Tilt 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 += c_rad('t1_blptm', 'Pan/Tilt moving', off_on_l, '', '')
} else if (modal_id == 4) {
h += c_opt('t1_dint', 'Display intensity', [10], '', 0, 1, '');
var t1_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('t1_dsd', 'Screensaver delay', t1_dsd_dtl_l, '', 0, 0, '');
h += c_opt('t1_dtl', 'Touchscreen lock', t1_dsd_dtl_l, '', 0, 0, '');
h += c_rad('t1_dor', 'Display orientation', ['normal', 'inverted', 'auto'], '')
} else if (modal_id == 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 += c_txt('t1_dtd', 'Day', '', ' col-4');
h += c_txt('t1_dtmo', 'Month', '', ' col-4');
h += c_txt('t1_dty', 'Year', '', ' col-4');
h += c_txt('t1_dth', 'Hour', '', ' col-4');
h += c_txt('t1_dtmi', 'Minute', '', ' col-4');
h += c_txt('t1_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('mics', 'Microphone sensitivity', [20], '', 0, 1, '');
h += c_rad('them', 'Theatre mode', ['off', 'quiet'], '', '');
h += '<div class="form-group" id="fannl_fg">';
h += '<label for="fannl" class="col-form-label">Fan noise level</label>';
} else if (modal_id == 6) {
h += c_opt('t1_mics', 'Microphone sensitivity', [20], '', 0, 1, '');
h += c_rad('t1_them', 'Theatre mode', ['off', 'quiet'], '', '');
h += '<div class="form-group" id="t1_fannl_fg">';
h += '<label for="t1_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-9 col-sm-10"><input type="range" min="0" max="100" class="form-control" id="t1_fannl"></div>';
h += '<div class="col-3 col-sm-2 mt06 text-right">100%</div>';
h += '</div>';
h += '</div>';
h += c_rad('frqs', 'Frequency setup (Hz)', ['300', '600', '1200', '2400'], '', '');
h += c_rad('t1_frqs', 'Frequency setup (Hz)', ['300', '600', '1200', '2400'], '', '');
h += '<div class="form-group">';
h += '<label for="frqa" class="col-form-label">Frequency Adjust</label>';
h += '<label for="t1_frqa" class="col-form-label">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 class="col-7 col-sm-8"><input type="range" min="0" max="1663" class="form-control" id="t1_frqa"></div>';
h += '<div class="col-5 col-sm-4 mt06 text-right" id="t1_frq_bv"></div>';
h += '</div>';
h += '</div>';
h += c_rad('fanm', 'Fan mode', ['auto', 'high'], '', '');
h += c_rad('tmpu', 'Temperature unit', ['&deg;C', '&deg;F'], '', '')
} else if (a_m == 7) {
h += c_rad('t1_fanm', 'Fan mode', ['auto', 'high'], '', '');
h += c_rad('t1_tmpu', 'Temperature unit', ['&deg;C', '&deg;F'], '', '')
} else if (modal_id == 7) {
h += '<div class="row">';
h += c_rad('ccalm', 'Colour calibration mode', off_on_l, '', ' col-6');
h += c_rad('cmixm', 'Colour mixing mode', ['rgb', 'cmy'], '', ' col-6');
h += c_rad('chrwh', 'Chromatic white', off_on_l, '', ' col-12');
h += c_rad('thefs', 'Thungsten effect simulation', ['off', '750 W', '1000 W', '1200 W', '2000 W',
h += c_rad('t1_ccalm', 'Colour calibration mode', off_on_l, '', ' col-6');
h += c_rad('t1_cmixm', 'Colour mixing mode', ['rgb', 'cmy'], '', ' col-6');
h += c_rad('t1_chrwh', 'Chromatic white', off_on_l, '', ' col-12');
h += c_rad('t1_thefs', 'Thungsten effect simulation', ['off', '750 W', '1000 W', '1200 W', '2000 W',
'2500 W'
], '', ' col-12');
h += c_rad('cdimc', 'Dimmer curve', ['linear', 'square law'], '', ' col-6')
} else if (a_m == 8) {
h += c_rad('lonof', 'Lamp status', off_on_l, '', '');
h += '<div class="form-group" id="ligde_fg">';
h += c_rad('t1_cdimc', 'Dimmer curve', ['linear', 'square law'], '', ' col-6')
} else if (modal_id == 8) {
h += c_rad('t1_lonof', 'Lamp status', off_on_l, '', '');
h += '<div class="form-group" id="t1_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>';
'<div class="col-9 col-sm-10"><input type="range" min="0" max="90" class="form-control" id="t1_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 += c_rad('t1_llise', 'Lamp light sensor', off_on_l, '', ' col-6');
h += c_rad('t1_lonpon', 'Lamp on power on', off_on_l, '', ' col-6');
h += c_rad('t1_lofvd', 'Lamp off via DMX', off_on_l, '', ' col-6');
h += c_rad('t1_londp', 'Lamp on if DMX present', off_on_l, '', ' col-6');
h += c_rad('t1_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 (modal_id == 8) {
if ($('#ligde_v').html() == 'off') {
$('#ligde').val(0)
}
@@ -401,46 +398,51 @@
$('.sb').bind('click', function () {
loader(1);
var p_add = '';
if (a_m == 6) {
p_add = '&frq=' + frq
if (modal_id == 6) {
p_add = '&t1_frq=' + t1_frq
}
do_ajax(addrs[a_m], serialize_parameters(params[a_m]) + p_add)
do_ajax(addrs[modal_id], serialize_parameters(params[modal_id]) + p_add)
});
if (a_m == 5) {
if (modal_id == 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))
$('#t1_dtd').val(date.getDate());
$('#t1_dtmo').val(date.getMonth() + 1);
$('#t1_dty').val(date.getFullYear());
$('#t1_dth').val(('0' + date.getHours()).slice(-2));
$('#t1_dtmi').val(('0' + date.getMinutes()).slice(-2));
$('#t1_dts').val(('0' + date.getSeconds()).slice(-2))
})
} else if (a_m == 6) {
$('#fannl').on('input change', function () {
} else if (modal_id == 6) {
$('t1_fannl').val(t1_fannl);
$('input[name=t1_them]').eq(t1_them).attr('checked', 'checked');
$('#t1_fannl').on('input change', function () {
$(this).parent().next().html($(this).val() + '%')
});
$('#fannl').change();
$('input[name=them]').on('change', function () {
if ($('input[name=them]:checked').val() == 1) $('#fannl_fg').show();
else $('#fannl_fg').hide()
$('#t1_fannl').change();
$('input[name=t1_them]').on('change', function () {
if ($('input[name=t1_them]:checked').val() == 1) {
$('#t1_fannl_fg').show();
} else {
$('#t1_fannl_fg').hide();
}
});
$('input[name=them]').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')
$('input[name=t1_them]').change();
$('input[name=t1_frqs]').eq(t1_frq >> 12).attr('checked', 'checked'); // checks the radio of the proper
$('#t1_frqa').val(t1_frq & 0xfff);
$('input[name=t1_frqs]').on('change', function () {
t1_frq = $('input[name=t1_frqs]:checked').val() << 12;
t1_frq |= 0x340;
$('#t1_frqa').val(0x340);
$('#t1_frq_bv').html(t1_frq_s(t1_frq) + ' Hz')
});
$('#frqa').on('input change', function () {
frq &= 0xf000;
frq |= $('#frqa').val();
$('#frq_bv').html(frq_s(frq) + ' Hz')
$('#t1_frqa').on('input change', function () {
t1_frq &= 0xf000;
t1_frq |= $('#t1_frqa').val();
$('#t1_frq_bv').html(t1_frq_s(t1_frq) + ' Hz')
});
$('#frqa').change()
} else if (a_m == 8) {
$('#t1_frqa').change()
} else if (modal_id == 8) {
$('#ligde').on('input change', function () {
var o = $(this).parent().next();
if ($(this).val() == 0) o.html('off');
@@ -450,15 +452,6 @@
}
}
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)
}
</script>
</body>