-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Automation time tracking #190
Conversation
At the moment the time is in seconds, we should talk about the correct format of the data. |
The tracking was moved to the base implement. The unnecessary Kpis were removed and are no longer shown in the UI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should talk about what we really want to track. Going by these changes the time when changing rows won't be tracked because the implements are deactivated during that.
self.start_time = rosys.time() | ||
self.start_time = rosys.time() | ||
self.start_time = rosys.time() | ||
self.start_time = rosys.time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.start_time = rosys.time() | |
self.start_time = rosys.time() | |
self.start_time = rosys.time() | |
self.start_time = rosys.time() | |
self.start_time = rosys.time() |
What happened here? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Have no idea 😄
maybe we could put this tracking into the navigation? |
def increment_all_time_kpi(self, indicator: str) -> None: | ||
self.increment(indicator) | ||
if getattr(self.all_time_kpis, indicator) is None: | ||
new_value = 1 | ||
else: | ||
new_value = getattr(self.all_time_kpis, indicator)+1 | ||
setattr(self.all_time_kpis, indicator, new_value) | ||
self.invalidate() | ||
return | ||
|
||
def get_time_kpi(self) -> str: | ||
total_seconds = self.all_time_kpis.time | ||
hours = total_seconds // 3600 | ||
minutes = (total_seconds % 3600) // 60 | ||
seconds = total_seconds % 60 | ||
return f'{hours:02}:{minutes:02}:{seconds:02}' | ||
|
||
def increment_weeding_kpi(self, indicator: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather increment by a given value because the passed time is not always exactly 1 second.
def __init__(self, name: str, system:'System') -> None: | ||
self.name = name | ||
self.system = system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
|
||
async def prepare(self) -> bool: | ||
return True | ||
|
||
async def finish(self) -> None: | ||
await super().finish() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed anymore
@@ -49,6 +49,8 @@ def __init__(self, plant_provider: PlantProvider) -> None: | |||
self.WEEDING_KPIS_UPDATED = rosys.event.Event() | |||
"""one of the KPIs of the running weeding automation has been updated.""" | |||
|
|||
self.all_time_kpis: KPIs = KPIs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other KPIs can be deleted due to their inactivity.
There is a Timetracker. But it seams to be used for Time on a specific field.
I made a tracker to track all the time in automations. This Tacker works for all weeding implements and the Recorder. It can be seen in the status drawer.