import socket
import threading
from pymodbus.client.tcp import ModbusTcpClient

class HmiRequest:
    is_connected: bool
    def __init__(self) -> None: ...
    def close(self) -> None: ...
    @staticmethod
    def get_from_id(msg_id: str) -> str: ...
    def exec_cmd(self, cmd: str, **kwargs): ...

class ModbusRequest:
    def __init__(self) -> None: ...
    def r_clear_alarm(self) -> None: ...
    def r_reset_estop(self) -> None: ...
    def r_reset_estop_clear_alarm(self) -> None: ...
    def r_motor_on(self) -> None: ...
    def r_motor_off(self) -> None: ...
    def r_motor_on_off(self, action: bool): ...
    def r_motoron_pp2main_start(self) -> None: ...
    def r_motoron_start(self) -> None: ...
    def r_pulse_motoroff(self) -> None: ...
    def r_pp2main(self) -> None: ...
    def r_program_start(self) -> None: ...
    def r_program_stop(self) -> None: ...
    def r_program_start_stop(self, action: bool): ...
    def r_set_program_speed(self, speed: int): ...
    def r_soft_estop(self, action: bool): ...
    def r_switch_auto_motoron(self) -> None: ...
    def r_switch_auto(self) -> None: ...
    def r_switch_manual(self) -> None: ...
    def r_switch_auto_manual(self, action: bool): ...
    def r_reduced_mode(self, action: bool): ...
    def r_switch_safe_region(self, idx: int, enable: bool): ...
    @property
    def w_alarm_state(self): ...
    @property
    def w_sta_collision(self): ...
    @property
    def w_sta_collision_alarm(self): ...
    @property
    def w_sta_collision_open(self): ...
    @property
    def w_controller_is_running(self): ...
    @property
    def w_encoder_low_battery(self): ...
    @property
    def w_sta_error_code(self): ...
    @property
    def w_sta_estop(self): ...
    @property
    def w_sta_heartbeat(self): ...
    @property
    def w_sta_home(self): ...
    @property
    def w_sta_motor(self): ...
    @property
    def w_sta_operation_mode(self): ...
    @property
    def w_sta_program(self): ...
    @property
    def w_sta_program_full(self): ...
    @property
    def w_sta_program_not_run(self): ...
    @property
    def w_sta_program_reset(self): ...
    @property
    def w_sta_program_speed(self): ...
    @property
    def w_sta_reduce_mode(self): ...
    @property
    def w_sta_robot_is_busy(self): ...
    @property
    def w_sta_robot_is_moving(self): ...
    @property
    def w_safe_door_state(self): ...
    @property
    def w_sta_safe_jnt_pos(self): ...
    @property
    def w_sta_soft_estop(self): ...
    @property
    def w_sta_safe_region(self): ...
    @property
    def w_sta_on_path(self): ...
    @property
    def w_sta_near_path(self): ...
    @property
    def w_sta_cart_pose(self) -> list: ...
    @property
    def w_sta_cart_vel(self) -> list: ...
    @property
    def w_sta_jnt_pose(self) -> list: ...
    @property
    def w_sta_jnt_vel(self) -> list: ...
    @property
    def w_sta_tcp_pose(self) -> list: ...
    @property
    def w_sta_tcp_vel(self) -> list: ...
    @property
    def w_sta_tcp_vel_mag(self): ...
    def io_write_coils(self, addr, value: bool): ...
    def io_read_coils(self): ...
    def io_read_discretes(self): ...

class EcRequest:
    def __init__(self) -> None: ...
    def motor_on(self): ...
    def motor_off(self): ...
    def pp_to_main(self): ...
    def program_start(self): ...
    def program_stop(self): ...
    def clear_alarm(self): ...
    def switch_operation_auto(self): ...
    def switch_operation_manual(self): ...
    def open_drag_mode(self): ...
    def close_drag_mode(self): ...
    def get_project_list(self): ...
    def get_current_project(self): ...
    def load_project(self, project_name): ...
    def estop_reset(self): ...
    def estopreset_and_clearalarm(self): ...
    def motoron_pp2main_start(self): ...
    def motoron_start(self): ...
    def pause_motoroff(self): ...
    def set_program_speed(self, speed: int = 20): ...
    def set_soft_estop(self, enable: str): ...
    def switch_auto_motoron(self): ...
    def open_safe_region(self, number: int): ...
    def close_safe_region(self, number: int): ...
    def open_reduced_mode(self): ...
    def close_reduced_mode(self): ...
    def setdo_value(self, do_name: str, do_value: str): ...
    def set_robot_time(self, robot_time: str = ...): ...
    @property
    def motor_on_state(self): ...
    @property
    def robot_running_state(self): ...
    @property
    def estop_state(self): ...
    @property
    def operation_mode(self): ...
    @property
    def home_state(self): ...
    @property
    def fault_state(self): ...
    @property
    def collision_state(self): ...
    @property
    def task_state(self): ...
    @property
    def get_cart_pos(self): ...
    @property
    def get_joint_pos(self): ...
    @property
    def get_joint_vel(self): ...
    @property
    def get_joint_trq(self): ...
    @property
    def reduced_mode_state(self): ...
    def get_io_state(self, io_list: str): ...
    @property
    def alarm_state(self): ...
    @property
    def collision_alarm_state(self): ...
    @property
    def collision_open_state(self): ...
    @property
    def controller_is_running(self): ...
    @property
    def encoder_low_battery_state(self): ...
    @property
    def robot_error_code(self): ...
    @property
    def rl_pause_state(self): ...
    @property
    def program_reset_state(self): ...
    @property
    def program_speed_value(self): ...
    @property
    def robot_is_busy(self): ...
    @property
    def robot_is_moving(self): ...
    @property
    def safe_door_state(self): ...
    @property
    def soft_estop_state(self): ...
    @property
    def get_cart_vel(self): ...
    @property
    def get_tcp_pos(self): ...
    @property
    def get_tcp_vel(self): ...
    @property
    def get_tcp_vel_mag(self): ...
    @property
    def ext_estop_state(self): ...
    @property
    def hand_estop_state(self): ...
    @property
    def sta_on_path(self): ...
    @property
    def sta_near_path(self): ...

class PreDos:
    def __init__(self) -> None: ...
    def push_prj_to_server(self, prj_file: str): ...
    def pull_prj_from_server(self, prj_name: str, local_prj_path: str): ...
    def push_file_to_server(self, local_file: str, server_file: str): ...
    def pull_file_from_server(self, server_file: str, local_file: str): ...

class RobotInit:
    def __init__(self, hr: HmiRequest, pd: PreDos) -> None: ...
    def robot_init(self) -> None: ...
    def fw_updater(self, fw_file: str): ...

class UpgradeRequest:
    def __init__(self) -> None: ...
    def erase_cfg(self) -> None: ...
    def clear_rubbish(self) -> None: ...
    def soft_reboot(self) -> None: ...
    def version_query(self) -> None: ...
    def robot_reboot(self) -> None: ...
    def backup_origin(self) -> None: ...
    def origin_recovery(self) -> None: ...

class PlotTrajectory:
    def __init__(self, hr: HmiRequest, md: ModbusRequest, prj_name: str, tasks: list, curve_name: str = 'hw_cart_pos_feedback_tcp_in_world') -> None: ...
    def draw_traj(self) -> None: ...
