Hello Guest it is April 29, 2024, 11:57:39 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - django013

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 »
51
Mach4 General Discussion / Re: Tool Setup
« on: June 02, 2017, 01:52:22 AM »
do you use G41/G42 or G40?

52
Mach4 General Discussion / replacement for mcLuaPanelParent ?
« on: June 02, 2017, 12:35:00 AM »
Hi,

I start the lua panels with createUI(mcLuaPanelParent) after loading the panel code.
That works fine for runtime, but is of no help in debug sessions, as in debug mode mcLuaPanelParent is not existant.

In the samples they create a dialog frame in case mcLuaPanelParent is null, but I think, that is not apropriate.
In mach4 a luaPanel will most likely have no frame as parent, but another wxControl ...
So what could be used in screen-designer-debug-mode?

Inside createUI mcLuaPanelParent is used like this (as parameter called panel):
Code: [Select]
local window = panel:GetParent()
local wsize = window:GetSize()

panel:SetSize(wsize)

...

as I found out, at control creation time mcLuaPanelParent has no size, so the startup code does not lead to the desired size.
So a resize handler has to be established.


53
Mach4 General Discussion / Re: mcRegGetValue returns unexpected value
« on: June 01, 2017, 11:35:01 PM »
based on the new informations, I rearranged my module code ...

- I extracted lua panel code so that each panel has now its own source file
- I removed all but one register
- bounded the dro to the remaining register
- changed lua-panel code to change register instead of dro value directly
- dro now fires update events in GUI-thread when changing register value in lua-panel-thread
- update-handler runs in GUI-thread and can use module code

so no more usage of screen API in lua panel code. Hope, the new arrangement is more mach4-specs like :)

cheers Reinhard

54
Mach4 General Discussion / Re: Help needed setting UI Tab focus
« on: June 01, 2017, 11:29:04 PM »
Glad you found the solution on yourself.

I do the same on synching different notebooks - changing the page of one nb changes pages in other nbs too.

Quote
It's crazy ...
No, it's LUA :D

55
Mach4 General Discussion / Re: mcRegGetValue returns unexpected value
« on: June 01, 2017, 02:02:24 AM »
Ok, that makes sense :)
Thank you for the explainings!

Didn't expect, that each lua panel runs in its own thread. So ok.
Good to know, that registers are guarded by mutexes :)

Quote
All of these instances have access to the MachAPI functions.
Only the GUI has access to the ScreenAPI functions.
Sure about the latter?
Currently I use a hidden dro for synchronization and it works fairly well.
I use scr.GetProperty and scr.SetProperty from lua-panel-module-code
Ok user interaction is pretty slow respect to thread timings, but I use onUpdate and onModify triggers on dro controls which work too.

What about extending registers to table handling?
The serialization code is able to serialize tables to strings and read from strings ...
If you're interested, I could post the code ...

cheers Reinhard

56
Mach4 General Discussion / new control behaviour since 3400
« on: June 01, 2017, 12:10:03 AM »
Hi,

the much I like the idea of every control having its own ttf property, the less I like the current behaviour.
All controls have an 8pt Arial as default - without respecting the former font sizes/defaults.

Picture Fontsizes_00 is from before 3400 - picture fontsizes_01 after doing a small change and saving the screen with 3402 (was the same with 3400).

That change imports a huge amount of unneccessary changes to the screen designers :(

57
Hi Steve,

meanwhile I read, that there exists an API call for integers separately - but I don't like the idea of registers in that usecase any more.
The data is a table and I don't like the idea of having to read a complete table value by value ...
So I read a bit about lua and serialization and found a sample to store/load tables as single API-calls. The price is a separate file, but I'm willing to pay that price :)
Now the code is as clean as expected and works fine so far.

What I don't understand is the way of module loading. I got the hint, that each lua-panel is like a sandbox, where I have to reload the module.
Thats nasty :(
I checked the module internals and it shows, that the loaded code for a lua panel stays loaded the whole runtime of mach. That's quite ok, but there's no way of interaction with that panels elements. Neither exported variables can be accessed.
At least I found none.

So what do you think: would it be resonable to load a module and put the modules handle in a register and load that register inside the lua panel code?
That way the already loaded (and exported) variables could be accessed from different panels and the sandbox should work as before?!?
I like the idea, that a module could be treaten like a singleton :)

cheers Reinhard


58
Mach4 General Discussion / mcRegGetValue returns unexpected value
« on: May 30, 2017, 09:01:23 AM »
Hi,

I'm trying to work with registers. First I only want to read from registers and display that values ...
The register file configuration shows the defined registers with their values.
The screenshot from debugger shows, what mcRegGetValue read from register.

probe has value of 2, so expected value is 12, but retrieved register value is shown in the flyover help as 0.033

I already searched for typos, but can't find them. What am I doing wrong?

59
I tried luacheck with my current module:
680 source lines produced 1017 warnings and from that 1017 warnings there was ONE that made me change my code.

So the random noise is tremendous. luacheck does not know wxlua nor mach4 - so I agree with DazTheGaz.
Additionally it would be a huge job to enable luacheck to process lua code from screen.xml ...

60
Mach4 General Discussion / Re: access images from screen-file
« on: May 29, 2017, 11:56:28 AM »
good news: I got it :)

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 »