Feature/annotation#134
Conversation
e6a9fcb to
a59cd08
Compare
|
|
||
| def request_struct(self): | ||
| timestamp = InfuseTime.gps_seconds_from_unix(int(self.time.timestamp())) | ||
| return self.annotate_value_factory(self.logger, timestamp, self.label) |
There was a problem hiding this comment.
request_struct can return a bytes object directly, so the whole thing can be simplified to:
return self.request(self.logger, timestamp) + self.label.encode('utf-8') + "\x00"
I do need to update the types of InfuseRpcCommand to show that works though
There was a problem hiding this comment.
I initially replaced with return self.request(self.logger, timestamp) + self.label.encode('utf-8') + "\x00" but then realised this is duplicated in the annotate_events.py. (Constructing a whole InfuseRpcCommand seemed annoying compared to just having a static helper function).
As a result, I've kept self.annotate_factory and instead moved this there, since it can be used by annotate_events.py or other tools and reduces the likelihood of messing up elsewhere.
I think typing isn't happy about this till the other PR is merged.
76b70f5 to
5bb5e46
Compare
Added an annotation rpc wrapper to log an annotation tdf on device. Use `--string STRING` to specify the annotation label. Specify which logger to use with one of `--onboard`, `--external`, or `--logger`/`-l` and the logger ID/Name. Specify the time of the event with one of `--now`/`-n`, `--timestamp`/ `-t` with an ISO formatted timestamp, or `--delta`/`-d` with a delta in seconds from the current time. Signed-off-by: Aeyohan Furtado <aeyohan@embeint.com>
Added annotation tool that can be used to log events. Configure whether the tool should update the tag's time. Supply a label file (or labels at runtime) and then select a label from the list to annotate the vent. Otherwise, type a custom event label to be sent to the tag. usage `infuse annotate_events --help` for more details. Signed-off-by: Aeyohan Furtado <aeyohan@embeint.com>
5bb5e46 to
beea447
Compare
|
Add annotate RPC wrapper
Add annotate events tool
Closes on tag disconnect (reconnecting and handling input was not working as intended).