Преглед на файлове

Updated module slave commands

xnecas преди 1 седмица
родител
ревизия
852d96e9f4
променени са 1 файла, в които са добавени 9 реда и са изтрити 4 реда
  1. 9 4
      nbus_api/nbus_module_slave.py

+ 9 - 4
nbus_api/nbus_module_slave.py

@@ -367,11 +367,14 @@ class NBusSlaveModule:
     ================================================================================================================
     """
 
-    def start_streaming(self) -> None:
+    def start_streaming(self, send_start: bool) -> None:
         """
         Start data streaming (e.g. auto-cast).
+        :param send_start: flag to determine whether to send start cmd
         """
-        self.cmd_set_module_start()
+        if send_start:
+            self.cmd_set_module_start()
+
         self.__acquire_thread = Thread(target=self.__acquire_callback)
         self.__in_acquisition = True
 
@@ -381,11 +384,13 @@ class NBusSlaveModule:
 
         self.__acquire_thread.start()
 
-    def stop_streaming(self):
+    def stop_streaming(self, send_stop: bool) -> None:
         """
         Stop data streaming (e.g. auto-cast).
+        :param send_stop: flag to determine whether to send start cmd
         """
-        self.cmd_set_module_stop()
+        if send_stop:
+            self.cmd_set_module_stop()
 
         self.__in_acquisition = False