diff --git a/iforte/base.js b/iforte/base.js index 0343ac3..b1c12a7 100644 --- a/iforte/base.js +++ b/iforte/base.js @@ -1,5 +1,8 @@ $(document).ready(function() { + initSessionStorage() + populateUIFromSessionStorage() + // Sets the proper fixture name in the header and title var fixturename = "Robin iForte - Simulated"; $('#pth').html(fixturename) @@ -24,12 +27,18 @@ $(document).ready(function() { h += c_txt('opswd','Old password','Please put old password (four digits)','','password'); h += c_txt('npswd','New password','Please put new password (four digits)','','password'); h += c_txt('npsch','New password check','New passwords check failed','','password'); + h += "

Simulator

"; + h += c_btn('Reset demo values', 'btnresetdemo', ' btnresetdemo'); + h += c_rad('iforte_demo_rains_age', 'RAINS tubes age', ['New', 'Average', 'Old'], '',''); + h += c_rad('iforte_demo_pressure_test', 'Pressure test', ['OK', 'Failing'], '', ''); $('#m-b').html(h); $('.sb').unbind(); + copy_form_values(2); $('#cfg-modal').modal(); + $('.sb').bind('click',function() { loader(1); - var par = ['opswd','npswd','npsch']; + var par = ['opswd','npswd','npsch', 'iforte_demo_rains_age','iforte_demo_pressure_test']; do_ajax('/set_cfg',pv(par),function (json) { if (json) { if (json['status'] == 0) { @@ -44,6 +53,15 @@ $(document).ready(function() { }); }); + // handle reset demo values + $(document).on('click','.btnresetdemo',function() { + $('.sb').html('OK') + sessionStorage.clear() + initSessionStorage() + populateUIFromSessionStorage() + showCustomModal('Cleared', 'Simulated page reset to default settings.') + }); + // handle RDM ident var idntb = $('#idnt img'); $('#idnt').click(function() { @@ -51,22 +69,17 @@ $(document).ready(function() { }); }); - -function get_cookie(n,d,ti=false) { - var r = d; - var c = document.cookie.split(';'); - c.forEach(function(v,i) { - v = v.split('='); - if (v[0].trim() == n) { - if (ti) { - const par = parseInt(v[1].trim()); - if (!isNaN(par)) { - r = par; - } - } else r = v[1].trim(); - } +// custom modal +function showCustomModal(title, text) { + loader(0) + $('#m-t').html(title); + var h = '

' + text +'

'; + $('#m-b').html(h); + $('.sb').unbind(); + $('#cfg-modal').modal(); + $('.sb').bind('click',function() { + close_modal() }); - return r; } function mhdr_status(c) { @@ -81,11 +94,11 @@ function loader(showheader) { } function do_ajax(p_url,p_data,f,i = -1,a = true) { - console.log("url : " + p_url); + /*console.log("url : " + p_url); console.log("data : " + p_data); console.log("callback function : " + f); console.log("callback params : " + i); - console.log("async : " + a); + console.log("async : " + a);*/ } function copy_form_values(dir) { @@ -123,6 +136,13 @@ function copy_form_values(dir) { } }); } + + // if opening settings window + if (dir == 2) { + $('input[name=iforte_demo_rains_age]').eq(sessionStorage.getItem('iforte_demo_rains_age')).attr('checked','checked'); + $('input[name=iforte_demo_pressure_test]').eq(sessionStorage.getItem('iforte_demo_pressure_test')).attr('checked','checked'); + } + } function fill_values(d,ids) { @@ -199,17 +219,17 @@ function c_opt(n,t,o,pl,vp,lp,e) { return html; } -function c_rad(n,t,r,e,c) { +function c_rad(name,legend,options,invalid_feedback_text,group_class) { - var html = '
'; - html += '' + t + ''; - for (i = 0; i < r.length; i++) { + var html = '
'; + html += '' + legend + ''; + for (i = 0; i < options.length; i++) { html += '
'; - html += ''; - html += ''; + html += ''; + html += ''; html += '
'; } - html += e.length > 0 ? '
' + e + '
' : ''; + html += invalid_feedback_text.length > 0 ? '
' + invalid_feedback_text + '
' : ''; html += '
'; return html; @@ -289,7 +309,7 @@ function generateNavBar() { o += '
'; o += ''; o += ''; - + o += ' @@ -104,16 +104,16 @@

@@ -133,10 +133,10 @@

@@ -184,7 +184,7 @@ @@ -193,7 +193,7 @@ WET DRY -
+
MAX WET/resettable
@@ -201,20 +201,21 @@ WET DRY
-
+

- last reset: 2.3.2023 16:19:57 + last reset: 2.3.2023 16:19:57

Status messages

- -
+
  • This is a simulated REAP™ page for demo purposes. Some content might be different on real fixtures.
  • +
  • Big thanks to Vincent BOUQUET for creating this simulator.
  • +
    diff --git a/iforte/personality.html b/iforte/personality.html index a85e357..9892c32 100644 --- a/iforte/personality.html +++ b/iforte/personality.html @@ -30,17 +30,16 @@ @@ -61,22 +60,22 @@ @@ -96,19 +95,19 @@ @@ -124,7 +123,7 @@

    Active blackout while

    @@ -135,13 +134,13 @@ @@ -160,16 +159,16 @@ @@ -186,10 +185,10 @@ @@ -206,10 +205,10 @@ @@ -230,23 +229,22 @@ @@ -280,7 +278,7 @@ 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 = [ - ['dmxa', 'dmxp', 'dmxi', 'rdmn'], + ['iforte_dmxa', 'dmxp', 'dmxi', 'rdmn'], ['emod', 'ee2d', 'eanu', 'emau', 'emas', 'esau'], ['pr', 'tr', 'ptf', 'ptm', 'pte'], ['bldmc', 'blptm', 'blprm', 'blgwm', 'bltim'], @@ -485,44 +483,6 @@ } $(document).ready(function() { - $('h1').html('Personality'); - var boxes = ''; - boxes += box(m_t[0], 0, [ - ['', ['DMX address;dmxa', 'DMX preset;dmxp;
  • -
  • ', 'DMX input;dmxi', 'RDM label;rdmn', ]], - ]); - boxes += box(m_t[1], 1, [ - ['', ['Ethernet mode;emod', 'Ethernet to DMX;ee2d', 'ArtNet universe;eanu', 'MANet I/II universe;emau', 'MaNet session ID;emas', 'sACN universe;esau', ]], - ]); - boxes += box(m_t[2], 2, [ - ['', ['Pan reverse;pr', 'Tilt reverse;tr', 'Pan/Tilt feedback;ptf', 'Pan/Tilt mode;ptm', 'Pan/Tilt EMS;pte', ]], - ]); - boxes += box(m_t[3], 3, [ - ['', ['Blackout DMC;bldmc', ]], - ['Active blackout while', ['Pan/Tilt moving;blptm', 'Gobo wheel moving;blgwm', 'Color wheel moving;blprm', ]], - ]); - boxes += box(m_t[4], 4, [ - ['', ['Display intensity;dint', 'Screensaver delay;dsd', 'Touchscreen lock;dtl', 'Display orientation;dor', ]], - ]); - boxes += box(m_t[7], 7, [ - ['', ['Dimmer curve;cdimc', 'High power mode;hpwrm', ]], - ]); - boxes += box(m_t[5], 5, [ - ['', ['Date;;
  • -
    .
    -
    .
    -
  • ', 'Time;;
  • -
    :
    -
    :
    -
  • ', ]], - ]); - boxes += box(m_t[6], 6, [ - ['', ['Follow spot mode;fsmo', 'LEDs output frequency (Hz);frqs', 'Fan mode;fanm;
  • -
    (
    %)
  • ', 'Gobo indexing;gind', 'Temperature unit;tmpu', 'Display buttons;btns', ]], - ]); - boxes += '
    '; - boxes += '

    Pressure test

    '; - boxes += '
    '; - boxes += ''; - boxes += ''; - boxes += ''; - boxes += ''; - boxes += '
    '; - boxes += '
    '; - $('#boxes').html(boxes); - $('#themq').hide(); var bussy = false; function do_1s() {