How hard is it to build a completely new standalone GUI?

More
28 Jan 2019 07:14 #125045 by cmorley
I see in your INI that homing sequence is missing for axis a and c - my be the problem. I believe if they are missing them it homes at current position.

As for your on-button problem - you could fix this with a custom theme or by using a hal_button but then you would need python code to control your led - which is not a really big deal ... fix that later :)

You are welcome for the help. When you are happy with your LED modifications let me know and I will see about adding it to linuxcnc.

Chris

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 07:50 - 28 Jan 2019 07:52 #125047 by KevKim
Here is a certain initialization trouble with button status.
this is the first screen after launch
Start button in set to <active>
while stop is inactive,
and estop is inactive,
all by default.
In glade editor, I didn't touch their initial status. All are set to NO for the initial status.
So, I tried to change some status, like YES for Estop and Stop button - not only button, widget itself too
, it didn't work.
I thought about manually putting each value (setp) as initial status but then error message saying button pin is NOT writable.
So what would be a good way to overcome the situation?

desired initial status is
- estop ON
- power OFF
- stop ON
- hold OFF
- start OFF (start/stop are marked as one radio button group, so stop=ON will make start=OFF automatically, just my thinking)

kevin

ps. postgui file has only 4 lines;
net power gscreen.hal_led_power <= gscreen.hal_tbtn_power
net estop gscreen.hal_led_estop <= gscreen.hal_tbtn_estop
net hold gscreen.hal_led_hold <= gscreen.hal_tbtn_hold
net start gscreen.hal_led_start <= gscreen.hal_rbtn_start


Attachments:
Last edit: 28 Jan 2019 07:52 by KevKim.

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 07:59 - 28 Jan 2019 08:01 #125048 by KevKim
changed .ini to XYZ 3joints machine, now problem gone for the gui building - temporarily :)
I am totally happy with those slim-rectangular leds, it may have thickness option for maximum versatility but I am good with it for now.
I guess other ppl will like that too!!
Waiting for any response on how to set initial status of each button.

O, one more thing that I need help.
Now LCNC messages - like warnings - appear on top-right corner and they build up unless I manually click each of them.
Can I contain system messages inside <status bar> at the bottom of the main window? it is very annoying.
Last edit: 28 Jan 2019 08:01 by KevKim.

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 08:18 #125049 by cmorley
You could invert the on/off colors of the leds to match initial state.
Ultimately it would probably be better for the LEDs to be connected to linuxcnc state directly - but that can come later.
(in Qtvcp there are state_leds that follow linuxcnc's state - no HAL pins)

I will look into how to disconnect the notify messages...

Chris M

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 08:22 #125050 by KevKim
I am very glad you are still there.

Problem is that it's not just about color of LEDs. As button's status is actually set to ON, system notifies me that I can not run [program] while not homed, meaning button status is really at ON. I am curious what decides initial status of each action.

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 08:44 #125052 by cmorley
I'll have to look at why the start button isn't disabled at start up all by it's self.
You could put it inside a hal_state_sesitive_table and set all the options on:
must be idle, must be homed, must be on.

To rid your self of the notify message:
open the my_gui_handler.py file
look for the function:
    def initialize_widgets(self):
        self.gscreen.init_show_windows()

change it to this:
    def initialize_widgets(self):
        self.gscreen.init_show_windows()
        self.gscreen.initialize_preferences()

run the screen once (it will still notify)

now in your home file open the file:
.gscreen_preferences
it's a hidden file so you may need to set show hiddden file in your file manager.

now in that file look for:
desktop_notify = True

set it to False and save the file.

Now notify will not show.
If you add a statusbar named statusbar1to your Screen it will get those messages instead.

Chris M

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 08:51 - 28 Jan 2019 08:53 #125053 by KevKim
hey Chris,

You know what?
Once things are running, it is getting more and more interesting and exciting!
Now, I think I found a permanent solution to the above ON/OFF at initiation trouble.
After looked into all hal pins monitored by halmeter, I changed buttons to normal momentary switches and modified .hal file as belows;

net power gscreen.hal_led_power <= halui.machine.is-on
net estop gscreen.hal_led_estop <= gscreen.hal_tbtn_estop
net hold gscreen.hal_led_hold <= halui.program.is-paused
net start gscreen.hal_led_start <= halui.program.is-running

As of now, led gets signal directly from halui so it does not rely on button status any more. Likewise, I want to replace estop led too but so far I couldn't figure out which pin emits estop <true> signal. Instead, I could see in <signal tab> there actually is the estop but I don't know proper syntax to inject that signal directly into led pin. Will you give me a hint plz?
Last edit: 28 Jan 2019 08:53 by KevKim.

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 08:57 #125054 by cmorley
Yes that works too.
if you change form action_run to toggleaction_run the button will change sensitivity based on state.

toggle actions will control sensitivity
actions will not

Chris

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 09:00 #125055 by cmorley
halui.estop.is-activated would work for the estop LED

Please Log in or Create an account to join the conversation.

More
28 Jan 2019 09:03 #125056 by KevKim
mmm... I can not see any file similar to the name .gscreen_preferences.
I looked inside gscreen sim folder, show-hidden-file option is checked,
there is nothing like that.
is that something that needs preference file only? Can't be done with any other initialization python file?

Please Log in or Create an account to join the conversation.

Moderators: mhaberlerHansU
Time to create page: 0.332 seconds
Powered by Kunena Forum