Button erstellt und er soll auch schalten Button created and he should also swit

More
17 Nov 2023 19:18 - 18 Nov 2023 18:09 #285766 by Plasmanfm
Hallo phlllc54
my very very big thanks
what you have achieved is highly appreciated
It did take a lot of work
The program fulfills my wishes and it works very wellThe thing with the pin is curious
I've attached the hall shows

king regarde and very very big thanks
Juergen
Attachments:
Last edit: 18 Nov 2023 18:09 by Plasmanfm.
The following user(s) said Thank You: phillc54

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

More
17 Nov 2023 22:08 #285785 by phillc54
Es wäre schneller gegangen, wenn ich nicht falsch interpretiert hätte, was Sie wollten, aber am Ende haben wir es trotzdem geschafft.

Ja, die Pin-Sache ist seltsam, ich verstehe das überhaupt nicht ...
The following user(s) said Thank You: tommylight

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

More
18 Nov 2023 18:03 - 18 Nov 2023 18:09 #285845 by Plasmanfm
hallo phillc54
I still have a few questions about the program
I can increase the value using the + button Is it possible to set the limit to 70 ?
I can now set the value infinitely high

Another question would be about the color of the LED
Is it possible to set the LED color in the program ?
If so, is it possible to install it in an if loop?

example:
if self.cut_amps_pwmgn.isChecked():
                self.pwmEnablePin.set(True)
                self.pwmgn_led.setFlashing(False)
                self.pwmgn_led.setcolor(green)
            else:
                self.pwmEnablePin.set(False)
                self.pwmgn_led.setcolor(red)
                self.pwmgn_led.setFlashing(True)
               
king regarde and thank`s
Juergen
 
Last edit: 18 Nov 2023 18:09 by Plasmanfm.

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

More
18 Nov 2023 23:02 #285867 by phillc54
You can limit the cut amps with the following, the first number is the lower limit and the second number is the upper limit.
self.w.cut_amps.setRange(30,70)

You can set the LED color with the following but you should then remove the #pwm_led from qtplasmac_custom.qss:
self.pwmgn_led.setStyleSheet('LED {qproperty-color: green}')

You could do it in a loop but the way it works in this current setup you would probably need to code in both the pwmgn_clicked and new_power_state methods.

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

More
22 Nov 2023 09:25 - 22 Nov 2023 09:37 #286215 by Plasmanfm
Hallo phillc54It
works with limitations
EStop Reset Power on Pwmgn-Switch green LED green.
Pwmgn switch on or off LED green or flashes red.
Pwmgn-Switch in off and switch Power-Switch in off and again in on LED red (" not flashing must green" )!
After switching the Pwmgn switch on and off and on, the LED is green.I added the line here
 def pwmgn_clicked(self):
        ''' set cut_amps_pwmgen hal pin and led state'''
        if STATUS.machine_is_on():
            self.h = True
            if self.cut_amps_pwmgn.isChecked():
                self.pwmEnablePin.set(True)
                self.pwmgn_led.setFlashing(False)

                self.pwmgn_led.setStyleSheet('LED {qproperty-color: green}')
            else:
                self.pwmEnablePin.set(False)

               self.pwmgn_led.setStyleSheet('LED {qproperty-color: red}')
                self.pwmgn_led.setFlashing(True)

a new if loop ?
example:

def: ?????
if pwmgn on:
self.pwmgn_led.setStyleSheet('LED {qproperty-color: green}')
else:
self.pwmgn_led.setStyleSheet('LED {qproperty-color: red}')

king regarde and thank's
Juergen
 
Last edit: 22 Nov 2023 09:37 by Plasmanfm.

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

More
22 Nov 2023 22:50 #286280 by phillc54
You could create a file in the config directory named "user_periodic.py". This file is called every GUI cycle (approx 100mS).

linuxcnc.org/docs/devel/html/plasma/qtpl...#_custom_python_code
 

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

More
23 Nov 2023 13:22 #286327 by Plasmanfm
Hallo phillc54

OK....
Now I'm a bit overwhelmed
and what should be written in there?

king regarde and thank´s
Juergen

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

More
30 Nov 2023 11:26 - 30 Nov 2023 13:09 #286862 by Plasmanfm
Hallo
phillc54 I found the solution :

# patch handler power_state method so we can run some additional code
    old_power_state = self.power_state
    def new_power_state(state):
        old_power_state(state)
        if state:
            self.cut_amps_pwmgn.setChecked(True)
            self.cut_amps_pwmgn.setEnabled(True)
            self.pwmEnablePin.set(True)
            
        else:
            self.cut_amps_pwmgn.setChecked(False)
            self.cut_amps_pwmgn.setEnabled(False)
            self.pwmEnablePin.set(False)I

     added that :       

    ''' that is new '''
            self.pwmgn_led.setStyleSheet('LED {qproperty-color: green}')

        self.h = self.cut_amps_pwmgn.isChecked()
    self.power_state = new_power_state  

king regarde and thank´s
Juergen
Attachments:
Last edit: 30 Nov 2023 13:09 by Plasmanfm.
The following user(s) said Thank You: phillc54

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

More
30 Nov 2023 23:00 #286914 by phillc54
Sorry, I missed your previous post. Glad you got it going.
 

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

More
01 Dec 2023 10:10 #286956 by Plasmanfm
Hallo phillc54
i ok
I have two more questions:

At the top left of the main window there are 5 values ​​from the material list. I would like to expand them to include cut amps
where can I find it to expand it ?
Above the LED it says on
can you make the text status dependent on or off?
in TPL I know how
py is too new for me

king regarde and thank´s
Juergen

 

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

Moderators: snowgoer540
Time to create page: 0.079 seconds
Powered by Kunena Forum