{"action":"created","issue":{"url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/47","repository_url":"https://api.github.com/repos/LaserWeb/lw.comm-server","labels_url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/47/comments","events_url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/47/events","html_url":"https://github.com/LaserWeb/lw.comm-server/issues/47","id":249369559,"number":47,"title":"Api V2 suggestion (: ","user":{"login":"openhardwarecoza","id":7695323,"avatar_url":"https://avatars2.githubusercontent.com/u/7695323?v=4","gravatar_id":"","url":"https://api.github.com/users/openhardwarecoza","html_url":"https://github.com/openhardwarecoza","followers_url":"https://api.github.com/users/openhardwarecoza/followers","following_url":"https://api.github.com/users/openhardwarecoza/following{/other_user}","gists_url":"https://api.github.com/users/openhardwarecoza/gists{/gist_id}","starred_url":"https://api.github.com/users/openhardwarecoza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhardwarecoza/subscriptions","organizations_url":"https://api.github.com/users/openhardwarecoza/orgs","repos_url":"https://api.github.com/users/openhardwarecoza/repos","events_url":"https://api.github.com/users/openhardwarecoza/events{/privacy}","received_events_url":"https://api.github.com/users/openhardwarecoza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":38,"created_at":"2017-08-10T14:39:58Z","updated_at":"2017-08-11T14:53:17Z","closed_at":null,"body":"I briefly mentioned this to @cprezzi and he mentioned @tbfleming might anyway be revamping this for his new UI work, but i figured let me write up what i kinda need (using lw.comms-server in another frontend more config orientated) and see what you guys think before i forge ahead with my needs and this never makes it into lw.comm-server (;\r\n\r\nRight now - my old legacy way of doing that has stuck inside lw for too long, has been to send individual websocket events for position, queuecnt, etc - very inefficient.  in the frontend we have to listen for various named ws events...\r\n\r\nI propose we convert to a single object that gets sent over as a single websocket event.  Data binding to a single object and then just updating UI when a key changes is more efficient and easier to debug:\r\n\r\nHere's what i have so far\r\n\r\n```\r\nvar statusjson = {\r\n  machine: {\r\n    overrides: {\r\n      feedOverride: 0,\r\n      spindleOverride: 0\r\n    },\r\n    position: {\r\n      work: {\r\n        xWpos: 0,\r\n        yWpos: 0,\r\n        zWpos: 0,\r\n        aWpos: 0,\r\n        eWpos: 0,\r\n      },\r\n      machine: {\r\n        xMpos: 0,\r\n        yMpos: 0,\r\n        zMpos: 0,\r\n        aMpos: 0,\r\n        eMpos: 0\r\n      }\r\n\r\n    },\r\n    temperature: {\r\n      t1temp: 0,\r\n      t2temp: 0,\r\n      bedtemp: 0,\r\n    },\r\n    firmware: {\r\n      type: \"\",\r\n      version: \"\",\r\n      date: \"\"\r\n    },\r\n    configuration: {\r\n      x_steps_per_mm: 0,\r\n      y_steps_per_mm: 0,\r\n      z_steps_per_mm: 0,\r\n      x_acceleration: 0,\r\n      y_acceleration: 0,\r\n      z_acceleration: 0,\r\n      x_max_rate: 0,\r\n      y_max_rate: 0,\r\n      z_max_rate: 0,\r\n      x_axis_length: 0, // Max lenght of axes: Used for soft limits in grbl and smoothie - also maybe useful to autodraw grid size\r\n      y_axis_length: 0, // Max lenght of axes: Used for soft limits in grbl and smoothie - also maybe useful to autodraw grid size\r\n      z_axis_length: 0, // Max lenght of axes: Used for soft limits in grbl and smoothie - also maybe useful to autodraw grid size\r\n      x_homing: 0, // 0 = none, 1 = min, 2 = max\r\n      y_homing: 0, // 0 = none, 1 = min, 2 = max\r\n      z_homing: 0, // 0 = none, 1 = min, 2 = max\r\n      x_home_invert: 0, // 0 = none, 1 = inverted\r\n      y_home_invert: 0, // 0 = none, 1 = inverted\r\n      z_home_invert: 0, // 0 = none, 1 = min, 2 = max\r\n      x_dir: 0, // 0 = normal, 1 = inverted\r\n      y_dir: 0, // 0 = normal, 1 = inverted\r\n      z_dir: 0, // 0 = normal, 1 = inverted\r\n      x_current: 0, // grbl-lpc and smoothie\r\n      y_current: 0, // grbl-lpc and smoothie\r\n      z_current: 0, // grbl-lpc and smoothie\r\n      tools: {\r\n        bed: true, // not really scoped to configure from here... but rather used in frontend to configure showing options related\r\n        e0: true, // not really scoped to configure from here... but rather used in frontend to configure showing options related\r\n        e1: false, // not really scoped to configure from here... but rather used in frontend to configure showing options related\r\n        laser: false, // not really scoped to configure from here... but rather used in frontend to configure showing options related\r\n        spindle: false // not really scoped to configure from here... but rather used in frontend to configure showing options related\r\n      },\r\n    }\r\n  },\r\n  comms: {\r\n    connectionStatus: 0, //0 = not connected, 1 = connected, 2 = playing, 3 = paused, etc?\r\n    runStatus: 0,// 0 = init, 1 = idle, 2 = alarm, 3 = stop, 4 = run, etc?\r\n    queue: 0,\r\n    controllerBuffer: 0, // Seems like you are tracking available buffer?  Maybe nice to have in frontend?\r\n    interfaces: {\r\n      supportedInterfaces: ['USB', 'ESP8266', 'Telnet'],\r\n      ports: portsList,\r\n      activeInterface: \"\",\r\n      activePort: \"\" // or activeIP in the case of wifi/telnet?\r\n    },\r\n  },\r\n  logEntry: \"String\" // In electron we lose the cmd log - can we also emit the log lines here?\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/comments/321835325","html_url":"https://github.com/LaserWeb/lw.comm-server/issues/47#issuecomment-321835325","issue_url":"https://api.github.com/repos/LaserWeb/lw.comm-server/issues/47","id":321835325,"user":{"login":"cprezzi","id":5457949,"avatar_url":"https://avatars1.githubusercontent.com/u/5457949?v=4","gravatar_id":"","url":"https://api.github.com/users/cprezzi","html_url":"https://github.com/cprezzi","followers_url":"https://api.github.com/users/cprezzi/followers","following_url":"https://api.github.com/users/cprezzi/following{/other_user}","gists_url":"https://api.github.com/users/cprezzi/gists{/gist_id}","starred_url":"https://api.github.com/users/cprezzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cprezzi/subscriptions","organizations_url":"https://api.github.com/users/cprezzi/orgs","repos_url":"https://api.github.com/users/cprezzi/repos","events_url":"https://api.github.com/users/cprezzi/events{/privacy}","received_events_url":"https://api.github.com/users/cprezzi/received_events","type":"User","site_admin":false},"created_at":"2017-08-11T14:53:17Z","updated_at":"2017-08-11T14:53:17Z","body":"Ok. I'll create a new branch for now. Later I probably create a new repo without \"lw.\" to show it's not LW only."}}
{"actor":{"display_login":"cprezzi"}}