Update README.md

This commit is contained in:
scarlett kadan 2024-02-03 17:23:06 +00:00
parent 579f6f822d
commit f2ca5f3c86

381
README.md
View File

@ -1,263 +1,270 @@
<img src="https://cdn.worldvectorlogo.com/logos/belden-4.svg">
--- ---
# Belden Jukebox Front/Back Specifications <div style="display:flex;align-items:center;justify-content:center;flex-direction:column;" align="center">
## This document outlines how data will be transmitted between the frontend and the backend. <img style="width:10px;" src="https://www.digikey.com/-/media/Images/Vendors/B/web-belden.png?la=en-US&ts=db9a9e88-b1c7-415a-a252-934462927b19&w=200&h=100">
</div>
--- ---
<div style="display:flex;align-items:center;justify-content:center;flex-direction:column;" align="center">
<h3><b>Belden Jukebox Front/Back Specification: </b></h3>
<p><b>This document outlines how data will be transmitted between the frontend and the backend.</b></p>
</div>
### Standard Object ### Standard Object
- All objects sent between the frontend and backend will follow this format. 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: {
    } }
} }
``` ```
--- ---
### CABLE_MAP Object
#### Front: ## CABLE_MAP Object
### Front:
> Front -> Back > Front -> Back
```json ```json
{ {
    type: "cable_map" type: "cable_map"
    call: "request" call: "request"
    data: { data: {
    } }
} }
``` ```
#### Back: ### Back:
> Back -> Front > Back -> Front
```json ```json
{ {
    type: "cable_map" type: "cable_map"
    call: "send" call: "send"
    data: { data: {
        map: [ map: [
            item { item {
                part_number: 12345 part_number: 12345
                position: 0-53 position: 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!"
            } }
            ... many more items ... many more items
        ] ]
    } }
} }
``` ```
---
### CABLE_DETAILS Object ## CABLE_DETAILS Object
#### Front: ### Front:
> Front -> Back > Front -> Back
```json ```json
{ {
    type: "cable_details" type: "cable_details"
    call: "request" call: "request"
    data: { data: {
        part_number: [ part_number: [
            12345, 12345,
            67890, 67890,
            ... ...
        ] ]
        position: [ position: [
            0, 0,
            1, 1,
            2, 2,
            ... 53 ... 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-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
                } }
            }, },
            ..... .....
        ] ]
    } }
} }
``` ```
--- ---
### CABLE_SEARCH Object ## CABLE_SEARCH Object
#### Front: ### Front:
> 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"
    } }
} }
``` ```
#### 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-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
                } }
            }, },
            .... ....
        ] ]
    } }
} }
``` ```
--- ---
### KEYBOARD Object ## KEYBOARD Object
#### Front: ### Front:
> Front -> Back > Front -> Back
```json ```json
{ {
    type: "keyboard" type: "keyboard"
    call: "request" call: "request"
    data: { data: {
        enabled: True / False enabled: True / False
    } }
} }
``` ```
--- ---
### MACHINE_SETTINGS Object ## MACHINE_SETTINGS Object
#### Front: ### Front:
> Front -> Back > Front -> Back
```json ```json
{ {
    type: "machine_settings" type: "machine_settings"
    call: "request" call: "request"
    data: { 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"
    current_value: "current value of seting" current_value: "current value of seting"
    }, },
    { {
    setting_name: "radio button" setting_name: "radio button"
    type: "radio" type: "radio"
    current_value: "option 1" current_value: "option 1"
    radio_values: [ radio_values: [
    "option 1", "option 1",
    "option 2", "option 2",
    "option 3" "option 3"
    ] ]
    }, },
    { {
    setting_name: "check box" setting_name: "check box"
    type: "check" type: "check"
    current_value: ["option 1", "option 2"] current_value: ["option 1", "option 2"]
    radio_values: [ radio_values: [
    "option 1", "option 1",
    "option 2", "option 2",
    "option 3" "option 3"
    ] ]
    }, },
    { {
    setting_name: "enabled or disabled" setting_name: "enabled or disabled"
    type: "boolean" type: "boolean"
    current_value: True current_value: True
    }, },
    { {
    setting_name: "slider bar" setting_name: "slider bar"
    type: "slider" type: "slider"
    current_value: 50.0 #Float current_value: 50.0 #Float
    min: -100.0 #Float min: -100.0 #Float
    max: 100.0 #Float max: 100.0 #Float
    } }
    ] ]
    } }
} }
``` ```
#### 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 1",
    "option 2", "option 2",
    "option 3" "option 3"
    ] ]
    }, },
    { {
    setting_name: "check box" setting_name: "check box"
    type: "check" type: "check"
    new_value: [ new_value: [
    "option 1", "option 1",
    "option 2", "option 2",
    "option 3" "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 #Float
    } }
    ] ]
    } }
} }
``` ```