Hello Guest it is April 13, 2021, 09:36:45 PM

Author Topic: more lua (?) questions  (Read 5346 times)

0 Members and 1 Guest are viewing this topic.

Re: more lua (?) questions
« Reply #30 on: May 04, 2017, 06:54:37 AM »
Hello,

I noted a behaviour that looked strange to me:
I changed the enabled-state of the Jog-buttons to be enabled when idle only

The button has as down-function the jog-action and as up-function stop jogging.

I could press the button in idle state, but the release-function did not fire. I couldn't stop the motion. Not with stop-button, not by opposite-button.
I had to power off the machine.

It took a while until I understood, what happened: the enable-condition is checked for press-down and release each. Does that behaviour make sense?

From my point of view, the check for the release action makes sense only when there's no press-down function attached.
But may be, I don't see all aspects ...
Re: more lua (?) questions
« Reply #31 on: May 06, 2017, 12:33:00 AM »
@smurph
Did you received my translations? Could you have a look at it already?

@all
The fixture-sample seems not to work (see picture below).
Additionally the values of the axis looks quite strange to me.
All axis where set to 0 when I entered the fixtures in the dialog grid. I then closed the dialog to refresh my notebook page and reopened the dialog again.
What's about the value of the A-Axis? I find no way to calculate the displayed dro-Value from the fixtures entered. Even if I take into account, that the A-Value might wrap at 360° (will it?)

The fixture-dialog seems to use a different value of mc.MC_FIXTURES_START - or why don't I get the values, when I coded the formula from your sample?

I'm very lucky - the smoothstepper arrived yesterday :)
Looking at the config dialogs of smoothstepper leads to the question: when do I need to code a plugin and what can be done with modules?

Don't know, whether I got it right: I read in faq of smoothstepper, that mach changes location of poundvars between releases.
Really? - or is it my/some misunderstanding?
Re: more lua (?) questions
« Reply #32 on: May 08, 2017, 08:31:44 AM »
Quote
The fixture-dialog seems to use a different value of mc.MC_FIXTURES_START - or why don't I get the values, when I coded the formula from your sample?
I solved the problem on my own ;)

There's another gap in the pound vars between G59 and G54.1 P# - so I fixed GetID from "LuaExamples/Fixture Offset Table.mcs", which I renamed to getFixtureID():
Code: [Select]
--------------------------------
--This returns the #variable that is associated with a given row of the offset table.
--------------------------------
function getFixtureID(row, axis)
    local index = 0;
    local exFixStart = 7001;

    if (row == 0) then
        index = mc.SV_WORK_SHIFT_X + axis
    elseif (row == 1) then
        index = mc.SV_HEAD_SHIFT_X + axis
    elseif (row > 1 and row < 8) then
        -- G54 .. G59
        --                  5221                                    -- 20
        index = (mc.MC_FIXTURES_START + axis + ((row - 2) * mc.MC_FIXTURES_INC))
    else
        -- G54.1 .. G54.100
        index = (exFixStart + axis + ((row - 8) * mc.MC_FIXTURES_INC))
    end
    return (index);
end
with this patched function I get all fixtures of the grid :)

cheers Reinhard
Re: more lua (?) questions
« Reply #33 on: May 08, 2017, 09:25:48 AM »
Glad you have posted this bacause I need thus capability for my system but still stuck on the basics of file i/o and table manipulation.
Danke fiel mals again!
Keith