gondola 0.12.3__tar.gz → 0.12.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gondola-0.12.3 → gondola-0.12.4}/Cargo.lock +1 -1
- {gondola-0.12.3 → gondola-0.12.4}/Cargo.toml +1 -1
- {gondola-0.12.3 → gondola-0.12.4}/PKG-INFO +4 -1
- {gondola-0.12.3 → gondola-0.12.4}/pyproject.toml +5 -1
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/tof/__init__.py +30 -2
- {gondola-0.12.3 → gondola-0.12.4}/src/constants.rs +1 -1
- {gondola-0.12.3 → gondola-0.12.4}/src/database.rs +78 -1
- {gondola-0.12.3 → gondola-0.12.4}/src/errors.rs +3 -1
- {gondola-0.12.3 → gondola-0.12.4}/src/events/rb_waveform.rs +20 -13
- {gondola-0.12.3 → gondola-0.12.4}/src/events/tof_event.rs +261 -22
- {gondola-0.12.3 → gondola-0.12.4}/src/events/tof_hit.rs +136 -16
- {gondola-0.12.3 → gondola-0.12.4}/src/events.rs +61 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/lib.rs +1 -0
- gondola-0.12.4/src/monitoring/heartbeats/master_trigger_hb.rs +531 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/tof_packet.rs +14 -10
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/algorithms.rs +32 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/analysis_engine.rs +35 -5
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/detector_status.rs +7 -7
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/master_trigger/registers.rs +249 -2
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/master_trigger.rs +236 -9
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/settings.rs +12 -3
- gondola-0.12.3/src/monitoring/heartbeats/master_trigger_hb.rs +0 -329
- {gondola-0.12.3 → gondola-0.12.4}/.gitignore +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/README.md +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/alert-manifest-test.toml +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/benches/bench.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/diesel.toml +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/publish_to_bluejay.sh +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/__init__.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/calibration.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/db.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/gaps_flight.db +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/io/__init__.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/reconstruction/__init__.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/tof/analysis.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/tracker/__init__.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/tracker/analysis.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/visual/__init__.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/visual/tof.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/python/gondola/visual/tracker.py +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/calibration/tof.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/calibration/tracker.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/calibration.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/database/schema.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/events/rb_event.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/events/rb_event_header.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/events/telemetry_event.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/events/tracker_hit.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/caraspace/frame.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/caraspace/reader.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/caraspace/socket_reader.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/caraspace/writer.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/caraspace.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/data_source.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/ipbus.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/parsers.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/root_reader.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/serialization.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/streamers.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/telemetry_reader.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/tof_reader.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io/tof_writer.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/io.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/cpu_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/heartbeats/data_sink_hb.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/heartbeats/event_builder_hb.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/heartbeats.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/ltb_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/mtb_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/pa_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/pb_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/rb_moni_data.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring/run_statistics.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/monitoring.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/bfsw_ack_packet.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/gps_packet.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/magnetometer.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/telemetry_packet.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/telemetry_packet_header.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/telemetry_packet_type.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/tof_packet_type.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/tracker.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets/tracker_header.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/packets.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/prelude.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/python.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/random.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/stats.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/alerts.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/analysis.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/commands.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/config.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/cuts.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/master_trigger/control.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/rb_paddle_id.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/signal_handler.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/thread_control.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof/tof_response.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tof.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tracker/strips.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/tracker.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/src/version.rs +0 -0
- {gondola-0.12.3 → gondola-0.12.4}/tests/test.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gondola
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.4
|
|
4
4
|
Requires-Dist: tqdm>=4.0
|
|
5
5
|
Requires-Dist: numpy>=2.3
|
|
6
6
|
Requires-Dist: matplotlib>=3.10
|
|
@@ -16,6 +16,9 @@ Author-email: "J.A.Stoessl, G.Tytus" <stoessl@hawaii.edu>
|
|
|
16
16
|
License: GPLV3
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
19
|
+
Project-URL: Homepage, https://github.com/GAPS-Collab/gaps-online-software
|
|
20
|
+
Project-URL: Repository, https://github.com/GAPS-Collab/gaps-online-software
|
|
21
|
+
Project-URL: Documentation, https://gaps-collab.github.io/gaps-online-software/
|
|
19
22
|
|
|
20
23
|
# GONDOLA - python wrapper for gaps-online-software
|
|
21
24
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = 'gondola'
|
|
3
|
-
#version = "0.11.1"
|
|
4
3
|
dynamic = ['version']
|
|
5
4
|
description = "GAPS Online and Offline Analysis software"
|
|
6
5
|
authors = [{ name = "J.A.Stoessl, G.Tytus", email = "stoessl@hawaii.edu" }]
|
|
@@ -24,6 +23,11 @@ dependencies = [
|
|
|
24
23
|
requires = ["maturin>=1.0,<2.0"]
|
|
25
24
|
build-backend = "maturin"
|
|
26
25
|
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/GAPS-Collab/gaps-online-software"
|
|
28
|
+
Repository = "https://github.com/GAPS-Collab/gaps-online-software"
|
|
29
|
+
Documentation = "https://gaps-collab.github.io/gaps-online-software/"
|
|
30
|
+
|
|
27
31
|
[tool.maturin]
|
|
28
32
|
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
|
|
29
33
|
#features = ["pyo3/extension-module"]
|
|
@@ -11,18 +11,46 @@ RBPaddleID.__module__ = __name__
|
|
|
11
11
|
RBPaddleID.__name__ = "RBPaddleID"
|
|
12
12
|
#RBPaddleID.__doc__ = _gc.tof.RBPaddleID.__doc__
|
|
13
13
|
TofDetectorStatus = _gc.tof.TofDetectorStatus
|
|
14
|
+
TofDetectorStatus.__module__ = __name__
|
|
15
|
+
TofDetectorStatus.__name__ = 'TofDetectorStatus'
|
|
16
|
+
|
|
17
|
+
# enums
|
|
14
18
|
TofCommandCode = _gc.tof.TofCommandCode
|
|
15
|
-
TofCommand = _gc.tof.TofCommand
|
|
16
|
-
TofOperationMode = _gc.tof.TofOperationMode
|
|
17
19
|
BuildStrategy = _gc.tof.BuildStrategy
|
|
20
|
+
TofOperationMode = _gc.tof.TofOperationMode
|
|
21
|
+
|
|
22
|
+
TofCommand = _gc.tof.TofCommand
|
|
23
|
+
TofCommand.__module__ = __name__
|
|
24
|
+
TofCommand.__name__ = "TofCommand"
|
|
25
|
+
|
|
18
26
|
PreampBiasConfig = _gc.tof.PreampBiasConfig
|
|
27
|
+
PreampBiasConfig.__module__ = __name__
|
|
28
|
+
PreampBiasConfig.__name__ = "PreampBiasConfig"
|
|
29
|
+
|
|
19
30
|
RBChannelMaskConfig = _gc.tof.RBChannelMaskConfig
|
|
31
|
+
RBChannelMaskConfig.__module__ = __name__
|
|
32
|
+
RBChannelMaskConfig.__name__ = "RBChannelMaskConfig"
|
|
33
|
+
|
|
20
34
|
TriggerConfig = _gc.tof.TriggerConfig
|
|
35
|
+
TriggerConfig.__module__ = __name__
|
|
36
|
+
TriggerConfig.__name__ = "TriggerConfig"
|
|
37
|
+
|
|
21
38
|
TofRunConfig = _gc.tof.TofRunConfig
|
|
39
|
+
TofRunConfig.__module__ = __name__
|
|
40
|
+
TofRunConfig.__name__ = "TofRunConfig"
|
|
41
|
+
|
|
42
|
+
|
|
22
43
|
TofCuts = _gc.tof.TofCuts
|
|
44
|
+
TofCuts.__module__ = __name__
|
|
45
|
+
TofCuts.__name__ = 'TofCuts'
|
|
46
|
+
|
|
23
47
|
to_board_id_string = _gc.tof.to_board_id_string
|
|
24
48
|
TofAnalysis = analysis.TofAnalysis
|
|
25
49
|
|
|
50
|
+
MasterTrigger = _gc.tof.MasterTrigger
|
|
51
|
+
MasterTrigger.__module__ = __name__
|
|
52
|
+
MasterTrigger.__name__ = 'MasterTrigger'
|
|
53
|
+
|
|
26
54
|
## command factories
|
|
27
55
|
#start_run = _gc.tof.start_run
|
|
28
56
|
#start_run.__module__ = __name__
|
|
@@ -71,7 +71,7 @@ pub const LIFTOF_LOGO_SHOW : &str = "
|
|
|
71
71
|
>> with undying support from the Hawaiian islands \u{1f30a}\u{1f308}\u{1f965}\u{1f334}
|
|
72
72
|
|
|
73
73
|
* Documentation
|
|
74
|
-
==> GitHub https://github.com/GAPS-Collab/gaps-online-software/tree/
|
|
74
|
+
==> GitHub https://github.com/GAPS-Collab/gaps-online-software/tree/PAKII-0.11
|
|
75
75
|
==> API docs https://gaps-collab.github.io/gaps-online-software/
|
|
76
76
|
|
|
77
77
|
";
|
|
@@ -11,9 +11,11 @@ use diesel::prelude::*;
|
|
|
11
11
|
mod schema;
|
|
12
12
|
|
|
13
13
|
use schema::tof_db_rat::dsl::*;
|
|
14
|
-
//use schema::tof_db_dsicard::dsl::*;
|
|
15
14
|
|
|
15
|
+
/// Low gain/LTB connections to paddle ID
|
|
16
16
|
pub type DsiJChPidMapping = HashMap<u8, HashMap<u8, HashMap<u8, (u8, u8)>>>;
|
|
17
|
+
/// RB ID and RB Ch to paddle ID mapping
|
|
18
|
+
pub type RbChPidMapping = HashMap<u8, HashMap<u8, u8>>;
|
|
17
19
|
|
|
18
20
|
/// Connect to a database at a given location
|
|
19
21
|
pub fn connect_to_db_path(db_path : &str) -> Result<diesel::SqliteConnection, ConnectionError> {
|
|
@@ -138,6 +140,81 @@ pub fn get_linkid_rbid_map(rbs : &Vec<ReadoutBoard>) -> HashMap<u8, u8>{
|
|
|
138
140
|
|
|
139
141
|
//---------------------------------------------------------------------
|
|
140
142
|
|
|
143
|
+
/// Create a map for rbid, ch -> paddle id. This is only for the A
|
|
144
|
+
/// side and will not have an entry in case the given RB channel
|
|
145
|
+
/// is connected to the B side of the paddle
|
|
146
|
+
pub fn get_rb_ch_pid_a_map() -> Option<RbChPidMapping> {
|
|
147
|
+
let paddles = TofPaddle::all()?;
|
|
148
|
+
let mut mapping = RbChPidMapping::new();
|
|
149
|
+
for rbid in 1..51 {
|
|
150
|
+
let mut chmap = HashMap::<u8, u8>::new();
|
|
151
|
+
for ch in 1..9 {
|
|
152
|
+
chmap.insert(ch,0);
|
|
153
|
+
}
|
|
154
|
+
mapping.insert(rbid,chmap);
|
|
155
|
+
}
|
|
156
|
+
for pdl in paddles {
|
|
157
|
+
let rb_id = pdl.rb_id as u8;
|
|
158
|
+
let ch_a = pdl.rb_chA as u8;
|
|
159
|
+
let pid = pdl.paddle_id as u8;
|
|
160
|
+
*mapping.get_mut(&rb_id).unwrap().get_mut(&ch_a).unwrap() = pid;
|
|
161
|
+
}
|
|
162
|
+
Some(mapping)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//---------------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
/// Create a map for rbid, ch -> paddle id. This is only for the B
|
|
168
|
+
/// side and will not have an entry in case the given RB channel
|
|
169
|
+
/// is connected to the A side of the paddle
|
|
170
|
+
pub fn get_rb_ch_pid_b_map() -> Option<RbChPidMapping> {
|
|
171
|
+
let mut mapping = RbChPidMapping::new();
|
|
172
|
+
let paddles = TofPaddle::all()?;
|
|
173
|
+
for rbid in 1..51 {
|
|
174
|
+
let mut chmap = HashMap::<u8, u8>::new();
|
|
175
|
+
for ch in 1..9 {
|
|
176
|
+
chmap.insert(ch,0);
|
|
177
|
+
}
|
|
178
|
+
mapping.insert(rbid,chmap);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
for pdl in paddles {
|
|
182
|
+
let rb_id = pdl.rb_id as u8;
|
|
183
|
+
let ch_b = pdl.rb_chB as u8;
|
|
184
|
+
let pid = pdl.paddle_id as u8;
|
|
185
|
+
*mapping.get_mut(&rb_id).unwrap().get_mut(&ch_b).unwrap() = pid;
|
|
186
|
+
}
|
|
187
|
+
Some(mapping)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//---------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
/// Create a map for rbid, ch -> paddle id.
|
|
193
|
+
///
|
|
194
|
+
/// This version is oblivious to the paddle ends
|
|
195
|
+
pub fn get_rb_ch_pid() -> Option<RbChPidMapping> {
|
|
196
|
+
let paddles = TofPaddle::all()?;
|
|
197
|
+
let mut mapping = RbChPidMapping::new();
|
|
198
|
+
for rbid in 1..51 {
|
|
199
|
+
let mut chmap = HashMap::<u8, u8>::new();
|
|
200
|
+
for ch in 1..9 {
|
|
201
|
+
chmap.insert(ch,0);
|
|
202
|
+
}
|
|
203
|
+
mapping.insert(rbid,chmap);
|
|
204
|
+
}
|
|
205
|
+
for pdl in paddles {
|
|
206
|
+
let rb_id = pdl.rb_id as u8;
|
|
207
|
+
let ch_a = pdl.rb_chA as u8;
|
|
208
|
+
let ch_b = pdl.rb_chB as u8;
|
|
209
|
+
let pid = pdl.paddle_id as u8;
|
|
210
|
+
*mapping.get_mut(&rb_id).unwrap().get_mut(&ch_a).unwrap() = pid;
|
|
211
|
+
*mapping.get_mut(&rb_id).unwrap().get_mut(&ch_b).unwrap() = pid;
|
|
212
|
+
}
|
|
213
|
+
Some(mapping)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
//---------------------------------------------------------------------
|
|
217
|
+
|
|
141
218
|
/// Get all rb ids from paddles which are stored in the
|
|
142
219
|
/// database
|
|
143
220
|
#[cfg_attr(feature="pybindings", pyfunction)]
|
|
@@ -23,7 +23,8 @@ pub enum SerializationError {
|
|
|
23
23
|
TomlDecodingError,
|
|
24
24
|
Disconnected,
|
|
25
25
|
ObjectNotFound,
|
|
26
|
-
UnsupportedVersion
|
|
26
|
+
UnsupportedVersion,
|
|
27
|
+
WrongProtocolVersion
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
impl SerializationError {
|
|
@@ -45,6 +46,7 @@ impl SerializationError {
|
|
|
45
46
|
SerializationError::Disconnected => "Disconnected",
|
|
46
47
|
SerializationError::ObjectNotFound => "ObjectNotFound",
|
|
47
48
|
SerializationError::UnsupportedVersion => "UnsupportedVersion",
|
|
49
|
+
SerializationError::WrongProtocolVersion => "WrongProtoclVersion",
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
use crate::prelude::*;
|
|
5
5
|
|
|
6
|
+
use std::mem;
|
|
7
|
+
|
|
6
8
|
/// Waveform container for Tof waveforms
|
|
7
9
|
/// This holds the waveforms for both
|
|
8
10
|
/// paddle ends. Fields are available to
|
|
@@ -220,24 +222,28 @@ impl TofPackable for RBWaveform {
|
|
|
220
222
|
impl Serialization for RBWaveform {
|
|
221
223
|
const HEAD : u16 = 43690; //0xAAAA
|
|
222
224
|
const TAIL : u16 = 21845; //0x5555
|
|
223
|
-
|
|
225
|
+
const SIZE : usize = 13 + (4*NWORDS);
|
|
226
|
+
|
|
224
227
|
fn from_bytestream(stream : &Vec<u8>, pos : &mut usize)
|
|
225
228
|
-> Result<Self, SerializationError> {
|
|
229
|
+
Self::verify_fixed(stream, pos)?;
|
|
226
230
|
let mut wf = RBWaveform::new();
|
|
227
|
-
if parse_u16(stream, pos) != Self::HEAD {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
+
//if parse_u16(stream, pos) != Self::HEAD {
|
|
232
|
+
// error!("The given position {} does not point to a valid header signature of {}", pos, Self::HEAD);
|
|
233
|
+
// return Err(SerializationError::HeadInvalid {});
|
|
234
|
+
//}
|
|
231
235
|
wf.event_id = parse_u32(stream, pos);
|
|
232
|
-
wf.rb_id = parse_u8
|
|
233
|
-
wf.rb_channel_a = parse_u8
|
|
234
|
-
wf.rb_channel_b = parse_u8
|
|
236
|
+
wf.rb_id = parse_u8(stream, pos);
|
|
237
|
+
wf.rb_channel_a = parse_u8(stream, pos);
|
|
238
|
+
wf.rb_channel_b = parse_u8(stream, pos);
|
|
235
239
|
wf.stop_cell = parse_u16(stream, pos);
|
|
236
240
|
wf.paddle_id = parse_u8 (stream, pos);
|
|
237
241
|
if stream.len() < *pos+2*NWORDS {
|
|
238
242
|
return Err(SerializationError::StreamTooShort);
|
|
239
243
|
}
|
|
240
244
|
let data_a = &stream[*pos..*pos+2*NWORDS];
|
|
245
|
+
//println!("{} data_a stack size", mem::sizeof(data_a));
|
|
246
|
+
|
|
241
247
|
wf.adc_a = u8_to_u16(data_a);
|
|
242
248
|
*pos += 2*NWORDS;
|
|
243
249
|
if stream.len() < *pos+2*NWORDS {
|
|
@@ -250,6 +256,7 @@ impl Serialization for RBWaveform {
|
|
|
250
256
|
error!("The given position {} does not point to a tail signature of {}", pos, Self::TAIL);
|
|
251
257
|
return Err(SerializationError::TailInvalid);
|
|
252
258
|
}
|
|
259
|
+
*pos +=2;
|
|
253
260
|
Ok(wf)
|
|
254
261
|
}
|
|
255
262
|
|
|
@@ -467,11 +474,11 @@ impl FromRandom for RBWaveform {
|
|
|
467
474
|
let mut wf = Self::new();
|
|
468
475
|
let mut rng = rand::rng();
|
|
469
476
|
wf.event_id = rng.random::<u32>();
|
|
470
|
-
wf.rb_id = rng.
|
|
471
|
-
wf.rb_channel_a = rng.
|
|
472
|
-
wf.rb_channel_b = rng.
|
|
473
|
-
wf.stop_cell = rng.
|
|
474
|
-
wf.paddle_id = rng.random::<u8>();
|
|
477
|
+
wf.rb_id = rng.random_range(1..50);
|
|
478
|
+
wf.rb_channel_a = rng.random_range(1..9);
|
|
479
|
+
wf.rb_channel_b = rng.random_range(1..9);
|
|
480
|
+
wf.stop_cell = rng.random_range(0..1024);
|
|
481
|
+
//wf.paddle_id = rng.random::<u8>();
|
|
475
482
|
let random_numbers_a: Vec<u16> = (0..NWORDS).map(|_| rng.random()).collect();
|
|
476
483
|
wf.adc_a = random_numbers_a;
|
|
477
484
|
let random_numbers_b: Vec<u16> = (0..NWORDS).map(|_| rng.random()).collect();
|