10.6.1 Macro for SystemShutdown?

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
GerMan
Posts: 58
Joined: Sun Jun 28, 2009 12:05 pm
Primary Venue / Use: Professional Theatre
Where I Am: Engineer and Operator
Location: Germany

10.6.1 Macro for SystemShutdown?

Post by GerMan » Sun Jun 28, 2009 12:34 pm

Hello,

Can one construct a macro which checks by script whether is no Fixture in use and no Cue is active, and only under this prerau's settlement turns off the system?

For example, in this form:

Code: Select all

if HC.SearchFixtureProperties( 1/..., inuse,.???) then
    HC.MessageBox('Es sind noch Kreise aktiv')
else
    HC.SystemShutdown()
end
TIA, Maik

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: 10.6.1 Macro for SystemShutdown?

Post by RobertBell » Mon Jun 29, 2009 11:54 am

The easiest thing to do is check that all lights are at default levels for instance
print(HC.AttributeGetValue('1/2','Intensity', 'Pan', 'Tilt','+S'))

Should return nothing but "D"'s if they are all at defaults.
Robert Bell - Product Manager - Horizon Control Inc.

GerMan
Posts: 58
Joined: Sun Jun 28, 2009 12:05 pm
Primary Venue / Use: Professional Theatre
Where I Am: Engineer and Operator
Location: Germany

Re: 10.6.1 Macro for SystemShutdown?

Post by GerMan » Mon Jun 29, 2009 1:33 pm

Hello,
RobertBell wrote:Should return nothing but "D"'s if they are all at defaults.
thanks, but how can I evaluate this string " D C D D. . "? :?


ciao, Maik

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: 10.6.1 Macro for SystemShutdown?

Post by RobertBell » Mon Jun 29, 2009 1:37 pm

Try this:

Code: Select all

ExitOK = true
s = HC.AttributeGetValue('1/5','Intensity', 'Pan', 'Tilt','+S')
for w in string.gmatch(s, "%a+") do
   if w ~= 'D' then
      ExitOK = false
   end
end
if ExitOK then
  print('Shutting down')
  HC.SystemShutdown()
else
  HC.MessageBox('Es sind noch Kreise aktiv')
end
Robert Bell - Product Manager - Horizon Control Inc.

GerMan
Posts: 58
Joined: Sun Jun 28, 2009 12:05 pm
Primary Venue / Use: Professional Theatre
Where I Am: Engineer and Operator
Location: Germany

Re: 10.6.1 Macro for SystemShutdown?

Post by GerMan » Mon Jun 29, 2009 1:58 pm

Thanks Robert,

unfortunately, this does not work with looks. :(


ciao, Maik
Attachments
shutdown-macro.gif
Test-Macro
shutdown-macro.gif (14.42 KiB) Viewed 1147 times

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: 10.6.1 Macro for SystemShutdown?

Post by RobertBell » Mon Jun 29, 2009 3:05 pm

Right
:added: FS#1618 - HC.AttributeGetValue('+VLSD') return states should add "L" for driven from look

Until we get that done, I guess all you can do is also check for values and see if they are all zero. It's not 100% fool-proof as a look may be driving things to zero, but good enough for now:

Code: Select all

ExitOK = true
s = HC.AttributeGetValue('1/5','Intensity', 'Pan', 'Tilt','+SV')
for w in string.gmatch(s, "%w+") do
   if w ~= 'D' and w ~= '0' then
	  ExitOK = false
   end
end
if ExitOK then
  print('Shutting down')
  --HC.SystemShutdown()
else
  print('not shutting down')
  --HC.MessageBox('Es sind noch Kreise aktiv')
end
FYI - the double dash '--' is a comment. I see from your screen shot for debugging you deleted a line. Comment it out instead. You will have to remove comments in the code above to make it work.
Robert Bell - Product Manager - Horizon Control Inc.

GerMan
Posts: 58
Joined: Sun Jun 28, 2009 12:05 pm
Primary Venue / Use: Professional Theatre
Where I Am: Engineer and Operator
Location: Germany

Re: 10.6.1 Macro for SystemShutdown?

Post by GerMan » Mon Jun 29, 2009 3:30 pm

Hello,

thanks! With this macro it works very well. :)


ciao, Maik

Post Reply