LTY252628
2022-02-22 7b68bb4ebf024ebbce77682360fa921aefc220df
debug for dustcleaner
21个文件已修改
75 ■■■■■ 已修改文件
.gitignore 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/launch.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_bin2ply.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_ply_show .bat 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_startClient.bat 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_startServer.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_udp2bin.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_udp2ply.bat 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
TEST_udp_get.bat 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
bin2ply.BAT 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ply_show.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Server.py 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/engine/AcquisitionMain.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/engine/DeviceManager.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/engine/DustCleaner.py 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/engine/MessageQueueThread.py 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
startClient.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
startServer.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
udp2bin.bat 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
udp2ply.bat 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
udp_get.bat 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -14,6 +14,7 @@
# data & image & microwave
Data
Images
Images*
Microwaves
Manual_Microwave*
.vscode/launch.json
@@ -5,18 +5,18 @@
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Client_local",
            "name": "Client_test",
            "type": "python",
            "request": "launch",
            "python": "${workspaceFolder}/env/aerial_deploy/python.exe",
            "program": "${workspaceFolder}/src/Client.py",
            "args": [
                "localhost",
                "192.168.1.224",
                "chai",
                "password123",
                "aerial_rpc",
                "pod1",
                "http://localhost/api",
                "http://192.168.1.224/api",
                "localhost"
            ],
            "console": "integratedTerminal"
@@ -39,7 +39,7 @@
            "console": "integratedTerminal"
        },
        {
            "name": "Server_local",
            "name": "Server_test",
            "type": "python",
            "python": "${workspaceFolder}/env/aerial_deploy/python.exe",
            "request": "launch",
TEST_bin2ply.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set BINfolder=./Manual_Microwave_test/pod1-2022-02-21-15-34-45/
TEST_ply_show .bat
@@ -12,7 +12,10 @@
    call %envsetting% 
)
set PLYfile=./Manual_Microwave_test/pod1-2022-02-21-15-34-45/2522.ply
cd %~dp0
echo change to path: %cd%
set PLYfile=./Manual_Microwave_test/pod1-2022-02-22-15-44-51/28344.ply
@REM -------------- Usage: plot_ply.py [PLYfile]"
%aerialpython% ./src/utils/plot_ply.py %PLYfile%
pause
TEST_startClient.bat
@@ -12,19 +12,22 @@
    call %envsetting% 
)
set MQhost=localhost
set MQhost=192.168.1.224
set MQuser=chai
set MQpassword=password123
set QUEUEname=aerial_rpc
set DEVICEname=pod1
set SERVERhost=http://localhost/api
set SERVERhost=http://192.168.1.224/api
set MICROWAVEhost=localhost
set LOGfile=ClientTEST.log
cd %~dp0
echo change to path: %cd%
@REM Launch the Client
echo the log file will be saved in the [%LOGfile%] file
echo Client.py is running ...
@REM -------- Usage: Client.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [DEVICEname] [SERVERhost] [MICROWAVEhost]
%aerialpython% ./src/Client.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost% >> %LOGfile%
@REM %aerialpython% ./src/Client.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost% >> %LOGfile%
%aerialpython% ./src/Client.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost%
echo Client.py has been terminited.
pause
TEST_startServer.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set MQhost=localhost
set MQuser=chai
TEST_udp2bin.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set UDPfolder=./Manual_Microwave_test/pod1-2022-02-21-15-34-45/
TEST_udp2ply.bat
@@ -11,8 +11,10 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set UDPfolder=./Manual_Microwave_test/pod1-2022-02-21-15-34-45/
set UDPfolder=./Manual_Microwave_test/pod1-2022-02-22-15-44-51/
@REM ---------------Usage: udp2bin.py [UDPfolder]
%aerialpython% ./src/utils/udp2bin.py %UDPfolder%
TEST_udp_get.bat
@@ -11,9 +11,11 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set MICROWAVEhost=172.17.17.206
SET PACKETthreshold=100
set MICROWAVEhost=192.168.2.65
SET PACKETthreshold=1000
SET DEVICEname=pod1
SET SAVEfolder=./Manual_Microwave_test
@REM ---------------Usage: udp_get.py [MICROWAVEhost] [PACKETthreshold] [DEVICEname] [SAVEfolder]
bin2ply.BAT
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
@REM please the folder path of the bin files.
@REM set BINfolder=./Manual_Microwave/pod1-2012-12-12-12-12-12/
ply_show.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
@REM please the folder path of the bin files.
@REM set PLYfile=./Manual_Microwave/pod1-2022-02-21-15-34-45/2522.ply
src/Server.py
@@ -63,7 +63,7 @@
    def run_rabbitmq(self, host: str, user: str, password: str, queue: str) -> None:
        self._message_queue_thread = MessageQueueThread(
            host, user, password, queue, self._device_manager)
            host, user, password, queue, self._device_manager, save_folder)
        self._message_queue_thread.start()
    def run_all(self):
