diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-18 22:15:38 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-18 22:15:38 -0500 |
commit | 3a5f4f4d517e854fb9b4e0f723c9f6de91f812b5 (patch) | |
tree | b6df3388963a3862b9450062e7ac1844441af7ca /qolab/data | |
parent | c28b041949f96b5391a1f64238b38ca7c2a0c4f6 (diff) | |
download | qolab-3a5f4f4d517e854fb9b4e0f723c9f6de91f812b5.tar.gz qolab-3a5f4f4d517e854fb9b4e0f723c9f6de91f812b5.zip |
united trace initialization
Diffstat (limited to 'qolab/data')
-rw-r--r-- | qolab/data/trace.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/qolab/data/trace.py b/qolab/data/trace.py index 4c42cd0..d187575 100644 --- a/qolab/data/trace.py +++ b/qolab/data/trace.py @@ -14,12 +14,17 @@ class Trace: def __init__(self, label): self.config = {} self.config['label'] = label - self.config['unit'] = None self.config['tags'] = {} self.item_format='.15e' - self.values = np.empty(0) + self.last_saved_pos = 0 + self._trace_specific_init() self.clear_data() + def _trace_specific_init(self): + self.config['unit'] = None + self.values = np.empty(0) + self.last_saved_pos = 0 + def clear_last_saved_pos(self): self.last_saved_pos = 0 @@ -61,13 +66,11 @@ class Trace: class TraceXY(Trace): def __init__(self, label): - self.config = {} - self.config['label'] = label - self.item_format='.15e' - self.config['tags'] = {} + super().__init__(label) + + def _trace_specific_init(self): self.x = None self.y = None - self.clear_data() def clear_data(self): self.clear_last_saved_pos() @@ -109,13 +112,11 @@ class TraceXY(Trace): class TraceSetSameX(Trace): def __init__(self, label): - self.config = {} - self.config['label'] = label - self.item_format='.15e' - self.config['tags'] = {} + super().__init__(label) + + def _trace_specific_init(self): self.x = None self.traces={} - self.clear_data() def clear_data(self): self.clear_last_saved_pos() |