diff --git a/.gitignore b/.gitignore index f94999d..dccff45 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ venv/ code/__pycache__ code/testbench.py assets/logs/ -assets/configs/io_device_XBC_* \ No newline at end of file +assets/configs/io_device_XBC_* +assets/json/safety.safety_area.set_param.json \ No newline at end of file diff --git a/assets/json/safety_area.set_param.json b/assets/json/safety_area.set_param.json deleted file mode 100644 index cb354d3..0000000 --- a/assets/json/safety_area.set_param.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "s": { - "box": { - "Lx": 0.0, - "Ly": 0.0, - "Lz": 0.0, - "direction": true, - "ori": { - "euler": { - "a": 0.0, - "b": 0.0, - "c": 0.0 - }, - "quaternion": { - "q1": 0.0, - "q2": 0.0, - "q3": 0.0, - "q4": 0.0 - } - }, - "pos": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - } - }, - "enable": false, - "id": 0, - "name": "region1", - "plane": { - "direction": true, - "point": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "vector": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - } - }, - "shape": 0, - "shared_bind_di": "", - "shared_bind_do": "", - "sphere": { - "ori": { - "euler": { - "a": 0.0, - "b": 0.0, - "c": 0.0 - }, - "quaternion": { - "q1": 0.0, - "q2": 0.0, - "q3": 0.0, - "q4": 0.0 - } - }, - "pos": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "radius": 0.0 - }, - "state": true, - "trigger": 0, - "type": 0, - "vertebral": { - "high": 0.0, - "ori": { - "euler": { - "a": 0.0, - "b": 0.0, - "c": 0.0 - }, - "quaternion": { - "q1": 0.0, - "q2": 0.0, - "q3": 0.0, - "q4": 0.0 - } - }, - "pos": { - "x": 0.0, - "y": 0.0, - "z": 0.0 - }, - "radius": 0.0 - } - } -} \ No newline at end of file diff --git a/code/openapi.py b/code/openapi.py index 10d0fa1..8e7d449 100644 --- a/code/openapi.py +++ b/code/openapi.py @@ -1765,9 +1765,10 @@ class HmiRequest(object): for _ in keys: if _ in kwargs.keys(): res[_] = kwargs[_] - with open(f"{clibs.PREFIX}/json/safety_area.set_param.json", mode="w", encoding="utf-8") as f: - dump({"s": res}, f, indent=4) - self.execution("safety_area.set_param", protocol_flag=1) + with open(f"{clibs.PREFIX}/json/safety.safety_area.set_param.json", mode="w", encoding="utf-8") as f: + dump({"c": {"safety.safety_area.set_param": res}}, f, indent=4) + self.execution("safety.safety_area.set_param", protocol_flag=1) + self.execution("safety.safety_area.safety_area_enable", protocol_flag=1, id=id, enable=enable) @property def get_filtered_error_code(self):