@@ -71,7 +71,7 @@
        self.run(debug=False, host="0.0.0.0", port=self.port)
    def send_controll_message(self, device_id, msg):
        device = self._device_manager.get_device(device_id)
        device = self._device_manager.get_device(device_id,save_folder)
        if device is None:
            channel = device.controll_channel
            channel.basic_publish(
src/engine/AcquisitionMain.py
@@ -239,7 +239,7 @@
                if not self.msg_queue.empty():
                    msg = self.msg_queue.get()
                    self._send_data(msg)
                    print("send message")
                    print(time.asctime(), "send message")
                time.sleep(0.1)
            except Exception as e:
                break
src/engine/DeviceManager.py
@@ -25,7 +25,7 @@
            start = datetime.datetime.now()
            if not os.path.exists(save_folder):
                os.mkdir(save_folder)
            path = os,path.join(save_folder,f"{device_id}-{start.strftime('%Y-%m-%d-%H-%M-%S')}")
            path = os.path.join(save_folder,f"{device_id}-{start.strftime('%Y-%m-%d-%H-%M-%S')}")
            if not os.path.exists(path):
                os.mkdir(path)
            device = dict(
src/engine/DustCleaner.py
@@ -55,7 +55,7 @@
    # 发数据
    def Send(self, data):
        if (not self.com_port is None) and self.com_port.is_open():
        if (not self.com_port is None) and self.com_port.is_open:
            self.com_port.write(data)
            self.Recive()
@@ -97,7 +97,7 @@
        self.SendNoChecksum(bytes([0x5A, 0x07, 0x73, start_angle, end_angle, num, 0x00]))
    def Recive(self):
        return self.main_engine.read_all()
        return self.com_port.read_all()
if __name__ == '__main__':
src/engine/MessageQueueThread.py
@@ -19,9 +19,11 @@
                 user: str, 
                 password: str, 
                 queue: str, 
                 device_manager: DeviceManager):
                 device_manager: DeviceManager,
                 save_folder: str):
        threading.Thread.__init__(self)
        self._device_manager = device_manager
        self.save_folder = save_folder
        self._def_routes()
        self.message_received: int = 0
@@ -58,7 +60,7 @@
            print(
                f'send image sub command received, length={req.data1.length}')
            if req.data1.length > 0:
                device = self._device_manager.get_device(req.device_id)
                device = self._device_manager.get_device(req.device_id, self.save_folder)
                img_msg = pb.ImagesMessage()
                img_msg.ParseFromString(req.data1.data)
                # print(img_msg.image1)
@@ -74,7 +76,7 @@
        print('micro wave command')
        if pb.SubCommand.MICRO_WAVE_SUB_COMMAND == req.sub_command:
            print('micro wave sub command received')
            device = self._device_manager.get_device(req.device_id)
            device = self._device_manager.get_device(req.device_id,self.save_folder)
            micro_wave_msg = pb.MicroWaveMessage()
            micro_wave_msg.ParseFromString(req.data1.data)
            if (micro_wave_msg.length == len(micro_wave_msg.data)):
startClient.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set MQhost=172.17.17.206
set MQuser=chai
startServer.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set MQhost=172.17.17.206
set MQuser=chai
udp2bin.bat
@@ -12,6 +12,9 @@
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
@REM please the folder path of the udp files.
@REM set UDPfolder=./Manual_Microwave/pod1-2012-12-12-12-12-12/
udp2ply.bat
@@ -12,6 +12,9 @@
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
@REM please the folder path of the udp files.
@REM set UDPfolder=./Manual_Microwave/pod1-2012-12-12-12-12-12/
udp_get.bat
@@ -11,6 +11,8 @@
if not exist %aerialpython% (
    call %envsetting% 
)
cd %~dp0
echo change to path: %cd%
set MICROWAVEhost=192.168.2.65
SET PACKETthreshold=1000