minor fix

This commit is contained in:
2025-09-05 17:19:04 +08:00
parent 33184f1ffb
commit 98637a3d03
4 changed files with 5 additions and 5 deletions

View File

@@ -856,7 +856,7 @@ class PreDos(object):
class RobotInit(object): class RobotInit(object):
def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str): def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str = ""):
self.hr: HmiRequest = hr self.hr: HmiRequest = hr
self.pd: PreDos = pd self.pd: PreDos = pd
self.conf_path: str = conf_path self.conf_path: str = conf_path
@@ -876,9 +876,9 @@ class RobotInit(object):
if self.conf_path == "": if self.conf_path == "":
self.conf_path = f"{clibs.base_path}/assets/confs" self.conf_path = f"{clibs.base_path}/assets/confs"
config_files = [ config_files = [
f"{self.conf_path}/fieldbus_device.json", f"{clibs.base_path}/assets/confs/fieldbus_device.json",
f"{self.conf_path}/registers.json", f"{self.conf_path}/registers.json",
f"{self.conf_path}/assets/confs/registers.xml" f"{self.conf_path}/registers.xml"
] ]
for config_file in config_files: for config_file in config_files:
filename = os.path.basename(config_file) filename = os.path.basename(config_file)

View File

@@ -212,7 +212,7 @@ class PreDos:
def pull_file_from_server(self, server_file: str, local_file: str): ... def pull_file_from_server(self, server_file: str, local_file: str): ...
class RobotInit: class RobotInit:
def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str) -> None: ... def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str = '') -> None: ...
def robot_init(self) -> None: ... def robot_init(self) -> None: ...
def fw_updater(self, fw_file: str): ... def fw_updater(self, fw_file: str): ...

View File

@@ -237,7 +237,7 @@ class RobotInit:
hr: HmiRequest hr: HmiRequest
pd: PreDos pd: PreDos
conf_path: str conf_path: str
def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str) -> None: ... def __init__(self, hr: HmiRequest, pd: PreDos, conf_path: str = '') -> None: ...
def robot_init(self) -> None: ... def robot_init(self) -> None: ...
def fw_updater(self, fw_file: str): ... def fw_updater(self, fw_file: str): ...