-
Notifications
You must be signed in to change notification settings - Fork 22
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
Alert when Cockpit is minimized while vehicle is still armed #1379
base: master
Are you sure you want to change the base?
Alert when Cockpit is minimized while vehicle is still armed #1379
Conversation
src/stores/controller.ts
Outdated
alertStore.pushAlert( | ||
new Alert( | ||
AlertLevel.Warning, | ||
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.' | ||
) | ||
) | ||
showElectronDesktopNotification( | ||
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.' | ||
) | ||
} |
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.
In this case the alert will be disabled if the user disabled the general voice alerts or warning alerts.
We should create add a "force" parameter to the pushAlert
method and have a dedicated switch to disable this voice alert.
src/stores/controller.ts
Outdated
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.' | ||
) | ||
) | ||
showElectronDesktopNotification( | ||
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.' | ||
) |
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.
Messages are being replicated here. You can assign them to a variable and reuse. Will also consume less lines.
Also, could we make the message more explicit? Like "Cockpit minimized while vehicle is armed. Joystick inputs will not work. Ensure vehicle safety."?
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.
Critical alerts now act independently from the other 4 categories. They are not blocked from the "Enable voice alerts option" and have a special config item to be set on the Configurations->Alerts
Also an issue, #1389 was created to implement the desktop notifications on Electron Cockpit version.
You can use this to check if the application is running on Electron. Will work on both the Node process as well as the renderer. |
831e8ab
to
bc85ef8
Compare
…armed Signed-off-by: Arturo Manzoli <[email protected]>
bc85ef8
to
6c72d0d
Compare
<v-checkbox | ||
v-model="alertStore.enabledAlertLevels.find((level) => level.level === AlertLevel.Critical)!.enabled" | ||
v-tooltip=" | ||
'Critical system alerts work separately from your voice alert settings. These alerts are rare but really important, so we recommend keeping them on.' | ||
" | ||
label="Critical system alerts" | ||
hide-details | ||
color="white" | ||
class="mt-1" | ||
/> | ||
</div> |
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 problem with reusing the Critical level is that it's being also used on MAV_SEVERITY_EMERGENCY
, MAV_SEVERITY_ALERT
and MAV_SEVERITY_CRITICAL
, from Ardupilot. Their names suggest that they are only thrown on very critical situations, but I have found it to not be true.
Right now, with the Critical level enabled (which I want to have for the joystick warning), I'm being spammed by "Ardupilot logger stuck thread" voice alerts, so I will have to disable the critical level, and in consequence I will lose the joystick alert, which I want to have.
I can think of three solutions here:
-
Have this joystick alert on a separate level.
-
Make each
MAV_SEVERITY
have it's own dedicated level. -
Create a dynamic alert registration system, where each new alert will create an entry for it in the alerts menu, and the user will be able to disable each alert individually.
Solution 1 is the easy one. Solution 2 is also easy and more long-term, but makes Cockpit more tied to Ardupilot (and we want to go in the opposite direction). Solution 3 seems to be the correct one, but takes a little more work (although not that much I think).
Two alerts will be fired, voice (warning level) and electron desktop notification.
Closes #1377