{"action":"created","issue":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/404","repository_url":"https://api.github.com/repos/KevinOConnor/klipper","labels_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/404/labels{/name}","comments_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/404/comments","events_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/404/events","html_url":"https://github.com/KevinOConnor/klipper/issues/404","id":333094196,"node_id":"MDU6SXNzdWUzMzMwOTQxOTY=","number":404,"title":"Basic menu support (beta)","user":{"login":"mcmatrix","id":1433580,"node_id":"MDQ6VXNlcjE0MzM1ODA=","avatar_url":"https://avatars1.githubusercontent.com/u/1433580?v=4","gravatar_id":"","url":"https://api.github.com/users/mcmatrix","html_url":"https://github.com/mcmatrix","followers_url":"https://api.github.com/users/mcmatrix/followers","following_url":"https://api.github.com/users/mcmatrix/following{/other_user}","gists_url":"https://api.github.com/users/mcmatrix/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmatrix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmatrix/subscriptions","organizations_url":"https://api.github.com/users/mcmatrix/orgs","repos_url":"https://api.github.com/users/mcmatrix/repos","events_url":"https://api.github.com/users/mcmatrix/events{/privacy}","received_events_url":"https://api.github.com/users/mcmatrix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":89,"created_at":"2018-06-17T21:26:16Z","updated_at":"2018-07-06T11:14:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hi guys,\r\n\r\nI wanted to inform you that I'm working on a simple menu system for klipper.\r\nI already have working mockup and now I'm trying to fit it into Klippers system.\r\n\r\nThe menu structure is fully configurable via config file.\r\nMenu is working on different screens, 2x16, 4x20 and on graphics displays.\r\nIt's a text based menu system. You just have to specify correct cols and rows.\r\n\r\nIt has 3 basic menu elements:\r\n\r\n- **Group menu item** (folder)\r\nSELECT will enter into submenu\r\n- **Menu item with action**\r\nSELECT will execute GCODE (if specified)\r\n- **Menu item with input**\r\nSELECT will go into edit mode\r\n\r\nAll submenus have first item as \"go back\". System inserts it automatically.\r\n\r\nYou can define klipper system predefined variables in args attribute.\r\nIn menu item name you can use variables list defined in args as standard print format options.\r\nFor navigation only 3 buttons is needed: UP, DOWN, SELECT\r\n\r\nWhen menu item (only input item) is in edit mode then system shows asterisk and UP & DOWN will change value accordingly. Currently only float value type is supported.\r\nPressing SELECT again will exit from edit mode and will execute GCODE (value is given as print format  first element).\r\n\r\nI tried to make flexible way for adding dynamic data into name and gcode.\r\nThere is attribute **parameter: endstop.xmax:b[\"OPEN\", \"TRIG\"]**\r\nIn Klipper there's collection of status info from all modules.\r\nFirst part **endstop.xmax** of attribute value  is value key of that collection.\r\nSecond part **:b[\"OPEN\", \"TRIG\"]** of attribute value is additional way \r\nfor mapping value to list or dict.\r\n**:** is delimiter\r\n**b** is boolean typecast for value. Other casting types are: f - float, i - int, b - bool, s - str\r\n**[\"OPEN\", \"TRIG\"]** is literal presentation of python list. List and Dict are allowed.\r\nPython will use safe method to turn it into real dataset.\r\n\r\nYou don't have to use mapping options all the time. In most cases it's not needed and \r\njust parameter with simple value key **parameter: fan.speed** will do.\r\n\r\nWhen preparing name or gcode then you're able to use pyhton advanced string formatting\r\npossibilities. \r\nValue is avalilable as {0} and mapped option as {1}. \r\nIf there's error condition in conversion or just wrong data type\r\nthen raw name or gcode string is used instead of formatted one.\r\n\r\nChangeable input is using value and can only be float type.\r\nBut in name and gcode you can use mapped one if needed.\r\n\r\n**Menu manager config**\r\n```ini\r\n[menu]\r\nroot: main1     # mandatory\r\nrows: 4         # mandatory\r\ncols: 20        # mandatory\r\n\r\n```\r\n**Group menu item config**\r\n```ini\r\n[menu main1]\r\ntype: group                 # mandatory\r\nname: Main menu             # mandatory\r\nenter_gcode:                # optional\r\nleave_gcode:                # optional\r\nitems: menu1, menu2, menu3  # mandatory\r\n```\r\n\r\n**Menu item with action**\r\n```ini\r\n[menu menu1]\r\ntype: command                        # mandatory\r\nname: Fan speed: {0:d}               # mandatory\r\nparameter: fan.speed                 # optional\r\n\r\n[menu menu2]\r\ntype: command          # mandatory\r\nname: Pause octoprint  # mandatory\r\ngcode: @//pause        # optional\r\n\r\n[menu menu3]\r\ntype: command      # mandatory\r\nname: Kill me      # mandatory\r\ngcode: M112        # optional\r\n\r\n[menu menu1]\r\ntype: command                               # mandatory\r\nname: xmax endstop: {1:4s}                  # mandatory\r\nparameter: endstop.xmax:b[\"OPEN\", \"TRIG\"]   # optional\r\n```\r\n\r\n**Menu item with input**\r\n```ini\r\n[menu enable_fan]\r\ntype: input              # mandatory\r\nname: Enable Fan: {0:d}  # mandatory\r\nparameter: fan.speed     # mandatory\r\ninput_min: 0             # optional\r\ninput_max: 255           # optional\r\ninput_step: 1            # mandatory\r\ngcode: M106 {0}          # optional\r\n```\r\n\r\nSome screenshots from mockup demo\r\n![image](https://user-images.githubusercontent.com/1433580/41511971-269b6696-728a-11e8-8193-e7cdf0ac44ee.png)\r\n![image](https://user-images.githubusercontent.com/1433580/41511976-4bde5cba-728a-11e8-9f6e-b603b970dddb.png)\r\n![image](https://user-images.githubusercontent.com/1433580/41511986-71b30e5e-728a-11e8-94c5-bd1439f5b18e.png)\r\n\r\n**NB! This is still a Work in Progress. Concept, code, and other stuff might change!**\r\n"},"comment":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/comments/403004796","html_url":"https://github.com/KevinOConnor/klipper/issues/404#issuecomment-403004796","issue_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/404","id":403004796,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzAwNDc5Ng==","user":{"login":"hg42","id":4707597,"node_id":"MDQ6VXNlcjQ3MDc1OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/4707597?v=4","gravatar_id":"","url":"https://api.github.com/users/hg42","html_url":"https://github.com/hg42","followers_url":"https://api.github.com/users/hg42/followers","following_url":"https://api.github.com/users/hg42/following{/other_user}","gists_url":"https://api.github.com/users/hg42/gists{/gist_id}","starred_url":"https://api.github.com/users/hg42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hg42/subscriptions","organizations_url":"https://api.github.com/users/hg42/orgs","repos_url":"https://api.github.com/users/hg42/repos","events_url":"https://api.github.com/users/hg42/events{/privacy}","received_events_url":"https://api.github.com/users/hg42/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T11:14:20Z","updated_at":"2018-07-06T11:14:20Z","author_association":"NONE","body":"usually semicolons divide more...\r\nYou could use a dash to symbolize the direction."}}
{"actor":{"display_login":"hg42"}}