... | ... | @@ -215,134 +215,6 @@ By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) |
|
|
|
|
|
Use [`create_measure_external_trigger_queue(dataQueue)`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#create_measure_external_trigger_queue) to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a queue to save the measurement to and assign it to the process.
|
|
|
|
|
|
```python
|
|
|
from multiprocessing import Manager
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
|
|
|
manager = Manager()
|
|
|
dataQueue = manager.Queue()
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_queue(dataQueue)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_configuration</b>(<i>self, dataQueue, settings, debugCounter, behaviour, id, localLogger, debug</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L586">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Set the dataQueue to be used by the process to store the incoming [`RTISMeasurement`](https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement) objects on.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>dataQueue : <i>multiprocessing.Manager.Queue</i></b>
|
|
|
<p class="attr">
|
|
|
This is the data queue that will be used to store the RTISMeasurement objects on.
|
|
|
</p>
|
|
|
<b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for recording and processing that needs to be set.
|
|
|
</p>
|
|
|
<b>debugCounter : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The internal counter to use for indexing measurements in debug mode.
|
|
|
</p>
|
|
|
<b>mode : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The behaviour mode chosen. 0 = passive 1 = active
|
|
|
</p>
|
|
|
<b>id : <i>String</i></b>
|
|
|
<p class="attr">
|
|
|
The identifier to use for the measurements.
|
|
|
</p>
|
|
|
<b>customLogger : <i>logging.Logger</i></b>
|
|
|
<p class="attr">
|
|
|
The custom logger to be used by RTIS Dev.
|
|
|
</p>
|
|
|
<b>debug : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The toggle of the debug mode where a RTIS device is simulated using pre-recorded data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L623">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement process gracefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L630">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the process if it should be stopped or not.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L636">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main process function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
## **MeasureExternalTriggerCallbackThread**
|
|
|
|
|
|
<p class="func-header">
|
... | ... | @@ -357,141 +229,6 @@ By default using a `signal.SIGINT` exit (ex. using <kbd>CTRL</kbd>+<kbd>C</kbd>) |
|
|
|
|
|
Use `create_measure_external_trigger_callback(callback)` to make an easy to use the class.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
#### Examples
|
|
|
|
|
|
Create a callback to save the measurement to disk.
|
|
|
|
|
|
```python
|
|
|
import rtisdev
|
|
|
|
|
|
rtisdev.open_connection()
|
|
|
rtisdev.set_recording_settings(premade="default_25_50")
|
|
|
rtisdev.set_processing_settings(premade="2D_5m_181")
|
|
|
|
|
|
index = 0
|
|
|
|
|
|
def save_callback(measurement=None):
|
|
|
if measurement != None:
|
|
|
if measurement.rawData is not None:
|
|
|
data_sonar = measurement.rawData.tobytes()
|
|
|
file_handle_data = open(str(index) + ".bin","wb")
|
|
|
file_handle_data.write(data_sonar)
|
|
|
file_handle_data.close()
|
|
|
index = index + 1
|
|
|
|
|
|
measure_thread = rtisdev.create_measure_external_trigger_callback(save_callback)
|
|
|
measure_thread.start()
|
|
|
measure_thread.join()
|
|
|
```
|
|
|
|
|
|
#### Methods
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>set_configuration</b>(<i>self, callback, settings, debugCounter, behaviour, id, localLogger, debug</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L737">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
<tr class="field">
|
|
|
<th class="field-name"><b>Parameters:</b></td>
|
|
|
<td class="field-body" width="100%"><b>callback : <i>method with one argument (RTISMeasurement)</i></b>
|
|
|
<p class="attr">
|
|
|
This is the method that will be used as a callback when a new measurement is triggered by the external trigger. This function should only require one argument, the <a href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/wikis/home#rtismeasurement"><code>RTISMeasurement</code></a> object containing the measurement data.
|
|
|
</p>
|
|
|
<b>settings : <i>RTISSettings</i></b>
|
|
|
<p class="attr">
|
|
|
The complete class containing all RTIS settings for recording and processing that needs to be set.
|
|
|
</p>
|
|
|
<b>debugCounter : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The internal counter to use for indexing measurements in debug mode.
|
|
|
</p>
|
|
|
<b>mode : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The behaviour mode chosen. 0 = passive 1 = active
|
|
|
</p>
|
|
|
<b>id : <i>String</i></b>
|
|
|
<p class="attr">
|
|
|
The identifier to use for the measurements.
|
|
|
</p>
|
|
|
<b>customLogger : <i>logging.Logger</i></b>
|
|
|
<p class="attr">
|
|
|
The custom logger to be used by RTIS Dev.
|
|
|
</p>
|
|
|
<b>debug : <i>int</i></b>
|
|
|
<p class="attr">
|
|
|
The toggle of the debug mode where a RTIS device is simulated using pre-recorded data.
|
|
|
</p></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stop_thread</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L774">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Stop the measurement process gracefully.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>stopped</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L781">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Get status of the process if it should be stopped or not.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="func-header">
|
|
|
<i></i> <b>run</b>(<i>self</i>) <a class="src-href" target="_blank" href="https://cosysgit.uantwerpen.be/rtis-software/rtisdev/-/blob/master/rtisdev/RTISDev.py#L787">[source]</a>
|
|
|
</p>
|
|
|
|
|
|
Main process function to run continuously. Should not be used. Use `start()` instead.
|
|
|
|
|
|
<table class="docutils field-list field-table" frame="void" rules="none">
|
|
|
<col class="field-name" />
|
|
|
<col class="field-body" />
|
|
|
<tbody valign="top">
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
# **Methods**
|
|
|
|
|
|
## **open_connection**
|
... | ... | |