screenset getlayer ?? layerfield??

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

screenset getlayer ?? layerfield??

Postby Robertspark » Fri Dec 01, 2017 2:57 pm

I know that there is a setlayer function,

and I know that there are a number of LED's (50) which illuminate depending upon which screenset layer is in focus / selected

But I was wondering if there was a "getlayer" function or a field number which would be able to return the current screenset layer number?

I am toying with some macros and macoloops which I am intending will utilse a switch statement to use the toolpath view to display something depending upon which layer is active

It seems that we can have layers numbered up to 999, hence lets say I had some screensets which were 900 - 950, if I were able to know which of the ones were active I would be able to use the macroloop to calculate some gcode on the fly, compile / create a gcode file, and load the file which would display the gcode....

That's an option... but I need to know what the current layer is....

Thanks in advance as always
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: screenset getlayer ?? layerfield??

Postby dezsoe » Fri Dec 01, 2017 3:20 pm

I could only manage this problem re-using the missing layers. There are LEDs 161 to 211 to show active layer, but some layers are missing, so I re-used them starting at 26 to have LEDs to query them. I made a map of the layers to see the "holes". I am also missig the AS3.Getcurrentlayer() function!

Map (of version 1.2042):
Code: Select all
1           Main
  2           Run
  3           Toolpath
  4           Offsets
    20          G54
    21          G55
    22          G56
    23          G57
    24          G58
    25          G59
  5           Tools
    46          1..48
    47          49..96
    48          Probe
  6           Configure
    7           Axis setup
      13          X
      14          Y
      15          Z
      16          A
      17          B
      18          C
      19          Spindle
      55          Aux enc.
    8           I/O setup
    9           General settings
    10          Appearance
    42          I/O trigger
      43          Input trigger
        53          1..48
        54          49..96
      44          Output trigger
        51          1..48
        52          49..96
      11          Hotkeys
        49          1..48
        50          49..96
    12          Profiles
  36          Diagnostics
  45          CAM
  37          Help
    38          Supported g-codes
    39          Supported m-codes
    40          Supported other codes
    41          About
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: screenset getlayer ?? layerfield??

Postby dezsoe » Fri Dec 01, 2017 3:39 pm

I forgot to write that the Getactivelayer() is not so easy, because in the same time more than one layer can be active. E.g.: Config/axis setup/X axis layer selected means that config layer, axis setup layer and X axis layer is active. It's easy to query with LEDs, but how much LED to use for it? Maybe, Getactivelayer should give a list of layers as a result.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: screenset getlayer ?? layerfield??

Postby Robertspark » Fri Dec 01, 2017 3:55 pm

Thanks,

I see the problem with a "getlayer" function, as it would return the active layer + parent layers active too .... hmmm bit of a problem....

I didn't want to use the layers not presently used because they can change by UC controller (a bit) because some layers are not available for the UC100 ..... and I was hoping to make something a bit universal (all use layer 900+ for example.... [or some other high fixed number])

Note, there isn't a AS3.Getcurrentlayer() function at present (in version 1.2046 anyway)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: screenset getlayer ?? layerfield??

Postby dezsoe » Fri Dec 01, 2017 4:08 pm

Robertspark wrote:Note, there isn't a AS3.Getcurrentlayer() function at present (in version 1.2046 anyway)

That's why I wrote I'm missing it. :)
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Macros

Who is online

Users browsing this forum: No registered users and 7 guests

cron