-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (39 loc) · 1.54 KB
/
Copy pathmain.py
File metadata and controls
44 lines (39 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'''
Author: Y.Y. Daniel 626986815@qq.com
Date: 2024-08-01 17:23:42
LastEditors: Y.Y. Daniel 626986815@qq.com
LastEditTime: 2024-08-19 20:00:23
FilePath: /dxlr01_controller_python/main.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
import sys
from src.dxlr01 import *
import threading
import json
from src.yydora.parser import *
from src.yydora.manager import *
from src.data_processor import DataProcessor
def main() -> int:
loraModule = dxlr01('com8', 9600, False)
manager = YYDoraMessageManager(loraModule)
dataProcessor = DataProcessor()
# # writeThread = threading.Thread(target=loraModule.writeContinuously, name='continuouslyWrite')
# # readThread = threading.Thread(target=loraModule.readContinuously, name='continuouslyRead')
# # writeThread.start()
# # readThread.start()
# # writeThread.join()
# # readThread.join()
# # loraModule.getParams()
# res = loraModule.testFun()
# print("**********Test Result**********\n")
# print(f"\tAverage time: {res} s.\n")
# print("*******************************")
# teststr = "Now we will have a test on long strings. We will test if the time is affordable when calculating crc32 of a long string. "
# print(yydoraParser(teststr).decode())
# print(yydoraUnparser(yydoraParser(teststr)))
while True:
text = manager.getReceived()
dataProcessor.processData(text)
sleep(1)
if __name__ == '__main__':
main()