Skip to content

Conversation

zz912
Copy link
Contributor

@zz912 zz912 commented May 17, 2025

When the "halui MDI command" is run, the modes are switched in the background:

  1. Original (Manual or MDI or Auto)
  2. MDI
  3. Original (Manual or MDI or Auto)

This Pull Request ensures that the mode screens in the Gmoccapy GUI are not switched.

@andypugh andypugh requested a review from gmoccapy May 18, 2025 10:17
@Sigma1912
Copy link
Contributor

Maybe @hansu could review this.

@gmoccapy
Copy link
Collaborator

This patch does the MDI Running Check in the button press functions, IMHO the check should be done in Hal Status change function instead.

On the other Hand I do not like that the code is introduced on several places, so we have the same code on several places instead of having it in its own function.

Norbert

@zz912
Copy link
Contributor Author

zz912 commented May 26, 2025

This patch does the MDI Running Check in the button press functions, IMHO the check should be done in Hal Status change function instead.

This patch has three parts:

  1. in init it detects if LCNC configuration contains HALUI MDI commands
    line 216
  2. blocks mode buttons during run HALUI MDI commands
    line 2534 - 2558
    It is debatable whether this part is important. Theoretically this situation should not occur, because during run commands these buttons are no sensitive. However I have problems with real implementation of LCNC, when during use of remap and HALUI commands I have random horrible things happening and therefore here are logs that could help in finding problems.
  3. react to Hal Status change and block screen change
    line 2804 - 2888
    This is the main part of this patch.

On the other Hand I do not like that the code is introduced on several places, so we have the same code on several places instead of having it in its own function.

I also thought about enclosing part of the code in a function.

But does it make sense to make a function for 3 lines?

    if self.halui_cmd_exist:
        if hal.get_value("halui.halui-mdi-is-running"):
            MESSAGE
            return

The problem is that the MESSAGE is different every time.
Moreover, in part 2 I use LOG.error
in part 3 I use LOG.debug

I don't know how to do it so that it doesn't make it even worse for clarity.

Or do you want to move the code in the init part into the function?
To make the init function cleaner?

@hansu hansu self-assigned this May 29, 2025
@zz912
Copy link
Contributor Author

zz912 commented Jun 29, 2025

Is there anything I can do to get this Pull Request merged? Or is it just that no one has gotten to it and I should wait?
I don't want us to wait for each other.

@andypugh
Copy link
Collaborator

Is there anything I can do to get this Pull Request merged? Or is it just that no one has gotten to it and I should wait? I don't want us to wait for each other.

I saw that @hansu had self-assigned it, so I have not been paying much attention to it.

@zz912
Copy link
Contributor Author

zz912 commented Jun 30, 2025

Hello Andy,

Thanks for your response. I don't want to put any pressure on Hans.
I just wanted to make sure that there was no need to do anything on my part.

I didn't want a situation where I would be waiting for Hans and Hans would be waiting for me.

Zdeněk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants