This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, json | |
| class Calibration_Multi: | |
| def __init__(self, filepath=None): | |
| self.dots = { | |
| "origin": [900, 1300, 1700, 2100, 2500], | |
| "adjust": [0, 20, 40, 60 ,80], | |
| "count_in_use": 5 | |
| } | |
| self.filepath = filepath |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import time | |
| import threading | |
| import select | |
| import sys | |
| import ntplib | |
| if sys.version_info[0] == 2: | |
| import Queue as queue | |
| else: | |
| import queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Keep updating sensors' data via websocket. | |
| */ | |
| function update_sensor(data_json){ | |
| var actions = "Do something" | |
| } | |
| function websocket_init(){ | |
| if ("WebSocket" in window){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import websockets | |
| from queue import Queue | |
| Sensor_Data = {"Data_As_Dict": "Sensor-1, Sensor-2, ...."} | |
| Command_List = "Your_Command_list" | |
| Queue_waiting = Queue() | |
| Queue_result = Queue() |