diff --git a/README.md b/README.md index 4ea27b5..b67dabb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Dwarf II TCP server -**NOTE: This is a work in progress. It's been cloudy, so I haven't tested this code yet.** - This software lets you send goto commands to the Dwarf II using Stellarium's Telescope Control. Requires: @@ -22,15 +20,28 @@ This software setups up a TCP server. When you select an object Stellarium, and 3. Install libraries +On Linux, Mac or WSL for Windows : + ``` pip install -r requirements.txt ``` +On Windows : + +you can install Python 3.11 (search on Microsoft Store) +open a command prompt on the directory and do : + +``` +python3 -m pip install -r requirements.txt +``` + 4. Copy `config.sample.py`, and rename it to `config.py`. The `HOST` and `PORT` should be the same as those used in Stellarium Telescope Plugin. -Fill in your `LATITUDE` and `LONGITUDE`. +Fill in your `LATITUDE` and `LONGITUDE` (LONGITUDE is negative west of Greenwich) + +Add also your `TIMEZONE`, it's need when you are using the Stellarium Mobile App If you are using the Dwarf wifi, the `DWARF_IP` is 192.168.88.1. If you are using Dwarf II in STA mode, then get the IP for your Dwarf II. @@ -43,4 +54,16 @@ If you are using the Dwarf wifi, the `DWARF_IP` is 192.168.88.1. If you are usin python server.py ``` -6. Select an object in Stellarium, and issue a slew command. The Dwarf II should move to that object. +On Windows : + +``` +python3 server.py +``` + +6. Start the dwarf II and use the mobile app and go to Astro Mode and do the calibration + +7. Select an object in Stellarium, and issue a slew command. (shortcut for Windows is Alt + number, See Stellarium documentation, Command + number for Mac). The Dwarf II should move to that object. + +8. You can also use the Stellarium Plus Mobile App with the remote Telescopte function, Select an object in Stellarium, and issue a goto command with the remote control. The Dwarf II should move to that object. + +**NOTE: If the server disconnects from Stellarium, You can try reconnect on the cmd window by typing Y otherwise the program will stop ** diff --git a/TUTORIAL PLUGIN STELLARIUM MOBILE.pdf b/TUTORIAL PLUGIN STELLARIUM MOBILE.pdf new file mode 100644 index 0000000..9e13e2f Binary files /dev/null and b/TUTORIAL PLUGIN STELLARIUM MOBILE.pdf differ diff --git a/config.sample.py b/config.sample.py index 6225c32..401a567 100644 --- a/config.sample.py +++ b/config.sample.py @@ -3,4 +3,7 @@ LATITUDE = 0 LONGITUDE = 0 DWARF_IP = "192.168.88.1" +TIME_ZONE="Europe/Paris" +VERSION_API = 2 # 1 or 2 +CLIENT_ID = "0000DAF2-0000-1000-8000-00805F9B3500" DEBUG = True diff --git a/lib/dwarfII_api.py b/lib/dwarfII_api.py index 88812a0..0b9c380 100644 --- a/lib/dwarfII_api.py +++ b/lib/dwarfII_api.py @@ -9,18 +9,21 @@ def ws_uri(dwarf_ip): return f"ws://{dwarf_ip}:9900" -def now(): - return str(datetime.datetime.now()).split(".")[0] +def nowUTC(): + return str(datetime.datetime.utcnow()).split(".")[0] +def nowLocalFileName(): + return datetime.datetime.today().strftime('%Y%m%d%H%M%S') + def goto_target(latitude, longitude, rightAscension, declination, planet=None): options = { "interface": startGotoCmd, "camId": telephotoCamera, "lon": longitude, "lat": latitude, - "date": now(), - "path": "DWARF_GOTO_timestamp", + "date": nowUTC(), + "path": "DWARF_GOTO_" + nowLocalFileName(), } if planet is not None: @@ -31,7 +34,6 @@ def goto_target(latitude, longitude, rightAscension, declination, planet=None): return options - def cameraWorkingState(): return { "interface": statusWorkingStateTelephotoCmd, diff --git a/lib/dwarf_utils.py b/lib/dwarf_utils.py index 1fdb92d..15de1a1 100644 --- a/lib/dwarf_utils.py +++ b/lib/dwarf_utils.py @@ -2,16 +2,23 @@ import lib.dwarfII_api as d2 import config import lib.my_logger as log +import proto.astro_pb2 as astro +import proto.system_pb2 as system +import time +import math +def perform_gotoV1(ra, dec, result_queue): + # Inverse LONGITUDE for DwarfII !!!!!!! + payload = d2.goto_target(config.LATITUDE, - config.LONGITUDE, ra, dec) -def perform_goto(ra, dec): - payload = d2.goto_target(config.LATITUDE, config.LONGITUDE, ra, dec) + response = connect_socketV1(payload) - response = connect_socket(payload) + if response: - if response["interface"] == payload["interface"]: + if response["interface"] == payload["interface"]: if response["code"] == 0: log.debug("Goto success") + result_queue.put("ok") return "ok" elif response["code"] == -45: log.error("Target below horizon") @@ -19,10 +26,114 @@ def perform_goto(ra, dec): log.error("Goto or correction bump limit") else: log.error("Error:", response) - else: + else: log.error("Dwarf API:", response) + else: + log.error("Dwarf API:", "Dwarf II not connected") + + result_queue.put(False) + +# Add an number to target Stellarium to have a different target name each time +global id_target +id_target = 0 + +global do_time +do_time = False + +global do_timezone +do_timezone = False + + +def perform_goto(ra, dec, result_queue): + + global do_time + global do_timezone + + if (not do_time): + perform_time() + do_time = True + + if (not do_time): + perform_timezone() + do_timezone = True + + # Add an number to target Stellarium to have a different target name each time + global id_target + id_target += 1 + + if (id_target >= 10): + id_target = 1 + + # GOTO + module_id = 3 # MODULE_ASTRO + type_id = 0; #REQUEST + + ReqGotoDSO_message = astro.ReqGotoDSO() + ReqGotoDSO_message.ra = ra + ReqGotoDSO_message.dec = dec + ReqGotoDSO_message.target_name = f"Stellarium_{id_target}" + + command = 11002 #CMD_ASTRO_START_GOTO_DSO + response = connect_socket(ReqGotoDSO_message, command, type_id, module_id) + + if response is not False: + + if response == "ok": + log.debug("Goto success") + result_queue.put("ok") + return "ok" + else: + log.error("Error:", response) + else: + log.error("Dwarf API:", "Dwarf II not connected") + + result_queue.put(False) + +def perform_time(): + + # SET TIME + module_id = 4 # MODULE_SYSTEM + type_id = 0; #REQUEST + + ReqSetTime_message = system.ReqSetTime() + ReqSetTime_message.timestamp = math.floor(time.time()) + + command = 13000 #CMD_SYSTEM_SET_TIME + response = connect_socket(ReqSetTime_message, command, type_id, module_id) + + if response is not False: + + if response == 0: + log.debug("Set Time success") + return True + else: + log.error("Error:", response) + else: + log.error("Dwarf API:", "Dwarf II not connected") + + return False + +def perform_timezone(): + + # SET TIMEZONE + module_id = 4 # MODULE_SYSTEM + type_id = 0; #REQUEST + + ReqSetTimezone_message = system.ReqSetTimezone() + ReqSetTimezone_message.timezone = read_timezone() + + command = 13001 #CMD_SYSTEM_SET_TIME_ZONE + response = connect_socket(ReqSetTimezone_message, command, type_id, module_id) + + if response is not False: + + if response == 0: + log.debug("Set TimeZone success") + return True + else: + log.error("Error:", response) + else: + log.error("Dwarf API:", "Dwarf II not connected") + return False -def perform_camera_status(): - payload = d2.cameraWorkingState() - connect_socket(payload) diff --git a/lib/ftp_utils.py b/lib/ftp_utils.py new file mode 100644 index 0000000..b45f04a --- /dev/null +++ b/lib/ftp_utils.py @@ -0,0 +1,53 @@ +import paramiko + +def download_file_via_ssh(ssh_host, ssh_port, ssh_username, ssh_password, remote_file_path, local_file_path): + # Connect to the SSH server + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(ssh_host, port=ssh_port, username=ssh_username, password=ssh_password) + + # Use SFTP to download the file + sftp = ssh.open_sftp() + sftp.get(remote_file_path, local_file_path) + sftp.close() + ssh.close() + +def extract_last_matching_line(file_path, search_string): + last_matching_line = "" + # Open the local file to read its content + with open(file_path, 'r', encoding='utf-8', errors='replace') as file: + # Iterate through each line in the file + for line in file: + # If the search string is found in the line, update the last matching line + if search_string in line: + last_matching_line = line.strip() + return last_matching_line + +def extract_desired_value(line, search_string): + # Find the starting index of the desired value in the line + start_index = line.find(search_string) + len(search_string) + # Return the extracted value after the search string + return line[start_index:].strip() + +def test_ssh_connection(ssh_host, ssh_port, ssh_username, ssh_password): + try: + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(ssh_host, port=ssh_port, username=ssh_username, password=ssh_password) + ssh.close() + return True + except Exception as e: + print(f"Failed to connect to SSH server: {e}") + return False + +def update_config_file(file_path, new_client_id): + with open(file_path, 'r') as file: + lines = file.readlines() + + with open(file_path, 'w') as file: + for line in lines: + if line.startswith('CLIENT_ID'): + file.write(f'CLIENT_ID = "{new_client_id}"\n') + else: + file.write(line) + diff --git a/lib/my_logger.py b/lib/my_logger.py index 5f1dd4f..8657c31 100644 --- a/lib/my_logger.py +++ b/lib/my_logger.py @@ -6,6 +6,9 @@ def debug(*messages): for message in messages: print(message) +def info(*messages): + for message in messages: + print(message) def error(*messages): for message in messages: diff --git a/lib/stellarium_utils.py b/lib/stellarium_utils.py index 2120d5c..87bb0ca 100644 --- a/lib/stellarium_utils.py +++ b/lib/stellarium_utils.py @@ -4,7 +4,6 @@ import lib.my_logger as my_logger - def process_ra_dec_int(ra_int, dec_int): h = ra_int d = math.floor(0.5 + dec_int * (360 * 3600 * 1000 / 4294967296.0)) @@ -45,6 +44,21 @@ def process_ra_dec_int(ra_int, dec_int): }, } +def process_ra_dec(ra_int, dec_int): + data = process_ra_dec_int(ra_int, dec_int) + ra = data["ra"] + dec = data["dec"] + ra_number = ra['hour'] + ra['minute'] / 60 + ra['second'] / 3600 + if dec_int >= 0: + dec_number = dec['degree'] + dec['minute'] / 60 + dec['second'] / 3600 + else: + dec_number = -(dec['degree'] + dec['minute'] / 60 + dec['second'] / 3600) + + return { + "ra_number": ra_number, + "dec_number": dec_number + } + def format_ra_dec(ra_int, dec_int): data = process_ra_dec_int(ra_int, dec_int) @@ -59,20 +73,34 @@ def format_ra_dec(ra_int, dec_int): def process_stellarium_data(raw_data): - data = struct.unpack("3iIi", raw_data) - my_logger.debug("data from Stellarium >>", data) + my_logger.debug("data from Stellarium >>", raw_data) + try: + data = struct.unpack("3iIi", raw_data) + my_logger.debug("data from Stellarium >>", data) - ra_int = data[3] - dec_int = data[4] - formatted_data = format_ra_dec(ra_int, dec_int) - my_logger.debug("ra: " + formatted_data["ra"] + ", dec: " + formatted_data["dec"]) + ra_int = data[3] + dec_int = data[4] + formatted_data = format_ra_dec(ra_int, dec_int) + my_logger.debug("ra: " + formatted_data["ra"] + ", dec: " + formatted_data["dec"]) - return { - "ra_int": ra_int, - "ra": formatted_data["ra"], - "dec_int": dec_int, - "dec": formatted_data["dec"], - } + data_number = process_ra_dec(ra_int, dec_int) + ra_number = data_number["ra_number"] + dec_number = data_number["dec_number"] + my_logger.debug("ra: " + f"{ra_number}" + ", dec: " + f"{dec_number}") + + return { + "ra_int": ra_int, + "ra": formatted_data["ra"], + "ra_number": ra_number, + "dec_int": dec_int, + "dec": formatted_data["dec"], + "dec_number": dec_number, + } + + except struct.error: + # If a struct.error occurs, the data is not in the expected structure format + my_logger.debug("data from Stellarium Mobile >>", raw_data) + return False def update_stellarium(ra_int, dec_int, connection): diff --git a/lib/websockets_utils.py b/lib/websockets_utils.py index b49b58b..002a628 100644 --- a/lib/websockets_utils.py +++ b/lib/websockets_utils.py @@ -1,12 +1,26 @@ -from websockets.sync.client import connect -import config +import logging +import websockets +import asyncio import json +import gzip +import config +import proto.protocol_pb2 as protocol +import proto.notify_pb2 as notify +import proto.astro_pb2 as astro +import proto.system_pb2 as system +import proto.camera_pb2 as camera +# in notify +import proto.base_pb2 as base__pb2 import lib.my_logger as my_logger -from lib.dwarfII_api import ws_uri +def ws_uri(dwarf_ip): + return f"ws://{dwarf_ip}:9900" -def connect_socket(payload): +###################### +# old version V1 +###################### +def connect_socketV1(payload): try: with connect(ws_uri(config.DWARF_IP)) as websocket: my_logger.debug("data to API >>", json.dumps(payload, indent=2)) @@ -16,3 +30,625 @@ def connect_socket(payload): return json.loads(message) except TimeoutError: my_logger.error("Could not connect to websocket") + return False + +def getErrorCodeValueName(ErrorCode): + + try: + ValueName = protocol.DwarfErrorCode.Name(ErrorCode) + except ValueError: + ValueName ="" + pass + return ValueName + +def getDwarfCMDName(DwarfCMDCode): + + try: + ValueName = protocol.DwarfCMD.Name(DwarfCMDCode) + except ValueError: + ValueName ="" + pass + return ValueName + +def getAstroStateName(AstroStateCode): + + try: + ValueName = notify.AstroState.Name(AstroStateCode) + except ValueError: + ValueName ="" + pass + return ValueName + +class StopClientException(Exception): + pass + +# new version protobuf enabled +# use a Class +class WebSocketClient: + def __init__(self, uri, client_id, message, command, type_id, module_id, ping_interval_task=5): + self.websocket = False + self.result = False + self.uri = uri + self.message = message + self.command = command + self.target_name = "" + self.type_id = type_id + self.module_id = module_id + self.client_id = client_id + self.ping_interval_task = ping_interval_task + self.ping_task = None + self.receive_task = None + self.abort_tasks = None + self.abort_timeout = 240 + self.stop_task = asyncio.Event() + self.wait_pong = False + self.stopcalibration = False + + # TEST_CALIBRATION : Test Calibration Packet or Goto Packet + # Test Mode : Calibration Packet => TEST_CALIBRATION = True + # Production Mode GOTO Packet => TEST_CALIBRATION = False (default) + self.modeCalibration = False + + if hasattr(config, 'TEST_CALIBRATION'): + if(config.TEST_CALIBRATION): + self.modeCalibration = True + + async def abort_tasks_timeout(self, timeout): + + try: + count = 0 + self.abort_timeout = timeout + await asyncio.sleep(0.02) + while not self.stop_task.is_set() and count < self.abort_timeout: + await asyncio.sleep(1) + count += 1 + except Exception as e: + # Handle other exceptions + print(f"Timeout: Unhandled exception: {e}") + finally: + # Perform cleanup if needed + if (not self.stop_task.is_set()): + self.stop_task.set() + await asyncio.sleep(0.02) + print("TERMINATING TIMEOUT function.") + + async def send_ping_periodically(self): + if not self.websocket: + print("Error No WebSocket in send_ping_periodically") + self.stop_task.set() + + try: + await asyncio.sleep(2) + while not self.stop_task.is_set(): + if self.websocket.state != websockets.protocol.OPEN: + print("WebSocket connection is not open.") + self.stop_task.set() + elif (not self.wait_pong): + # Adjust the interval based on your requirements + print("Sent a PING frame") + + # Python by defaut sends a frame OP_CODE Ping with 4 bytes + # The dwarf II respond by a frame OP_CODE Pong with no data + await self.websocket.ping("") + await self.websocket.send("ping") + # Signal to Receive to Wait the Pong Frame + self.wait_pong = True + await asyncio.sleep(self.ping_interval_task) + else: + await asyncio.sleep(1) + await asyncio.sleep(0.02) + + except websockets.ConnectionClosedOK as e: + print(f'Ping: ConnectionClosedOK', e) + except websockets.ConnectionClosedError as e: + print(f'Ping: ConnectionClosedError', e) + except asyncio.CancelledError: + print("Ping Cancelled.") + except Exception as e: + # Handle other exceptions + print(f"Ping: Unhandled exception: {e}") + if (not self.stop_task.is_set()): + self.stop_task.set() + await asyncio.sleep(1) + finally: + # Perform cleanup if needed + print("TERMINATING PING function.") + + async def receive_messages(self): + if not self.websocket: + print("Error No WebSocket in receive_messages") + self.stop_task.set() + + try: + await asyncio.sleep(2) + while not self.stop_task.is_set() or self.wait_pong: + await asyncio.sleep(0.02) + print("Wait for frames") + + if self.websocket.state != websockets.protocol.OPEN: + print("WebSocket connection is not open.") + self.wait_pong = False + self.stop_task.set() + else: + message = await self.websocket.recv() + if (message): + if isinstance(message, str): + print("Receiving...") + print(message) + if (message =="pong"): + self.wait_pong = False + elif isinstance(message, bytes): + print("------------------") + print("Receiving... data") + + WsPacket_message = base__pb2.WsPacket() + WsPacket_message.ParseFromString(message) + my_logger.debug(f"receive cmd >> {WsPacket_message.cmd} type >> {WsPacket_message.type}") + my_logger.debug(f">> {getDwarfCMDName(WsPacket_message.cmd)}") + my_logger.debug(f"msg data len is >> {len(WsPacket_message.data)}") + print("------------------") + + # CMD_NOTIFY_WS_HOST_SLAVE_MODE = 15223; // Leader/follower mode notification + if (WsPacket_message.cmd==protocol.CMD_NOTIFY_WS_HOST_SLAVE_MODE): + ResNotifyHostSlaveMode_message = notify.ResNotifyHostSlaveMode() + ResNotifyHostSlaveMode_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_NOTIFY_WS_HOST_SLAVE_MODE") + my_logger.debug(f"receive Host/Slave data >> {ResNotifyHostSlaveMode_message.mode}") + + # Host = 0 Slave = 1 + if (ResNotifyHostSlaveMode_message.mode == 1): + my_logger.debug("SLAVE_MODE >> EXIT") + # Signal the abort_tasks_timeout functions to stop in 15 s + if (self.abort_timeout > 15 ): + self.abort_timeout = 15 + self.result = "Error SLAVE MODE" + await asyncio.sleep(1) + print("Error SLAVE MODE detected") + else: + print("Continue Decoding CMD_NOTIFY_WS_HOST_SLAVE_MODE") + + # CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE = 10039; // // Get the working status of the whole machine + elif (WsPacket_message.cmd==protocol.CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE): + ComResponse_message = base__pb2.ComResponse() + ComResponse_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE") + my_logger.debug(f"receive code data >> {ComResponse_message.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse_message.code)}") + + # OK = 0; // No Error + if (ComResponse_message.code != protocol.OK): + my_logger.debug(f"Error GET_SYSTEM_WORKING_STATE {ComResponse_message.code} >> EXIT") + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = "ok" + await asyncio.sleep(5) + print("Error CAMERA_TELE_GET_SYSTEM_WORKING_STATE CODE " + ComResponse_message.code) + else: + print("Continue OK CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE") + + # CMD_NOTIFY_STATE_ASTRO_CALIBRATION = 15210; // Astronomical calibration status + elif (WsPacket_message.cmd==protocol.CMD_NOTIFY_STATE_ASTRO_CALIBRATION): + ResNotifyStateAstroCalibration_message = notify.ResNotifyStateAstroCalibration() + ResNotifyStateAstroCalibration_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_NOTIFY_STATE_ASTRO_CALIBRATION") + my_logger.debug(f"receive notification data >> {ResNotifyStateAstroCalibration_message.state}") + my_logger.debug(f">> {getAstroStateName(ResNotifyStateAstroCalibration_message.state)}") + my_logger.debug(f"receive notification times >> {ResNotifyStateAstroCalibration_message.plate_solving_times}") + + # ASTRO_STATE_IDLE = 0; // Idle state Only when Success or Previous Error + if (ResNotifyStateAstroCalibration_message.state == notify.ASTRO_STATE_IDLE): + if (self.stopcalibration): + self.result = protocol.CODE_ASTRO_CALIBRATION_FAILED + await asyncio.sleep(5) + print("Error CALIBRATION CODE_ASTRO_CALIBRATION_FAILED") + else : + self.result = "ok" + my_logger.debug("ASTRO CALIBRATION OK >> EXIT") + print("Success ASTRO CALIBRATION OK") + # Signal the ping and receive functions to stop + self.stop_task.set() + await asyncio.sleep(5) + else: + print("Continue Decoding CMD_NOTIFY_STATE_ASTRO_CALIBRATION") + + # CMD_NOTIFY_STATE_ASTRO_GOTO = 15211; // Astronomical GOTO status + elif (WsPacket_message.cmd==protocol.CMD_NOTIFY_STATE_ASTRO_GOTO): + ResNotifyStateAstroGoto_message = notify.ResNotifyStateAstroGoto() + ResNotifyStateAstroGoto_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_NOTIFY_STATE_ASTRO_GOTO") + my_logger.debug(f"receive notification data >> {ResNotifyStateAstroGoto_message.state}") + my_logger.debug(f">> {getAstroStateName(ResNotifyStateAstroGoto_message.state)}") + + # CMD_NOTIFY_STATE_ASTRO_TRACKING = 15212; // Astronomical tracking status + elif (WsPacket_message.cmd==protocol.CMD_NOTIFY_STATE_ASTRO_TRACKING): + ResNotifyStateAstroGoto_message = notify.ResNotifyStateAstroTracking() + ResNotifyStateAstroGoto_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_NOTIFY_STATE_ASTRO_TRACKING") + my_logger.debug(f"receive notification data >> {ResNotifyStateAstroGoto_message.state}") + my_logger.debug(f">> {getAstroStateName(ResNotifyStateAstroGoto_message.state)}") + my_logger.debug(f"receive notification target_name >> {ResNotifyStateAstroGoto_message.target_name}") + + # ASTRO_STATE_RUNNING = 1; // Running + # Can be sending during CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE + # DSO or STELLAR + if ((self.command == protocol.CMD_ASTRO_START_GOTO_DSO) and ResNotifyStateAstroGoto_message.state == notify.ASTRO_STATE_RUNNING and ResNotifyStateAstroGoto_message.target_name == self.target_name): + my_logger.debug("ASTRO GOTO : SAME CMD AND TARGET") + my_logger.debug("ASTRO GOTO OK TRACKING >> EXIT") + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = "ok" + await asyncio.sleep(5) + print("Success ASTRO DSO GOTO TRACKING START") + + if ((self.command == protocol.CMD_ASTRO_START_GOTO_SOLAR_SYSTEM) and ResNotifyStateAstroGoto_message.state == notify.ASTRO_STATE_RUNNING and ResNotifyStateAstroGoto_message.target_name == self.target_name): + my_logger.debug("ASTRO GOTO : SAME CMD AND TARGET") + my_logger.debug("ASTRO GOTO OK TRACKING >> EXIT") + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = "ok" + await asyncio.sleep(5) + print("Success ASTRO SOLAR GOTO TRACKING START") + + # CMD_ASTRO_START_CALIBRATION = 11000; // Start calibration + elif (WsPacket_message.cmd==protocol.CMD_ASTRO_START_CALIBRATION): + ComResponse = base__pb2.ComResponse() + ComResponse.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_ASTRO_START_CALIBRATION") + my_logger.debug(f"receive code data >> {ComResponse.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse.code)}") + + # CODE_ASTRO_CALIBRATION_FAILED = -11504; // Calibration failed + if (ComResponse.code == -11504): + my_logger.debug("Error CALIBRATION >> EXIT") + self.stopcalibration = True + + # CMD_SYSTEM_SET_TIME = 13000; // Set the system time + elif (WsPacket_message.cmd==protocol.CMD_SYSTEM_SET_TIME): + ComResponse = base__pb2.ComResponse() + ComResponse.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_SYSTEM_SET_TIME") + my_logger.debug(f"receive code data >> {ComResponse.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse.code)}") + + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = ComResponse.code + await asyncio.sleep(5) + if (ComResponse.code == protocol.CODE_SYSTEM_SET_TIME_FAILED): + print("Error CMD_SYSTEM_SET_TIME") + else: + print("OK CMD_SYSTEM_SET_TIME") + + # CMD_SYSTEM_SET_TIME_ZONE = 13001; // Set the time zone + elif (WsPacket_message.cmd==protocol.CMD_SYSTEM_SET_TIME_ZONE): + ComResponse = base__pb2.ComResponse() + ComResponse.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_SYSTEM_SET_TIME_ZONE") + my_logger.debug(f"receive code data >> {ComResponse.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse.code)}") + + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = ComResponse.code + await asyncio.sleep(5) + if (ComResponse.code == protocol.CODE_SYSTEM_SET_TIMEZONE_FAILED): + print("Error CMD_SYSTEM_SET_TIME_ZONE") + else: + print("OK CMD_SYSTEM_SET_TIME_ZONE") + + # CMD_ASTRO_START_GOTO_DSO = 11002; // Start GOTO Deep Space Object + elif (WsPacket_message.cmd==protocol.CMD_ASTRO_START_GOTO_DSO): + ComResponse_message = base__pb2.ComResponse() + ComResponse_message.ParseFromString(WsPacket_message.data) + + print("Decoding CMD_ASTRO_START_GOTO_DSO") + my_logger.debug(f"receive data >> {ComResponse_message.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse_message.code)}") + + if (ComResponse_message.code != protocol.OK): + my_logger.debug(f"Error GOTO {ComResponse_message.code} >> EXIT") + # Signal the ping and receive functions to stop + self.stop_task.set() + self.result = ComResponse_message.code + await asyncio.sleep(5) + if (ComResponse_message.code == protocol.CODE_ASTRO_GOTO_FAILED): + print("Error GOTO CODE_ASTRO_GOTO_FAILED") + elif (ComResponse_message.code == protocol.CODE_STEP_MOTOR_LIMIT_POSITION_WARNING): + print("Error GOTO CODE_STEP_MOTOR_LIMIT_POSITION_WARNING") + elif (ComResponse_message.code == protocol.CODE_STEP_MOTOR_LIMIT_POSITION_HITTED): + print("Error GOTO CODE_STEP_MOTOR_LIMIT_POSITION_HITTED") + else: + print("Error GOTO CODE " + ComResponse_message.code) + # Unknown + elif (WsPacket_message.cmd != self.command): + if( WsPacket_message.type == 0): + print("Get Request Frame") + if( WsPacket_message.type == 1): + print("Decoding Response Request Frame") + ComResponse_message = base__pb2.ComResponse() + ComResponse_message.ParseFromString(WsPacket_message.data) + + my_logger.debug(f"receive request response data >> {ComResponse_message.code}") + my_logger.debug(f">> {getErrorCodeValueName(ComResponse_message.code)}") + + if( WsPacket_message.type == 2): + print("Decoding Notification Frame") + ResNotifyStateAstroGoto_message = notify.ResNotifyStateAstroGoto() + ResNotifyStateAstroGoto_message.ParseFromString(WsPacket_message.data) + + my_logger.debug(f"receive notification data >> {ResNotifyStateAstroGoto_message.state}") + my_logger.debug(f">> {getAstroStateName(ResNotifyStateAstroGoto_message.state)}") + + if( WsPacket_message.type == 3): + print("Decoding Response Notification Frame") + ResNotifyStateAstroGoto_message = notify.ResNotifyStateAstroGoto() + ResNotifyStateAstroGoto_message.ParseFromString(WsPacket_message.data) + + my_logger.debug(f"receive notification data >> {ResNotifyStateAstroGoto_message.state}") + my_logger.debug(f">> {getErrorCodeValueName(ResNotifyStateAstroGoto_message.state)}") + else: + print("Ignoring Unkown Type Frames") + else: + print("No Messages Rcv : close ??") + self.wait_pong = False + self.stop_task.set() + print("Continue .....") + + except websockets.ConnectionClosedOK as e: + print(f'Rcv: ConnectionClosedOK', e) + except websockets.ConnectionClosedError as e: + print(f'Rcv: ConnectionClosedError', e) + except asyncio.CancelledError: + print("Rcv Cancelled.") + except Exception as e: + # Handle other exceptions + print(f"Rcv: Unhandled exception: {e}") + if (not self.stop_task.is_set()): + self.stop_task.set() + await asyncio.sleep(1) + finally: + # Perform cleanup if needed + print("TERMINATING Receive function.") + + async def send_message(self): + # Create a protobuf message + # Start Sending + major_version = 1 + minor_version = 1 + device_id = 1 # DWARF II + self.target_name = "" + + if not self.websocket: + print("Error No WebSocket in send_message") + return + + Send_TeleGetSystemWorkingState = True + + #CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE + WsPacket_messageTeleGetSystemWorkingState = base__pb2.WsPacket() + ReqGetSystemWorkingState_message = camera.ReqGetSystemWorkingState() + WsPacket_messageTeleGetSystemWorkingState.data = ReqGetSystemWorkingState_message.SerializeToString() + + WsPacket_messageTeleGetSystemWorkingState.major_version = major_version + WsPacket_messageTeleGetSystemWorkingState.minor_version = minor_version + WsPacket_messageTeleGetSystemWorkingState.device_id = device_id + WsPacket_messageTeleGetSystemWorkingState.module_id = 1 # MODULE_TELEPHOTO + WsPacket_messageTeleGetSystemWorkingState.cmd = 10039 #CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE + WsPacket_messageTeleGetSystemWorkingState.type = 0; #REQUEST + WsPacket_messageTeleGetSystemWorkingState.client_id = self.client_id # "0000DAF2-0000-1000-8000-00805F9B34FB" # ff03aa11-5994-4857-a872-b411e8a3a5e51 + + # SEND COMMAND + WsPacket_message = base__pb2.WsPacket() + WsPacket_message.data = self.message.SerializeToString() + + WsPacket_message.major_version = major_version + WsPacket_message.minor_version = minor_version + WsPacket_message.device_id = device_id + WsPacket_message.module_id = self.module_id + WsPacket_message.cmd = self.command + WsPacket_message.type = self.type_id; + WsPacket_message.client_id = self.client_id # "0000DAF2-0000-1000-8000-00805F9B34FB" # ff03aa11-5994-4857-a872-b411e8a3a5e51 + + try: + # Serialize the message to bytes and send + # Send Command + await asyncio.sleep(0.02) + + if (Send_TeleGetSystemWorkingState): + await self.websocket.send(WsPacket_messageTeleGetSystemWorkingState.SerializeToString()) + print("#----------------#") + my_logger.debug(f"Send cmd >> {WsPacket_messageTeleGetSystemWorkingState.cmd}") + my_logger.debug(f">> {getDwarfCMDName(WsPacket_messageTeleGetSystemWorkingState.cmd)}") + + my_logger.debug(f"Send type >> {WsPacket_messageTeleGetSystemWorkingState.type}") + my_logger.debug(f"msg data len is >> {len(WsPacket_messageTeleGetSystemWorkingState.data)}") + print("Sendind End ...."); + + await asyncio.sleep(1) + + await self.websocket.send(WsPacket_message.SerializeToString()) + print("#----------------#") + my_logger.debug(f"Send cmd >> {WsPacket_message.cmd}") + my_logger.debug(f">> {getDwarfCMDName(WsPacket_message.cmd)}") + + # Special GOTO DSO or SOLAR save Target Name to verifiy is GOTO is success + if ((self.command == protocol.CMD_ASTRO_START_GOTO_DSO) or (self.command == protocol.CMD_ASTRO_START_GOTO_SOLAR_SYSTEM)): + self.target_name = self.message.target_name + + # Special CALIBRATION + if (self.command == protocol.CMD_ASTRO_START_CALIBRATION): + self.stopcalibration = False + + my_logger.debug(f"Send type >> {WsPacket_message.type}") + my_logger.debug(f"Send message >> {self.message}") + my_logger.debug(f"msg data len is >> {len(WsPacket_message.data)}") + print("Sendind End ...."); + + except Exception as e: + # Handle other exceptions + print(f"Unhandled exception1: {e}") + finally: + # Perform cleanup if needed + print("TERMINATING Sending function.") + + async def start(self): + try: + result = False + #asyncio.set_event_loop(asyncio.new_event_loop()) + #ping_timeout=self.ping_interval_task+2 + print(f"ping_interval : {self.ping_interval_task}") + start_client = False + self.stop_task.clear(); + async with websockets.connect(self.uri, ping_interval=None, extra_headers=[("Accept-Encoding", "gzip"), ("Sec-WebSocket-Extensions", "permessage-deflate")]) as websocket: + try: + start_client = True + self.websocket = websocket + if self.websocket: + print(f"Connected to {self.uri} with {self.message}command:{self.command}") + print("------------------") + + # Start the task to receive messages + #self.receive_task = asyncio.ensure_future(self.receive_messages()) + self.receive_task = asyncio.create_task(self.receive_messages()) + + # Start the periodic task to send pings + #self.ping_task = asyncio.ensure_future(self.send_ping_periodically()) + self.ping_task = asyncio.create_task(self.send_ping_periodically()) + + # Start the periodic task to abort all task after timeout + self.abort_tasks = asyncio.create_task(self.abort_tasks_timeout(180)) + + await asyncio.sleep(2) + + # Send a unique message to the server + try: + await self.send_message() + + # For python 11 + #async with asyncio.TaskGroup() as tg: + # self.receive_task = tg.create_task(self.receive_messages()) + # self.ping_task = tg.create_task(self.send_ping_periodically()) + + #print(f"Both tasks have completed now: {self.receive_task.result()}, {self.ping_task.result()}") + #await self.abort_tasks_timeout(30) + + results = await asyncio.gather( + self.receive_task, + self.ping_task, + self.abort_tasks, + return_exceptions=True + ) + print(results) + print("End of Current Tasks.") + + # get the exception #raised by a task + + try: + self.receive_task.result() + self.ping_task.result() + self.abort_tasks.result() + + except Exception as e: + print(f"Exception occurred in the Gather try block: {e}") + + print("End of Current Tasks Results.") + + except Exception as e: + print(f"Exception occurred in the try block: {e}") + + except Exception as e: + print(f"Exception occurred in the 2nd try block: {e}") + except Exception as e: + print(f"unknown exception with error: {e}") + finally: + # Signal the ping and receive functions to stop + self.stop_task.set() + + # Cancel the ping task when the client is done + if self.ping_task: + print("Closing Ping Task ....") + self.ping_task.cancel() + try: + await self.ping_task + except Exception as e: + print(f"unknown exception with error: {e}") + + # Cancel the receive task when the client is done + if self.receive_task: + print("Closing Receive Task ....") + self.receive_task.cancel() + try: + await self.receive_task + except Exception as e: + print(f"unknown exception with error: {e}") + + # Close the WebSocket connection explicitly + if start_client: + if self.websocket: #and self.websocket.open: + print("Closing Socket ....") + try: + await self.websocket.close() + print("WebSocket connection closed.") + except websockets.ConnectionClosedOK as e: + print(f'Close: ConnectionClosedOK', e) + except websockets.ConnectionClosedError as e: + print(f'Close: ConnectionClosedError', e) + except Exception as e: + print(f"unknown exception with error: {e}") + + print("WebSocket Terminated.") + +# Run the client +def start_socket(message, command, type_id, module_id, uri=None, client_id=None, ping_interval_task=10): + if uri is None: + uri = config.DWARF_IP + if client_id is None: + client_id = config.CLIENT_ID + + websocket_uri = ws_uri(uri) + + print(f"Try Connect to {websocket_uri} for {client_id} with data:") + print(f"{message}") + print(f"command:{command}") + my_logger.debug(f">> {getDwarfCMDName(command)}") + print("------------------") + + try: + # Create an instance of WebSocketClient + client_instance = WebSocketClient(websocket_uri, client_id, message, command, type_id, module_id, ping_interval_task) + + # Call the start method to initiate the WebSocket connection and tasks + asyncio.run(client_instance.start()) + print("WebSocket Client End.") + return client_instance.result; + + except Exception as e: + # Handle any errors that may occur during the close operation + print(f"Unknown Error closing : {e}") + pass # Ignore this exception, it's expected during clean-up + + return False; + +def connect_socket(message, command, type_id, module_id): + + result = False + + try: + # Call the start function + result = start_socket(message, command, type_id, module_id) + print(f"Result : {result}") + + except KeyboardInterrupt: + # Handle KeyboardInterrupt separately + print("KeyboardInterrupt received. Stopping gracefully.") + pass # Ignore this exception, it's expected during clean-up + return result + diff --git a/proto/astro.proto b/proto/astro.proto new file mode 100644 index 0000000..fbea8cc --- /dev/null +++ b/proto/astro.proto @@ -0,0 +1,79 @@ +syntax = "proto3"; + +// 开始校准 +message ReqStartCalibration { + +} + +// 停止校准 +message ReqStopCalibration { + +} + +// Goto深空天体 +message ReqGotoDSO { + double ra = 1; + double dec = 2; + string target_name = 3; +} + +// Goto太阳系 +message ReqGotoSolarSystem { + int32 index = 1; + double lon = 2; + double lat = 3; + string target_name = 4; +} + +// 停止Goto +message ReqStopGoto { + +} + +// 开始叠图 +message ReqCaptureRawLiveStacking { + +} + +// 停止叠图 +message ReqStopCaptureRawLiveStacking { + +} + +// 查询暗场进度 +message ReqCheckDarkFrame { + +} + +// 暗场进度返回 +message ResCheckDarkFrame { + int32 progress = 1; + int32 code = 2; +} + +// 开始拍摄暗场 +message ReqCaptureDarkFrame { + int32 reshoot = 1; +} + +// 停止拍摄暗场 +message ReqStopCaptureDarkFrame { + +} + +// GO LIVE接口 +message ReqGoLive { + +} + +// 开始日月跟踪 +message ReqTrackSpecialTarget { + int32 index = 1; + double lon = 2; + double lat = 3; +} + +// 停止日月跟踪 +message ReqStopTrackSpecialTarget { + +} diff --git a/proto/astro_pb2.py b/proto/astro_pb2.py new file mode 100644 index 0000000..67ef1a5 --- /dev/null +++ b/proto/astro_pb2.py @@ -0,0 +1,583 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: astro.proto + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='astro.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0b\x61stro.proto\"\x15\n\x13ReqStartCalibration\"\x14\n\x12ReqStopCalibration\":\n\nReqGotoDSO\x12\n\n\x02ra\x18\x01 \x01(\x01\x12\x0b\n\x03\x64\x65\x63\x18\x02 \x01(\x01\x12\x13\n\x0btarget_name\x18\x03 \x01(\t\"R\n\x12ReqGotoSolarSystem\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x0b\n\x03lon\x18\x02 \x01(\x01\x12\x0b\n\x03lat\x18\x03 \x01(\x01\x12\x13\n\x0btarget_name\x18\x04 \x01(\t\"\r\n\x0bReqStopGoto\"\x1b\n\x19ReqCaptureRawLiveStacking\"\x1f\n\x1dReqStopCaptureRawLiveStacking\"\x13\n\x11ReqCheckDarkFrame\"3\n\x11ResCheckDarkFrame\x12\x10\n\x08progress\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"&\n\x13ReqCaptureDarkFrame\x12\x0f\n\x07reshoot\x18\x01 \x01(\x05\"\x19\n\x17ReqStopCaptureDarkFrame\"\x0b\n\tReqGoLive\"@\n\x15ReqTrackSpecialTarget\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x0b\n\x03lon\x18\x02 \x01(\x01\x12\x0b\n\x03lat\x18\x03 \x01(\x01\"\x1b\n\x19ReqStopTrackSpecialTargetb\x06proto3' +) + + + + +_REQSTARTCALIBRATION = _descriptor.Descriptor( + name='ReqStartCalibration', + full_name='ReqStartCalibration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=15, + serialized_end=36, +) + + +_REQSTOPCALIBRATION = _descriptor.Descriptor( + name='ReqStopCalibration', + full_name='ReqStopCalibration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=38, + serialized_end=58, +) + + +_REQGOTODSO = _descriptor.Descriptor( + name='ReqGotoDSO', + full_name='ReqGotoDSO', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='ra', full_name='ReqGotoDSO.ra', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='dec', full_name='ReqGotoDSO.dec', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='target_name', full_name='ReqGotoDSO.target_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=60, + serialized_end=118, +) + + +_REQGOTOSOLARSYSTEM = _descriptor.Descriptor( + name='ReqGotoSolarSystem', + full_name='ReqGotoSolarSystem', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='ReqGotoSolarSystem.index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='lon', full_name='ReqGotoSolarSystem.lon', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='lat', full_name='ReqGotoSolarSystem.lat', index=2, + number=3, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='target_name', full_name='ReqGotoSolarSystem.target_name', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=120, + serialized_end=202, +) + + +_REQSTOPGOTO = _descriptor.Descriptor( + name='ReqStopGoto', + full_name='ReqStopGoto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=204, + serialized_end=217, +) + + +_REQCAPTURERAWLIVESTACKING = _descriptor.Descriptor( + name='ReqCaptureRawLiveStacking', + full_name='ReqCaptureRawLiveStacking', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=219, + serialized_end=246, +) + + +_REQSTOPCAPTURERAWLIVESTACKING = _descriptor.Descriptor( + name='ReqStopCaptureRawLiveStacking', + full_name='ReqStopCaptureRawLiveStacking', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=248, + serialized_end=279, +) + + +_REQCHECKDARKFRAME = _descriptor.Descriptor( + name='ReqCheckDarkFrame', + full_name='ReqCheckDarkFrame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=281, + serialized_end=300, +) + + +_RESCHECKDARKFRAME = _descriptor.Descriptor( + name='ResCheckDarkFrame', + full_name='ResCheckDarkFrame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='progress', full_name='ResCheckDarkFrame.progress', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ResCheckDarkFrame.code', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=302, + serialized_end=353, +) + + +_REQCAPTUREDARKFRAME = _descriptor.Descriptor( + name='ReqCaptureDarkFrame', + full_name='ReqCaptureDarkFrame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='reshoot', full_name='ReqCaptureDarkFrame.reshoot', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=355, + serialized_end=393, +) + + +_REQSTOPCAPTUREDARKFRAME = _descriptor.Descriptor( + name='ReqStopCaptureDarkFrame', + full_name='ReqStopCaptureDarkFrame', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=395, + serialized_end=420, +) + + +_REQGOLIVE = _descriptor.Descriptor( + name='ReqGoLive', + full_name='ReqGoLive', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=422, + serialized_end=433, +) + + +_REQTRACKSPECIALTARGET = _descriptor.Descriptor( + name='ReqTrackSpecialTarget', + full_name='ReqTrackSpecialTarget', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='ReqTrackSpecialTarget.index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='lon', full_name='ReqTrackSpecialTarget.lon', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='lat', full_name='ReqTrackSpecialTarget.lat', index=2, + number=3, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=435, + serialized_end=499, +) + + +_REQSTOPTRACKSPECIALTARGET = _descriptor.Descriptor( + name='ReqStopTrackSpecialTarget', + full_name='ReqStopTrackSpecialTarget', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=501, + serialized_end=528, +) + +DESCRIPTOR.message_types_by_name['ReqStartCalibration'] = _REQSTARTCALIBRATION +DESCRIPTOR.message_types_by_name['ReqStopCalibration'] = _REQSTOPCALIBRATION +DESCRIPTOR.message_types_by_name['ReqGotoDSO'] = _REQGOTODSO +DESCRIPTOR.message_types_by_name['ReqGotoSolarSystem'] = _REQGOTOSOLARSYSTEM +DESCRIPTOR.message_types_by_name['ReqStopGoto'] = _REQSTOPGOTO +DESCRIPTOR.message_types_by_name['ReqCaptureRawLiveStacking'] = _REQCAPTURERAWLIVESTACKING +DESCRIPTOR.message_types_by_name['ReqStopCaptureRawLiveStacking'] = _REQSTOPCAPTURERAWLIVESTACKING +DESCRIPTOR.message_types_by_name['ReqCheckDarkFrame'] = _REQCHECKDARKFRAME +DESCRIPTOR.message_types_by_name['ResCheckDarkFrame'] = _RESCHECKDARKFRAME +DESCRIPTOR.message_types_by_name['ReqCaptureDarkFrame'] = _REQCAPTUREDARKFRAME +DESCRIPTOR.message_types_by_name['ReqStopCaptureDarkFrame'] = _REQSTOPCAPTUREDARKFRAME +DESCRIPTOR.message_types_by_name['ReqGoLive'] = _REQGOLIVE +DESCRIPTOR.message_types_by_name['ReqTrackSpecialTarget'] = _REQTRACKSPECIALTARGET +DESCRIPTOR.message_types_by_name['ReqStopTrackSpecialTarget'] = _REQSTOPTRACKSPECIALTARGET +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ReqStartCalibration = _reflection.GeneratedProtocolMessageType('ReqStartCalibration', (_message.Message,), { + 'DESCRIPTOR' : _REQSTARTCALIBRATION, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStartCalibration) + }) +_sym_db.RegisterMessage(ReqStartCalibration) + +ReqStopCalibration = _reflection.GeneratedProtocolMessageType('ReqStopCalibration', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPCALIBRATION, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStopCalibration) + }) +_sym_db.RegisterMessage(ReqStopCalibration) + +ReqGotoDSO = _reflection.GeneratedProtocolMessageType('ReqGotoDSO', (_message.Message,), { + 'DESCRIPTOR' : _REQGOTODSO, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqGotoDSO) + }) +_sym_db.RegisterMessage(ReqGotoDSO) + +ReqGotoSolarSystem = _reflection.GeneratedProtocolMessageType('ReqGotoSolarSystem', (_message.Message,), { + 'DESCRIPTOR' : _REQGOTOSOLARSYSTEM, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqGotoSolarSystem) + }) +_sym_db.RegisterMessage(ReqGotoSolarSystem) + +ReqStopGoto = _reflection.GeneratedProtocolMessageType('ReqStopGoto', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPGOTO, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStopGoto) + }) +_sym_db.RegisterMessage(ReqStopGoto) + +ReqCaptureRawLiveStacking = _reflection.GeneratedProtocolMessageType('ReqCaptureRawLiveStacking', (_message.Message,), { + 'DESCRIPTOR' : _REQCAPTURERAWLIVESTACKING, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqCaptureRawLiveStacking) + }) +_sym_db.RegisterMessage(ReqCaptureRawLiveStacking) + +ReqStopCaptureRawLiveStacking = _reflection.GeneratedProtocolMessageType('ReqStopCaptureRawLiveStacking', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPCAPTURERAWLIVESTACKING, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStopCaptureRawLiveStacking) + }) +_sym_db.RegisterMessage(ReqStopCaptureRawLiveStacking) + +ReqCheckDarkFrame = _reflection.GeneratedProtocolMessageType('ReqCheckDarkFrame', (_message.Message,), { + 'DESCRIPTOR' : _REQCHECKDARKFRAME, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqCheckDarkFrame) + }) +_sym_db.RegisterMessage(ReqCheckDarkFrame) + +ResCheckDarkFrame = _reflection.GeneratedProtocolMessageType('ResCheckDarkFrame', (_message.Message,), { + 'DESCRIPTOR' : _RESCHECKDARKFRAME, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ResCheckDarkFrame) + }) +_sym_db.RegisterMessage(ResCheckDarkFrame) + +ReqCaptureDarkFrame = _reflection.GeneratedProtocolMessageType('ReqCaptureDarkFrame', (_message.Message,), { + 'DESCRIPTOR' : _REQCAPTUREDARKFRAME, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqCaptureDarkFrame) + }) +_sym_db.RegisterMessage(ReqCaptureDarkFrame) + +ReqStopCaptureDarkFrame = _reflection.GeneratedProtocolMessageType('ReqStopCaptureDarkFrame', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPCAPTUREDARKFRAME, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStopCaptureDarkFrame) + }) +_sym_db.RegisterMessage(ReqStopCaptureDarkFrame) + +ReqGoLive = _reflection.GeneratedProtocolMessageType('ReqGoLive', (_message.Message,), { + 'DESCRIPTOR' : _REQGOLIVE, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqGoLive) + }) +_sym_db.RegisterMessage(ReqGoLive) + +ReqTrackSpecialTarget = _reflection.GeneratedProtocolMessageType('ReqTrackSpecialTarget', (_message.Message,), { + 'DESCRIPTOR' : _REQTRACKSPECIALTARGET, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqTrackSpecialTarget) + }) +_sym_db.RegisterMessage(ReqTrackSpecialTarget) + +ReqStopTrackSpecialTarget = _reflection.GeneratedProtocolMessageType('ReqStopTrackSpecialTarget', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPTRACKSPECIALTARGET, + '__module__' : 'astro_pb2' + # @@protoc_insertion_point(class_scope:ReqStopTrackSpecialTarget) + }) +_sym_db.RegisterMessage(ReqStopTrackSpecialTarget) + + +# @@protoc_insertion_point(module_scope) diff --git a/proto/base.proto b/proto/base.proto new file mode 100644 index 0000000..fadd4d0 --- /dev/null +++ b/proto/base.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +enum WsMajorVersion { + WS_MAJOR_VERSION_UNKNOWN = 0; + WS_MAJOR_VERSION_NUMBER = 1; +} + +enum WsMinorVersion { + WS_MINOR_VERSION_UNKNOWN = 0; + WS_MINOR_VERSION_NUMBER = 1; +} + +message WsPacket { + uint32 major_version = 1; //协议主版本 + uint32 minor_version = 2; //协议次版本 + uint32 device_id = 3; //设备ID + uint32 module_id = 4; //模块ID + uint32 cmd = 5; //指令 + uint32 type = 6; //消息类型 0:请求 1:应答 2:通知 3:响应 + bytes data = 7; //请求、响应数据,对应具体的业务接口 + string client_id = 8; //ws客户端id +} + +message ComResponse { + int32 code = 1; +} + +message ComResWithInt { + int32 value = 1; + int32 code = 2; +} + +message ComResWithDouble { + double value = 1; + int32 code = 2; +} + +message CommonParam { + bool hasAuto = 1; + int32 auto_mode = 2; + int32 id = 3; + int32 mode_index = 4; + int32 index = 5; + double continue_value = 6; +} + diff --git a/proto/base_pb2.py b/proto/base_pb2.py new file mode 100644 index 0000000..dd6f3ea --- /dev/null +++ b/proto/base_pb2.py @@ -0,0 +1,387 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: base.proto + +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='base.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\nbase.proto\"\x9a\x01\n\x08WsPacket\x12\x15\n\rmajor_version\x18\x01 \x01(\r\x12\x15\n\rminor_version\x18\x02 \x01(\r\x12\x11\n\tdevice_id\x18\x03 \x01(\r\x12\x11\n\tmodule_id\x18\x04 \x01(\r\x12\x0b\n\x03\x63md\x18\x05 \x01(\r\x12\x0c\n\x04type\x18\x06 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x07 \x01(\x0c\x12\x11\n\tclient_id\x18\x08 \x01(\t\"\x1b\n\x0b\x43omResponse\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\",\n\rComResWithInt\x12\r\n\x05value\x18\x01 \x01(\x05\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"/\n\x10\x43omResWithDouble\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"x\n\x0b\x43ommonParam\x12\x0f\n\x07hasAuto\x18\x01 \x01(\x08\x12\x11\n\tauto_mode\x18\x02 \x01(\x05\x12\n\n\x02id\x18\x03 \x01(\x05\x12\x12\n\nmode_index\x18\x04 \x01(\x05\x12\r\n\x05index\x18\x05 \x01(\x05\x12\x16\n\x0e\x63ontinue_value\x18\x06 \x01(\x01*K\n\x0eWsMajorVersion\x12\x1c\n\x18WS_MAJOR_VERSION_UNKNOWN\x10\x00\x12\x1b\n\x17WS_MAJOR_VERSION_NUMBER\x10\x01*K\n\x0eWsMinorVersion\x12\x1c\n\x18WS_MINOR_VERSION_UNKNOWN\x10\x00\x12\x1b\n\x17WS_MINOR_VERSION_NUMBER\x10\x01\x62\x06proto3' +) + +_WSMAJORVERSION = _descriptor.EnumDescriptor( + name='WsMajorVersion', + full_name='WsMajorVersion', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='WS_MAJOR_VERSION_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_MAJOR_VERSION_NUMBER', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=417, + serialized_end=492, +) +_sym_db.RegisterEnumDescriptor(_WSMAJORVERSION) + +WsMajorVersion = enum_type_wrapper.EnumTypeWrapper(_WSMAJORVERSION) +_WSMINORVERSION = _descriptor.EnumDescriptor( + name='WsMinorVersion', + full_name='WsMinorVersion', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='WS_MINOR_VERSION_UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_MINOR_VERSION_NUMBER', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=494, + serialized_end=569, +) +_sym_db.RegisterEnumDescriptor(_WSMINORVERSION) + +WsMinorVersion = enum_type_wrapper.EnumTypeWrapper(_WSMINORVERSION) +WS_MAJOR_VERSION_UNKNOWN = 0 +WS_MAJOR_VERSION_NUMBER = 1 +WS_MINOR_VERSION_UNKNOWN = 0 +WS_MINOR_VERSION_NUMBER = 1 + + + +_WSPACKET = _descriptor.Descriptor( + name='WsPacket', + full_name='WsPacket', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='major_version', full_name='WsPacket.major_version', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='minor_version', full_name='WsPacket.minor_version', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='WsPacket.device_id', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='module_id', full_name='WsPacket.module_id', index=3, + number=4, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='cmd', full_name='WsPacket.cmd', index=4, + number=5, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='type', full_name='WsPacket.type', index=5, + number=6, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='data', full_name='WsPacket.data', index=6, + number=7, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='client_id', full_name='WsPacket.client_id', index=7, + number=8, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=15, + serialized_end=169, +) + + +_COMRESPONSE = _descriptor.Descriptor( + name='ComResponse', + full_name='ComResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='code', full_name='ComResponse.code', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=171, + serialized_end=198, +) + + +_COMRESWITHINT = _descriptor.Descriptor( + name='ComResWithInt', + full_name='ComResWithInt', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ComResWithInt.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ComResWithInt.code', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=200, + serialized_end=244, +) + + +_COMRESWITHDOUBLE = _descriptor.Descriptor( + name='ComResWithDouble', + full_name='ComResWithDouble', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ComResWithDouble.value', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ComResWithDouble.code', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=246, + serialized_end=293, +) + + +_COMMONPARAM = _descriptor.Descriptor( + name='CommonParam', + full_name='CommonParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='hasAuto', full_name='CommonParam.hasAuto', index=0, + number=1, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='auto_mode', full_name='CommonParam.auto_mode', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='id', full_name='CommonParam.id', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='mode_index', full_name='CommonParam.mode_index', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='index', full_name='CommonParam.index', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='continue_value', full_name='CommonParam.continue_value', index=5, + number=6, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=295, + serialized_end=415, +) + +DESCRIPTOR.message_types_by_name['WsPacket'] = _WSPACKET +DESCRIPTOR.message_types_by_name['ComResponse'] = _COMRESPONSE +DESCRIPTOR.message_types_by_name['ComResWithInt'] = _COMRESWITHINT +DESCRIPTOR.message_types_by_name['ComResWithDouble'] = _COMRESWITHDOUBLE +DESCRIPTOR.message_types_by_name['CommonParam'] = _COMMONPARAM +DESCRIPTOR.enum_types_by_name['WsMajorVersion'] = _WSMAJORVERSION +DESCRIPTOR.enum_types_by_name['WsMinorVersion'] = _WSMINORVERSION +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +WsPacket = _reflection.GeneratedProtocolMessageType('WsPacket', (_message.Message,), { + 'DESCRIPTOR' : _WSPACKET, + '__module__' : 'base_pb2' + # @@protoc_insertion_point(class_scope:WsPacket) + }) +_sym_db.RegisterMessage(WsPacket) + +ComResponse = _reflection.GeneratedProtocolMessageType('ComResponse', (_message.Message,), { + 'DESCRIPTOR' : _COMRESPONSE, + '__module__' : 'base_pb2' + # @@protoc_insertion_point(class_scope:ComResponse) + }) +_sym_db.RegisterMessage(ComResponse) + +ComResWithInt = _reflection.GeneratedProtocolMessageType('ComResWithInt', (_message.Message,), { + 'DESCRIPTOR' : _COMRESWITHINT, + '__module__' : 'base_pb2' + # @@protoc_insertion_point(class_scope:ComResWithInt) + }) +_sym_db.RegisterMessage(ComResWithInt) + +ComResWithDouble = _reflection.GeneratedProtocolMessageType('ComResWithDouble', (_message.Message,), { + 'DESCRIPTOR' : _COMRESWITHDOUBLE, + '__module__' : 'base_pb2' + # @@protoc_insertion_point(class_scope:ComResWithDouble) + }) +_sym_db.RegisterMessage(ComResWithDouble) + +CommonParam = _reflection.GeneratedProtocolMessageType('CommonParam', (_message.Message,), { + 'DESCRIPTOR' : _COMMONPARAM, + '__module__' : 'base_pb2' + # @@protoc_insertion_point(class_scope:CommonParam) + }) +_sym_db.RegisterMessage(CommonParam) + + +# @@protoc_insertion_point(module_scope) diff --git a/proto/camera.proto b/proto/camera.proto new file mode 100644 index 0000000..9afe08e --- /dev/null +++ b/proto/camera.proto @@ -0,0 +1,231 @@ +syntax = "proto3"; + +import "base.proto"; + + +//打开摄像头 +message ReqOpenCamera { + bool binning = 1; +} + +//关闭摄像头 +message ReqCloseCamera { +} + +//拍照 +message ReqPhoto { +} + +//开始连拍 +message ReqBurstPhoto { + int32 count = 1; +} + +//停止连拍 +message ReqStopBurstPhoto { +} + +//开始录像 +message ReqStartRecord { +} + +//停止录像 +message ReqStopRecord { +} + +//设置曝光模式 +message ReqSetExpMode { + int32 mode = 1; +} + +//获取曝光模式 +message ReqGetExpMode { + +} + +//设置曝光 +message ReqSetExp { + int32 index = 1; +} + +//获取曝光 +message ReqGetExp { +} + +//设置增益模式 +message ReqSetGainMode { + int32 mode = 1; +} + +//获取增益模式 +message ReqGetGainMode { + +} + +//设置增益 +message ReqSetGain { + int32 index = 1; +} + +//获取增益 +message ReqGetGain { + +} + +//设置亮度 +message ReqSetBrightness { + int32 value = 1; +} + +//获取亮度 +message ReqGetBrightness { + +} + +//设置对比度 +message ReqSetContrast { + int32 value = 1; +} + +//获取对比度 +message ReqGetContrast { + +} + +//设置色调 +message ReqSetHue { + int32 value = 1; +} + +//获取色调 +message ReqGetHue { + +} + +//设置饱和度 +message ReqSetSaturation { + int32 value = 1; +} + +//获取饱和度 +message ReqGetSaturation { + +} + +//设置锐度 +message ReqSetSharpness { + int32 value = 1; +} + +//获取锐度 +message ReqGetSharpness { + +} + +//设置白平衡模式 +message ReqSetWBMode { + int32 mode = 1; +} + +//获取白平衡模式 +message ReqGetWBMode { + +} + +//设置白平衡场景 +message ReqSetWBSence { + int32 value = 1; +} + +//获取白平衡场景 +message ReqGetWBSence { + +} + +//设置白平衡色温 +message ReqSetWBCT { + int32 index = 1; +} + +//获取白平衡色温 +message ReqGetWBCT { + +} + +//设置IRCUT +message ReqSetIrCut { + int32 value = 1; +} + +//获取IRCUT状态 +message ReqGetIrcut { + +} + +//开始延时摄影 +message ReqStartTimeLapse { +} + +//停止延时摄影 +message ReqStopTimeLapse { + +} + +//设置所有参数 +message ReqSetAllParams { + int32 exp_mode = 1; + int32 exp_index = 2; + int32 gain_mode = 3; + int32 gain_index = 4; + int32 ircut_value = 5; + int32 wb_mode = 6; + int32 wb_index_type = 7; + int32 wb_index = 8; + int32 brightness = 9; + int32 contrast = 10; + int32 hue = 11; + int32 saturation = 12; + int32 sharpness = 13; + int32 jpg_quality = 14; +} + +// 获取所有参数 +message ReqGetAllParams { + +} + +// 返回所有参数结果 +message ResGetAllParams { + repeated CommonParam all_params = 1; + int32 code = 2; +} + +// 设置feature参数 +message ReqSetFeatureParams { + CommonParam param = 1; +} + +// 获取所有feature参数 +message ReqGetAllFeatureParams { +} + +// 返回所有feature参数 +message ResGetAllFeatureParams { + repeated CommonParam all_feature_params = 1; + int32 code = 2; +} + +// 获取整机工作状态 +message ReqGetSystemWorkingState { + +} + +// 设置预览jpg质量 +message ReqSetJpgQuality { + int32 quality = 1; +} + +// 获取预览jpg质量 +message ReqGetJpgQuality { +} + diff --git a/proto/camera_pb2.py b/proto/camera_pb2.py new file mode 100644 index 0000000..c65ff5c --- /dev/null +++ b/proto/camera_pb2.py @@ -0,0 +1,1732 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: camera.proto + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import proto.base_pb2 as base__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='camera.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0c\x63\x61mera.proto\x1a\nbase.proto\" \n\rReqOpenCamera\x12\x0f\n\x07\x62inning\x18\x01 \x01(\x08\"\x10\n\x0eReqCloseCamera\"\n\n\x08ReqPhoto\"\x1e\n\rReqBurstPhoto\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\"\x13\n\x11ReqStopBurstPhoto\"\x10\n\x0eReqStartRecord\"\x0f\n\rReqStopRecord\"\x1d\n\rReqSetExpMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"\x0f\n\rReqGetExpMode\"\x1a\n\tReqSetExp\x12\r\n\x05index\x18\x01 \x01(\x05\"\x0b\n\tReqGetExp\"\x1e\n\x0eReqSetGainMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"\x10\n\x0eReqGetGainMode\"\x1b\n\nReqSetGain\x12\r\n\x05index\x18\x01 \x01(\x05\"\x0c\n\nReqGetGain\"!\n\x10ReqSetBrightness\x12\r\n\x05value\x18\x01 \x01(\x05\"\x12\n\x10ReqGetBrightness\"\x1f\n\x0eReqSetContrast\x12\r\n\x05value\x18\x01 \x01(\x05\"\x10\n\x0eReqGetContrast\"\x1a\n\tReqSetHue\x12\r\n\x05value\x18\x01 \x01(\x05\"\x0b\n\tReqGetHue\"!\n\x10ReqSetSaturation\x12\r\n\x05value\x18\x01 \x01(\x05\"\x12\n\x10ReqGetSaturation\" \n\x0fReqSetSharpness\x12\r\n\x05value\x18\x01 \x01(\x05\"\x11\n\x0fReqGetSharpness\"\x1c\n\x0cReqSetWBMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"\x0e\n\x0cReqGetWBMode\"\x1e\n\rReqSetWBSence\x12\r\n\x05value\x18\x01 \x01(\x05\"\x0f\n\rReqGetWBSence\"\x1b\n\nReqSetWBCT\x12\r\n\x05index\x18\x01 \x01(\x05\"\x0c\n\nReqGetWBCT\"\x1c\n\x0bReqSetIrCut\x12\r\n\x05value\x18\x01 \x01(\x05\"\r\n\x0bReqGetIrcut\"\x13\n\x11ReqStartTimeLapse\"\x12\n\x10ReqStopTimeLapse\"\x9b\x02\n\x0fReqSetAllParams\x12\x10\n\x08\x65xp_mode\x18\x01 \x01(\x05\x12\x11\n\texp_index\x18\x02 \x01(\x05\x12\x11\n\tgain_mode\x18\x03 \x01(\x05\x12\x12\n\ngain_index\x18\x04 \x01(\x05\x12\x13\n\x0bircut_value\x18\x05 \x01(\x05\x12\x0f\n\x07wb_mode\x18\x06 \x01(\x05\x12\x15\n\rwb_index_type\x18\x07 \x01(\x05\x12\x10\n\x08wb_index\x18\x08 \x01(\x05\x12\x12\n\nbrightness\x18\t \x01(\x05\x12\x10\n\x08\x63ontrast\x18\n \x01(\x05\x12\x0b\n\x03hue\x18\x0b \x01(\x05\x12\x12\n\nsaturation\x18\x0c \x01(\x05\x12\x11\n\tsharpness\x18\r \x01(\x05\x12\x13\n\x0bjpg_quality\x18\x0e \x01(\x05\"\x11\n\x0fReqGetAllParams\"A\n\x0fResGetAllParams\x12 \n\nall_params\x18\x01 \x03(\x0b\x32\x0c.CommonParam\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"2\n\x13ReqSetFeatureParams\x12\x1b\n\x05param\x18\x01 \x01(\x0b\x32\x0c.CommonParam\"\x18\n\x16ReqGetAllFeatureParams\"P\n\x16ResGetAllFeatureParams\x12(\n\x12\x61ll_feature_params\x18\x01 \x03(\x0b\x32\x0c.CommonParam\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x05\"\x1a\n\x18ReqGetSystemWorkingState\"#\n\x10ReqSetJpgQuality\x12\x0f\n\x07quality\x18\x01 \x01(\x05\"\x12\n\x10ReqGetJpgQualityb\x06proto3' + , + dependencies=[base__pb2.DESCRIPTOR,]) + + + + +_REQOPENCAMERA = _descriptor.Descriptor( + name='ReqOpenCamera', + full_name='ReqOpenCamera', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='binning', full_name='ReqOpenCamera.binning', index=0, + number=1, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=28, + serialized_end=60, +) + + +_REQCLOSECAMERA = _descriptor.Descriptor( + name='ReqCloseCamera', + full_name='ReqCloseCamera', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=62, + serialized_end=78, +) + + +_REQPHOTO = _descriptor.Descriptor( + name='ReqPhoto', + full_name='ReqPhoto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=80, + serialized_end=90, +) + + +_REQBURSTPHOTO = _descriptor.Descriptor( + name='ReqBurstPhoto', + full_name='ReqBurstPhoto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='count', full_name='ReqBurstPhoto.count', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=92, + serialized_end=122, +) + + +_REQSTOPBURSTPHOTO = _descriptor.Descriptor( + name='ReqStopBurstPhoto', + full_name='ReqStopBurstPhoto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=124, + serialized_end=143, +) + + +_REQSTARTRECORD = _descriptor.Descriptor( + name='ReqStartRecord', + full_name='ReqStartRecord', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=145, + serialized_end=161, +) + + +_REQSTOPRECORD = _descriptor.Descriptor( + name='ReqStopRecord', + full_name='ReqStopRecord', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=163, + serialized_end=178, +) + + +_REQSETEXPMODE = _descriptor.Descriptor( + name='ReqSetExpMode', + full_name='ReqSetExpMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ReqSetExpMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=180, + serialized_end=209, +) + + +_REQGETEXPMODE = _descriptor.Descriptor( + name='ReqGetExpMode', + full_name='ReqGetExpMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=211, + serialized_end=226, +) + + +_REQSETEXP = _descriptor.Descriptor( + name='ReqSetExp', + full_name='ReqSetExp', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='ReqSetExp.index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=228, + serialized_end=254, +) + + +_REQGETEXP = _descriptor.Descriptor( + name='ReqGetExp', + full_name='ReqGetExp', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=256, + serialized_end=267, +) + + +_REQSETGAINMODE = _descriptor.Descriptor( + name='ReqSetGainMode', + full_name='ReqSetGainMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ReqSetGainMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=269, + serialized_end=299, +) + + +_REQGETGAINMODE = _descriptor.Descriptor( + name='ReqGetGainMode', + full_name='ReqGetGainMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=301, + serialized_end=317, +) + + +_REQSETGAIN = _descriptor.Descriptor( + name='ReqSetGain', + full_name='ReqSetGain', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='ReqSetGain.index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=319, + serialized_end=346, +) + + +_REQGETGAIN = _descriptor.Descriptor( + name='ReqGetGain', + full_name='ReqGetGain', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=348, + serialized_end=360, +) + + +_REQSETBRIGHTNESS = _descriptor.Descriptor( + name='ReqSetBrightness', + full_name='ReqSetBrightness', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetBrightness.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=362, + serialized_end=395, +) + + +_REQGETBRIGHTNESS = _descriptor.Descriptor( + name='ReqGetBrightness', + full_name='ReqGetBrightness', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=397, + serialized_end=415, +) + + +_REQSETCONTRAST = _descriptor.Descriptor( + name='ReqSetContrast', + full_name='ReqSetContrast', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetContrast.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=417, + serialized_end=448, +) + + +_REQGETCONTRAST = _descriptor.Descriptor( + name='ReqGetContrast', + full_name='ReqGetContrast', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=450, + serialized_end=466, +) + + +_REQSETHUE = _descriptor.Descriptor( + name='ReqSetHue', + full_name='ReqSetHue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetHue.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=468, + serialized_end=494, +) + + +_REQGETHUE = _descriptor.Descriptor( + name='ReqGetHue', + full_name='ReqGetHue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=496, + serialized_end=507, +) + + +_REQSETSATURATION = _descriptor.Descriptor( + name='ReqSetSaturation', + full_name='ReqSetSaturation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetSaturation.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=509, + serialized_end=542, +) + + +_REQGETSATURATION = _descriptor.Descriptor( + name='ReqGetSaturation', + full_name='ReqGetSaturation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=544, + serialized_end=562, +) + + +_REQSETSHARPNESS = _descriptor.Descriptor( + name='ReqSetSharpness', + full_name='ReqSetSharpness', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetSharpness.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=564, + serialized_end=596, +) + + +_REQGETSHARPNESS = _descriptor.Descriptor( + name='ReqGetSharpness', + full_name='ReqGetSharpness', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=598, + serialized_end=615, +) + + +_REQSETWBMODE = _descriptor.Descriptor( + name='ReqSetWBMode', + full_name='ReqSetWBMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ReqSetWBMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=617, + serialized_end=645, +) + + +_REQGETWBMODE = _descriptor.Descriptor( + name='ReqGetWBMode', + full_name='ReqGetWBMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=647, + serialized_end=661, +) + + +_REQSETWBSENCE = _descriptor.Descriptor( + name='ReqSetWBSence', + full_name='ReqSetWBSence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetWBSence.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=663, + serialized_end=693, +) + + +_REQGETWBSENCE = _descriptor.Descriptor( + name='ReqGetWBSence', + full_name='ReqGetWBSence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=695, + serialized_end=710, +) + + +_REQSETWBCT = _descriptor.Descriptor( + name='ReqSetWBCT', + full_name='ReqSetWBCT', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='index', full_name='ReqSetWBCT.index', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=712, + serialized_end=739, +) + + +_REQGETWBCT = _descriptor.Descriptor( + name='ReqGetWBCT', + full_name='ReqGetWBCT', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=741, + serialized_end=753, +) + + +_REQSETIRCUT = _descriptor.Descriptor( + name='ReqSetIrCut', + full_name='ReqSetIrCut', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='ReqSetIrCut.value', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=755, + serialized_end=783, +) + + +_REQGETIRCUT = _descriptor.Descriptor( + name='ReqGetIrcut', + full_name='ReqGetIrcut', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=785, + serialized_end=798, +) + + +_REQSTARTTIMELAPSE = _descriptor.Descriptor( + name='ReqStartTimeLapse', + full_name='ReqStartTimeLapse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=800, + serialized_end=819, +) + + +_REQSTOPTIMELAPSE = _descriptor.Descriptor( + name='ReqStopTimeLapse', + full_name='ReqStopTimeLapse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=821, + serialized_end=839, +) + + +_REQSETALLPARAMS = _descriptor.Descriptor( + name='ReqSetAllParams', + full_name='ReqSetAllParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='exp_mode', full_name='ReqSetAllParams.exp_mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='exp_index', full_name='ReqSetAllParams.exp_index', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='gain_mode', full_name='ReqSetAllParams.gain_mode', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='gain_index', full_name='ReqSetAllParams.gain_index', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='ircut_value', full_name='ReqSetAllParams.ircut_value', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='wb_mode', full_name='ReqSetAllParams.wb_mode', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='wb_index_type', full_name='ReqSetAllParams.wb_index_type', index=6, + number=7, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='wb_index', full_name='ReqSetAllParams.wb_index', index=7, + number=8, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='brightness', full_name='ReqSetAllParams.brightness', index=8, + number=9, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='contrast', full_name='ReqSetAllParams.contrast', index=9, + number=10, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='hue', full_name='ReqSetAllParams.hue', index=10, + number=11, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='saturation', full_name='ReqSetAllParams.saturation', index=11, + number=12, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sharpness', full_name='ReqSetAllParams.sharpness', index=12, + number=13, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='jpg_quality', full_name='ReqSetAllParams.jpg_quality', index=13, + number=14, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=842, + serialized_end=1125, +) + + +_REQGETALLPARAMS = _descriptor.Descriptor( + name='ReqGetAllParams', + full_name='ReqGetAllParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1127, + serialized_end=1144, +) + + +_RESGETALLPARAMS = _descriptor.Descriptor( + name='ResGetAllParams', + full_name='ResGetAllParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='all_params', full_name='ResGetAllParams.all_params', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ResGetAllParams.code', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1146, + serialized_end=1211, +) + + +_REQSETFEATUREPARAMS = _descriptor.Descriptor( + name='ReqSetFeatureParams', + full_name='ReqSetFeatureParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='param', full_name='ReqSetFeatureParams.param', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1213, + serialized_end=1263, +) + + +_REQGETALLFEATUREPARAMS = _descriptor.Descriptor( + name='ReqGetAllFeatureParams', + full_name='ReqGetAllFeatureParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1265, + serialized_end=1289, +) + + +_RESGETALLFEATUREPARAMS = _descriptor.Descriptor( + name='ResGetAllFeatureParams', + full_name='ResGetAllFeatureParams', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='all_feature_params', full_name='ResGetAllFeatureParams.all_feature_params', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ResGetAllFeatureParams.code', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1291, + serialized_end=1371, +) + + +_REQGETSYSTEMWORKINGSTATE = _descriptor.Descriptor( + name='ReqGetSystemWorkingState', + full_name='ReqGetSystemWorkingState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1373, + serialized_end=1399, +) + + +_REQSETJPGQUALITY = _descriptor.Descriptor( + name='ReqSetJpgQuality', + full_name='ReqSetJpgQuality', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='quality', full_name='ReqSetJpgQuality.quality', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1401, + serialized_end=1436, +) + + +_REQGETJPGQUALITY = _descriptor.Descriptor( + name='ReqGetJpgQuality', + full_name='ReqGetJpgQuality', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1438, + serialized_end=1456, +) + +_RESGETALLPARAMS.fields_by_name['all_params'].message_type = base__pb2._COMMONPARAM +_REQSETFEATUREPARAMS.fields_by_name['param'].message_type = base__pb2._COMMONPARAM +_RESGETALLFEATUREPARAMS.fields_by_name['all_feature_params'].message_type = base__pb2._COMMONPARAM +DESCRIPTOR.message_types_by_name['ReqOpenCamera'] = _REQOPENCAMERA +DESCRIPTOR.message_types_by_name['ReqCloseCamera'] = _REQCLOSECAMERA +DESCRIPTOR.message_types_by_name['ReqPhoto'] = _REQPHOTO +DESCRIPTOR.message_types_by_name['ReqBurstPhoto'] = _REQBURSTPHOTO +DESCRIPTOR.message_types_by_name['ReqStopBurstPhoto'] = _REQSTOPBURSTPHOTO +DESCRIPTOR.message_types_by_name['ReqStartRecord'] = _REQSTARTRECORD +DESCRIPTOR.message_types_by_name['ReqStopRecord'] = _REQSTOPRECORD +DESCRIPTOR.message_types_by_name['ReqSetExpMode'] = _REQSETEXPMODE +DESCRIPTOR.message_types_by_name['ReqGetExpMode'] = _REQGETEXPMODE +DESCRIPTOR.message_types_by_name['ReqSetExp'] = _REQSETEXP +DESCRIPTOR.message_types_by_name['ReqGetExp'] = _REQGETEXP +DESCRIPTOR.message_types_by_name['ReqSetGainMode'] = _REQSETGAINMODE +DESCRIPTOR.message_types_by_name['ReqGetGainMode'] = _REQGETGAINMODE +DESCRIPTOR.message_types_by_name['ReqSetGain'] = _REQSETGAIN +DESCRIPTOR.message_types_by_name['ReqGetGain'] = _REQGETGAIN +DESCRIPTOR.message_types_by_name['ReqSetBrightness'] = _REQSETBRIGHTNESS +DESCRIPTOR.message_types_by_name['ReqGetBrightness'] = _REQGETBRIGHTNESS +DESCRIPTOR.message_types_by_name['ReqSetContrast'] = _REQSETCONTRAST +DESCRIPTOR.message_types_by_name['ReqGetContrast'] = _REQGETCONTRAST +DESCRIPTOR.message_types_by_name['ReqSetHue'] = _REQSETHUE +DESCRIPTOR.message_types_by_name['ReqGetHue'] = _REQGETHUE +DESCRIPTOR.message_types_by_name['ReqSetSaturation'] = _REQSETSATURATION +DESCRIPTOR.message_types_by_name['ReqGetSaturation'] = _REQGETSATURATION +DESCRIPTOR.message_types_by_name['ReqSetSharpness'] = _REQSETSHARPNESS +DESCRIPTOR.message_types_by_name['ReqGetSharpness'] = _REQGETSHARPNESS +DESCRIPTOR.message_types_by_name['ReqSetWBMode'] = _REQSETWBMODE +DESCRIPTOR.message_types_by_name['ReqGetWBMode'] = _REQGETWBMODE +DESCRIPTOR.message_types_by_name['ReqSetWBSence'] = _REQSETWBSENCE +DESCRIPTOR.message_types_by_name['ReqGetWBSence'] = _REQGETWBSENCE +DESCRIPTOR.message_types_by_name['ReqSetWBCT'] = _REQSETWBCT +DESCRIPTOR.message_types_by_name['ReqGetWBCT'] = _REQGETWBCT +DESCRIPTOR.message_types_by_name['ReqSetIrCut'] = _REQSETIRCUT +DESCRIPTOR.message_types_by_name['ReqGetIrcut'] = _REQGETIRCUT +DESCRIPTOR.message_types_by_name['ReqStartTimeLapse'] = _REQSTARTTIMELAPSE +DESCRIPTOR.message_types_by_name['ReqStopTimeLapse'] = _REQSTOPTIMELAPSE +DESCRIPTOR.message_types_by_name['ReqSetAllParams'] = _REQSETALLPARAMS +DESCRIPTOR.message_types_by_name['ReqGetAllParams'] = _REQGETALLPARAMS +DESCRIPTOR.message_types_by_name['ResGetAllParams'] = _RESGETALLPARAMS +DESCRIPTOR.message_types_by_name['ReqSetFeatureParams'] = _REQSETFEATUREPARAMS +DESCRIPTOR.message_types_by_name['ReqGetAllFeatureParams'] = _REQGETALLFEATUREPARAMS +DESCRIPTOR.message_types_by_name['ResGetAllFeatureParams'] = _RESGETALLFEATUREPARAMS +DESCRIPTOR.message_types_by_name['ReqGetSystemWorkingState'] = _REQGETSYSTEMWORKINGSTATE +DESCRIPTOR.message_types_by_name['ReqSetJpgQuality'] = _REQSETJPGQUALITY +DESCRIPTOR.message_types_by_name['ReqGetJpgQuality'] = _REQGETJPGQUALITY +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ReqOpenCamera = _reflection.GeneratedProtocolMessageType('ReqOpenCamera', (_message.Message,), { + 'DESCRIPTOR' : _REQOPENCAMERA, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqOpenCamera) + }) +_sym_db.RegisterMessage(ReqOpenCamera) + +ReqCloseCamera = _reflection.GeneratedProtocolMessageType('ReqCloseCamera', (_message.Message,), { + 'DESCRIPTOR' : _REQCLOSECAMERA, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqCloseCamera) + }) +_sym_db.RegisterMessage(ReqCloseCamera) + +ReqPhoto = _reflection.GeneratedProtocolMessageType('ReqPhoto', (_message.Message,), { + 'DESCRIPTOR' : _REQPHOTO, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqPhoto) + }) +_sym_db.RegisterMessage(ReqPhoto) + +ReqBurstPhoto = _reflection.GeneratedProtocolMessageType('ReqBurstPhoto', (_message.Message,), { + 'DESCRIPTOR' : _REQBURSTPHOTO, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqBurstPhoto) + }) +_sym_db.RegisterMessage(ReqBurstPhoto) + +ReqStopBurstPhoto = _reflection.GeneratedProtocolMessageType('ReqStopBurstPhoto', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPBURSTPHOTO, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqStopBurstPhoto) + }) +_sym_db.RegisterMessage(ReqStopBurstPhoto) + +ReqStartRecord = _reflection.GeneratedProtocolMessageType('ReqStartRecord', (_message.Message,), { + 'DESCRIPTOR' : _REQSTARTRECORD, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqStartRecord) + }) +_sym_db.RegisterMessage(ReqStartRecord) + +ReqStopRecord = _reflection.GeneratedProtocolMessageType('ReqStopRecord', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPRECORD, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqStopRecord) + }) +_sym_db.RegisterMessage(ReqStopRecord) + +ReqSetExpMode = _reflection.GeneratedProtocolMessageType('ReqSetExpMode', (_message.Message,), { + 'DESCRIPTOR' : _REQSETEXPMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetExpMode) + }) +_sym_db.RegisterMessage(ReqSetExpMode) + +ReqGetExpMode = _reflection.GeneratedProtocolMessageType('ReqGetExpMode', (_message.Message,), { + 'DESCRIPTOR' : _REQGETEXPMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetExpMode) + }) +_sym_db.RegisterMessage(ReqGetExpMode) + +ReqSetExp = _reflection.GeneratedProtocolMessageType('ReqSetExp', (_message.Message,), { + 'DESCRIPTOR' : _REQSETEXP, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetExp) + }) +_sym_db.RegisterMessage(ReqSetExp) + +ReqGetExp = _reflection.GeneratedProtocolMessageType('ReqGetExp', (_message.Message,), { + 'DESCRIPTOR' : _REQGETEXP, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetExp) + }) +_sym_db.RegisterMessage(ReqGetExp) + +ReqSetGainMode = _reflection.GeneratedProtocolMessageType('ReqSetGainMode', (_message.Message,), { + 'DESCRIPTOR' : _REQSETGAINMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetGainMode) + }) +_sym_db.RegisterMessage(ReqSetGainMode) + +ReqGetGainMode = _reflection.GeneratedProtocolMessageType('ReqGetGainMode', (_message.Message,), { + 'DESCRIPTOR' : _REQGETGAINMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetGainMode) + }) +_sym_db.RegisterMessage(ReqGetGainMode) + +ReqSetGain = _reflection.GeneratedProtocolMessageType('ReqSetGain', (_message.Message,), { + 'DESCRIPTOR' : _REQSETGAIN, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetGain) + }) +_sym_db.RegisterMessage(ReqSetGain) + +ReqGetGain = _reflection.GeneratedProtocolMessageType('ReqGetGain', (_message.Message,), { + 'DESCRIPTOR' : _REQGETGAIN, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetGain) + }) +_sym_db.RegisterMessage(ReqGetGain) + +ReqSetBrightness = _reflection.GeneratedProtocolMessageType('ReqSetBrightness', (_message.Message,), { + 'DESCRIPTOR' : _REQSETBRIGHTNESS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetBrightness) + }) +_sym_db.RegisterMessage(ReqSetBrightness) + +ReqGetBrightness = _reflection.GeneratedProtocolMessageType('ReqGetBrightness', (_message.Message,), { + 'DESCRIPTOR' : _REQGETBRIGHTNESS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetBrightness) + }) +_sym_db.RegisterMessage(ReqGetBrightness) + +ReqSetContrast = _reflection.GeneratedProtocolMessageType('ReqSetContrast', (_message.Message,), { + 'DESCRIPTOR' : _REQSETCONTRAST, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetContrast) + }) +_sym_db.RegisterMessage(ReqSetContrast) + +ReqGetContrast = _reflection.GeneratedProtocolMessageType('ReqGetContrast', (_message.Message,), { + 'DESCRIPTOR' : _REQGETCONTRAST, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetContrast) + }) +_sym_db.RegisterMessage(ReqGetContrast) + +ReqSetHue = _reflection.GeneratedProtocolMessageType('ReqSetHue', (_message.Message,), { + 'DESCRIPTOR' : _REQSETHUE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetHue) + }) +_sym_db.RegisterMessage(ReqSetHue) + +ReqGetHue = _reflection.GeneratedProtocolMessageType('ReqGetHue', (_message.Message,), { + 'DESCRIPTOR' : _REQGETHUE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetHue) + }) +_sym_db.RegisterMessage(ReqGetHue) + +ReqSetSaturation = _reflection.GeneratedProtocolMessageType('ReqSetSaturation', (_message.Message,), { + 'DESCRIPTOR' : _REQSETSATURATION, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetSaturation) + }) +_sym_db.RegisterMessage(ReqSetSaturation) + +ReqGetSaturation = _reflection.GeneratedProtocolMessageType('ReqGetSaturation', (_message.Message,), { + 'DESCRIPTOR' : _REQGETSATURATION, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetSaturation) + }) +_sym_db.RegisterMessage(ReqGetSaturation) + +ReqSetSharpness = _reflection.GeneratedProtocolMessageType('ReqSetSharpness', (_message.Message,), { + 'DESCRIPTOR' : _REQSETSHARPNESS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetSharpness) + }) +_sym_db.RegisterMessage(ReqSetSharpness) + +ReqGetSharpness = _reflection.GeneratedProtocolMessageType('ReqGetSharpness', (_message.Message,), { + 'DESCRIPTOR' : _REQGETSHARPNESS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetSharpness) + }) +_sym_db.RegisterMessage(ReqGetSharpness) + +ReqSetWBMode = _reflection.GeneratedProtocolMessageType('ReqSetWBMode', (_message.Message,), { + 'DESCRIPTOR' : _REQSETWBMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetWBMode) + }) +_sym_db.RegisterMessage(ReqSetWBMode) + +ReqGetWBMode = _reflection.GeneratedProtocolMessageType('ReqGetWBMode', (_message.Message,), { + 'DESCRIPTOR' : _REQGETWBMODE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetWBMode) + }) +_sym_db.RegisterMessage(ReqGetWBMode) + +ReqSetWBSence = _reflection.GeneratedProtocolMessageType('ReqSetWBSence', (_message.Message,), { + 'DESCRIPTOR' : _REQSETWBSENCE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetWBSence) + }) +_sym_db.RegisterMessage(ReqSetWBSence) + +ReqGetWBSence = _reflection.GeneratedProtocolMessageType('ReqGetWBSence', (_message.Message,), { + 'DESCRIPTOR' : _REQGETWBSENCE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetWBSence) + }) +_sym_db.RegisterMessage(ReqGetWBSence) + +ReqSetWBCT = _reflection.GeneratedProtocolMessageType('ReqSetWBCT', (_message.Message,), { + 'DESCRIPTOR' : _REQSETWBCT, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetWBCT) + }) +_sym_db.RegisterMessage(ReqSetWBCT) + +ReqGetWBCT = _reflection.GeneratedProtocolMessageType('ReqGetWBCT', (_message.Message,), { + 'DESCRIPTOR' : _REQGETWBCT, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetWBCT) + }) +_sym_db.RegisterMessage(ReqGetWBCT) + +ReqSetIrCut = _reflection.GeneratedProtocolMessageType('ReqSetIrCut', (_message.Message,), { + 'DESCRIPTOR' : _REQSETIRCUT, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetIrCut) + }) +_sym_db.RegisterMessage(ReqSetIrCut) + +ReqGetIrcut = _reflection.GeneratedProtocolMessageType('ReqGetIrcut', (_message.Message,), { + 'DESCRIPTOR' : _REQGETIRCUT, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetIrcut) + }) +_sym_db.RegisterMessage(ReqGetIrcut) + +ReqStartTimeLapse = _reflection.GeneratedProtocolMessageType('ReqStartTimeLapse', (_message.Message,), { + 'DESCRIPTOR' : _REQSTARTTIMELAPSE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqStartTimeLapse) + }) +_sym_db.RegisterMessage(ReqStartTimeLapse) + +ReqStopTimeLapse = _reflection.GeneratedProtocolMessageType('ReqStopTimeLapse', (_message.Message,), { + 'DESCRIPTOR' : _REQSTOPTIMELAPSE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqStopTimeLapse) + }) +_sym_db.RegisterMessage(ReqStopTimeLapse) + +ReqSetAllParams = _reflection.GeneratedProtocolMessageType('ReqSetAllParams', (_message.Message,), { + 'DESCRIPTOR' : _REQSETALLPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetAllParams) + }) +_sym_db.RegisterMessage(ReqSetAllParams) + +ReqGetAllParams = _reflection.GeneratedProtocolMessageType('ReqGetAllParams', (_message.Message,), { + 'DESCRIPTOR' : _REQGETALLPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetAllParams) + }) +_sym_db.RegisterMessage(ReqGetAllParams) + +ResGetAllParams = _reflection.GeneratedProtocolMessageType('ResGetAllParams', (_message.Message,), { + 'DESCRIPTOR' : _RESGETALLPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ResGetAllParams) + }) +_sym_db.RegisterMessage(ResGetAllParams) + +ReqSetFeatureParams = _reflection.GeneratedProtocolMessageType('ReqSetFeatureParams', (_message.Message,), { + 'DESCRIPTOR' : _REQSETFEATUREPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetFeatureParams) + }) +_sym_db.RegisterMessage(ReqSetFeatureParams) + +ReqGetAllFeatureParams = _reflection.GeneratedProtocolMessageType('ReqGetAllFeatureParams', (_message.Message,), { + 'DESCRIPTOR' : _REQGETALLFEATUREPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetAllFeatureParams) + }) +_sym_db.RegisterMessage(ReqGetAllFeatureParams) + +ResGetAllFeatureParams = _reflection.GeneratedProtocolMessageType('ResGetAllFeatureParams', (_message.Message,), { + 'DESCRIPTOR' : _RESGETALLFEATUREPARAMS, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ResGetAllFeatureParams) + }) +_sym_db.RegisterMessage(ResGetAllFeatureParams) + +ReqGetSystemWorkingState = _reflection.GeneratedProtocolMessageType('ReqGetSystemWorkingState', (_message.Message,), { + 'DESCRIPTOR' : _REQGETSYSTEMWORKINGSTATE, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetSystemWorkingState) + }) +_sym_db.RegisterMessage(ReqGetSystemWorkingState) + +ReqSetJpgQuality = _reflection.GeneratedProtocolMessageType('ReqSetJpgQuality', (_message.Message,), { + 'DESCRIPTOR' : _REQSETJPGQUALITY, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqSetJpgQuality) + }) +_sym_db.RegisterMessage(ReqSetJpgQuality) + +ReqGetJpgQuality = _reflection.GeneratedProtocolMessageType('ReqGetJpgQuality', (_message.Message,), { + 'DESCRIPTOR' : _REQGETJPGQUALITY, + '__module__' : 'camera_pb2' + # @@protoc_insertion_point(class_scope:ReqGetJpgQuality) + }) +_sym_db.RegisterMessage(ReqGetJpgQuality) + + +# @@protoc_insertion_point(module_scope) diff --git a/proto/notify.proto b/proto/notify.proto new file mode 100644 index 0000000..9627c06 --- /dev/null +++ b/proto/notify.proto @@ -0,0 +1,163 @@ +syntax = "proto3"; + +import "base.proto"; + +enum State { + STATE_IDLE = 0; // Idle state + STATE_RUNNING = 1; // Running + STATE_STOPPING = 2; // Is stopping + STATE_STOPPED = 3; // Has stopped + STATE_SUCCESS = 4; // Success + STATE_FAILED = 5; // Failure + STATE_ASTRO_PLATE_SOLVING = 6; // Astronomy is Plating Solving +} + +enum OperationState { + OPERATION_STATE_IDLE = 0; + OPERATION_STATE_RUNNING = 1; + OPERATION_STATE_STOPPING = 2; + OPERATION_STATE_STOPPED = 3; +} + +enum AstroState { + ASTRO_STATE_IDLE = 0; // Idle state + ASTRO_STATE_RUNNING = 1; // Running + ASTRO_STATE_STOPPING = 2; // Is stopping + ASTRO_STATE_STOPPED = 3; // Has stopped + ASTRO_STATE_PLATE_SOLVING = 4; // Astronomy is Plating Solving +} + +// 长焦广角预览画面匹配结果 +message ResNotifyPictureMatching { + uint32 x = 1; + uint32 y = 2; + uint32 width = 3; + uint32 height = 4; + double value = 5; + int32 code = 6; +} + +// SD卡容量信息 +message ResNotifySDcardInfo { + uint32 available_size = 1; + uint32 total_size = 2; + int32 code = 3; +} + +// 录像时间显示 +message ResNotifyRecordTime { + int32 record_time = 1; +} + +// 延时摄影时间显示 +message ResNotifyTimeLapseOutTime { + int32 interval = 1; + int32 out_time = 2; + int32 total_time = 3; +} + +// 运行状态 +message ResNotifyOperationState { + OperationState state = 1; +} + +// 天文校准状态 +message ResNotifyStateAstroCalibration { + AstroState state = 1; + int32 plate_solving_times = 2; +} + +// 天文GOTO状态 +message ResNotifyStateAstroGoto { + AstroState state = 1; +} + +// 天文跟踪状态 +message ResNotifyStateAstroTracking { + OperationState state = 1; + string target_name = 2; +} + +// 天文暗场拍摄进度 +message ResNotifyProgressCaptureRawDark { + int32 progress = 1; + int32 remaining_time = 2; +} + +// 天文叠图拍摄进度 +message ResNotifyProgressCaptureRawLiveStacking { + int32 total_count = 1; + int32 update_count_type = 2; + int32 current_count = 3; + int32 stacked_count = 4; + int32 exp_index = 5; + int32 gain_index = 6; + string target_name = 7; +} + +// 参数回显 +message ResNotifyParam { + repeated CommonParam param = 1; +} + +// 摄像头功能状态 +message ResNotifyCamFunctionState { + OperationState state = 1; + uint32 function_id = 2; +} + +// 连拍进度 +message ResNotifyBurstProgress { + uint32 total_count = 1; + uint32 completed_count = 2; +} + +// 全景拍摄进度 +message ResNotifyPanoramaProgress { + int32 total_count = 1; + int32 completed_count = 2; +} + +// 环形灯状态 +message ResNotifyRgbState { + int32 state = 1; +} + +// 电量指示灯状态 +message ResNotifyPowerIndState { + int32 state = 1; +} + +// websocket主机从机模式状态 +message ResNotifyHostSlaveMode { + int32 mode = 1; +} + +// mtp模式通知 +message ResNotifyMTPState { + int32 mode = 1; +} + +// 跟踪结果通知 +message ResNotifyTrackResult { + int32 x = 1; + int32 y = 2; + int32 w = 3; + int32 h = 4; +} + +// cpu mode +message ResNotifyCPUMode { + int32 mode = 1; +} + +// 日月跟踪通知 +message ResNotifyStateAstroTrackingSpecial { + OperationState state = 1; + string target_name = 2; + int32 index = 3; +} + +// 关机通知 +message ResNotifyPowerOff { +} diff --git a/proto/notify_pb2.py b/proto/notify_pb2.py new file mode 100644 index 0000000..ba657a1 --- /dev/null +++ b/proto/notify_pb2.py @@ -0,0 +1,1242 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: notify.proto + +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import proto.base_pb2 as base__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='notify.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0cnotify.proto\x1a\nbase.proto\"l\n\x18ResNotifyPictureMatching\x12\t\n\x01x\x18\x01 \x01(\r\x12\t\n\x01y\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\r\n\x05value\x18\x05 \x01(\x01\x12\x0c\n\x04\x63ode\x18\x06 \x01(\x05\"O\n\x13ResNotifySDcardInfo\x12\x16\n\x0e\x61vailable_size\x18\x01 \x01(\r\x12\x12\n\ntotal_size\x18\x02 \x01(\r\x12\x0c\n\x04\x63ode\x18\x03 \x01(\x05\"*\n\x13ResNotifyRecordTime\x12\x13\n\x0brecord_time\x18\x01 \x01(\x05\"S\n\x19ResNotifyTimeLapseOutTime\x12\x10\n\x08interval\x18\x01 \x01(\x05\x12\x10\n\x08out_time\x18\x02 \x01(\x05\x12\x12\n\ntotal_time\x18\x03 \x01(\x05\"9\n\x17ResNotifyOperationState\x12\x1e\n\x05state\x18\x01 \x01(\x0e\x32\x0f.OperationState\"Y\n\x1eResNotifyStateAstroCalibration\x12\x1a\n\x05state\x18\x01 \x01(\x0e\x32\x0b.AstroState\x12\x1b\n\x13plate_solving_times\x18\x02 \x01(\x05\"5\n\x17ResNotifyStateAstroGoto\x12\x1a\n\x05state\x18\x01 \x01(\x0e\x32\x0b.AstroState\"R\n\x1bResNotifyStateAstroTracking\x12\x1e\n\x05state\x18\x01 \x01(\x0e\x32\x0f.OperationState\x12\x13\n\x0btarget_name\x18\x02 \x01(\t\"K\n\x1fResNotifyProgressCaptureRawDark\x12\x10\n\x08progress\x18\x01 \x01(\x05\x12\x16\n\x0eremaining_time\x18\x02 \x01(\x05\"\xc3\x01\n\'ResNotifyProgressCaptureRawLiveStacking\x12\x13\n\x0btotal_count\x18\x01 \x01(\x05\x12\x19\n\x11update_count_type\x18\x02 \x01(\x05\x12\x15\n\rcurrent_count\x18\x03 \x01(\x05\x12\x15\n\rstacked_count\x18\x04 \x01(\x05\x12\x11\n\texp_index\x18\x05 \x01(\x05\x12\x12\n\ngain_index\x18\x06 \x01(\x05\x12\x13\n\x0btarget_name\x18\x07 \x01(\t\"-\n\x0eResNotifyParam\x12\x1b\n\x05param\x18\x01 \x03(\x0b\x32\x0c.CommonParam\"P\n\x19ResNotifyCamFunctionState\x12\x1e\n\x05state\x18\x01 \x01(\x0e\x32\x0f.OperationState\x12\x13\n\x0b\x66unction_id\x18\x02 \x01(\r\"F\n\x16ResNotifyBurstProgress\x12\x13\n\x0btotal_count\x18\x01 \x01(\r\x12\x17\n\x0f\x63ompleted_count\x18\x02 \x01(\r\"I\n\x19ResNotifyPanoramaProgress\x12\x13\n\x0btotal_count\x18\x01 \x01(\x05\x12\x17\n\x0f\x63ompleted_count\x18\x02 \x01(\x05\"\"\n\x11ResNotifyRgbState\x12\r\n\x05state\x18\x01 \x01(\x05\"\'\n\x16ResNotifyPowerIndState\x12\r\n\x05state\x18\x01 \x01(\x05\"&\n\x16ResNotifyHostSlaveMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"!\n\x11ResNotifyMTPState\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"B\n\x14ResNotifyTrackResult\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\t\n\x01w\x18\x03 \x01(\x05\x12\t\n\x01h\x18\x04 \x01(\x05\" \n\x10ResNotifyCPUMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"h\n\"ResNotifyStateAstroTrackingSpecial\x12\x1e\n\x05state\x18\x01 \x01(\x0e\x32\x0f.OperationState\x12\x13\n\x0btarget_name\x18\x02 \x01(\t\x12\r\n\x05index\x18\x03 \x01(\x05\"\x13\n\x11ResNotifyPowerOff*\x95\x01\n\x05State\x12\x0e\n\nSTATE_IDLE\x10\x00\x12\x11\n\rSTATE_RUNNING\x10\x01\x12\x12\n\x0eSTATE_STOPPING\x10\x02\x12\x11\n\rSTATE_STOPPED\x10\x03\x12\x11\n\rSTATE_SUCCESS\x10\x04\x12\x10\n\x0cSTATE_FAILED\x10\x05\x12\x1d\n\x19STATE_ASTRO_PLATE_SOLVING\x10\x06*\x82\x01\n\x0eOperationState\x12\x18\n\x14OPERATION_STATE_IDLE\x10\x00\x12\x1b\n\x17OPERATION_STATE_RUNNING\x10\x01\x12\x1c\n\x18OPERATION_STATE_STOPPING\x10\x02\x12\x1b\n\x17OPERATION_STATE_STOPPED\x10\x03*\x8d\x01\n\nAstroState\x12\x14\n\x10\x41STRO_STATE_IDLE\x10\x00\x12\x17\n\x13\x41STRO_STATE_RUNNING\x10\x01\x12\x18\n\x14\x41STRO_STATE_STOPPING\x10\x02\x12\x17\n\x13\x41STRO_STATE_STOPPED\x10\x03\x12\x1d\n\x19\x41STRO_STATE_PLATE_SOLVING\x10\x04\x62\x06proto3' + , + dependencies=[base__pb2.DESCRIPTOR,]) + +_STATE = _descriptor.EnumDescriptor( + name='State', + full_name='State', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='STATE_IDLE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_RUNNING', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_STOPPING', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_STOPPED', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_SUCCESS', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_FAILED', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='STATE_ASTRO_PLATE_SOLVING', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1570, + serialized_end=1719, +) +_sym_db.RegisterEnumDescriptor(_STATE) + +State = enum_type_wrapper.EnumTypeWrapper(_STATE) +_OPERATIONSTATE = _descriptor.EnumDescriptor( + name='OperationState', + full_name='OperationState', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='OPERATION_STATE_IDLE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='OPERATION_STATE_RUNNING', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='OPERATION_STATE_STOPPING', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='OPERATION_STATE_STOPPED', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1722, + serialized_end=1852, +) +_sym_db.RegisterEnumDescriptor(_OPERATIONSTATE) + +OperationState = enum_type_wrapper.EnumTypeWrapper(_OPERATIONSTATE) +_ASTROSTATE = _descriptor.EnumDescriptor( + name='AstroState', + full_name='AstroState', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='ASTRO_STATE_IDLE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ASTRO_STATE_RUNNING', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ASTRO_STATE_STOPPING', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ASTRO_STATE_STOPPED', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ASTRO_STATE_PLATE_SOLVING', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1855, + serialized_end=1996, +) +_sym_db.RegisterEnumDescriptor(_ASTROSTATE) + +AstroState = enum_type_wrapper.EnumTypeWrapper(_ASTROSTATE) +STATE_IDLE = 0 +STATE_RUNNING = 1 +STATE_STOPPING = 2 +STATE_STOPPED = 3 +STATE_SUCCESS = 4 +STATE_FAILED = 5 +STATE_ASTRO_PLATE_SOLVING = 6 +OPERATION_STATE_IDLE = 0 +OPERATION_STATE_RUNNING = 1 +OPERATION_STATE_STOPPING = 2 +OPERATION_STATE_STOPPED = 3 +ASTRO_STATE_IDLE = 0 +ASTRO_STATE_RUNNING = 1 +ASTRO_STATE_STOPPING = 2 +ASTRO_STATE_STOPPED = 3 +ASTRO_STATE_PLATE_SOLVING = 4 + + + +_RESNOTIFYPICTUREMATCHING = _descriptor.Descriptor( + name='ResNotifyPictureMatching', + full_name='ResNotifyPictureMatching', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='x', full_name='ResNotifyPictureMatching.x', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='y', full_name='ResNotifyPictureMatching.y', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='width', full_name='ResNotifyPictureMatching.width', index=2, + number=3, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='height', full_name='ResNotifyPictureMatching.height', index=3, + number=4, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='ResNotifyPictureMatching.value', index=4, + number=5, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ResNotifyPictureMatching.code', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=28, + serialized_end=136, +) + + +_RESNOTIFYSDCARDINFO = _descriptor.Descriptor( + name='ResNotifySDcardInfo', + full_name='ResNotifySDcardInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='available_size', full_name='ResNotifySDcardInfo.available_size', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='total_size', full_name='ResNotifySDcardInfo.total_size', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='code', full_name='ResNotifySDcardInfo.code', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=138, + serialized_end=217, +) + + +_RESNOTIFYRECORDTIME = _descriptor.Descriptor( + name='ResNotifyRecordTime', + full_name='ResNotifyRecordTime', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='record_time', full_name='ResNotifyRecordTime.record_time', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=219, + serialized_end=261, +) + + +_RESNOTIFYTIMELAPSEOUTTIME = _descriptor.Descriptor( + name='ResNotifyTimeLapseOutTime', + full_name='ResNotifyTimeLapseOutTime', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='interval', full_name='ResNotifyTimeLapseOutTime.interval', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='out_time', full_name='ResNotifyTimeLapseOutTime.out_time', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='total_time', full_name='ResNotifyTimeLapseOutTime.total_time', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=263, + serialized_end=346, +) + + +_RESNOTIFYOPERATIONSTATE = _descriptor.Descriptor( + name='ResNotifyOperationState', + full_name='ResNotifyOperationState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyOperationState.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=348, + serialized_end=405, +) + + +_RESNOTIFYSTATEASTROCALIBRATION = _descriptor.Descriptor( + name='ResNotifyStateAstroCalibration', + full_name='ResNotifyStateAstroCalibration', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyStateAstroCalibration.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='plate_solving_times', full_name='ResNotifyStateAstroCalibration.plate_solving_times', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=407, + serialized_end=496, +) + + +_RESNOTIFYSTATEASTROGOTO = _descriptor.Descriptor( + name='ResNotifyStateAstroGoto', + full_name='ResNotifyStateAstroGoto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyStateAstroGoto.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=498, + serialized_end=551, +) + + +_RESNOTIFYSTATEASTROTRACKING = _descriptor.Descriptor( + name='ResNotifyStateAstroTracking', + full_name='ResNotifyStateAstroTracking', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyStateAstroTracking.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='target_name', full_name='ResNotifyStateAstroTracking.target_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=553, + serialized_end=635, +) + + +_RESNOTIFYPROGRESSCAPTURERAWDARK = _descriptor.Descriptor( + name='ResNotifyProgressCaptureRawDark', + full_name='ResNotifyProgressCaptureRawDark', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='progress', full_name='ResNotifyProgressCaptureRawDark.progress', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='remaining_time', full_name='ResNotifyProgressCaptureRawDark.remaining_time', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=637, + serialized_end=712, +) + + +_RESNOTIFYPROGRESSCAPTURERAWLIVESTACKING = _descriptor.Descriptor( + name='ResNotifyProgressCaptureRawLiveStacking', + full_name='ResNotifyProgressCaptureRawLiveStacking', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='total_count', full_name='ResNotifyProgressCaptureRawLiveStacking.total_count', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='update_count_type', full_name='ResNotifyProgressCaptureRawLiveStacking.update_count_type', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='current_count', full_name='ResNotifyProgressCaptureRawLiveStacking.current_count', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='stacked_count', full_name='ResNotifyProgressCaptureRawLiveStacking.stacked_count', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='exp_index', full_name='ResNotifyProgressCaptureRawLiveStacking.exp_index', index=4, + number=5, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='gain_index', full_name='ResNotifyProgressCaptureRawLiveStacking.gain_index', index=5, + number=6, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='target_name', full_name='ResNotifyProgressCaptureRawLiveStacking.target_name', index=6, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=715, + serialized_end=910, +) + + +_RESNOTIFYPARAM = _descriptor.Descriptor( + name='ResNotifyParam', + full_name='ResNotifyParam', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='param', full_name='ResNotifyParam.param', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=912, + serialized_end=957, +) + + +_RESNOTIFYCAMFUNCTIONSTATE = _descriptor.Descriptor( + name='ResNotifyCamFunctionState', + full_name='ResNotifyCamFunctionState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyCamFunctionState.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='function_id', full_name='ResNotifyCamFunctionState.function_id', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=959, + serialized_end=1039, +) + + +_RESNOTIFYBURSTPROGRESS = _descriptor.Descriptor( + name='ResNotifyBurstProgress', + full_name='ResNotifyBurstProgress', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='total_count', full_name='ResNotifyBurstProgress.total_count', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='completed_count', full_name='ResNotifyBurstProgress.completed_count', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1041, + serialized_end=1111, +) + + +_RESNOTIFYPANORAMAPROGRESS = _descriptor.Descriptor( + name='ResNotifyPanoramaProgress', + full_name='ResNotifyPanoramaProgress', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='total_count', full_name='ResNotifyPanoramaProgress.total_count', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='completed_count', full_name='ResNotifyPanoramaProgress.completed_count', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1113, + serialized_end=1186, +) + + +_RESNOTIFYRGBSTATE = _descriptor.Descriptor( + name='ResNotifyRgbState', + full_name='ResNotifyRgbState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyRgbState.state', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1188, + serialized_end=1222, +) + + +_RESNOTIFYPOWERINDSTATE = _descriptor.Descriptor( + name='ResNotifyPowerIndState', + full_name='ResNotifyPowerIndState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyPowerIndState.state', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1224, + serialized_end=1263, +) + + +_RESNOTIFYHOSTSLAVEMODE = _descriptor.Descriptor( + name='ResNotifyHostSlaveMode', + full_name='ResNotifyHostSlaveMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ResNotifyHostSlaveMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1265, + serialized_end=1303, +) + + +_RESNOTIFYMTPSTATE = _descriptor.Descriptor( + name='ResNotifyMTPState', + full_name='ResNotifyMTPState', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ResNotifyMTPState.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1305, + serialized_end=1338, +) + + +_RESNOTIFYTRACKRESULT = _descriptor.Descriptor( + name='ResNotifyTrackResult', + full_name='ResNotifyTrackResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='x', full_name='ResNotifyTrackResult.x', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='y', full_name='ResNotifyTrackResult.y', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='w', full_name='ResNotifyTrackResult.w', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='h', full_name='ResNotifyTrackResult.h', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1340, + serialized_end=1406, +) + + +_RESNOTIFYCPUMODE = _descriptor.Descriptor( + name='ResNotifyCPUMode', + full_name='ResNotifyCPUMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ResNotifyCPUMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1408, + serialized_end=1440, +) + + +_RESNOTIFYSTATEASTROTRACKINGSPECIAL = _descriptor.Descriptor( + name='ResNotifyStateAstroTrackingSpecial', + full_name='ResNotifyStateAstroTrackingSpecial', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='state', full_name='ResNotifyStateAstroTrackingSpecial.state', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='target_name', full_name='ResNotifyStateAstroTrackingSpecial.target_name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='index', full_name='ResNotifyStateAstroTrackingSpecial.index', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1442, + serialized_end=1546, +) + + +_RESNOTIFYPOWEROFF = _descriptor.Descriptor( + name='ResNotifyPowerOff', + full_name='ResNotifyPowerOff', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1548, + serialized_end=1567, +) + +_RESNOTIFYOPERATIONSTATE.fields_by_name['state'].enum_type = _OPERATIONSTATE +_RESNOTIFYSTATEASTROCALIBRATION.fields_by_name['state'].enum_type = _ASTROSTATE +_RESNOTIFYSTATEASTROGOTO.fields_by_name['state'].enum_type = _ASTROSTATE +_RESNOTIFYSTATEASTROTRACKING.fields_by_name['state'].enum_type = _OPERATIONSTATE +_RESNOTIFYPARAM.fields_by_name['param'].message_type = base__pb2._COMMONPARAM +_RESNOTIFYCAMFUNCTIONSTATE.fields_by_name['state'].enum_type = _OPERATIONSTATE +_RESNOTIFYSTATEASTROTRACKINGSPECIAL.fields_by_name['state'].enum_type = _OPERATIONSTATE +DESCRIPTOR.message_types_by_name['ResNotifyPictureMatching'] = _RESNOTIFYPICTUREMATCHING +DESCRIPTOR.message_types_by_name['ResNotifySDcardInfo'] = _RESNOTIFYSDCARDINFO +DESCRIPTOR.message_types_by_name['ResNotifyRecordTime'] = _RESNOTIFYRECORDTIME +DESCRIPTOR.message_types_by_name['ResNotifyTimeLapseOutTime'] = _RESNOTIFYTIMELAPSEOUTTIME +DESCRIPTOR.message_types_by_name['ResNotifyOperationState'] = _RESNOTIFYOPERATIONSTATE +DESCRIPTOR.message_types_by_name['ResNotifyStateAstroCalibration'] = _RESNOTIFYSTATEASTROCALIBRATION +DESCRIPTOR.message_types_by_name['ResNotifyStateAstroGoto'] = _RESNOTIFYSTATEASTROGOTO +DESCRIPTOR.message_types_by_name['ResNotifyStateAstroTracking'] = _RESNOTIFYSTATEASTROTRACKING +DESCRIPTOR.message_types_by_name['ResNotifyProgressCaptureRawDark'] = _RESNOTIFYPROGRESSCAPTURERAWDARK +DESCRIPTOR.message_types_by_name['ResNotifyProgressCaptureRawLiveStacking'] = _RESNOTIFYPROGRESSCAPTURERAWLIVESTACKING +DESCRIPTOR.message_types_by_name['ResNotifyParam'] = _RESNOTIFYPARAM +DESCRIPTOR.message_types_by_name['ResNotifyCamFunctionState'] = _RESNOTIFYCAMFUNCTIONSTATE +DESCRIPTOR.message_types_by_name['ResNotifyBurstProgress'] = _RESNOTIFYBURSTPROGRESS +DESCRIPTOR.message_types_by_name['ResNotifyPanoramaProgress'] = _RESNOTIFYPANORAMAPROGRESS +DESCRIPTOR.message_types_by_name['ResNotifyRgbState'] = _RESNOTIFYRGBSTATE +DESCRIPTOR.message_types_by_name['ResNotifyPowerIndState'] = _RESNOTIFYPOWERINDSTATE +DESCRIPTOR.message_types_by_name['ResNotifyHostSlaveMode'] = _RESNOTIFYHOSTSLAVEMODE +DESCRIPTOR.message_types_by_name['ResNotifyMTPState'] = _RESNOTIFYMTPSTATE +DESCRIPTOR.message_types_by_name['ResNotifyTrackResult'] = _RESNOTIFYTRACKRESULT +DESCRIPTOR.message_types_by_name['ResNotifyCPUMode'] = _RESNOTIFYCPUMODE +DESCRIPTOR.message_types_by_name['ResNotifyStateAstroTrackingSpecial'] = _RESNOTIFYSTATEASTROTRACKINGSPECIAL +DESCRIPTOR.message_types_by_name['ResNotifyPowerOff'] = _RESNOTIFYPOWEROFF +DESCRIPTOR.enum_types_by_name['State'] = _STATE +DESCRIPTOR.enum_types_by_name['OperationState'] = _OPERATIONSTATE +DESCRIPTOR.enum_types_by_name['AstroState'] = _ASTROSTATE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ResNotifyPictureMatching = _reflection.GeneratedProtocolMessageType('ResNotifyPictureMatching', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPICTUREMATCHING, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyPictureMatching) + }) +_sym_db.RegisterMessage(ResNotifyPictureMatching) + +ResNotifySDcardInfo = _reflection.GeneratedProtocolMessageType('ResNotifySDcardInfo', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYSDCARDINFO, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifySDcardInfo) + }) +_sym_db.RegisterMessage(ResNotifySDcardInfo) + +ResNotifyRecordTime = _reflection.GeneratedProtocolMessageType('ResNotifyRecordTime', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYRECORDTIME, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyRecordTime) + }) +_sym_db.RegisterMessage(ResNotifyRecordTime) + +ResNotifyTimeLapseOutTime = _reflection.GeneratedProtocolMessageType('ResNotifyTimeLapseOutTime', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYTIMELAPSEOUTTIME, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyTimeLapseOutTime) + }) +_sym_db.RegisterMessage(ResNotifyTimeLapseOutTime) + +ResNotifyOperationState = _reflection.GeneratedProtocolMessageType('ResNotifyOperationState', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYOPERATIONSTATE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyOperationState) + }) +_sym_db.RegisterMessage(ResNotifyOperationState) + +ResNotifyStateAstroCalibration = _reflection.GeneratedProtocolMessageType('ResNotifyStateAstroCalibration', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYSTATEASTROCALIBRATION, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyStateAstroCalibration) + }) +_sym_db.RegisterMessage(ResNotifyStateAstroCalibration) + +ResNotifyStateAstroGoto = _reflection.GeneratedProtocolMessageType('ResNotifyStateAstroGoto', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYSTATEASTROGOTO, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyStateAstroGoto) + }) +_sym_db.RegisterMessage(ResNotifyStateAstroGoto) + +ResNotifyStateAstroTracking = _reflection.GeneratedProtocolMessageType('ResNotifyStateAstroTracking', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYSTATEASTROTRACKING, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyStateAstroTracking) + }) +_sym_db.RegisterMessage(ResNotifyStateAstroTracking) + +ResNotifyProgressCaptureRawDark = _reflection.GeneratedProtocolMessageType('ResNotifyProgressCaptureRawDark', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPROGRESSCAPTURERAWDARK, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyProgressCaptureRawDark) + }) +_sym_db.RegisterMessage(ResNotifyProgressCaptureRawDark) + +ResNotifyProgressCaptureRawLiveStacking = _reflection.GeneratedProtocolMessageType('ResNotifyProgressCaptureRawLiveStacking', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPROGRESSCAPTURERAWLIVESTACKING, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyProgressCaptureRawLiveStacking) + }) +_sym_db.RegisterMessage(ResNotifyProgressCaptureRawLiveStacking) + +ResNotifyParam = _reflection.GeneratedProtocolMessageType('ResNotifyParam', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPARAM, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyParam) + }) +_sym_db.RegisterMessage(ResNotifyParam) + +ResNotifyCamFunctionState = _reflection.GeneratedProtocolMessageType('ResNotifyCamFunctionState', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYCAMFUNCTIONSTATE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyCamFunctionState) + }) +_sym_db.RegisterMessage(ResNotifyCamFunctionState) + +ResNotifyBurstProgress = _reflection.GeneratedProtocolMessageType('ResNotifyBurstProgress', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYBURSTPROGRESS, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyBurstProgress) + }) +_sym_db.RegisterMessage(ResNotifyBurstProgress) + +ResNotifyPanoramaProgress = _reflection.GeneratedProtocolMessageType('ResNotifyPanoramaProgress', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPANORAMAPROGRESS, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyPanoramaProgress) + }) +_sym_db.RegisterMessage(ResNotifyPanoramaProgress) + +ResNotifyRgbState = _reflection.GeneratedProtocolMessageType('ResNotifyRgbState', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYRGBSTATE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyRgbState) + }) +_sym_db.RegisterMessage(ResNotifyRgbState) + +ResNotifyPowerIndState = _reflection.GeneratedProtocolMessageType('ResNotifyPowerIndState', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPOWERINDSTATE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyPowerIndState) + }) +_sym_db.RegisterMessage(ResNotifyPowerIndState) + +ResNotifyHostSlaveMode = _reflection.GeneratedProtocolMessageType('ResNotifyHostSlaveMode', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYHOSTSLAVEMODE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyHostSlaveMode) + }) +_sym_db.RegisterMessage(ResNotifyHostSlaveMode) + +ResNotifyMTPState = _reflection.GeneratedProtocolMessageType('ResNotifyMTPState', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYMTPSTATE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyMTPState) + }) +_sym_db.RegisterMessage(ResNotifyMTPState) + +ResNotifyTrackResult = _reflection.GeneratedProtocolMessageType('ResNotifyTrackResult', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYTRACKRESULT, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyTrackResult) + }) +_sym_db.RegisterMessage(ResNotifyTrackResult) + +ResNotifyCPUMode = _reflection.GeneratedProtocolMessageType('ResNotifyCPUMode', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYCPUMODE, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyCPUMode) + }) +_sym_db.RegisterMessage(ResNotifyCPUMode) + +ResNotifyStateAstroTrackingSpecial = _reflection.GeneratedProtocolMessageType('ResNotifyStateAstroTrackingSpecial', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYSTATEASTROTRACKINGSPECIAL, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyStateAstroTrackingSpecial) + }) +_sym_db.RegisterMessage(ResNotifyStateAstroTrackingSpecial) + +ResNotifyPowerOff = _reflection.GeneratedProtocolMessageType('ResNotifyPowerOff', (_message.Message,), { + 'DESCRIPTOR' : _RESNOTIFYPOWEROFF, + '__module__' : 'notify_pb2' + # @@protoc_insertion_point(class_scope:ResNotifyPowerOff) + }) +_sym_db.RegisterMessage(ResNotifyPowerOff) + + +# @@protoc_insertion_point(module_scope) diff --git a/proto/protocol.proto b/proto/protocol.proto new file mode 100644 index 0000000..03785a3 --- /dev/null +++ b/proto/protocol.proto @@ -0,0 +1,237 @@ +syntax = "proto3"; + +enum ModuleId { + MODULE_NONE = 0; // No + MODULE_CAMERA_TELE = 1; // 10000-10499 Telephoto camera module + MODULE_CAMERA_WIDE = 2; // 12000-12499 Wide-angle camera module + MODULE_ASTRO = 3; // 11000-11499 Astronomy module + MODULE_SYSTEM = 4; // 13000-13299 System modules + MODULE_RGB_POWER = 5; // 13500-13799 RGB & Power Management Modules + MODULE_MOTOR = 6; // 14000-14499 Motor module + MODULE_TRACK = 7; // 14800-14899 Tracking module + MODULE_FOCUS = 8; // 15000-15099 Focusing module + MODULE_NOTIFY = 9; // 15200-15499 Notification module + MODULE_PANORAMA = 10; // 15500-15599 Panoramic module +} + +enum MessageTypeId { + TYPE_REQUEST = 0; // Message Type Request + TYPE_REQUEST_RESPONSE = 1; // Message Type Request Response + TYPE_NOTIFICATION = 2; // Message Type Notification + TYPE_NOTIFICATION_RESPONSE = 3; // Message Type Notification Response +} + +enum DwarfCMD { + NO_CMD = 0; // No Cmd + + CMD_CAMERA_TELE_OPEN_CAMERA = 10000; // Turn on the camera + CMD_CAMERA_TELE_CLOSE_CAMERA = 10001; // Turn off the camera + CMD_CAMERA_TELE_PHOTOGRAPH = 10002; // Take photos + CMD_CAMERA_TELE_BURST = 10003; // Start continuous shooting + CMD_CAMERA_TELE_STOP_BURST = 10004; // Stop continuous shooting + CMD_CAMERA_TELE_START_RECORD = 10005; // Start recording + CMD_CAMERA_TELE_STOP_RECORD = 10006; // Stop recording + CMD_CAMERA_TELE_SET_EXP_MODE = 10007; // Set exposure mode + CMD_CAMERA_TELE_GET_EXP_MODE = 10008; // Acquire exposure mode + CMD_CAMERA_TELE_SET_EXP = 10009; // Set exposure value + CMD_CAMERA_TELE_GET_EXP = 10010; // Get exposure value + CMD_CAMERA_TELE_SET_GAIN_MODE = 10011; // Set gain mode + CMD_CAMERA_TELE_GET_GAIN_MODE = 10012; // Acquisition gain mode + CMD_CAMERA_TELE_SET_GAIN = 10013; // Set gain value + CMD_CAMERA_TELE_GET_GAIN = 10014; // Get gain value + CMD_CAMERA_TELE_SET_BRIGHTNESS = 10015; // Set brightness + CMD_CAMERA_TELE_GET_BRIGHTNESS = 10016; // Acquire brightness + CMD_CAMERA_TELE_SET_CONTRAST = 10017; // Set contrast + CMD_CAMERA_TELE_GET_CONTRAST = 10018; // Get contrast + CMD_CAMERA_TELE_SET_SATURATION = 10019; // Set saturation + CMD_CAMERA_TELE_GET_SATURATION = 10020; // Acquire saturation + CMD_CAMERA_TELE_SET_HUE = 10021; // Set tone + CMD_CAMERA_TELE_GET_HUE = 10022; // Get hue + CMD_CAMERA_TELE_SET_SHARPNESS = 10023; // Set sharpness + CMD_CAMERA_TELE_GET_SHARPNESS = 10024; // Acquire sharpness + CMD_CAMERA_TELE_SET_WB_MODE = 10025; // Set white balance mode + CMD_CAMERA_TELE_GET_WB_MODE = 10026; // Acquire white balance mode + CMD_CAMERA_TELE_SET_WB_SCENE = 10027; // Set white balance scene + CMD_CAMERA_TELE_GET_WB_SCENE = 10028; // Get white balance scene + CMD_CAMERA_TELE_SET_WB_CT = 10029; // Set the white balance color temperature value + CMD_CAMERA_TELE_GET_WB_CT = 10030; // Obtain the white balance color temperature value + CMD_CAMERA_TELE_SET_IRCUT = 10031; // Set IRCUT + CMD_CAMERA_TELE_GET_IRCUT = 10032; // Get IRCUT status + CMD_CAMERA_TELE_START_TIMELAPSE_PHOTO = 10033; // Start time-lapse photography + CMD_CAMERA_TELE_STOP_TIMELAPSE_PHOTO = 10034; // Stop time-lapse photography + CMD_CAMERA_TELE_SET_ALL_PARAMS = 10035; // Set all parameters + CMD_CAMERA_TELE_GET_ALL_PARAMS = 10036; // Get all parameters + CMD_CAMERA_TELE_SET_FEATURE_PARAM = 10037; // Set feature parameters + CMD_CAMERA_TELE_GET_ALL_FEATURE_PARAMS = 10038; // Get all feature parameters + CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE = 10039; // Get the working status of the whole machine + CMD_CAMERA_TELE_SET_JPG_QUALITY = 10040; // Set jpg preview quality + + CMD_ASTRO_START_CALIBRATION = 11000; // Start calibration + CMD_ASTRO_STOP_CALIBRATION = 11001; // Stop calibration + CMD_ASTRO_START_GOTO_DSO = 11002; // Start GOTO Deep Space Object + CMD_ASTRO_START_GOTO_SOLAR_SYSTEM = 11003; // Start GOTO Solar System Target + CMD_ASTRO_STOP_GOTO = 11004; // Stop GOTO + CMD_ASTRO_START_CAPTURE_RAW_LIVE_STACKING = 11005; // Start stacking + CMD_ASTRO_STOP_CAPTURE_RAW_LIVE_STACKING = 11006; // Stop overlay + CMD_ASTRO_START_CAPTURE_RAW_DARK = 11007; // Start shooting dark scenes + CMD_ASTRO_STOP_CAPTURE_RAW_DARK = 11008; // Stop filming darkfield + CMD_ASTRO_CHECK_GOT_DARK = 11009; // Inquire about the dark field that has been shot + CMD_ASTRO_GO_LIVE = 11010; // GO LIVE interface + CMD_ASTRO_START_TRACK_SPECIAL_TARGET = 11011; // Start tracking the sun and moon + CMD_ASTRO_STOP_TRACK_SPECIAL_TARGET = 11012; // Stop tracking the sun and moon + + CMD_CAMERA_WIDE_OPEN_CAMERA = 12000; // Turn on the camera + CMD_CAMERA_WIDE_CLOSE_CAMERA = 12001; // Turn off the camera + CMD_CAMERA_WIDE_SET_EXP_MODE = 12002; // Set exposure mode + CMD_CAMERA_WIDE_GET_EXP_MODE = 12003; // Acquire exposure mode + CMD_CAMERA_WIDE_SET_EXP = 12004; // Set exposure value + CMD_CAMERA_WIDE_GET_EXP = 12005; // Get exposure value + CMD_CAMERA_WIDE_SET_GAIN = 12006; // Set gain + CMD_CAMERA_WIDE_GET_GAIN = 12007; // Acquisition gain + CMD_CAMERA_WIDE_SET_BRIGHTNESS = 12008; // Set brightness + CMD_CAMERA_WIDE_GET_BRIGHTNESS = 12009; // Acquire brightness + CMD_CAMERA_WIDE_SET_CONTRAST = 12010; // Set contrast + CMD_CAMERA_WIDE_GET_CONTRAST = 12011; // Get contrast + CMD_CAMERA_WIDE_SET_SATURATION = 12012; // Set saturation + CMD_CAMERA_WIDE_GET_SATURATION = 12013; // Acquire saturation + CMD_CAMERA_WIDE_SET_HUE = 12014; // Set tone + CMD_CAMERA_WIDE_GET_HUE = 12015; // Get hue + CMD_CAMERA_WIDE_SET_SHARPNESS = 12016; // Set sharpness + CMD_CAMERA_WIDE_GET_SHARPNESS = 12017; // Acquire sharpness + CMD_CAMERA_WIDE_SET_WB_MODE = 12018; // Set white balance mode + CMD_CAMERA_WIDE_GET_WB_MODE = 12019; // Acquire white balance mode + CMD_CAMERA_WIDE_SET_WB_CT = 12020; // Set white balance color temperature + CMD_CAMERA_WIDE_GET_WB_CT = 12021; // Obtain white balance color temperature + CMD_CAMERA_WIDE_PHOTOGRAPH = 12022; // Take photos + CMD_CAMERA_WIDE_BURST = 12023; // Continuous shooting + CMD_CAMERA_WIDE_STOP_BURST = 12024; // Stop continuous shooting + CMD_CAMERA_WIDE_START_TIMELAPSE_PHOTO = 12025; // Start time-lapse photography + CMD_CAMERA_WIDE_STOP_TIMELAPSE_PHOTO = 12026; // Stop time-lapse photography + CMD_CAMERA_WIDE_GET_ALL_PARAMS = 12027; // Get all parameters + CMD_CAMERA_WIDE_SET_ALL_PARAMS = 12028; // Set all parameters + + CMD_SYSTEM_SET_TIME = 13000; // Set the system time + CMD_SYSTEM_SET_TIME_ZONE = 13001; // Set the time zone + CMD_SYSTEM_SET_MTP_MODE = 13002; // Set MTP mode + CMD_SYSTEM_SET_CPU_MODE = 13003; // Set CPU mode + + CMD_RGB_POWER_OPEN_RGB = 13500; // Turn on the ring light + CMD_RGB_POWER_CLOSE_RGB = 13501; // Turn off the ring light + CMD_RGB_POWER_POWER_DOWN = 13502; // Shut down + CMD_RGB_POWER_POWERIND_ON = 13503; // Turn on the battery indicator + CMD_RGB_POWER_POWERIND_OFF = 13504; // Turn off battery indicator = + CMD_RGB_POWER_REBOOT = 13505; // Restart + + CMD_FOCUS_AUTO_FOCUS = 15000; // Normal mode autofocus + CMD_FOCUS_MANUAL_SINGLE_STEP_FOCUS = 15001; // Manual single-step focusing + CMD_FOCUS_START_MANUAL_CONTINU_FOCUS = 15002; // Start manual continuous focus + CMD_FOCUS_STOP_MANUAL_CONTINU_FOCUS = 15003; // Stop manual continuous focus + CMD_FOCUS_START_ASTRO_AUTO_FOCUS = 15004; // Start astronomical autofocus + CMD_FOCUS_STOP_ASTRO_AUTO_FOCUS = 15005; // Stop astronomical autofocus + + CMD_NOTIFY_TELE_WIDI_PICTURE_MATCHING = 15200; // Telephoto wide-angle image matching + CMD_NOTIFY_ELE = 15201; // Battery Notification + CMD_NOTIFY_CHARGE = 15202; // Charge status notification + CMD_NOTIFY_SDCARD_INFO = 15203; // SD card capacity notification + CMD_NOTIFY_TELE_RECORD_TIME = 15204; // Recording time + CMD_NOTIFY_TELE_TIMELAPSE_OUT_TIME = 15205; // Telephoto time-lapse photography time + CMD_NOTIFY_STATE_CAPTURE_RAW_DARK = 15206; // Dark field shooting state + CMD_NOTIFY_PROGRASS_CAPTURE_RAW_DARK = 15207; // Dark field shooting progress + CMD_NOTIFY_STATE_CAPTURE_RAW_LIVE_STACKING = 15208; // Astronomical overlay shooting status + CMD_NOTIFY_PROGRASS_CAPTURE_RAW_LIVE_STACKING = 15209; // Astronomical overlay shooting progress + CMD_NOTIFY_STATE_ASTRO_CALIBRATION = 15210; // Astronomical calibration status + CMD_NOTIFY_STATE_ASTRO_GOTO = 15211; // Astronomical GOTO status + CMD_NOTIFY_STATE_ASTRO_TRACKING = 15212; // Astronomical tracking status + CMD_NOTIFY_TELE_SET_PARAM = 15213; // Telephoto parameter echo + CMD_NOTIFY_WIDE_SET_PARAM = 15214; // Wide-angle parametric echo + CMD_NOTIFY_TELE_FUNCTION_STATE = 15215; // Telephoto functional status + CMD_NOTIFY_WIDE_FUNCTION_STATE = 15216; // Wide-angle functional status + CMD_NOTIFY_SET_FEATURE_PARAM = 15217; // Feature parameter echo + CMD_NOTIFY_TELE_BURST_PROGRESS = 15218; // Telephoto continuous shooting progress + CMD_NOTIFY_PANORAMA_PROGRESS = 15219; // Telephoto panoramic shooting progress + CMD_NOTIFY_WIDE_BURST_PROGRESS = 15220; // Wide-angle continuous shooting progress + CMD_NOTIFY_RGB_STATE = 15221; // RGB Ring Light Status + CMD_NOTIFY_POWER_IND_STATE = 15222; // Power indicator status + CMD_NOTIFY_WS_HOST_SLAVE_MODE = 15223; // Leader/follower mode notification + CMD_NOTIFY_MTP_STATE = 15224; // MTP mode notification + CMD_NOTIFY_TRACK_RESULT = 15225; // Tracking result notification + CMD_NOTIFY_WIDE_TIMELAPSE_OUT_TIME = 15226; // Wide-angle time-lapse photography time + CMD_NOTIFY_CPU_MODE = 15227; // CPU mode + CMD_NOTIFY_STATE_ASTRO_TRACKING_SPECIAL = 15228; // Sun and moon tracking status + CMD_NOTIFY_POWER_OFF = 15229; // Shutdown notification +} + +enum DwarfErrorCode { + OK = 0; // OK : No Error + WS_PARSE_PROTOBUF_ERROR = -1; // Protobuf parsing failed + WS_SDCARD_NOT_EXIST = -2; // SD card not detected + WS_INVALID_PARAM = -3; // Invalid parameter + WS_SDCARD_WRITE_ERROR = -4; // Image writing to SD card failed (maybe the card is full) + + CODE_CAMERA_TELE_OPENED = -10500; // Camera is turned on + CODE_CAMERA_TELE_CLOSED = -10501; // Camera is off + CODE_CAMERA_TELE_ISP_SET_FAILED = -10502; // ISP parameter settings failed + CODE_CAMERA_TELE_OPEN_FAILED = -10504; // Camera failed to open + CODE_CAMERA_TELE_WORKING_BUSY_STACK = -10507; // The telephoto camera is busy. + CODE_CAMERA_TELE_CAPTURE_RAW_FAILED = -10510; // Failed to catch RAW image + CODE_CAMERA_TELE_WORKING_BUSY = -10511; // The telephoto camera is busy with work + + CODE_ASTRO_PLATE_SOLVING_FAILED = -11500; // Plate solving failed + CODE_ASTRO_FUNCTION_BUSY = -11501; // Astronomical function busy + CODE_ASTRO_DARK_GAIN_OUT_OF_RANGE = -11502; // Gain beyond darkfield shooting range (darkfield coverage 30-150 gain) + CODE_ASTRO_DARK_NOT_FOUND = -11503; // Darkfield not found + CODE_ASTRO_CALIBRATION_FAILED = -11504; // Calibration failed + CODE_ASTRO_GOTO_FAILED = -11505; // GOTO failed + CODE_ASTRO_NEED_GOTO = -11513; // No GOTO + CODE_ASTRO_NEED_ADJUST_SHOOT_PARAM = -11514; // Parameters are not suitable + + CODE_CAMERA_WIDE_OPENED = -12500; // Wide-angle camera turned on + CODE_CAMERA_WIDE_CLOSED = -12501; // The wide-angle camera is turned off + CODE_CAMERA_WIDE_CANNOT_FOUND = -12502; // Can't find the camera + CODE_CAMERA_WIDE_OPEN_FAILED = -12503; // Failed to open camera + CODE_CAMERA_WIDE_CLOSE_FAILED = -12504; // Failed to turn off camera + CODE_CAMERA_WIDE_SET_ISP_FAILED = -12505; // Failed to set ISP parameters + CODE_CAMERA_WIDE_PHOTOGRAPHING = -12506; // Taking pictures + + CODE_SYSTEM_SET_TIME_FAILED = -13300; // Set time failed + CODE_SYSTEM_SET_TIMEZONE_FAILED = -13301; // Failed to set time zone + CODE_SYSTEM_SETTING_TIMEZONE_FAILED = -13302; // Time zone setting failed + + CODE_STEP_MOTOR_LIMIT_POSITION_WARNING = -14518; // GOTO limit warning + CODE_STEP_MOTOR_LIMIT_POSITION_HITTED = -14519; // Star collision limit + CODE_PANORAMA_PHOTO_FAILED = -15600; // Panoramic shooting failed + CODE_PANORAMA_MOTOR_RESET_FAILED = -15601; // Panoramic shooting motor reset failed +} + +enum AstroTrackingSpecial { + TRACKING_SUN = 0; + TRACKING_MOON = 1; +} + +enum SolarSystemTarget { + Unknown = 0; + Mercury = 1; + Venus = 2; + Mars = 3; + Jupiter = 4; + Saturn = 5; + Uranus = 6; + Neptune = 7; + Moon = 8; + Sun = 9; +} + +enum PhotoMode { + Auto = 0; + Manual = 1; +} + +enum WBMode { + ColorTemperature = 0; + SceneMode = 1; +} + +enum IrCut { + CUT = 0; + PASS = 1; +} diff --git a/proto/protocol_pb2.py b/proto/protocol_pb2.py new file mode 100644 index 0000000..4ba90e9 --- /dev/null +++ b/proto/protocol_pb2.py @@ -0,0 +1,1366 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: protocol.proto + +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='protocol.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0eprotocol.proto*\xe4\x01\n\x08ModuleId\x12\x0f\n\x0bMODULE_NONE\x10\x00\x12\x16\n\x12MODULE_CAMERA_TELE\x10\x01\x12\x16\n\x12MODULE_CAMERA_WIDE\x10\x02\x12\x10\n\x0cMODULE_ASTRO\x10\x03\x12\x11\n\rMODULE_SYSTEM\x10\x04\x12\x14\n\x10MODULE_RGB_POWER\x10\x05\x12\x10\n\x0cMODULE_MOTOR\x10\x06\x12\x10\n\x0cMODULE_TRACK\x10\x07\x12\x10\n\x0cMODULE_FOCUS\x10\x08\x12\x11\n\rMODULE_NOTIFY\x10\t\x12\x13\n\x0fMODULE_PANORAMA\x10\n*s\n\rMessageTypeId\x12\x10\n\x0cTYPE_REQUEST\x10\x00\x12\x19\n\x15TYPE_REQUEST_RESPONSE\x10\x01\x12\x15\n\x11TYPE_NOTIFICATION\x10\x02\x12\x1e\n\x1aTYPE_NOTIFICATION_RESPONSE\x10\x03*\xb5#\n\x08\x44warfCMD\x12\n\n\x06NO_CMD\x10\x00\x12 \n\x1b\x43MD_CAMERA_TELE_OPEN_CAMERA\x10\x90N\x12!\n\x1c\x43MD_CAMERA_TELE_CLOSE_CAMERA\x10\x91N\x12\x1f\n\x1a\x43MD_CAMERA_TELE_PHOTOGRAPH\x10\x92N\x12\x1a\n\x15\x43MD_CAMERA_TELE_BURST\x10\x93N\x12\x1f\n\x1a\x43MD_CAMERA_TELE_STOP_BURST\x10\x94N\x12!\n\x1c\x43MD_CAMERA_TELE_START_RECORD\x10\x95N\x12 \n\x1b\x43MD_CAMERA_TELE_STOP_RECORD\x10\x96N\x12!\n\x1c\x43MD_CAMERA_TELE_SET_EXP_MODE\x10\x97N\x12!\n\x1c\x43MD_CAMERA_TELE_GET_EXP_MODE\x10\x98N\x12\x1c\n\x17\x43MD_CAMERA_TELE_SET_EXP\x10\x99N\x12\x1c\n\x17\x43MD_CAMERA_TELE_GET_EXP\x10\x9aN\x12\"\n\x1d\x43MD_CAMERA_TELE_SET_GAIN_MODE\x10\x9bN\x12\"\n\x1d\x43MD_CAMERA_TELE_GET_GAIN_MODE\x10\x9cN\x12\x1d\n\x18\x43MD_CAMERA_TELE_SET_GAIN\x10\x9dN\x12\x1d\n\x18\x43MD_CAMERA_TELE_GET_GAIN\x10\x9eN\x12#\n\x1e\x43MD_CAMERA_TELE_SET_BRIGHTNESS\x10\x9fN\x12#\n\x1e\x43MD_CAMERA_TELE_GET_BRIGHTNESS\x10\xa0N\x12!\n\x1c\x43MD_CAMERA_TELE_SET_CONTRAST\x10\xa1N\x12!\n\x1c\x43MD_CAMERA_TELE_GET_CONTRAST\x10\xa2N\x12#\n\x1e\x43MD_CAMERA_TELE_SET_SATURATION\x10\xa3N\x12#\n\x1e\x43MD_CAMERA_TELE_GET_SATURATION\x10\xa4N\x12\x1c\n\x17\x43MD_CAMERA_TELE_SET_HUE\x10\xa5N\x12\x1c\n\x17\x43MD_CAMERA_TELE_GET_HUE\x10\xa6N\x12\"\n\x1d\x43MD_CAMERA_TELE_SET_SHARPNESS\x10\xa7N\x12\"\n\x1d\x43MD_CAMERA_TELE_GET_SHARPNESS\x10\xa8N\x12 \n\x1b\x43MD_CAMERA_TELE_SET_WB_MODE\x10\xa9N\x12 \n\x1b\x43MD_CAMERA_TELE_GET_WB_MODE\x10\xaaN\x12!\n\x1c\x43MD_CAMERA_TELE_SET_WB_SCENE\x10\xabN\x12!\n\x1c\x43MD_CAMERA_TELE_GET_WB_SCENE\x10\xacN\x12\x1e\n\x19\x43MD_CAMERA_TELE_SET_WB_CT\x10\xadN\x12\x1e\n\x19\x43MD_CAMERA_TELE_GET_WB_CT\x10\xaeN\x12\x1e\n\x19\x43MD_CAMERA_TELE_SET_IRCUT\x10\xafN\x12\x1e\n\x19\x43MD_CAMERA_TELE_GET_IRCUT\x10\xb0N\x12*\n%CMD_CAMERA_TELE_START_TIMELAPSE_PHOTO\x10\xb1N\x12)\n$CMD_CAMERA_TELE_STOP_TIMELAPSE_PHOTO\x10\xb2N\x12#\n\x1e\x43MD_CAMERA_TELE_SET_ALL_PARAMS\x10\xb3N\x12#\n\x1e\x43MD_CAMERA_TELE_GET_ALL_PARAMS\x10\xb4N\x12&\n!CMD_CAMERA_TELE_SET_FEATURE_PARAM\x10\xb5N\x12+\n&CMD_CAMERA_TELE_GET_ALL_FEATURE_PARAMS\x10\xb6N\x12-\n(CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE\x10\xb7N\x12$\n\x1f\x43MD_CAMERA_TELE_SET_JPG_QUALITY\x10\xb8N\x12 \n\x1b\x43MD_ASTRO_START_CALIBRATION\x10\xf8U\x12\x1f\n\x1a\x43MD_ASTRO_STOP_CALIBRATION\x10\xf9U\x12\x1d\n\x18\x43MD_ASTRO_START_GOTO_DSO\x10\xfaU\x12&\n!CMD_ASTRO_START_GOTO_SOLAR_SYSTEM\x10\xfbU\x12\x18\n\x13\x43MD_ASTRO_STOP_GOTO\x10\xfcU\x12.\n)CMD_ASTRO_START_CAPTURE_RAW_LIVE_STACKING\x10\xfdU\x12-\n(CMD_ASTRO_STOP_CAPTURE_RAW_LIVE_STACKING\x10\xfeU\x12%\n CMD_ASTRO_START_CAPTURE_RAW_DARK\x10\xffU\x12$\n\x1f\x43MD_ASTRO_STOP_CAPTURE_RAW_DARK\x10\x80V\x12\x1d\n\x18\x43MD_ASTRO_CHECK_GOT_DARK\x10\x81V\x12\x16\n\x11\x43MD_ASTRO_GO_LIVE\x10\x82V\x12)\n$CMD_ASTRO_START_TRACK_SPECIAL_TARGET\x10\x83V\x12(\n#CMD_ASTRO_STOP_TRACK_SPECIAL_TARGET\x10\x84V\x12 \n\x1b\x43MD_CAMERA_WIDE_OPEN_CAMERA\x10\xe0]\x12!\n\x1c\x43MD_CAMERA_WIDE_CLOSE_CAMERA\x10\xe1]\x12!\n\x1c\x43MD_CAMERA_WIDE_SET_EXP_MODE\x10\xe2]\x12!\n\x1c\x43MD_CAMERA_WIDE_GET_EXP_MODE\x10\xe3]\x12\x1c\n\x17\x43MD_CAMERA_WIDE_SET_EXP\x10\xe4]\x12\x1c\n\x17\x43MD_CAMERA_WIDE_GET_EXP\x10\xe5]\x12\x1d\n\x18\x43MD_CAMERA_WIDE_SET_GAIN\x10\xe6]\x12\x1d\n\x18\x43MD_CAMERA_WIDE_GET_GAIN\x10\xe7]\x12#\n\x1e\x43MD_CAMERA_WIDE_SET_BRIGHTNESS\x10\xe8]\x12#\n\x1e\x43MD_CAMERA_WIDE_GET_BRIGHTNESS\x10\xe9]\x12!\n\x1c\x43MD_CAMERA_WIDE_SET_CONTRAST\x10\xea]\x12!\n\x1c\x43MD_CAMERA_WIDE_GET_CONTRAST\x10\xeb]\x12#\n\x1e\x43MD_CAMERA_WIDE_SET_SATURATION\x10\xec]\x12#\n\x1e\x43MD_CAMERA_WIDE_GET_SATURATION\x10\xed]\x12\x1c\n\x17\x43MD_CAMERA_WIDE_SET_HUE\x10\xee]\x12\x1c\n\x17\x43MD_CAMERA_WIDE_GET_HUE\x10\xef]\x12\"\n\x1d\x43MD_CAMERA_WIDE_SET_SHARPNESS\x10\xf0]\x12\"\n\x1d\x43MD_CAMERA_WIDE_GET_SHARPNESS\x10\xf1]\x12 \n\x1b\x43MD_CAMERA_WIDE_SET_WB_MODE\x10\xf2]\x12 \n\x1b\x43MD_CAMERA_WIDE_GET_WB_MODE\x10\xf3]\x12\x1e\n\x19\x43MD_CAMERA_WIDE_SET_WB_CT\x10\xf4]\x12\x1e\n\x19\x43MD_CAMERA_WIDE_GET_WB_CT\x10\xf5]\x12\x1f\n\x1a\x43MD_CAMERA_WIDE_PHOTOGRAPH\x10\xf6]\x12\x1a\n\x15\x43MD_CAMERA_WIDE_BURST\x10\xf7]\x12\x1f\n\x1a\x43MD_CAMERA_WIDE_STOP_BURST\x10\xf8]\x12*\n%CMD_CAMERA_WIDE_START_TIMELAPSE_PHOTO\x10\xf9]\x12)\n$CMD_CAMERA_WIDE_STOP_TIMELAPSE_PHOTO\x10\xfa]\x12#\n\x1e\x43MD_CAMERA_WIDE_GET_ALL_PARAMS\x10\xfb]\x12#\n\x1e\x43MD_CAMERA_WIDE_SET_ALL_PARAMS\x10\xfc]\x12\x18\n\x13\x43MD_SYSTEM_SET_TIME\x10\xc8\x65\x12\x1d\n\x18\x43MD_SYSTEM_SET_TIME_ZONE\x10\xc9\x65\x12\x1c\n\x17\x43MD_SYSTEM_SET_MTP_MODE\x10\xca\x65\x12\x1c\n\x17\x43MD_SYSTEM_SET_CPU_MODE\x10\xcb\x65\x12\x1b\n\x16\x43MD_RGB_POWER_OPEN_RGB\x10\xbci\x12\x1c\n\x17\x43MD_RGB_POWER_CLOSE_RGB\x10\xbdi\x12\x1d\n\x18\x43MD_RGB_POWER_POWER_DOWN\x10\xbei\x12\x1e\n\x19\x43MD_RGB_POWER_POWERIND_ON\x10\xbfi\x12\x1f\n\x1a\x43MD_RGB_POWER_POWERIND_OFF\x10\xc0i\x12\x19\n\x14\x43MD_RGB_POWER_REBOOT\x10\xc1i\x12\x19\n\x14\x43MD_FOCUS_AUTO_FOCUS\x10\x98u\x12\'\n\"CMD_FOCUS_MANUAL_SINGLE_STEP_FOCUS\x10\x99u\x12)\n$CMD_FOCUS_START_MANUAL_CONTINU_FOCUS\x10\x9au\x12(\n#CMD_FOCUS_STOP_MANUAL_CONTINU_FOCUS\x10\x9bu\x12%\n CMD_FOCUS_START_ASTRO_AUTO_FOCUS\x10\x9cu\x12$\n\x1f\x43MD_FOCUS_STOP_ASTRO_AUTO_FOCUS\x10\x9du\x12*\n%CMD_NOTIFY_TELE_WIDI_PICTURE_MATCHING\x10\xe0v\x12\x13\n\x0e\x43MD_NOTIFY_ELE\x10\xe1v\x12\x16\n\x11\x43MD_NOTIFY_CHARGE\x10\xe2v\x12\x1b\n\x16\x43MD_NOTIFY_SDCARD_INFO\x10\xe3v\x12 \n\x1b\x43MD_NOTIFY_TELE_RECORD_TIME\x10\xe4v\x12\'\n\"CMD_NOTIFY_TELE_TIMELAPSE_OUT_TIME\x10\xe5v\x12&\n!CMD_NOTIFY_STATE_CAPTURE_RAW_DARK\x10\xe6v\x12)\n$CMD_NOTIFY_PROGRASS_CAPTURE_RAW_DARK\x10\xe7v\x12/\n*CMD_NOTIFY_STATE_CAPTURE_RAW_LIVE_STACKING\x10\xe8v\x12\x32\n-CMD_NOTIFY_PROGRASS_CAPTURE_RAW_LIVE_STACKING\x10\xe9v\x12\'\n\"CMD_NOTIFY_STATE_ASTRO_CALIBRATION\x10\xeav\x12 \n\x1b\x43MD_NOTIFY_STATE_ASTRO_GOTO\x10\xebv\x12$\n\x1f\x43MD_NOTIFY_STATE_ASTRO_TRACKING\x10\xecv\x12\x1e\n\x19\x43MD_NOTIFY_TELE_SET_PARAM\x10\xedv\x12\x1e\n\x19\x43MD_NOTIFY_WIDE_SET_PARAM\x10\xeev\x12#\n\x1e\x43MD_NOTIFY_TELE_FUNCTION_STATE\x10\xefv\x12#\n\x1e\x43MD_NOTIFY_WIDE_FUNCTION_STATE\x10\xf0v\x12!\n\x1c\x43MD_NOTIFY_SET_FEATURE_PARAM\x10\xf1v\x12#\n\x1e\x43MD_NOTIFY_TELE_BURST_PROGRESS\x10\xf2v\x12!\n\x1c\x43MD_NOTIFY_PANORAMA_PROGRESS\x10\xf3v\x12#\n\x1e\x43MD_NOTIFY_WIDE_BURST_PROGRESS\x10\xf4v\x12\x19\n\x14\x43MD_NOTIFY_RGB_STATE\x10\xf5v\x12\x1f\n\x1a\x43MD_NOTIFY_POWER_IND_STATE\x10\xf6v\x12\"\n\x1d\x43MD_NOTIFY_WS_HOST_SLAVE_MODE\x10\xf7v\x12\x19\n\x14\x43MD_NOTIFY_MTP_STATE\x10\xf8v\x12\x1c\n\x17\x43MD_NOTIFY_TRACK_RESULT\x10\xf9v\x12\'\n\"CMD_NOTIFY_WIDE_TIMELAPSE_OUT_TIME\x10\xfav\x12\x18\n\x13\x43MD_NOTIFY_CPU_MODE\x10\xfbv\x12,\n\'CMD_NOTIFY_STATE_ASTRO_TRACKING_SPECIAL\x10\xfcv\x12\x19\n\x14\x43MD_NOTIFY_POWER_OFF\x10\xfdv*\x9f\x0b\n\x0e\x44warfErrorCode\x12\x06\n\x02OK\x10\x00\x12$\n\x17WS_PARSE_PROTOBUF_ERROR\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12 \n\x13WS_SDCARD_NOT_EXIST\x10\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x1d\n\x10WS_INVALID_PARAM\x10\xfd\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\"\n\x15WS_SDCARD_WRITE_ERROR\x10\xfc\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12$\n\x17\x43ODE_CAMERA_TELE_OPENED\x10\xfc\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12$\n\x17\x43ODE_CAMERA_TELE_CLOSED\x10\xfb\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12,\n\x1f\x43ODE_CAMERA_TELE_ISP_SET_FAILED\x10\xfa\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12)\n\x1c\x43ODE_CAMERA_TELE_OPEN_FAILED\x10\xf8\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12\x30\n#CODE_CAMERA_TELE_WORKING_BUSY_STACK\x10\xf5\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12\x30\n#CODE_CAMERA_TELE_CAPTURE_RAW_FAILED\x10\xf2\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12*\n\x1d\x43ODE_CAMERA_TELE_WORKING_BUSY\x10\xf1\xad\xff\xff\xff\xff\xff\xff\xff\x01\x12,\n\x1f\x43ODE_ASTRO_PLATE_SOLVING_FAILED\x10\x94\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12%\n\x18\x43ODE_ASTRO_FUNCTION_BUSY\x10\x93\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12.\n!CODE_ASTRO_DARK_GAIN_OUT_OF_RANGE\x10\x92\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12&\n\x19\x43ODE_ASTRO_DARK_NOT_FOUND\x10\x91\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12*\n\x1d\x43ODE_ASTRO_CALIBRATION_FAILED\x10\x90\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12#\n\x16\x43ODE_ASTRO_GOTO_FAILED\x10\x8f\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12!\n\x14\x43ODE_ASTRO_NEED_GOTO\x10\x87\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12/\n\"CODE_ASTRO_NEED_ADJUST_SHOOT_PARAM\x10\x86\xa6\xff\xff\xff\xff\xff\xff\xff\x01\x12$\n\x17\x43ODE_CAMERA_WIDE_OPENED\x10\xac\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12$\n\x17\x43ODE_CAMERA_WIDE_CLOSED\x10\xab\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12*\n\x1d\x43ODE_CAMERA_WIDE_CANNOT_FOUND\x10\xaa\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12)\n\x1c\x43ODE_CAMERA_WIDE_OPEN_FAILED\x10\xa9\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12*\n\x1d\x43ODE_CAMERA_WIDE_CLOSE_FAILED\x10\xa8\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12,\n\x1f\x43ODE_CAMERA_WIDE_SET_ISP_FAILED\x10\xa7\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12+\n\x1e\x43ODE_CAMERA_WIDE_PHOTOGRAPHING\x10\xa6\x9e\xff\xff\xff\xff\xff\xff\xff\x01\x12(\n\x1b\x43ODE_SYSTEM_SET_TIME_FAILED\x10\x8c\x98\xff\xff\xff\xff\xff\xff\xff\x01\x12,\n\x1f\x43ODE_SYSTEM_SET_TIMEZONE_FAILED\x10\x8b\x98\xff\xff\xff\xff\xff\xff\xff\x01\x12\x30\n#CODE_SYSTEM_SETTING_TIMEZONE_FAILED\x10\x8a\x98\xff\xff\xff\xff\xff\xff\xff\x01\x12\x33\n&CODE_STEP_MOTOR_LIMIT_POSITION_WARNING\x10\xca\x8e\xff\xff\xff\xff\xff\xff\xff\x01\x12\x32\n%CODE_STEP_MOTOR_LIMIT_POSITION_HITTED\x10\xc9\x8e\xff\xff\xff\xff\xff\xff\xff\x01\x12\'\n\x1a\x43ODE_PANORAMA_PHOTO_FAILED\x10\x90\x86\xff\xff\xff\xff\xff\xff\xff\x01\x12-\n CODE_PANORAMA_MOTOR_RESET_FAILED\x10\x8f\x86\xff\xff\xff\xff\xff\xff\xff\x01*;\n\x14\x41stroTrackingSpecial\x12\x10\n\x0cTRACKING_SUN\x10\x00\x12\x11\n\rTRACKING_MOON\x10\x01*\x87\x01\n\x11SolarSystemTarget\x12\x0b\n\x07Unknown\x10\x00\x12\x0b\n\x07Mercury\x10\x01\x12\t\n\x05Venus\x10\x02\x12\x08\n\x04Mars\x10\x03\x12\x0b\n\x07Jupiter\x10\x04\x12\n\n\x06Saturn\x10\x05\x12\n\n\x06Uranus\x10\x06\x12\x0b\n\x07Neptune\x10\x07\x12\x08\n\x04Moon\x10\x08\x12\x07\n\x03Sun\x10\t*!\n\tPhotoMode\x12\x08\n\x04\x41uto\x10\x00\x12\n\n\x06Manual\x10\x01*-\n\x06WBMode\x12\x14\n\x10\x43olorTemperature\x10\x00\x12\r\n\tSceneMode\x10\x01*\x1a\n\x05IrCut\x12\x07\n\x03\x43UT\x10\x00\x12\x08\n\x04PASS\x10\x01\x62\x06proto3' +) + +_MODULEID = _descriptor.EnumDescriptor( + name='ModuleId', + full_name='ModuleId', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='MODULE_NONE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_CAMERA_TELE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_CAMERA_WIDE', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_ASTRO', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_SYSTEM', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_RGB_POWER', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_MOTOR', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_TRACK', index=7, number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_FOCUS', index=8, number=8, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_NOTIFY', index=9, number=9, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MODULE_PANORAMA', index=10, number=10, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=19, + serialized_end=247, +) +_sym_db.RegisterEnumDescriptor(_MODULEID) + +ModuleId = enum_type_wrapper.EnumTypeWrapper(_MODULEID) +_MESSAGETYPEID = _descriptor.EnumDescriptor( + name='MessageTypeId', + full_name='MessageTypeId', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='TYPE_REQUEST', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TYPE_REQUEST_RESPONSE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TYPE_NOTIFICATION', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TYPE_NOTIFICATION_RESPONSE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=249, + serialized_end=364, +) +_sym_db.RegisterEnumDescriptor(_MESSAGETYPEID) + +MessageTypeId = enum_type_wrapper.EnumTypeWrapper(_MESSAGETYPEID) +_DWARFCMD = _descriptor.EnumDescriptor( + name='DwarfCMD', + full_name='DwarfCMD', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='NO_CMD', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_OPEN_CAMERA', index=1, number=10000, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_CLOSE_CAMERA', index=2, number=10001, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_PHOTOGRAPH', index=3, number=10002, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_BURST', index=4, number=10003, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_STOP_BURST', index=5, number=10004, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_START_RECORD', index=6, number=10005, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_STOP_RECORD', index=7, number=10006, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_EXP_MODE', index=8, number=10007, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_EXP_MODE', index=9, number=10008, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_EXP', index=10, number=10009, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_EXP', index=11, number=10010, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_GAIN_MODE', index=12, number=10011, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_GAIN_MODE', index=13, number=10012, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_GAIN', index=14, number=10013, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_GAIN', index=15, number=10014, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_BRIGHTNESS', index=16, number=10015, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_BRIGHTNESS', index=17, number=10016, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_CONTRAST', index=18, number=10017, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_CONTRAST', index=19, number=10018, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_SATURATION', index=20, number=10019, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_SATURATION', index=21, number=10020, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_HUE', index=22, number=10021, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_HUE', index=23, number=10022, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_SHARPNESS', index=24, number=10023, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_SHARPNESS', index=25, number=10024, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_WB_MODE', index=26, number=10025, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_WB_MODE', index=27, number=10026, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_WB_SCENE', index=28, number=10027, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_WB_SCENE', index=29, number=10028, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_WB_CT', index=30, number=10029, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_WB_CT', index=31, number=10030, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_IRCUT', index=32, number=10031, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_IRCUT', index=33, number=10032, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_START_TIMELAPSE_PHOTO', index=34, number=10033, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_STOP_TIMELAPSE_PHOTO', index=35, number=10034, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_ALL_PARAMS', index=36, number=10035, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_ALL_PARAMS', index=37, number=10036, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_FEATURE_PARAM', index=38, number=10037, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_ALL_FEATURE_PARAMS', index=39, number=10038, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE', index=40, number=10039, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_TELE_SET_JPG_QUALITY', index=41, number=10040, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_CALIBRATION', index=42, number=11000, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_STOP_CALIBRATION', index=43, number=11001, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_GOTO_DSO', index=44, number=11002, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_GOTO_SOLAR_SYSTEM', index=45, number=11003, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_STOP_GOTO', index=46, number=11004, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_CAPTURE_RAW_LIVE_STACKING', index=47, number=11005, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_STOP_CAPTURE_RAW_LIVE_STACKING', index=48, number=11006, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_CAPTURE_RAW_DARK', index=49, number=11007, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_STOP_CAPTURE_RAW_DARK', index=50, number=11008, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_CHECK_GOT_DARK', index=51, number=11009, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_GO_LIVE', index=52, number=11010, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_START_TRACK_SPECIAL_TARGET', index=53, number=11011, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_ASTRO_STOP_TRACK_SPECIAL_TARGET', index=54, number=11012, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_OPEN_CAMERA', index=55, number=12000, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_CLOSE_CAMERA', index=56, number=12001, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_EXP_MODE', index=57, number=12002, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_EXP_MODE', index=58, number=12003, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_EXP', index=59, number=12004, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_EXP', index=60, number=12005, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_GAIN', index=61, number=12006, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_GAIN', index=62, number=12007, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_BRIGHTNESS', index=63, number=12008, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_BRIGHTNESS', index=64, number=12009, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_CONTRAST', index=65, number=12010, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_CONTRAST', index=66, number=12011, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_SATURATION', index=67, number=12012, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_SATURATION', index=68, number=12013, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_HUE', index=69, number=12014, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_HUE', index=70, number=12015, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_SHARPNESS', index=71, number=12016, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_SHARPNESS', index=72, number=12017, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_WB_MODE', index=73, number=12018, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_WB_MODE', index=74, number=12019, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_WB_CT', index=75, number=12020, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_WB_CT', index=76, number=12021, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_PHOTOGRAPH', index=77, number=12022, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_BURST', index=78, number=12023, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_STOP_BURST', index=79, number=12024, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_START_TIMELAPSE_PHOTO', index=80, number=12025, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_STOP_TIMELAPSE_PHOTO', index=81, number=12026, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_GET_ALL_PARAMS', index=82, number=12027, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_CAMERA_WIDE_SET_ALL_PARAMS', index=83, number=12028, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_SYSTEM_SET_TIME', index=84, number=13000, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_SYSTEM_SET_TIME_ZONE', index=85, number=13001, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_SYSTEM_SET_MTP_MODE', index=86, number=13002, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_SYSTEM_SET_CPU_MODE', index=87, number=13003, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_OPEN_RGB', index=88, number=13500, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_CLOSE_RGB', index=89, number=13501, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_POWER_DOWN', index=90, number=13502, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_POWERIND_ON', index=91, number=13503, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_POWERIND_OFF', index=92, number=13504, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_RGB_POWER_REBOOT', index=93, number=13505, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_AUTO_FOCUS', index=94, number=15000, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_MANUAL_SINGLE_STEP_FOCUS', index=95, number=15001, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_START_MANUAL_CONTINU_FOCUS', index=96, number=15002, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_STOP_MANUAL_CONTINU_FOCUS', index=97, number=15003, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_START_ASTRO_AUTO_FOCUS', index=98, number=15004, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_FOCUS_STOP_ASTRO_AUTO_FOCUS', index=99, number=15005, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_WIDI_PICTURE_MATCHING', index=100, number=15200, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_ELE', index=101, number=15201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_CHARGE', index=102, number=15202, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_SDCARD_INFO', index=103, number=15203, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_RECORD_TIME', index=104, number=15204, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_TIMELAPSE_OUT_TIME', index=105, number=15205, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_CAPTURE_RAW_DARK', index=106, number=15206, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_PROGRASS_CAPTURE_RAW_DARK', index=107, number=15207, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_CAPTURE_RAW_LIVE_STACKING', index=108, number=15208, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_PROGRASS_CAPTURE_RAW_LIVE_STACKING', index=109, number=15209, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_ASTRO_CALIBRATION', index=110, number=15210, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_ASTRO_GOTO', index=111, number=15211, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_ASTRO_TRACKING', index=112, number=15212, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_SET_PARAM', index=113, number=15213, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_WIDE_SET_PARAM', index=114, number=15214, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_FUNCTION_STATE', index=115, number=15215, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_WIDE_FUNCTION_STATE', index=116, number=15216, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_SET_FEATURE_PARAM', index=117, number=15217, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TELE_BURST_PROGRESS', index=118, number=15218, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_PANORAMA_PROGRESS', index=119, number=15219, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_WIDE_BURST_PROGRESS', index=120, number=15220, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_RGB_STATE', index=121, number=15221, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_POWER_IND_STATE', index=122, number=15222, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_WS_HOST_SLAVE_MODE', index=123, number=15223, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_MTP_STATE', index=124, number=15224, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_TRACK_RESULT', index=125, number=15225, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_WIDE_TIMELAPSE_OUT_TIME', index=126, number=15226, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_CPU_MODE', index=127, number=15227, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_STATE_ASTRO_TRACKING_SPECIAL', index=128, number=15228, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CMD_NOTIFY_POWER_OFF', index=129, number=15229, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=367, + serialized_end=4900, +) +_sym_db.RegisterEnumDescriptor(_DWARFCMD) + +DwarfCMD = enum_type_wrapper.EnumTypeWrapper(_DWARFCMD) +_DWARFERRORCODE = _descriptor.EnumDescriptor( + name='DwarfErrorCode', + full_name='DwarfErrorCode', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='OK', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_PARSE_PROTOBUF_ERROR', index=1, number=-1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_SDCARD_NOT_EXIST', index=2, number=-2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_INVALID_PARAM', index=3, number=-3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='WS_SDCARD_WRITE_ERROR', index=4, number=-4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_OPENED', index=5, number=-10500, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_CLOSED', index=6, number=-10501, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_ISP_SET_FAILED', index=7, number=-10502, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_OPEN_FAILED', index=8, number=-10504, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_WORKING_BUSY_STACK', index=9, number=-10507, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_CAPTURE_RAW_FAILED', index=10, number=-10510, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_TELE_WORKING_BUSY', index=11, number=-10511, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_PLATE_SOLVING_FAILED', index=12, number=-11500, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_FUNCTION_BUSY', index=13, number=-11501, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_DARK_GAIN_OUT_OF_RANGE', index=14, number=-11502, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_DARK_NOT_FOUND', index=15, number=-11503, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_CALIBRATION_FAILED', index=16, number=-11504, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_GOTO_FAILED', index=17, number=-11505, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_NEED_GOTO', index=18, number=-11513, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_ASTRO_NEED_ADJUST_SHOOT_PARAM', index=19, number=-11514, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_OPENED', index=20, number=-12500, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_CLOSED', index=21, number=-12501, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_CANNOT_FOUND', index=22, number=-12502, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_OPEN_FAILED', index=23, number=-12503, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_CLOSE_FAILED', index=24, number=-12504, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_SET_ISP_FAILED', index=25, number=-12505, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_CAMERA_WIDE_PHOTOGRAPHING', index=26, number=-12506, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_SYSTEM_SET_TIME_FAILED', index=27, number=-13300, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_SYSTEM_SET_TIMEZONE_FAILED', index=28, number=-13301, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_SYSTEM_SETTING_TIMEZONE_FAILED', index=29, number=-13302, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_STEP_MOTOR_LIMIT_POSITION_WARNING', index=30, number=-14518, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_STEP_MOTOR_LIMIT_POSITION_HITTED', index=31, number=-14519, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_PANORAMA_PHOTO_FAILED', index=32, number=-15600, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='CODE_PANORAMA_MOTOR_RESET_FAILED', index=33, number=-15601, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=4903, + serialized_end=6342, +) +_sym_db.RegisterEnumDescriptor(_DWARFERRORCODE) + +DwarfErrorCode = enum_type_wrapper.EnumTypeWrapper(_DWARFERRORCODE) +_ASTROTRACKINGSPECIAL = _descriptor.EnumDescriptor( + name='AstroTrackingSpecial', + full_name='AstroTrackingSpecial', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='TRACKING_SUN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TRACKING_MOON', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=6344, + serialized_end=6403, +) +_sym_db.RegisterEnumDescriptor(_ASTROTRACKINGSPECIAL) + +AstroTrackingSpecial = enum_type_wrapper.EnumTypeWrapper(_ASTROTRACKINGSPECIAL) +_SOLARSYSTEMTARGET = _descriptor.EnumDescriptor( + name='SolarSystemTarget', + full_name='SolarSystemTarget', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='Unknown', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Mercury', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Venus', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Mars', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Jupiter', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Saturn', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Uranus', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Neptune', index=7, number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Moon', index=8, number=8, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Sun', index=9, number=9, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=6406, + serialized_end=6541, +) +_sym_db.RegisterEnumDescriptor(_SOLARSYSTEMTARGET) + +SolarSystemTarget = enum_type_wrapper.EnumTypeWrapper(_SOLARSYSTEMTARGET) +_PHOTOMODE = _descriptor.EnumDescriptor( + name='PhotoMode', + full_name='PhotoMode', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='Auto', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='Manual', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=6543, + serialized_end=6576, +) +_sym_db.RegisterEnumDescriptor(_PHOTOMODE) + +PhotoMode = enum_type_wrapper.EnumTypeWrapper(_PHOTOMODE) +_WBMODE = _descriptor.EnumDescriptor( + name='WBMode', + full_name='WBMode', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='ColorTemperature', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SceneMode', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=6578, + serialized_end=6623, +) +_sym_db.RegisterEnumDescriptor(_WBMODE) + +WBMode = enum_type_wrapper.EnumTypeWrapper(_WBMODE) +_IRCUT = _descriptor.EnumDescriptor( + name='IrCut', + full_name='IrCut', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CUT', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='PASS', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=6625, + serialized_end=6651, +) +_sym_db.RegisterEnumDescriptor(_IRCUT) + +IrCut = enum_type_wrapper.EnumTypeWrapper(_IRCUT) +MODULE_NONE = 0 +MODULE_CAMERA_TELE = 1 +MODULE_CAMERA_WIDE = 2 +MODULE_ASTRO = 3 +MODULE_SYSTEM = 4 +MODULE_RGB_POWER = 5 +MODULE_MOTOR = 6 +MODULE_TRACK = 7 +MODULE_FOCUS = 8 +MODULE_NOTIFY = 9 +MODULE_PANORAMA = 10 +TYPE_REQUEST = 0 +TYPE_REQUEST_RESPONSE = 1 +TYPE_NOTIFICATION = 2 +TYPE_NOTIFICATION_RESPONSE = 3 +NO_CMD = 0 +CMD_CAMERA_TELE_OPEN_CAMERA = 10000 +CMD_CAMERA_TELE_CLOSE_CAMERA = 10001 +CMD_CAMERA_TELE_PHOTOGRAPH = 10002 +CMD_CAMERA_TELE_BURST = 10003 +CMD_CAMERA_TELE_STOP_BURST = 10004 +CMD_CAMERA_TELE_START_RECORD = 10005 +CMD_CAMERA_TELE_STOP_RECORD = 10006 +CMD_CAMERA_TELE_SET_EXP_MODE = 10007 +CMD_CAMERA_TELE_GET_EXP_MODE = 10008 +CMD_CAMERA_TELE_SET_EXP = 10009 +CMD_CAMERA_TELE_GET_EXP = 10010 +CMD_CAMERA_TELE_SET_GAIN_MODE = 10011 +CMD_CAMERA_TELE_GET_GAIN_MODE = 10012 +CMD_CAMERA_TELE_SET_GAIN = 10013 +CMD_CAMERA_TELE_GET_GAIN = 10014 +CMD_CAMERA_TELE_SET_BRIGHTNESS = 10015 +CMD_CAMERA_TELE_GET_BRIGHTNESS = 10016 +CMD_CAMERA_TELE_SET_CONTRAST = 10017 +CMD_CAMERA_TELE_GET_CONTRAST = 10018 +CMD_CAMERA_TELE_SET_SATURATION = 10019 +CMD_CAMERA_TELE_GET_SATURATION = 10020 +CMD_CAMERA_TELE_SET_HUE = 10021 +CMD_CAMERA_TELE_GET_HUE = 10022 +CMD_CAMERA_TELE_SET_SHARPNESS = 10023 +CMD_CAMERA_TELE_GET_SHARPNESS = 10024 +CMD_CAMERA_TELE_SET_WB_MODE = 10025 +CMD_CAMERA_TELE_GET_WB_MODE = 10026 +CMD_CAMERA_TELE_SET_WB_SCENE = 10027 +CMD_CAMERA_TELE_GET_WB_SCENE = 10028 +CMD_CAMERA_TELE_SET_WB_CT = 10029 +CMD_CAMERA_TELE_GET_WB_CT = 10030 +CMD_CAMERA_TELE_SET_IRCUT = 10031 +CMD_CAMERA_TELE_GET_IRCUT = 10032 +CMD_CAMERA_TELE_START_TIMELAPSE_PHOTO = 10033 +CMD_CAMERA_TELE_STOP_TIMELAPSE_PHOTO = 10034 +CMD_CAMERA_TELE_SET_ALL_PARAMS = 10035 +CMD_CAMERA_TELE_GET_ALL_PARAMS = 10036 +CMD_CAMERA_TELE_SET_FEATURE_PARAM = 10037 +CMD_CAMERA_TELE_GET_ALL_FEATURE_PARAMS = 10038 +CMD_CAMERA_TELE_GET_SYSTEM_WORKING_STATE = 10039 +CMD_CAMERA_TELE_SET_JPG_QUALITY = 10040 +CMD_ASTRO_START_CALIBRATION = 11000 +CMD_ASTRO_STOP_CALIBRATION = 11001 +CMD_ASTRO_START_GOTO_DSO = 11002 +CMD_ASTRO_START_GOTO_SOLAR_SYSTEM = 11003 +CMD_ASTRO_STOP_GOTO = 11004 +CMD_ASTRO_START_CAPTURE_RAW_LIVE_STACKING = 11005 +CMD_ASTRO_STOP_CAPTURE_RAW_LIVE_STACKING = 11006 +CMD_ASTRO_START_CAPTURE_RAW_DARK = 11007 +CMD_ASTRO_STOP_CAPTURE_RAW_DARK = 11008 +CMD_ASTRO_CHECK_GOT_DARK = 11009 +CMD_ASTRO_GO_LIVE = 11010 +CMD_ASTRO_START_TRACK_SPECIAL_TARGET = 11011 +CMD_ASTRO_STOP_TRACK_SPECIAL_TARGET = 11012 +CMD_CAMERA_WIDE_OPEN_CAMERA = 12000 +CMD_CAMERA_WIDE_CLOSE_CAMERA = 12001 +CMD_CAMERA_WIDE_SET_EXP_MODE = 12002 +CMD_CAMERA_WIDE_GET_EXP_MODE = 12003 +CMD_CAMERA_WIDE_SET_EXP = 12004 +CMD_CAMERA_WIDE_GET_EXP = 12005 +CMD_CAMERA_WIDE_SET_GAIN = 12006 +CMD_CAMERA_WIDE_GET_GAIN = 12007 +CMD_CAMERA_WIDE_SET_BRIGHTNESS = 12008 +CMD_CAMERA_WIDE_GET_BRIGHTNESS = 12009 +CMD_CAMERA_WIDE_SET_CONTRAST = 12010 +CMD_CAMERA_WIDE_GET_CONTRAST = 12011 +CMD_CAMERA_WIDE_SET_SATURATION = 12012 +CMD_CAMERA_WIDE_GET_SATURATION = 12013 +CMD_CAMERA_WIDE_SET_HUE = 12014 +CMD_CAMERA_WIDE_GET_HUE = 12015 +CMD_CAMERA_WIDE_SET_SHARPNESS = 12016 +CMD_CAMERA_WIDE_GET_SHARPNESS = 12017 +CMD_CAMERA_WIDE_SET_WB_MODE = 12018 +CMD_CAMERA_WIDE_GET_WB_MODE = 12019 +CMD_CAMERA_WIDE_SET_WB_CT = 12020 +CMD_CAMERA_WIDE_GET_WB_CT = 12021 +CMD_CAMERA_WIDE_PHOTOGRAPH = 12022 +CMD_CAMERA_WIDE_BURST = 12023 +CMD_CAMERA_WIDE_STOP_BURST = 12024 +CMD_CAMERA_WIDE_START_TIMELAPSE_PHOTO = 12025 +CMD_CAMERA_WIDE_STOP_TIMELAPSE_PHOTO = 12026 +CMD_CAMERA_WIDE_GET_ALL_PARAMS = 12027 +CMD_CAMERA_WIDE_SET_ALL_PARAMS = 12028 +CMD_SYSTEM_SET_TIME = 13000 +CMD_SYSTEM_SET_TIME_ZONE = 13001 +CMD_SYSTEM_SET_MTP_MODE = 13002 +CMD_SYSTEM_SET_CPU_MODE = 13003 +CMD_RGB_POWER_OPEN_RGB = 13500 +CMD_RGB_POWER_CLOSE_RGB = 13501 +CMD_RGB_POWER_POWER_DOWN = 13502 +CMD_RGB_POWER_POWERIND_ON = 13503 +CMD_RGB_POWER_POWERIND_OFF = 13504 +CMD_RGB_POWER_REBOOT = 13505 +CMD_FOCUS_AUTO_FOCUS = 15000 +CMD_FOCUS_MANUAL_SINGLE_STEP_FOCUS = 15001 +CMD_FOCUS_START_MANUAL_CONTINU_FOCUS = 15002 +CMD_FOCUS_STOP_MANUAL_CONTINU_FOCUS = 15003 +CMD_FOCUS_START_ASTRO_AUTO_FOCUS = 15004 +CMD_FOCUS_STOP_ASTRO_AUTO_FOCUS = 15005 +CMD_NOTIFY_TELE_WIDI_PICTURE_MATCHING = 15200 +CMD_NOTIFY_ELE = 15201 +CMD_NOTIFY_CHARGE = 15202 +CMD_NOTIFY_SDCARD_INFO = 15203 +CMD_NOTIFY_TELE_RECORD_TIME = 15204 +CMD_NOTIFY_TELE_TIMELAPSE_OUT_TIME = 15205 +CMD_NOTIFY_STATE_CAPTURE_RAW_DARK = 15206 +CMD_NOTIFY_PROGRASS_CAPTURE_RAW_DARK = 15207 +CMD_NOTIFY_STATE_CAPTURE_RAW_LIVE_STACKING = 15208 +CMD_NOTIFY_PROGRASS_CAPTURE_RAW_LIVE_STACKING = 15209 +CMD_NOTIFY_STATE_ASTRO_CALIBRATION = 15210 +CMD_NOTIFY_STATE_ASTRO_GOTO = 15211 +CMD_NOTIFY_STATE_ASTRO_TRACKING = 15212 +CMD_NOTIFY_TELE_SET_PARAM = 15213 +CMD_NOTIFY_WIDE_SET_PARAM = 15214 +CMD_NOTIFY_TELE_FUNCTION_STATE = 15215 +CMD_NOTIFY_WIDE_FUNCTION_STATE = 15216 +CMD_NOTIFY_SET_FEATURE_PARAM = 15217 +CMD_NOTIFY_TELE_BURST_PROGRESS = 15218 +CMD_NOTIFY_PANORAMA_PROGRESS = 15219 +CMD_NOTIFY_WIDE_BURST_PROGRESS = 15220 +CMD_NOTIFY_RGB_STATE = 15221 +CMD_NOTIFY_POWER_IND_STATE = 15222 +CMD_NOTIFY_WS_HOST_SLAVE_MODE = 15223 +CMD_NOTIFY_MTP_STATE = 15224 +CMD_NOTIFY_TRACK_RESULT = 15225 +CMD_NOTIFY_WIDE_TIMELAPSE_OUT_TIME = 15226 +CMD_NOTIFY_CPU_MODE = 15227 +CMD_NOTIFY_STATE_ASTRO_TRACKING_SPECIAL = 15228 +CMD_NOTIFY_POWER_OFF = 15229 +OK = 0 +WS_PARSE_PROTOBUF_ERROR = -1 +WS_SDCARD_NOT_EXIST = -2 +WS_INVALID_PARAM = -3 +WS_SDCARD_WRITE_ERROR = -4 +CODE_CAMERA_TELE_OPENED = -10500 +CODE_CAMERA_TELE_CLOSED = -10501 +CODE_CAMERA_TELE_ISP_SET_FAILED = -10502 +CODE_CAMERA_TELE_OPEN_FAILED = -10504 +CODE_CAMERA_TELE_WORKING_BUSY_STACK = -10507 +CODE_CAMERA_TELE_CAPTURE_RAW_FAILED = -10510 +CODE_CAMERA_TELE_WORKING_BUSY = -10511 +CODE_ASTRO_PLATE_SOLVING_FAILED = -11500 +CODE_ASTRO_FUNCTION_BUSY = -11501 +CODE_ASTRO_DARK_GAIN_OUT_OF_RANGE = -11502 +CODE_ASTRO_DARK_NOT_FOUND = -11503 +CODE_ASTRO_CALIBRATION_FAILED = -11504 +CODE_ASTRO_GOTO_FAILED = -11505 +CODE_ASTRO_NEED_GOTO = -11513 +CODE_ASTRO_NEED_ADJUST_SHOOT_PARAM = -11514 +CODE_CAMERA_WIDE_OPENED = -12500 +CODE_CAMERA_WIDE_CLOSED = -12501 +CODE_CAMERA_WIDE_CANNOT_FOUND = -12502 +CODE_CAMERA_WIDE_OPEN_FAILED = -12503 +CODE_CAMERA_WIDE_CLOSE_FAILED = -12504 +CODE_CAMERA_WIDE_SET_ISP_FAILED = -12505 +CODE_CAMERA_WIDE_PHOTOGRAPHING = -12506 +CODE_SYSTEM_SET_TIME_FAILED = -13300 +CODE_SYSTEM_SET_TIMEZONE_FAILED = -13301 +CODE_SYSTEM_SETTING_TIMEZONE_FAILED = -13302 +CODE_STEP_MOTOR_LIMIT_POSITION_WARNING = -14518 +CODE_STEP_MOTOR_LIMIT_POSITION_HITTED = -14519 +CODE_PANORAMA_PHOTO_FAILED = -15600 +CODE_PANORAMA_MOTOR_RESET_FAILED = -15601 +TRACKING_SUN = 0 +TRACKING_MOON = 1 +Unknown = 0 +Mercury = 1 +Venus = 2 +Mars = 3 +Jupiter = 4 +Saturn = 5 +Uranus = 6 +Neptune = 7 +Moon = 8 +Sun = 9 +Auto = 0 +Manual = 1 +ColorTemperature = 0 +SceneMode = 1 +CUT = 0 +PASS = 1 + + +DESCRIPTOR.enum_types_by_name['ModuleId'] = _MODULEID +DESCRIPTOR.enum_types_by_name['MessageTypeId'] = _MESSAGETYPEID +DESCRIPTOR.enum_types_by_name['DwarfCMD'] = _DWARFCMD +DESCRIPTOR.enum_types_by_name['DwarfErrorCode'] = _DWARFERRORCODE +DESCRIPTOR.enum_types_by_name['AstroTrackingSpecial'] = _ASTROTRACKINGSPECIAL +DESCRIPTOR.enum_types_by_name['SolarSystemTarget'] = _SOLARSYSTEMTARGET +DESCRIPTOR.enum_types_by_name['PhotoMode'] = _PHOTOMODE +DESCRIPTOR.enum_types_by_name['WBMode'] = _WBMODE +DESCRIPTOR.enum_types_by_name['IrCut'] = _IRCUT +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +# @@protoc_insertion_point(module_scope) diff --git a/proto/system.proto b/proto/system.proto new file mode 100644 index 0000000..2258be1 --- /dev/null +++ b/proto/system.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +//设置系统时间 +message ReqSetTime { + uint64 timestamp = 1; +} + +//设置系统时区 +message ReqSetTimezone { + string timezone = 1; +} + +// 设置MTP模式 +message ReqSetMtpMode { + int32 mode = 1; +} + +// 设置CPU模式 +message ReqSetCpuMode { + int32 mode = 1; +} \ No newline at end of file diff --git a/proto/system_pb2.py b/proto/system_pb2.py new file mode 100644 index 0000000..144b64b --- /dev/null +++ b/proto/system_pb2.py @@ -0,0 +1,190 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: system.proto + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='system.proto', + package='', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0csystem.proto\"\x1f\n\nReqSetTime\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\"\"\n\x0eReqSetTimezone\x12\x10\n\x08timezone\x18\x01 \x01(\t\"\x1d\n\rReqSetMtpMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\"\x1d\n\rReqSetCpuMode\x12\x0c\n\x04mode\x18\x01 \x01(\x05\x62\x06proto3' +) + + + + +_REQSETTIME = _descriptor.Descriptor( + name='ReqSetTime', + full_name='ReqSetTime', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='ReqSetTime.timestamp', index=0, + number=1, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=16, + serialized_end=47, +) + + +_REQSETTIMEZONE = _descriptor.Descriptor( + name='ReqSetTimezone', + full_name='ReqSetTimezone', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='timezone', full_name='ReqSetTimezone.timezone', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=49, + serialized_end=83, +) + + +_REQSETMTPMODE = _descriptor.Descriptor( + name='ReqSetMtpMode', + full_name='ReqSetMtpMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ReqSetMtpMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=85, + serialized_end=114, +) + + +_REQSETCPUMODE = _descriptor.Descriptor( + name='ReqSetCpuMode', + full_name='ReqSetCpuMode', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='mode', full_name='ReqSetCpuMode.mode', index=0, + number=1, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=116, + serialized_end=145, +) + +DESCRIPTOR.message_types_by_name['ReqSetTime'] = _REQSETTIME +DESCRIPTOR.message_types_by_name['ReqSetTimezone'] = _REQSETTIMEZONE +DESCRIPTOR.message_types_by_name['ReqSetMtpMode'] = _REQSETMTPMODE +DESCRIPTOR.message_types_by_name['ReqSetCpuMode'] = _REQSETCPUMODE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ReqSetTime = _reflection.GeneratedProtocolMessageType('ReqSetTime', (_message.Message,), { + 'DESCRIPTOR' : _REQSETTIME, + '__module__' : 'system_pb2' + # @@protoc_insertion_point(class_scope:ReqSetTime) + }) +_sym_db.RegisterMessage(ReqSetTime) + +ReqSetTimezone = _reflection.GeneratedProtocolMessageType('ReqSetTimezone', (_message.Message,), { + 'DESCRIPTOR' : _REQSETTIMEZONE, + '__module__' : 'system_pb2' + # @@protoc_insertion_point(class_scope:ReqSetTimezone) + }) +_sym_db.RegisterMessage(ReqSetTimezone) + +ReqSetMtpMode = _reflection.GeneratedProtocolMessageType('ReqSetMtpMode', (_message.Message,), { + 'DESCRIPTOR' : _REQSETMTPMODE, + '__module__' : 'system_pb2' + # @@protoc_insertion_point(class_scope:ReqSetMtpMode) + }) +_sym_db.RegisterMessage(ReqSetMtpMode) + +ReqSetCpuMode = _reflection.GeneratedProtocolMessageType('ReqSetCpuMode', (_message.Message,), { + 'DESCRIPTOR' : _REQSETCPUMODE, + '__module__' : 'system_pb2' + # @@protoc_insertion_point(class_scope:ReqSetCpuMode) + }) +_sym_db.RegisterMessage(ReqSetCpuMode) + + +# @@protoc_insertion_point(module_scope) diff --git a/requirements.txt b/requirements.txt index 80360aa..b4c23bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,7 @@ websockets==11.0.3 + +protobuf==3.20.* + +pytz + +paramiko \ No newline at end of file diff --git a/server.py b/server.py index fd0ce5d..1e1c592 100644 --- a/server.py +++ b/server.py @@ -1,36 +1,400 @@ import socket +import threading +import time +import importlib +import pytz + +from queue import Queue + +from datetime import datetime import config import lib.my_logger as my_logger -from lib.stellarium_utils import process_stellarium_data, update_stellarium from lib.dwarf_utils import perform_goto +from lib.ftp_utils import test_ssh_connection, download_file_via_ssh, extract_last_matching_line, extract_desired_value, update_config_file +from lib.stellarium_utils import process_stellarium_data, update_stellarium + + +# Convert Deg to +def process_deg_dec(deg_dec): + deg_sign = "" + + if deg_dec >= 0: + deg_sign = "+" + else: + deg_sign = "-" + deg_dec = -deg_dec + + d = int(deg_dec) + my_logger.debug(f"process_deg_dec: {deg_sign}{deg_dec}<->{d}") + + dec_min = int((deg_dec - d) * 60 ) + dec_sec = int((deg_dec - d - (dec_min / 60))*3600) + + return { + "deg_sign": deg_sign, + "degree": d, + "minute": dec_min, + "second": dec_sec, + } + + +# Create a Queue to pass the result from the thread to the main program +result_queue = Queue() +dwarf_ra_deg = 0 +dwarf_dec_deg = 0 +dwarf_goto_thread_started = False + +# Create a thread and pass variables to it +dwarf_goto_thread = False + +nbDeconnect = 10 +ssh_host = config.DWARF_IP +ssh_port = 22 +ssh_username = "root" +ssh_password = "rockchip" +remote_file_path = "/userdata/log/dwarf/dwarf.log" +local_file_path = "dwarf.log" +search_string = "master client id =" +config_file_path = "config.py" + +processAction = True + +try: + my_logger.info(f"Try to connect to DWARF, with IP : {ssh_host}") + my_logger.info("To Stop the program, Use CTRL+C") + time.sleep(1) + while True: + # Test SSH connection + if test_ssh_connection(ssh_host, ssh_port, ssh_username, ssh_password): + my_logger.info("connection successful to DWARF ") + + # Download the file from the SSH server + download_file_via_ssh(ssh_host, ssh_port, ssh_username, ssh_password, remote_file_path, local_file_path) + + # Extract the last line containing the search string + last_matching_line = extract_last_matching_line(local_file_path, search_string) + + # Extract the desired value after the search string + if last_matching_line: + new_client_id = extract_desired_value(last_matching_line, search_string) + my_logger.info(f"Extracted new CLIENT_ID: {new_client_id}") + + # Update the config file with the new client_id + update_config_file(config_file_path, new_client_id) + + # Reload the config module to reflect the updated CLIENT_ID + importlib.reload(config) + my_logger.info(f"Updated CLIENT_ID to match DwarfLab app one") + break # Exit the loop since we found the client_id + else: + my_logger.info("No line containing the search string was found. Retrying...") + else: + my_logger.info("DWARF connection failed. Retrying...") + + # Wait for a short period before retrying (e.g., 10 seconds) + time.sleep(10) + +except KeyboardInterrupt: + my_logger.info("Process interrupted by user. Exiting...") + processAction = False + +while processAction: + try: + my_logger.info(f"Waiting Connection to Stellarium : {config.HOST}") + + # create socket + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + # ensure we can quickly restart server + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # set host and port + sock.bind((config.HOST, config.PORT)) + # set number of client that can be queued + sock.listen(5) + sock.settimeout(30) # Set a timeout of 30 seconds + + while True: + try: + # create new socket to interact with client + new_socket = None + addr = None + new_socket, addr = sock.accept() + my_logger.info(f"Connected by {addr}") + + raw_data = new_socket.recv(1024) + if not raw_data: + break + # Process raw_data here... + except TimeoutError: + my_logger.info("No incoming connections. Timeout reached, retrying...") + sock.close() + if new_socket: + new_socket.close() + break + except ConnectionResetError: + my_logger.info("Error Connection stops. Closing connection...") + sock.close() + if new_socket: + new_socket.close() + break + except KeyboardInterrupt: + my_logger.info("Process interrupted by user. Closing connection...") + sock.close() + if new_socket: + new_socket.close() + break + + # Process raw_data here... + + # process data from Stellarium PC to get RA/Dec + data = process_stellarium_data(raw_data) + + if (data): # For Stellarium PC + my_logger.info("Connected to Stellarium PC") + # send goto command to DWARF II + if hasattr(config, 'VERSION_API'): + if (config.VERSION_API == 1): + result = perform_gotoV1(data["ra_number"], data["dec_number"], result_queue) + else: + result = perform_goto(data["ra_number"], data["dec_number"], result_queue) + else: + result = perform_goto(data["ra_number"], data["dec_number"], result_queue) + + # add DWARF II to Stellarium's sky map + if result == "ok": + update_stellarium(data["ra_int"], data["dec_int"], new_socket) + + new_socket.close() + + else: # For Stellarium Mobile Plus simulate Telescope Nexstar + my_logger.info("Connected to Stellarium Mobile +") + location = "" + datetoday = "" + goto_data = b'1B4A735F,3F7A6B85#' # Init to Polaris Position + goto = False + ra_deg = 0 + dec_deg = 0 + DST = None + + while True: + send_data = b'##' + if (raw_data == b'Ka'): + send_data = b'a#' + if (raw_data == b'V'): # Version + send_data = b'\x02\x06#' + if (raw_data == b'P\x01\x10\xfe\x00\x00\x00\x02'): # Version AZM/ RA motor + send_data = b'\x02\x06#' + if (raw_data == b'P\x01\x11\xfe\x00\x00\x00\x02'): # Version Alt/ DEC motor + send_data = b'\x02\x06#' + if (raw_data == b'm'): # Model + send_data = b'\x10#' + if (raw_data == b't'): # Tracking Mode + send_data = b'\x00#' # b'\x02# + if (raw_data == b'L'): # Is GOTO + if (goto): + send_data = b'1#' + else: + send_data = b'0#' + if (raw_data == b'J'): # Is Align + send_data = b'\x01#' + if (raw_data == b'e'): # Position + send_data = goto_data + + if (raw_data == b'h'): # Send Time + today = datetime.now() + # Get Local Timezone from Config + try: + local_timezone = config.TIME_ZONE + except AttributeError as e: + local_timezone = "UTC" + my_logger.debug(f"No TimeZone defined in config, UTC used") + + # adding a timezone + timezone = pytz.timezone(local_timezone) + date_GMTDST = timezone.localize(today) + + # Get GMT + gmt = int(date_GMTDST.utcoffset().total_seconds() // 3600) + if (gmt < 0): + gmt = 256 - gmt + # Get DST + dst_active = 1 + if (int(date_GMTDST.dst().total_seconds()) == 0): + dst_active = 0 + # dst_active seems different, so get the one received + if DST is not None: + dst_active = int(not DST == "") + my_logger.debug(f"Local Date Time :", today, gmt, dst_active) + + # today_hexa = f"{hex(today.hour)[2:]}{hex(today.minute)[2:]}{hex(today.second)[2:]}{hex(today.month)[2:]}{hex(today.day)[2:]}{hex(today.year-2000)[2:]}{hex(gmt)[2:]}{hex(dst_active)[2:]}" + today_hexa = f"{today.hour:02x}{today.minute:02x}{today.second:02x}{today.month:02x}{today.day:02x}{today.year-2000:02x}{gmt:02x}{dst_active:02x}" + my_logger.debug(f"Date Time hexa: ", today_hexa) + send_data = bytes.fromhex(today_hexa) + b'#' + + if (raw_data[0] == ord('H')): # Get Time + datetoday = raw_data[1:] + Time = f"{raw_data[1]}H{raw_data[2]}M{raw_data[3]}S" + Date = f"{raw_data[4]}/{raw_data[5]}/20{raw_data[6]}\"" + GMT = f"GMT +{raw_data[7]}" + my_logger.debug(f"Date Time GMT :", GMT) + if (int(raw_data[7]) <= 127): + GMT = f"GMT +{raw_data[7]}" + else: + GMT = f"GMT -{256-raw_data[7]}" + DST = "" + if (raw_data[8] == 1): + DST = "DST" + my_logger.debug(f"Date Time :", Date, Time, GMT, DST) + send_data = b'#' + + if (raw_data == b'w'): # send Local Location + send_data = b'/\x13,\x00\x01),\x01' + if (location): + send_data = location + b'#' + # Get Local Location from Config + try: + Latitude = config.LATITUDE + Longitude = config.LONGITUDE + my_logger.debug(f"Config Local Location:", Latitude, Longitude) + except AttributeError as e: + local_timezone = "UTC" + my_logger.debug(f"No Local Location Info in config, send Location from phone") + if (location): + send_data = location + b'#' + + data_Lat = process_deg_dec(Latitude) + Lat_NS = 0 + if (data_Lat['deg_sign'] == "-"): + Lat_NS = 1 + + data_Lon = process_deg_dec(Longitude) + Lon_WE = 0 + if (data_Lon['deg_sign'] == "-"): + Lon_WE = 1 + + str_lattitude = f"{data_Lat['degree']}°{data_Lat['minute']}'{data_Lat['second']}\"" + if (data_Lat['deg_sign'] == "+"): + str_lattitude += "N" + else: + str_lattitude += "S" + + str_longitude = f"{data_Lon['degree']}°{data_Lon['minute']}'{data_Lon['second']}\"" + if (data_Lon['deg_sign'] == "-"): + str_longitude += "W" + else: + str_longitude += "E" + my_logger.debug(f"Local Location:", str_lattitude, str_longitude) + + data_location_hexa = f"{data_Lat['degree']:02x}{data_Lat['minute']:02x}{data_Lat['second']:02x}{Lat_NS:02x}{data_Lon['degree']:02x}{data_Lon['minute']:02x}{data_Lon['second']:02x}{Lon_WE:02x}" + my_logger.debug(f"Local Location hexa: ", data_location_hexa) + send_data = bytes.fromhex(data_location_hexa) + b'#' + + if (raw_data[0] == ord('W')): # get Location + location = raw_data[1:] + lattitude = f"{raw_data[1]}°{raw_data[2]}'{raw_data[3]}\"" + if (raw_data[4] == 0): + lattitude += "N" + else: + lattitude += "S" + longitude = f"{raw_data[5]}°{raw_data[6]}'{raw_data[7]}\"" + if (raw_data[8] == 0): + longitude += "E" + else: + longitude += "W" + my_logger.debug(f"Location:", lattitude, longitude) + send_data = b'#' + + # GOTO Command + if (raw_data[0] == ord('r')): + my_logger.info(f"Receive Goto Command : {raw_data}") + my_logger.info(f"Receive Goto Command : RA {raw_data[1:7]}") + my_logger.info(f"Receive Goto Command : DEC {raw_data[10:16]}") + ra_data = int(raw_data[1:7], base=16) + if (ra_data < 0): + ra_data = 16777216 + ra_data + ra_deg = (ra_data / 16777216) * 360 / 15 + my_logger.debug(f"Decode Ra:{ra_deg}") + dec_data = int(raw_data[10:16], base=16) + dec_deg = (dec_data / 16777216) * 360 + my_logger.debug(f"Decode Dec:{dec_deg}") + if (dec_deg > 180): + dec_deg = dec_deg - 360 + my_logger.info(f"Receive Goto Command : Ra:{ra_deg} Dec:{dec_deg}") + + if (dwarf_goto_thread_started): + my_logger.info(f"Receive Goto Command : Goto is still Processing Wait...") + else: + goto = True + + # start thread goto command to DWARF II + dwarf_goto_thread_started = True + dwarf_ra_deg = ra_deg; + dwarf_dec_deg = dec_deg; + if (config.VERSION_API == 1): + dwarf_goto_thread = threading.Thread(target=perform_gotoV1, args=(dwarf_ra_deg, dwarf_dec_deg, result_queue)) + else: + dwarf_goto_thread = threading.Thread(target=perform_goto, args=(dwarf_ra_deg, dwarf_dec_deg, result_queue)) + dwarf_goto_thread.start() + + send_data = b'#' + + new_socket.settimeout(10) # Set a timeout of 10 seconds + try: + my_logger.debug(f"Sending ...", send_data) + new_socket.send(send_data) + + raw_data = new_socket.recv(1024) + if not raw_data: + break + # Process raw_data here... + except socket.timeout: + my_logger.info("Send operation timed out.") + except ConnectionResetError: + my_logger.info("Error Connection stops. Closing connection...") + new_socket.close() + break + except KeyboardInterrupt: + my_logger.info("Process interrupted by user. Closing connection...") + new_socket.close() + break + + my_logger.debug("data from Stellarium >>", raw_data) -# create socket -sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -# ensure we can quickly restart server -sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) -# set host and port -sock.bind((config.HOST, config.PORT)) -# set number of client that can be queued -sock.listen(5) + if goto: + if not(dwarf_goto_thread.is_alive()): + my_logger.debug("End of Dwarf Goto") + dwarf_goto_thread_started = False + goto = False + # Retrieve the result from the Queue + result = result_queue.get() -while True: - # create new socket to interact with client - new_socket, addr = sock.accept() - my_logger.debug(f"Connected by {addr}") + # add DWARF II to Stellarium's sky map + if result == "ok": + goto_data = raw_data[1:] - raw_data = new_socket.recv(1024) - if not raw_data: - break + # Create a thread and pass variables to it for next time + dwarf_goto_thread = False - # process data from Stellarium to get RA/Dec - data = process_stellarium_data(raw_data) + if addr: + my_logger.debug(f"Disconnected from Stellarium : {addr}") + else: + my_logger.debug(f"Not connected to Stellarium") - # send goto command to DWARF II - result = perform_goto(data["ra"], data["dec"]) + nbDeconnect -= 1 - # add DWARF II to Stellarium's sky map - if result == "ok": - update_stellarium(data["ra_int"], data["dec_int"], new_socket) + if (nbDeconnect <= 0): + restart = input("Restart? [Y/n]") + + if restart != "Y" and restart != "y": + my_logger.debug("End of Server") + break; + else: + nbDeconnect = 3 - new_socket.close() + except KeyboardInterrupt: + my_logger.info("Process interrupted by user. Exiting...") + processAction = False + finally: + if sock: + sock.close() + my_logger.info("Socket closed.") \ No newline at end of file