Update README.md

This commit is contained in:
scarlett kadan 2024-03-27 03:29:42 +00:00
parent 435894ba25
commit 81d13a70db

271
README.md
View File

@ -17,10 +17,9 @@ All objects sent between the frontend and backend will follow this format.
```json ```json
{ {
type: "name_of_request" "type": "name_of_request",
call: "send, request" "call": "send, request",
data: { "data": {}
}
} }
``` ```
@ -32,33 +31,37 @@ All objects sent between the frontend and backend will follow this format.
> Front -> Back > Front -> Back
```json ```json
{ {
type: "cable_map" "type": "cable_map",
call: "request" "call": "request",
data: { "data": {}
}
} }
One Liner: {"type":"cable_map","call":"request","data":{}}
``` ```
### Back: ### Back:
> Back -> Front > Back -> Front
```json ```json
{ {
type: "cable_map" "type": "cable_map",
call: "send" "call": "send",
data: { "data": {
map: [ "map": [
item { {
part_number: 12345 "part_number": 12345,
position: 0-53 "position": 0, // 0-53
name: "Fancy Displayable Name" "name": "Fancy Displayable Name",
brand: "Belden" "brand": "Belden",
description: "This is a good cable!" "description": "This is a good cable!",
short_description: "Good cable!" "short_description": "Good cable!",
"image": "https://google.com"
} }
... many more items // 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 > Front -> Back
```json ```json
{ {
type: "cable_details" "type": "cable_details",
call: "request" "call": "request",
data: { "data": {
part_number: [ "part_number": [12345, 67890, 54321, 98765],
12345, "position": [0, 1, 2, 53]
67890,
...
]
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:
> Back -> Front > Back -> Front
```json ```json
{ {
type: "cable_details" "type": "cable_details",
call: "send" "call": "send",
data: { "data": {
cables: [ "cables": [
{ {
part_number: 12345 "part_number": 12345,
position: 0-53 "position": 0, // 0-53
part_image_url: "https://belden.com" "part_image_url": "https://belden.com",
brand_image_url: "https://belden.com" "brand_image_url": "https://belden.com",
extracted_object: { "extracted_object": {
....... #brand will be in here // 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 > Front -> Back
```json ```json
{ {
type: "cable_search" "type": "cable_search",
call: "request" "call": "request",
data: { "data": {
string: "name/part_number/type/category/etc" "string": "name/part_number/type/category/etc"
} }
} }
One Liner: {"type":"cable_search","call":"request","data":{"string":"name/part_number/type/category/etc"}}
``` ```
### Back: ### Back:
> Back -> Front > Back -> Front
```json ```json
{ {
type: "cable_search" "type": "cable_search",
call: "send" "call": "send",
data: { "data": {
cables: [ "cables": [
{ {
part_number: 12345 "part_number": 12345,
position: 0-53 "position": 0, // 0-53
part_image_url: "https://belden.com" "part_image_url": "https://belden.com",
brand_image_url: "https://belden.com" "brand_image_url": "https://belden.com",
extracted_object: { "extracted_object": {
....... #brand will be in here // 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 > Front -> Back
```json ```json
{ {
type: "keyboard" "type": "keyboard",
call: "request" "call": "request",
data: { "data": {
enabled: True / False "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 > Front -> Back
```json ```json
{ {
type: "machine_settings" "type": "machine_settings",
call: "request" "call": "request",
data: { "data": {}
}
} }
One Liner: {"type":"machine_settings","call":"request","data":{}}
``` ```
### Back: ### Back:
> Back -> Front > Back -> Front
```json ```json
{ {
type: "machine_settings" "type": "machine_settings",
call: "send" "call": "send",
data: { "data": {
settings: [ "settings": [
{ {
setting_name: "text field" "setting_name": "text field",
type: "text" "type": "text",
advanced: True "advanced": true,
current_value: "current value of seting" "current_value": "current value of seting"
}, },
{ {
setting_name: "radio button" "setting_name": "radio button",
type: "radio" "type": "radio",
advanced: True "advanced": true,
current_value: "option 1" "current_value": "option 1",
radio_values: [ "radio_values": ["option 1", "option 2", "option 3"]
"option 1",
"option 2",
"option 3"
]
}, },
{ {
setting_name: "check box" "setting_name": "check box",
type: "check" "type": "check",
advanced: True "advanced": true,
current_value: ["option 1", "option 2"] "current_value": ["option 1", "option 2"],
radio_values: [ "radio_values": ["option 1", "option 2", "option 3"]
"option 1",
"option 2",
"option 3"
]
}, },
{ {
setting_name: "enabled or disabled" "setting_name": "enabled or disabled",
type: "boolean" "type": "boolean",
advanced: True "advanced": true,
current_value: True "current_value": true
}, },
{ {
setting_name: "slider bar" "setting_name": "slider bar",
type: "slider" "type": "slider",
advanced: True "advanced": true,
current_value: 50.0 #Float "current_value": 50.0,
min: -100.0 #Float "min": -100.0,
max: 100.0 #Float "max": 100.0
}, },
{ {
setting_name: "button" "setting_name": "button",
advanced: True "advanced": true,
type: "button" "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:
> Front -> Back > Front -> Back
```json ```json
{ {
type: "machine_settings" "type": "machine_settings",
call: "send" "call": "send",
data: { "data": {
settings: [ "settings": [
{ {
setting_name: "text field" "setting_name": "text field",
type: "text" "type": "text",
new_value: "current value of seting" "new_value": "current value of seting"
}, },
{ {
setting_name: "radio button" "setting_name": "radio button",
type: "radio" "type": "radio",
new_value: [ "new_value": ["option 1", "option 2", "option 3"]
"option 1",
"option 2",
"option 3"
]
}, },
{ {
setting_name: "check box" "setting_name": "check box",
type: "check" "type": "check",
new_value: [ "new_value": ["option 1", "option 2", "option 3"]
"option 1",
"option 2",
"option 3"
]
}, },
{ {
setting_name: "enabled or disabled" "setting_name": "enabled or disabled",
type: "boolean" "type": "boolean",
new_value: False "new_value": false
}, },
{ {
setting_name: "slider bar" "setting_name": "slider bar",
type: "slider" "type": "slider",
new_value: 100.0 #Float "new_value": 100.0
}, },
{ {
setting_name: "button" "setting_name": "button",
type: "button" "type": "button",
new_value: True "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}]}}
``` ```
--- ---