Help with a plug-in???
Posted: Mon Feb 25, 2008 3:22 pm
Hello, I'm writing on a plug-in and I would like to ask if someone can give me advice of the following:
In the plug in I have a class DeviceCT for definition of counter objects. The user can set the counter number (1 or 2) and a counter limit for each (from 1 and up).
The class definition looks like this
My problem is how I can read the configured values from anywhere in the plug-in code (like from code inside another class or in my case a thread). How can I read the actual values from ctr_ctrl and ctr_limit above? Do I have to make them eg.globals or is there a more clever way?
Thanks in advance, Walter
In the plug in I have a class DeviceCT for definition of counter objects. The user can set the counter number (1 or 2) and a counter limit for each (from 1 and up).
The class definition looks like this
Code: Select all
class DeviceCT(object):
def Configure(self, ct = 1, ctl = 5):
nbr_list = []
for i in range(255):
nbr_list.append(str(i))
panel = eg.ConfigPanel(self)
ctr_ctrl = panel.Choice(ct, choices=['', '1', '2'])
panel.AddLine("Counter", ctr_ctrl)
ctr_limit = panel.Choice(ctl, choices=nbr_list)
panel.AddLine("Counter limit", ctr_limit)
while panel.Affirmed():
panel.SetResult(ctr_ctrl.GetValue(), ctr_limit.GetValue())
Thanks in advance, Walter