qgroundcontrol icon indicating copy to clipboard operation
qgroundcontrol copied to clipboard

Clear button offline

Open arnaudjuin opened this issue 1 year ago • 2 comments

It would be nice to have an option to clear the planning view when QGC is not connected to the vehicle.

arnaudjuin avatar May 16 '24 11:05 arnaudjuin

I agree that having an option to clear the planning view when QGroundControl (QGC) is not connected to the vehicle would be a useful enhancement.

To address this issue, I propose adding a Clear button that is always enabled, regardless of the vehicle connection status. This button would allow users to clear all mission items from the planning view, even when QGC is offline.

Here's a high-level plan for implementing this feature:

  • Add a Clear button to the toolstrip in the planning view.
  • Implement a clearPlanningView function that removes all mission items and resets the view.
  • Ensure the Clear button triggers this function.

Files to edit for this features:

  • https://github.com/mavlink/qgroundcontrol/blob/master/src/PlanView/PlanView.qml

I would love to hear your feedback on this approach or any suggestions you might have before I start working on a pull request.

Thanks!

smadi0x86 avatar Jun 18 '24 09:06 smadi0x86

That's the way I see it. I can also help you with the PR.

arnaudjuin avatar Jun 19 '24 09:06 arnaudjuin

Hello, I hope you're doing well, I apologize for the delay in working on this, I was on vacation. I've put together a PR (https://github.com/mavlink/qgroundcontrol/pull/11691) to address the issue and detailed what I've done in it.

Turns out my earlier insights were incorrect after diving deep into the code, the logic to enable the "Clear" button when offline was already in place. I tried tracing and changing the logic to just give a warning when vehicle is offline and execute the clear button.

smadi0x86 avatar Jul 19 '24 19:07 smadi0x86

You can just use File/Blank to start over again. Is that too confusin? Adding a toolstrip button to clear isn't a great use of important real estate. Options like "Clear" are already under the File button.

DonLakeFlyer avatar Jul 22 '24 18:07 DonLakeFlyer

I totally agree, in fact I was trying to copy the same functionality/logic of creating a new blank plan for clearing via the clear button. I have no problem with both, if the feature requester have any strong takes on why we need to that, we can possibly continue if that's possible.

smadi0x86 avatar Jul 22 '24 20:07 smadi0x86

if the feature requester have any strong takes on why we need to that, we can possibly continue if that's possible.

Or maybe just re-oeganizse/re-name things to make them more clear. We'll see where the. confusion is.

DonLakeFlyer avatar Jul 22 '24 23:07 DonLakeFlyer

Yes that's the way I see it, do you have anything in mind?

smadi0x86 avatar Jul 23 '24 07:07 smadi0x86

I think maybe a solution is to move the Clear out of the Vehicle section so that it's appropriate for use at all times. Let me think about that a bit.

DonLakeFlyer avatar Aug 01 '24 17:08 DonLakeFlyer

@arnaudjuin Any comments on why you didn't think to use File/Create Plan/Blank?

DonLakeFlyer avatar Aug 01 '24 17:08 DonLakeFlyer

Clear Mission / Clear Plan sounds like a positive change to the menu item

mrpollo avatar Aug 01 '24 18:08 mrpollo

Moving it out of the Vehicle section makes more sense indeed.

arnaudjuin avatar Aug 12 '24 14:08 arnaudjuin