PDA

View Full Version : Component Manager Issues



harleydude
January 24th, 2007, 07:36 PM
In working with the Component Manager the past few weeks I have made notes of the following items. Some things I have just accepted as part of an evolving new product, found work arounds and moved on. Somtimes I have spent an hour or more looking at new code and trying to decide on where to go with each new release. Dont get me wrong, I think the CM is a wonderful piece of work and has made the job of creating plugins much easier and provided a common interface in which to do so. So here is what I have so far.

1. Somtimes on Girder reset components dont load. I may have 5 components active and when I do a reset the only component loaded is Geographical Location.

2. Is using the InstanceContainer class the preferred method of programming components even if a component will only use one instance of a class?

3. The only way I have been able to make config DUI pages is to copy one of the original DUI interfaces and remove the DUI form and group node it belongs to and start from there. If I try to create from scratch I get another Misc Components box on the left side of the CM.

4. A lot of quirkiness with the DUI designer. Sometimes when I save the file and reset G, the changes do not appear. I have to go back to the designer click on a few items and then save and everything then shows up.

All for now.

Rick

Promixis
January 25th, 2007, 07:11 PM
In working with the Component Manager the past few weeks I have made notes of the following items. Some things I have just accepted as part of an evolving new product, found work arounds and moved on. Somtimes I have spent an hour or more looking at new code and trying to decide on where to go with each new release. Dont get me wrong, I think the CM is a wonderful piece of work and has made the job of creating plugins much easier and provided a common interface in which to do so. So here is what I have so far.

1. Somtimes on Girder reset components dont load. I may have 5 components active and when I do a reset the only component loaded is Geographical Location.

2. Is using the InstanceContainer class the preferred method of programming components even if a component will only use one instance of a class?

3. The only way I have been able to make config DUI pages is to copy one of the original DUI interfaces and remove the DUI form and group node it belongs to and start from there. If I try to create from scratch I get another Misc Components box on the left side of the CM.

4. A lot of quirkiness with the DUI designer. Sometimes when I save the file and reset G, the changes do not appear. I have to go back to the designer click on a few items and then save and everything then shows up.

All for now.

Rick

1. If there is a script error during certain point the CM will forget enabled components.

2. No, I wouldn't use it then -> but if there are > 1 there is a base dui class to make handling them very easy.

3. This is for Ron -> we are going to be rearranging the various setup pages shortly.

4. True. Question of where we spend our resources :) If you click on the page on the left and then save usually it works :D

harleydude
January 25th, 2007, 07:22 PM
4. True. Question of where we spend our resources :) If you click on the page on the left and then save usually it works :D

That is the method I have found to work, however I sometimes forget. :(

harleydude
January 25th, 2007, 07:51 PM
2. No, I wouldn't use it then -> but if there are > 1 there is a base dui class to make handling them very easy.

When I was running HomeSeer, I used to have a plugin that pinged the other computers on my network to make sure they were still online. I am wanting to do the same with G5. Is this something that would be applicable to using the InstanceContainer classes, creating a instance for each computer, or would this be overkill?

Promixis
January 26th, 2007, 07:54 AM
no, i think that would be the best way.

follow the custom weather component.

harleydude
January 26th, 2007, 07:42 PM
5. When using the InstanceContainer class, how do I modify the settings to add additional or modify existing fields from the Component class that it loads. It appears that when the component class is loaded that it only receives a copy of the settings and I can't make changes to the presist across resets/restarts. From the DUI script I used componet:GetInstance({Name = name}) and I have tried self:GetInstance({Name = name}) and neither worked. I am sure I could try NetworkMonitor:GetInstance({Name = name}), but wonder if this will meet my needs or is the proper way of doing it.

Rick

Promixis
January 27th, 2007, 12:38 PM
Rick, it should be automatic, ie you Add an instance and it should persist. See the CW UI file for how it creates a new instance of the CW Class.

harleydude
January 27th, 2007, 03:38 PM
Yes my settings do presist across resets/restarts.

When the InstanceContainer loads an instance of my luascript\classes\NM.lua file it passes a copy of the settings to that instance. I would like to get access to the real settings and make a change to one of the fields.

Rick

Promixis
January 28th, 2007, 10:49 AM
see the container component class.

GetInstanceSettings returns the instance

maybe we need an UpdateInstanceSetting method?

harleydude
May 24th, 2007, 08:34 PM
Did UpdateInstanceSettings make it in any of the new releases?

Rob H
May 25th, 2007, 12:46 AM
No, it doesn't look like it.

Promixis
May 25th, 2007, 06:41 AM
No, it doesn't look like it.

how should this work...

ie kill and restart the instance? or change a property via a predetermined method?

harleydude
May 25th, 2007, 05:08 PM
I would prefer a method, and maybe also an event that indicated an update to the new settings.

Rob H
May 26th, 2007, 12:36 AM
What are you trying to achieve?

harleydude
June 4th, 2007, 05:43 AM
Another issue that I found a while back, but forgot to mention.

I was doing a script engine reset and G5 crashed. When I started it back up I noticed that I had lost several days for CID data. If I understand the CM architecture correctly, settings are loaded upon script startup and not saved until either a script engine reset is done or G5 is gracefully shutdown. Is there a method in place that would allow for periodic saves or is this something that needs to be handled by a timer put into the plugins?

Thanks

Promixis
June 4th, 2007, 06:30 AM
Another issue that I found a while back, but forgot to mention.

I was doing a script engine reset and G5 crashed. When I started it back up I noticed that I had lost several days for CID data. If I understand the CM architecture correctly, settings are loaded upon script startup and not saved until either a script engine reset is done or G5 is gracefully shutdown. Is there a method in place that would allow for periodic saves or is this something that needs to be handled by a timer put into the plugins?

Thanks


You can call

self:SaveSettings ()

whenever you want. Savings are only saved when changed from the UI. We do not save persisted variables (ie the CID LOG) everytime they change as this would overload the system for some components.

harleydude
June 4th, 2007, 06:36 AM
So multiple days worth of call data are not lost, how would one tell the CID plugin to save settings?

quixote
June 4th, 2007, 06:49 AM
Would it not be possible to use gir.WriteConfigTable? You could just save the whole table, no?

Promixis
June 4th, 2007, 01:18 PM
Would it not be possible to use gir.WriteConfigTable? You could just save the whole table, no?

That is what the base code uses.

We can change the behaviour to store with each new call. Shouldn't be a big burden on the system.

jwilson56
June 4th, 2007, 02:09 PM
Well if not every call then at least a couple times a day maybe. I too have lost not only the Caller ID info but also things like schedules I have added after I have had G5 crash later and for some reason things were not saved.

John

Promixis
June 4th, 2007, 02:36 PM
So multiple days worth of call data are not lost, how would one tell the CID plugin to save settings?


added for next release

harleydude
June 4th, 2007, 07:19 PM
Cool, thanks Mike.

harleydude
June 6th, 2007, 10:41 AM
Any time frame on next release?