Hello Guest it is April 23, 2024, 03:24:34 PM

Author Topic: Jogging/Pendant Interface-What is the best way? Ramblings  (Read 39801 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #70 on: June 04, 2015, 08:09:51 AM »
Next question...How do I get it into Mach4?

Very nicely done.

When you say 'into' Mach4, are you seeking to add your wizard to a Mach Screen, or connect it to the Jogging system?

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #71 on: June 04, 2015, 08:21:47 AM »
First I would like to connect it to the jogging system.  I was able connect switches and an MPG to the jogging system via a signal script.  Now I have created a display to display the switch positions.  Now I would like to tie it all together....When I rotate the switch I want to see it change the screen and the Mach4 settings.

The code is set up as a standalone frame (Wizard Like)...but I can just put the panels I created on an "Operations" tab or my own "Display" tab.  I just don't know how/where to put the code.

....sorry....work all day...play with Mach4 late into the night.  Maybe I should just get some sleep ;) ... but I am on a role :D

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #72 on: June 04, 2015, 09:18:57 AM »
Tim,

Add a Lua Panel.

Open the scripting choice for the panel (second 'page' of parameters with tiny icon that looks like a page)

The editor will open.

Copy your code into the editor and save.

Save screen - exit MACH4 and restart.

Your wizard should be in the panel . . . although is does not size down, so you'll need a big panel . .  :)

You might consider leaving it as a moveable window. That way it will always be available.

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #73 on: June 04, 2015, 09:28:24 AM »
Thank You for your help... I can kind of visualize this...

I will try it tonight after work.  I don't have Mach at work so it will have to wait until I get home to try this....(Good thing I... :D ...I should be working... I can only do quick email replies to gather info and answer questions)

I also have a 5k race tonight so it will be about 7ish before I can try it.  When you sit on your butt all day you have to do something to unflatten it   ;D

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #74 on: June 04, 2015, 08:32:13 PM »
I created a panel and added code....now I have a problem where I am not receiving events or generating them beyond the panel "wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED" 

...baby steps

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #75 on: June 08, 2015, 08:23:57 AM »
SMurphy (aka Steve)  You tackled this problem once before, I believe.  I added a tab, inserted a Lua Panel and added my code.  I click on the radio buttons and they move but nothing else happens.  Turned on logging and see no messages being generated ??? Do you have any ideas?

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #76 on: June 09, 2015, 08:06:17 PM »
Still stuck ...Can't receive events ??? ??? ???

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #77 on: June 10, 2015, 12:26:03 AM »
Look at the "Joy Stick" example, it has an embedded wxLua Panel that throws events and you can get an idea how to do them.

Scott
fun times

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #78 on: June 10, 2015, 10:52:31 AM »
The joystick example uses wx.EVT_SIZE, wx.wxEVT_PAINT and wx.wxEVT_TIMER.  It seems radio buttons events or mouse events seemed to be blocked.

I posted my code on page 7 of this discussion....I don't see where I have gone wrong.

The radio buttons move but I do not catch/detect the radio button events

Code: [Select]
   panel:Connect(RADIOBTN1_ID, wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED,
                        function(event)
                            local Selected = rbtns1:GetValue();                             
                            if Selected then
                                frame:SetStatusText("MPG OFF");
                                MPGSwitchPosition = 1;
                                local dc = wx.wxPaintDC(BitMapPanel1);
                                dc:DrawBitmap (MPGSwitchBMPs[MPGSwitchPosition], 0,0, true);
                                dc:delete ();
                                panel:Refresh();
                           end
« Last Edit: June 10, 2015, 11:03:23 AM by TimGS »

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #79 on: June 10, 2015, 12:17:47 PM »
Everything works when it is in its own frame (Like when in a wizard).  Which I might eventually do but I would like to know how to add buttons and code to a Lua Panel too. ;D