Commit 29d8867d authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Merge branch 'v2024_rc' of gitlab-ssh.irstea.fr:reversaal/OhmPi into v2024_rc

Showing with 30 additions and 3 deletions
+30 -3
......@@ -40,6 +40,10 @@ Contents:
source_rst/V2024.x.x/V2024
source_rst/api
source_rst/developing_hardware_components.rst
source_
source_rst/gallery
source_rst/archived_version
......
......@@ -30,7 +30,8 @@ mosquitto_sub -h raspberrypi.local -t ohmpi_0001/ctrl
<button id='runBtn' type="button" class="btn btn-primary">&#9654</button>
<button id='stopBtn' type="button" class="btn btn-warning">&#9724</button>
<!-- upload button for csv which display the table ABMN -->
<button id="removeDataBtn" type="button" class="btn btn-danger">Clear data</button>
<!-- <button id="removeDataBtn" type="button" class="btn btn-danger">Clear data</button> -->
<button id="rmDataModal" type="button" class="btn btn-danger" data-toggle="modal" data-target="#rmModal">Clear data</button>
<button id="getDataBtn" type="button" class="btn btn-info">Get data</button>
<div class="form-check">
<input id="dataRetrievalCheck" class="form-check-input" type="checkbox" value="">
......@@ -149,6 +150,28 @@ mosquitto_sub -h raspberrypi.local -t ohmpi_0001/ctrl
</div>
</div>
</div>
<!-- Modal for removing data -->
<div class="modal fade" id="rmModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Data clearing</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Are you sure you want to remove all data?</p>
<p>Data can be downloaded as .zip at the bottom of the page.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button id="removeDataBtn" type="button" class="btn btn-danger">Clear data</button>
</div>
</div>
</div>
</div>
<footer>v0.3.0</footer>
</div>
......
......@@ -276,7 +276,7 @@ class OhmPi(object):
headers[i] = 'R [Ohm]'
icols = list(np.where(np.in1d(headers, ['A', 'B', 'M', 'N', 'R [Ohm]']))[0])
data = np.loadtxt(os.path.join(ddir, fname), delimiter=',',
skiprows=1, usecols=icols, ndmin=2)
skiprows=1, usecols=icols)
data = data[None, :] if len(data.shape) == 1 else data
ddic[fname.replace('.csv', '')] = {
'a': data[:, 0].astype(int).tolist(),
......@@ -325,7 +325,7 @@ class OhmPi(object):
Array of shape (number quadrupoles * 4).
"""
self.exec_logger.debug(f'Loading sequence {filename}')
sequence = np.loadtxt(filename, delimiter=" ", dtype=np.uint32) # load quadrupole file
sequence = np.loadtxt(filename, delimiter=" ", dtype=np.uint32, ndmin=2) # load quadrupole file
if sequence is not None:
self.exec_logger.debug(f'Sequence of {sequence.shape[0]:d} quadrupoles read.')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment