diff --git a/README.md b/README.md index a21daa4..e47f7f3 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,9 @@ All objects sent between the frontend and backend will follow this format. ```json { - type: "name_of_request" - call: "send, request" - data: { - } + "type": "name_of_request", + "call": "send, request", + "data": {} } ``` @@ -32,33 +31,37 @@ All objects sent between the frontend and backend will follow this format. > Front -> Back ```json { - type: "cable_map" - call: "request" - data: { - } + "type": "cable_map", + "call": "request", + "data": {} } + +One Liner: {"type":"cable_map","call":"request","data":{}} ``` ### Back: > Back -> Front ```json { - type: "cable_map" - call: "send" - data: { - map: [ - item { - part_number: 12345 - position: 0-53 - name: "Fancy Displayable Name" - brand: "Belden" - description: "This is a good cable!" - short_description: "Good cable!" - } - ... many more items - ] - } + "type": "cable_map", + "call": "send", + "data": { + "map": [ + { + "part_number": 12345, + "position": 0, // 0-53 + "name": "Fancy Displayable Name", + "brand": "Belden", + "description": "This is a good cable!", + "short_description": "Good cable!", + "image": "https://google.com" + } + // many more items + ] + } } + +One Liner: {"type":"cable_map","call":"send","data":{"map":[{"part_number":12345,"position":0,"name":"Fancy Displayable Name","brand":"Belden","description":"This is a good cable!","short_description":"Good cable!"}]}} ``` @@ -67,45 +70,40 @@ All objects sent between the frontend and backend will follow this format. > Front -> Back ```json { - type: "cable_details" - call: "request" - data: { - part_number: [ - 12345, - 67890, - ... - ] - position: [ - 0, - 1, - 2, - ... 53 - ] - } + "type": "cable_details", + "call": "request", + "data": { + "part_number": [12345, 67890, 54321, 98765], + "position": [0, 1, 2, 53] + } } + +One Liner: {"type":"cable_details","call":"request","data":{"part_number":[12345,67890,54321,98765],"position":[0,1,2,53]}} ``` ### Back: > Back -> Front ```json { - type: "cable_details" - call: "send" - data: { - cables: [ - { - part_number: 12345 - position: 0-53 - part_image_url: "https://belden.com" - brand_image_url: "https://belden.com" - extracted_object: { - ....... #brand will be in here - } - }, - ..... - ] - } + "type": "cable_details", + "call": "send", + "data": { + "cables": [ + { + "part_number": 12345, + "position": 0, // 0-53 + "part_image_url": "https://belden.com", + "brand_image_url": "https://belden.com", + "extracted_object": { + // brand will be in here + } + } + // more cables + ] + } } + +One Liner: {"type":"cable_details","call":"send","data":{"cables":[{"part_number":12345,"position":0,"part_image_url":"https://belden.com","brand_image_url":"https://belden.com","extracted_object":{}}]}} ``` --- @@ -114,35 +112,39 @@ All objects sent between the frontend and backend will follow this format. > Front -> Back ```json { - type: "cable_search" - call: "request" - data: { - string: "name/part_number/type/category/etc" - } + "type": "cable_search", + "call": "request", + "data": { + "string": "name/part_number/type/category/etc" + } } + +One Liner: {"type":"cable_search","call":"request","data":{"string":"name/part_number/type/category/etc"}} ``` ### Back: > Back -> Front ```json { - type: "cable_search" - call: "send" - data: { - cables: [ - { - part_number: 12345 - position: 0-53 - part_image_url: "https://belden.com" - brand_image_url: "https://belden.com" - extracted_object: { - ....... #brand will be in here - } - }, - .... - ] - } + "type": "cable_search", + "call": "send", + "data": { + "cables": [ + { + "part_number": 12345, + "position": 0, // 0-53 + "part_image_url": "https://belden.com", + "brand_image_url": "https://belden.com", + "extracted_object": { + // brand will be in here + } + } + // more cables + ] + } } + +One Liner: {"type":"cable_search","call":"send","data":{"cables":[{"part_number":12345,"position":0,"part_image_url":"https://belden.com","brand_image_url":"https://belden.com","extracted_object":{}}]}} ``` --- @@ -151,12 +153,14 @@ All objects sent between the frontend and backend will follow this format. > Front -> Back ```json { - type: "keyboard" - call: "request" - data: { - enabled: True / False - } + "type": "keyboard", + "call": "request", + "data": { + "enabled": true + } } + +One Liner: {"type":"keyboard","call":"request","data":{"enabled":true}} ``` --- @@ -165,122 +169,111 @@ All objects sent between the frontend and backend will follow this format. > Front -> Back ```json { - type: "machine_settings" - call: "request" - data: { - } + "type": "machine_settings", + "call": "request", + "data": {} } + +One Liner: {"type":"machine_settings","call":"request","data":{}} ``` ### Back: > Back -> Front ```json { - type: "machine_settings" - call: "send" - data: { - settings: [ - { - setting_name: "text field" - type: "text" - advanced: True - current_value: "current value of seting" - }, - { - setting_name: "radio button" - type: "radio" - advanced: True - current_value: "option 1" - radio_values: [ - "option 1", - "option 2", - "option 3" - ] - }, - { - setting_name: "check box" - type: "check" - advanced: True - current_value: ["option 1", "option 2"] - radio_values: [ - "option 1", - "option 2", - "option 3" - ] - }, - { - setting_name: "enabled or disabled" - type: "boolean" - advanced: True - current_value: True - }, - { - setting_name: "slider bar" - type: "slider" - advanced: True - current_value: 50.0 #Float - min: -100.0 #Float - max: 100.0 #Float - }, - { - setting_name: "button" - advanced: True - type: "button" - } - ] - } + "type": "machine_settings", + "call": "send", + "data": { + "settings": [ + { + "setting_name": "text field", + "type": "text", + "advanced": true, + "current_value": "current value of seting" + }, + { + "setting_name": "radio button", + "type": "radio", + "advanced": true, + "current_value": "option 1", + "radio_values": ["option 1", "option 2", "option 3"] + }, + { + "setting_name": "check box", + "type": "check", + "advanced": true, + "current_value": ["option 1", "option 2"], + "radio_values": ["option 1", "option 2", "option 3"] + }, + { + "setting_name": "enabled or disabled", + "type": "boolean", + "advanced": true, + "current_value": true + }, + { + "setting_name": "slider bar", + "type": "slider", + "advanced": true, + "current_value": 50.0, + "min": -100.0, + "max": 100.0 + }, + { + "setting_name": "button", + "advanced": true, + "type": "button" + } + ] + } } + +One Liner: {"type":"machine_settings","call":"send","data":{"settings":[{"setting_name":"text field","type":"text","advanced":true,"current_value":"current value of seting"},{"setting_name":"radio button","type":"radio","advanced":true,"current_value":"option 1","radio_values":["option 1","option 2","option 3"]},{"setting_name":"check box","type":"check","advanced":true,"current_value":["option 1","option 2"],"radio_values":["option 1","option 2","option 3"]},{"setting_name":"enabled or disabled","type":"boolean","advanced":true,"current_value":true},{"setting_name":"slider bar","type":"slider","advanced":true,"current_value":50,"min":-100,"max":100},{"setting_name":"button","advanced":true,"type":"button"}]}} ``` ### Front: > Front -> Back ```json { - type: "machine_settings" - call: "send" - data: { - settings: [ - { - setting_name: "text field" - type: "text" - new_value: "current value of seting" - }, - { - setting_name: "radio button" - type: "radio" - new_value: [ - "option 1", - "option 2", - "option 3" - ] - }, - { - setting_name: "check box" - type: "check" - new_value: [ - "option 1", - "option 2", - "option 3" - ] - }, - { - setting_name: "enabled or disabled" - type: "boolean" - new_value: False - }, - { - setting_name: "slider bar" - type: "slider" - new_value: 100.0 #Float - }, - { - setting_name: "button" - type: "button" - new_value: True - } - ] - } + "type": "machine_settings", + "call": "send", + "data": { + "settings": [ + { + "setting_name": "text field", + "type": "text", + "new_value": "current value of seting" + }, + { + "setting_name": "radio button", + "type": "radio", + "new_value": ["option 1", "option 2", "option 3"] + }, + { + "setting_name": "check box", + "type": "check", + "new_value": ["option 1", "option 2", "option 3"] + }, + { + "setting_name": "enabled or disabled", + "type": "boolean", + "new_value": false + }, + { + "setting_name": "slider bar", + "type": "slider", + "new_value": 100.0 + }, + { + "setting_name": "button", + "type": "button", + "new_value": true + } + ] + } } + +One Liner: {"type":"machine_settings","call":"send","data":{"settings":[{"setting_name":"text field","type":"text","new_value":"current value of seting"},{"setting_name":"radio button","type":"radio","new_value":["option 1","option 2","option 3"]},{"setting_name":"check box","type":"check","new_value":["option 1","option 2","option 3"]},{"setting_name":"enabled or disabled","type":"boolean","new_value":false},{"setting_name":"slider bar","type":"slider","new_value":100},{"setting_name":"button","type":"button","new_value":true}]}} ``` ---