- Posts: 131
- Thank you received: 0
Button erstellt und er soll auch schalten Button created and he should also swit
2 years 11 months ago #285766
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
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
Please Log in to join the conversation.
2 years 11 months ago #285785
by phillc54
Replied by phillc54 on topic Button erstellt und er soll auch schalten Button created and he should also swit
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 ...
Ja, die Pin-Sache ist seltsam, ich verstehe das überhaupt nicht ...
Please Log in to join the conversation.
2 years 11 months ago #285845
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
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
Please Log in to join the conversation.
2 years 11 months ago #285867
by phillc54
Replied by phillc54 on topic Button erstellt und er soll auch schalten Button created and he should also swit
You can limit the cut amps with the following, the first number is the lower limit and the second number is the upper limit.
You can set the LED color with the following but you should then remove the #pwm_led from qtplasmac_custom.qss:
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.
Code:
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:
Code:
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 to join the conversation.
2 years 11 months ago #286215
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
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
Please Log in to join the conversation.
2 years 11 months ago #286280
by phillc54
Replied by phillc54 on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
linuxcnc.org/docs/devel/html/plasma/qtpl...#_custom_python_code
Please Log in to join the conversation.
2 years 11 months ago #286327
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
Hallo phillc54
OK....
Now I'm a bit overwhelmed
and what should be written in there?
king regarde and thank´s
Juergen
OK....
Now I'm a bit overwhelmed
and what should be written in there?
king regarde and thank´s
Juergen
Please Log in to join the conversation.
2 years 11 months ago #286862
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
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
Please Log in to join the conversation.
2 years 11 months ago #286914
by phillc54
Replied by phillc54 on topic Button erstellt und er soll auch schalten Button created and he should also swit
Sorry, I missed your previous post. Glad you got it going.
Please Log in to join the conversation.
2 years 10 months ago #286956
by Plasmanfm
Replied by Plasmanfm on topic Button erstellt und er soll auch schalten Button created and he should also swit
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
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 to join the conversation.
Time to create page: 0.162 seconds
