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

More
06 Nov 2023 15:33 - 06 Nov 2023 16:10 #284710 by Plasmanfm
So nun bin ich mal wider ein Schritt weiter…
Nun nach dem ich die QtPlasmac.ui überarbeitet habe Anzeige Led Button eingefügt habe sollen die Button auch was schalten. nach den einschalten maschine-is-enableein soll der Button ein sein also NC und die Led und der pwmgen sind on beim betätigen des Button aus !
habe kein plan wie habe einiges ausprobiert geht aber alles nicht


.So now I'm one step further.
.Now that I have revised the QtPlasmac.ui, I have inserted the display LED button The buttons should also switch something. After turning on the machine-is-enable, the button should be on Alison NC and the Led and the pwmgen are on when pressing the button off!I don't have a idee, I tried a lot, but everything doesn't work

king reagarde and thank‘s
juergen
Last edit: 06 Nov 2023 16:10 by Plasmanfm.

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

More
06 Nov 2023 15:35 #284712 by Aciera

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

More
06 Nov 2023 17:39 #284721 by Plasmanfm
Ach so was muss ich wo eingeben ein Beispiel währe schön

Oh, what do I have to program where, an example would be nice

King regarde and thank‘s

Juergen

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

More
08 Nov 2023 10:52 #284853 by Plasmanfm
Ich habe in den qtplasmac_handler.py  das im Attachments eingegeben .
zusätzlich habe ich noch CALL() eingegeben.
jetzt sehe ich in der Halshow den Button qtplasmac:cut-amps-pwmgn-on in off kann auch über set aktevieren Button, LED wird on aber im Main
des qtplasma gibt es keine änderung beim betätigen des Button.

Was ist falsch ?
Wer kann helfenI entered the attached in the qtplasmac_handler.py.
Additionally I entered CALL().
now I see in the halshow the button qtplasmac:cut-amps-pwmgn-on in off Using set I can activate the button and set the LED to on in Main of my qtplasma there is no change when pressing the button.

what's wrong who can help

king regarde and thank´s

Juergen
Attachments:

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

More
08 Nov 2023 22:37 #284908 by phillc54
Can you post all the code that sets up the button.
 

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

More
09 Nov 2023 11:18 #284935 by Plasmanfm
Hallo phillc54I in the atachmen is the overview of what I have written where


king regarde and thank´s
Juergen
Attachments:

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

More
10 Nov 2023 02:22 #284996 by phillc54
You would need to add a method in the handler that runs when the button is clicked and also connect the button to that method, something like:
def cut_amps_pwmgen_on_clicked(self):
    print("cut_amps_pwmgen_on was clicked")

self.w.cut_amps_pwmgn_on.clicked.connect(self.cut_amps_pwmgen_on_clicked)

If you are just toggling a hal pin you could probably use a  toggle-halpin user button  or for extra code a  dual-code user button .

Custom styling is usually done via the  qtplasmac_custom.qss file .

 

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

More
10 Nov 2023 11:45 #285022 by Plasmanfm
Hallo phillc 54
I set this :
def cut_amps_pwmgen_on_clicked(self):print("cut_amps_pwmgen_on was clicked")
def self.w.cut_amps_pwmgn_on.clicked.connect(self.cut_amps_pwmgen_on_clicked )
in the qtplasmac_handler and get the error message:Traceback (most recent call last):                                           
File "/usr/bin/qtvcp", line 545, in <module>
_qtvcp = QTVCP()^^^^^^^File "/usr/bin/qtvcp", line 261, in __init__
window.load_extension(opts.usermod)File "/usr/lib/python3/dist-packages/qtvcp/qt_makegui.py", line 269, in load_extensionmethods, self[obj].handler_module, self[obj].handler_instance = self._load_handlers([handlerpath], self.halcomp, self[obj])^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/lib/python3/dist-packages/qtvcp/qt_makegui.py", line 297, in _load_handlersmod = __import__(basename)^^^^^^^^^^^^^^^^^^^^File "/usr/share/qtvcp/screens/qtplasmac/qtplasmac_handler.py", line 1783def self.w.cut_amps_pwmgn_on.clicked.connect(self.cut_amps_pwmgen_on_clicked)^SyntaxError: expected '('

kann you helping

king regarde and thank`s
Juergen

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

More
10 Nov 2023 22:11 #285059 by phillc54
Could you attach the complete handler file and ui file so that I can attempt to run them here.
 

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

More
11 Nov 2023 09:37 - 11 Nov 2023 18:14 #285088 by Plasmanfm
 Hallo phillc 54that's very nice of youWhat I plan to do is thisIf the emergency stop and the power is on (Green), then the button and the LED onPress the Button LED and Button off.king regarde and thank`sJuergen 

File Attachment:

File Name: qtplasmac.ui
File Size:758 KB
 

File Attachment:

File Name: custom_postgui.hal
File Size:0 KB
  

File Attachment:

File Name: qtplasmac_handler.py
File Size:316 KB
 

File Attachment:

File Name: qtplasmac_handler.py
File Size:316 KB
Attachments:
Last edit: 11 Nov 2023 18:14 by Plasmanfm.

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

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