Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • RTIS Dev RTIS Dev
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • RTIS Software
  • RTIS DevRTIS Dev
  • Wiki
  • Home

Home · Changes

Page history
Update home authored Feb 15, 2022 by Wouter Jansen's avatar Wouter Jansen
Hide whitespace changes
Inline Side-by-side
home.md
View page @ 6ddd808b
......@@ -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**
......
Clone repository
  • General Example
  • Classes
    • RTISMeasurement
    • RTISSettings
    • MeasureExternalTriggerQueueThread
    • MeasureExternalTriggerCallbackThread
  • Methods
    • open_connection
    • close_connection
    • set_recording_settings
    • set_processing_settings
    • get_current_settings
    • clear_current_settings
    • get_settings
    • set_settings_from_class
    • get_premade_processing_settings_list
    • get_premade_recording_settings_list
    • get_microphone_layout_list
    • prepare_processing
    • unload_processing
    • get_raw_measurement
    • get_signal_measurement
    • get_processed_measurement
    • process_measurement
    • set_counter
    • set_behaviour
    • get_firmware_version
    • create_measure_external_trigger_queue
    • create_measure_external_trigger_callback
    • create_processing_workers
    • toggle_amplifier
    • toggle_external_triggers
    • reset_device
    • set_log_mode
    • set_custom_logger