Mon, 22 Apr 2024 20:58:55 +0200
The global settings screen added. No Save function yet.
var DeviceTypeData = [ { id: 0, mno: 'NA', en: 'Unknown' }, { id: 1, mno: 'W1', en: 'One-wire' }, { id: 2, mno: 'GPIO', en: 'GPIO' }, { id: 3, mno: 'RC433', en: 'RC-433' }, { id: 4, mno: 'DHT', en: 'DHT11' }, { id: 5, mno: 'I2C', en: 'I2C bus' }, { id: 6, mno: 'SPI', en: 'SPI bus' }, { id: 7, mno: 'SIM', en: 'Simulator' } ], DeviceTypeSource = { localdata: DeviceTypeData, datatype: 'array', datafields: [{ name: 'id' }, { name: 'mno' }, { name: 'en' }] }, DeviceTypeAdapter = new $.jqx.dataAdapter(DeviceTypeSource), DevicePresentData = [ { id: 0, mno: 'UNDEF', en: 'Unknown' }, { id: 1, mno: 'NO', en: 'No' }, { id: 2, mno: 'YES', en: 'Yes' }, { id: 3, mno: 'ERROR', en: 'Error' } ], DevicePresentSource = { localdata: DevicePresentData, datatype: 'array', datafields: [{ name: 'id' }, { name: 'mno' }, { name: 'en' }] }, DevicePresentAdapter = new $.jqx.dataAdapter(DevicePresentSource), DeviceDirectionData = [ { id: 0, mno: 'UNDEF', en: 'Unknown' }, { id: 1, mno: 'IN_BIN', en: 'Binary input' }, { id: 2, mno: 'OUT_BIN', en: 'Binary output' }, { id: 3, mno: 'IN_ANALOG', en: 'Analog input' }, { id: 4, mno: 'OUT_ANALOG', en: 'Analog output' }, { id: 5, mno: 'OUT_PWM', en: 'PWM output' }, { id: 6, mno: 'INTERN', en: 'Intern' } ], DeviceDirectionSource = { localdata: DeviceDirectionData, datatype: 'array', datafields: [{ name: 'id' }, { name: 'mno' }, { name: 'en' }] }, DeviceDirectionAdapter = new $.jqx.dataAdapter(DeviceDirectionSource), // Temp sensors droptdown list tempsensorSource = { datatype: 'json', datafields: [ { name: 'uuid', type: 'string' }, { name: 'name', type: 'string' } ], url: 'drop_tempsensors.php' }, tempsensorlist = new $.jqx.dataAdapter(tempsensorSource), // options for editors Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 }, Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 }, Spin0dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }, PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }, SubInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 63, decimalDigits: 0, spinButtons: true }, GPIOInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1, max:31, decimalDigits: 0, spinButtons: true }; /* Websocket interface. Place "websocket.onmessage = function(evt) {}" in the user script. */ var websocket = new ReconnectingWebSocket('ws://'+location.hostname+'/ws'); websocket.onerror = function(event) { console.log('Websocket error: ' + event.data); } $(document).ready(function() { $('#jqxMenu').jqxMenu({ width: 1280, height: '30px', autoOpen: false, clickToOpen: true, theme: theme }); $('#jqxWidget').css('visibility', 'visible'); });