Hello Guest it is April 28, 2024, 01:26:53 PM

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

0 Members and 1 Guest are viewing this topic.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #90 on: June 11, 2015, 06:32:28 AM »
na the torys
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #91 on: June 11, 2015, 06:35:37 AM »
I thought you were a Kiwi dan? or an aussie?

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #92 on: June 11, 2015, 09:08:31 AM »
Screwie Louie....

Reference the attached image.
1.  Operator>Edit Screen
2.  Expand Default
3.  Select MaintTabs (or the location you want to add the page)
4.  Select Add a page
5.  Select Add Lua Panel
6.  Resize the Panel Now (It doesn't seem to adjust later)
7.  Under Properties, select the little page with the lightning bolt
8.  Select the "..." to open the LuaEditor.exe

----Sorry no graphics for this part---
9.  Add your code
10. Save your code
11. CLOSE MACH 4 Display NOW
12.  Open Mach 4  (your panel should be there)

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #93 on: June 11, 2015, 09:34:58 AM »
If you can't resize the lua panel (sometimes it can be touchy to "Grab" the edges/corners with your mouse), go to the properties window.
change the Ht/Wt properties and that will cause it to change size, also the top corner location can change its position.

Scott
fun times

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #94 on: June 11, 2015, 09:41:48 AM »
Thank Scott....good to know
I am hoping to have some time this weekend to tie my I/O code to this display and visa-versa; my grandson is staying over so progress maybe a little slow between naps....both his and mine ;D
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #95 on: June 11, 2015, 03:35:55 PM »
Yah, thanx Tim. That's not what I am talking about tho (where you insulting my intelligence, haha! j/k). I am taking about how to tell the window that the panel has a parent; connect the panel to parent (ie, Default page) so my image does not "pop up" as it' own window. I want it to stick to Mach4's window (or "Default page")

my question was referencing the use of-

local window = panel:GetParent();  


or connect the window(that was coded) to the lua panel that I just added to the screen.....



-josh
« Last Edit: June 11, 2015, 03:38:53 PM by Screwie Louie »

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #96 on: June 11, 2015, 04:54:30 PM »
panel = mcLuaPanelParent;  --Ties your panel to the mcLua Panel Parent
and stripout all of the window stuff or throw some if statements around the window stuff. 

You can make it such that your code can work in a window or a panel.
if (mcLuaPanelParent == nil) then
   --Do window setup
else
  --Do Lua Panel stuff
end

Beware if you have messages that refer to frame:SetStatusText("MPG OFF") and you do not have a window it will cause your code to fail.  Wrap your windows/frame code with an if (mcLuaPanelParent == nil) then statement

PoppaBear has a lot of good examples in his wizards that can become panels.

For the most part I just stripped out all of the window related stuff in mpanelscriptRev5.mcs.  I probably could clean it up a bit more and remove some more.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #97 on: June 11, 2015, 05:35:28 PM »
I thought you were a Kiwi dan? or an aussie?

I am no Aussie. I am a kiwi bro grr
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #98 on: June 12, 2015, 05:09:27 PM »
That's weird. Huh...frame:SetStatusText("MPG OFF")  "MPG OFF" is just being passed as a string not a command. I wonder why it is interpreted that way? Although I think MPG_OFF is a C++ argument, but I don't think that would matter. Weird!

Thanx Tim! I'll try stripping out the window definition and see if the panel connects to my screen instead of a pop-up. So mcLuaPanelParent must be a defined global variable in wx.Lua.....

Offline TimGS

*
  •  108 108
    • View Profile
Re: Jogging/Pendant Interface-What is the best way? Ramblings
« Reply #99 on: June 17, 2015, 11:28:40 AM »
I finally made it such that the MPG Axis selection can be controlled from either the mechanical switch or the display radio buttons. ;D
 
1)  I swapped out the radiobuttons for radioboxs; just to reduce code size and to make selecting the radio buttons via software easier.
2)  The Mach4 Display Rotary Switch image and MPG Axis RadioBox will always reflect which Axis the MPG is connected to
     a)  The MPG Axis Radiobox controls which Axis the MPG is connected to independent of the MPG mechanical rotary switch position
           i)  The MPG Axis Radiobox controls always reflect which Axis the MPG is connected to
           ii)  The selection of an Axis in the MPG Axis Radiobox does NOT move the MPG mechanical rotary switch position
     b)  The MPG mechanical rotary switch "when switched" controls which Axis the MPG is connected to independent of the MPG Axis Radiobox selection
           i)  MPG mechanical rotary switch only reflects the current MPG Axis selection at powerup, at Mach4 startup and after the MPG mechanical rotary switch has moved.
           ii)  The Mach4 Display Rotary Switch image and the MPG Axis RadioBox are always automatically updated to reflect the current MPG Axis setting

When I update and test the other Jog Increment control code I will post the code so you can see or try out what I am talking about.

Then all I have to do is implement the Manual MPG "Rotation Direction Detection" code and I will be able to make a small video so you can see how it all works ;D

This may not be the best way to create a Jogging/Pendant Interface but I will be able to connect switch based pendants to Mach4 through an Ethernet Smooth Stepper and have cool images reflect what is going on ;D
« Last Edit: June 17, 2015, 11:31:34 AM by TimGS »