Skip to content

Commit

Permalink
Merge pull request #1 from hz-b/dev/feature/bpm-turn-by-turn
Browse files Browse the repository at this point in the history
BPM data model extended to Turn by Turn data
  • Loading branch information
PierreSchnizer authored Mar 19, 2024
2 parents c0594f0 + 426a525 commit 74930ef
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bact_device_models/devices/bpm_elem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from typing import Sequence
import jsons


Expand All @@ -15,7 +16,7 @@ def describe_dict():
return dict(source="", shape=[32], dtype="array")

def to_dict(self, timestamp):
return {'value': self.bpmElemList, 'timestamp': timestamp}
return {"value": self.bpmElemList, "timestamp": timestamp}

@staticmethod
def to_json(data):
Expand All @@ -38,3 +39,14 @@ class BpmElem:
stat: float
gain_raw: float
name: str


@dataclass
class BpmElementOneTurn:
element: BpmElem
turn: int


@dataclass
class BpmElementTurnByTurn:
turn_by_turn_data: Sequence[BpmElementOneTurn]

0 comments on commit 74930ef

Please sign in to comment.