diff --git a/EcosApp/images/noimage.png b/EcosApp/images/noimage.png new file mode 100644 index 00000000..cffb198a Binary files /dev/null and b/EcosApp/images/noimage.png differ diff --git a/EcosApp/index.js b/EcosApp/index.js index 9563e9d8..058e5be1 100644 --- a/EcosApp/index.js +++ b/EcosApp/index.js @@ -85,6 +85,18 @@ function accessoryExecute(data) { }); } +function accessoryTest(data) { + var srv = window.serverHandling; + if (typeof srv === "undefined" || srv == null) + return; // TODO show error + + srv.sendCommand({ + "command": "accessory", + "timestamp": Date.now(), + "cmddata": data + }); +} + // an item in the plan is clicked function itemClicked(data) { var srv = window.serverHandling; @@ -470,6 +482,9 @@ $(document).ready(function () { window.accessoriesDlg.on("setting", function (ev) { changeSetting(ev.data); }); + window.__eventOn('startAccessoryTest', function (ev) { + accessoryTest(ev.data); + }); window.routesDlg = new Routes(); window.routesDlg.install(); @@ -493,7 +508,7 @@ $(document).ready(function () { var jsonData = JSON.parse(ev.data); changeLocomotive('function', jsonData); }); - + window.planField = new Planfield({ isEditMode: false }); diff --git a/EcosApp/railessentials.min.js b/EcosApp/railessentials.min.js index b15e1fcc..5ad01bf8 100644 --- a/EcosApp/railessentials.min.js +++ b/EcosApp/railessentials.min.js @@ -1,4 +1,4 @@ -function bringToFront(n){const r=$(".ui-dialog");let t=null,i=0;for(let u=0;ui&&(i=s);const o=e.attr("aria-describedby");typeof o!="undefined"&&o!=null&&o===n&&(t=e)}}t!=null&&t.css({"z-index":i+1})}function getRouteByName(n){if(typeof n=="undefined"||n==null||n.length===0||typeof routes=="undefined"||window.routes==null)return null;for(let t=0;t>16&255,g:t>>8&255,b:t&255,w:1023};throw new Error("Bad Hex");}function toggleAllLocomotiveInformation(n){const i=$("div.locomotiveInfo");let t;const r=i.length;for(t=0;t0&&parseInt(i.Port1)>0,t=parseInt(i.Addr2)>0&&parseInt(i.Port2)>0;return{planItem:f,themeData:u,ecosAddresses:[{ecosAddr:e,ecosAddrValid:n,inverse:i.Inverse1},{ecosAddr:o,ecosAddrValid:t,inverse:i.Inverse2}]}}}}}return null}function getFbByEcosAddr(n,t){if(typeof n=="undefined"||n==null||typeof t=="undefined")return null;const i=n.length;for(let r=0;r=f)break}}}return t}function loadLocomotiveImageIntoHtml(n,t,i="100%"){if(typeof window.__cachedLocomotiveImages[t]!="undefined"&&window.__cachedLocomotiveImages[t]!=null){const i=$("img#"+n);i.get(0).src=window.__cachedLocomotiveImages[t]}const r=new Image;(typeof i=="undefined"||i==null)&&(i="100%");r.onload=function(){const r=$("img#"+n);r.get(0).src=this.src;r.css({width:i});window.__cachedLocomotiveImages[t]=this.src};t=t.replace("/","_");t=t.replace(".","_");const u="./images/locomotives/"+t+".png";r.src=u}function getCtrlOfPosition(n,t,i){if(n==null||t==null||i==null)return null;let r;const u=i.length;for(r=0;r=e&&n<=c&&t>=f&&t<=l)return $(u)}}return null}function getCtrlOfCoord(n,t,i){if(n==null||t==null||i==null)return null;let r;const u=i.length;for(r=0;r=100&&n<=125?!0:!1:!1}function isSwitchOrAccessory(n){return n?n>=50&&n<150&&n!==54&&n!==55?!0:!1:!1}function isAccessory(n){return n?n>=250&&n<=260?!0:!1:!1}function isDecoupler(n){return n?n===70?!0:!1:!1}function isBlock(n){return n===150?!0:n===151?!0:n===152?!0:!1}function isFeedback(n){return n?n>=200&&n<=210?!0:!1:!1}function changeLocomotive(n,t={}){var i=window.serverHandling;typeof i!="undefined"&&i!=null&&(t.mode=n,i.sendCommand({command:"locomotive",timestamp:Date.now(),cmddata:t}))}function accessoryExecute(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"accessory",timestamp:Date.now(),cmddata:n})}function itemClicked(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"accessory",timestamp:Date.now(),cmddata:n})}function assignLocomotiveToBlock(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"routing",timestamp:Date.now(),cmddata:n})}function resetAssignment(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"routing",timestamp:Date.now(),cmddata:n})}function gotoBlock(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"routing",timestamp:Date.now(),cmddata:n})}function checkRoute(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"routing",timestamp:Date.now(),cmddata:n})}function changeSetting(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"setting",timestamp:Date.now(),cmddata:n})}function relayWebsocketCommand(n){var t=window.serverHandling;typeof t!="undefined"&&t!=null&&t.sendCommand({command:"relayCommand",timestamp:Date.now(),cmddata:n})}function removeTextfieldFromGlobalList(n){var i,t,r;if(n!=null){for(i=-1,t=0;t0){window.open("?workspace="+i,"_self");return}}}function handleWorkspace(){const n=$("#workspaceSelectionFrame");n.w2popup({title:"Workspace Selection",height:"200px",width:"450px",buttons:'