Schneider Electric GIS Tech Support

Forum discussion for Schneider Electric GIS products, including ArcFM, ArcFM Viewer, Designer, Responder, and others.
It is currently Sat May 18, 2013 8:31 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How to disable a particular AU?
PostPosted: Thu Jul 15, 2010 3:52 am 
Offline

Joined: Thu Jul 30, 2009 8:27 am
Posts: 10
Hi,

Is there any way to disable a particular attribute AU?

Cheers,
Thaviti


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Thu Jul 15, 2010 8:42 am 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
Hi Thaviti,
I have come across situations where someone needed to disable a particular AU, and the solution they decided to implement essentially was to have build a second AU. This second AU purpose would be to simply toggle some registry value given certain sets of conditions; meanwhile, the AU that they were interested in disabling would pay attention to that registry value (though I don't know the implementation specifics) and would fire or not-fire accordingly. This would probably work for your purposes if the AU you were looking to disable was custom. You may have to re-implement some of the OOTB AUs so as to modify their execute() method.

I don't believe the API allows you to specifically disable an AU, but does allow you to set the AU mode and to also implement the specific edit events to which an AU reacts to. Hopefully one of these types of controls will work for your purposes.

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Wed Jul 21, 2010 9:07 am 
Offline

Joined: Wed Feb 04, 2009 8:33 am
Posts: 10
Hi Thaviti,

we came accross this problem, and we solved with a static boolean toggle variable in the extension we have developed.

When the AU is fired, it check the static variable and exit

The static variable, in my case, is toggled by a command click, wich have to do several operations without that particular AU

The beauty of the static variable is that you can access it without initializing the class, this speaking in C#, if you use VB.Net you can add a global module and put your variable there

Hope this helps

Fra

_________________
.Net Developer
Sinergis
www.sinergis.it


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Thu Jul 22, 2010 4:30 am 
Offline

Joined: Thu Jul 30, 2009 8:27 am
Posts: 10
Dear Mat and Fra,
Thanks for ur reply.

Can you provide a sample piece of code?

Cheers
Thaviti


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Wed Aug 11, 2010 1:25 am 
Offline

Joined: Wed Feb 04, 2009 8:33 am
Posts: 10
Sorry for the delay, here i am.

For the sake of semplicity, i will use a useless class with a static variable in c#

Code:
AppVariables.cs:

public class AppVariables
{
    public static bool disable_my_autoupdater = false;
}


Note that i have not used a namespace, so this class can be referenced anywhere in your code without any prefix

Now in your autoupdater you have just to

Code:
if (AppVariables.disable_my_autoupdater)
                    return;


And here you are, now you have just to set the variable to true before the update and then set it again to false

Code:
AppVariables.disable_my_autoupdater = true;

//...your code, updates and so on

AppVariables.disable_my_autoupdater = false;


This is very IMPORTANT since a static variable keep its value, dont forget to put it again to false or your AU will never fire again until application restart

Hope this helps

_________________
.Net Developer
Sinergis
www.sinergis.it


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Wed Aug 11, 2010 7:07 am 
Offline

Joined: Thu Jul 30, 2009 8:27 am
Posts: 10
Hi Fra,

Thanks for ur reply.
This can be done if the AU is custom developed. But I am looking for an option to disable OOTB AUs i.e. ArcFM AutoUpdaters.

Please let me know, if u have any idea on this?

Thanks
Thaviti


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Thu Aug 12, 2010 1:15 am 
Offline

Joined: Wed Feb 04, 2009 8:33 am
Posts: 10
Hi Thaviti,

thats's pretty hard i think, i know only how to stop all AUs

Code:
IMMAutoUpdater pAutoupdater = new MMAutoUpdaterClass();
pAutoupdater.AutoUpdaterMode = mmAutoUpdaterMode.mmAUMNoEvents;


But i really don't know how to stop a notcustom particular one, the only way i see is to create a custom AU wich does the same job and it's stopable, or the second way could be create a custom AU wich calls the AU you need, but i don't know how to launch a specific AU from code.

I think your best solution now is to open a ticket on the support portal and have someone in Telvent helping you

Regards

Fra

_________________
.Net Developer
Sinergis
www.sinergis.it


Top
 Profile  
 
 Post subject: Re: How to disable a particular AU?
PostPosted: Thu Aug 12, 2010 5:17 pm 
Offline
Telvent North America Rep
User avatar

Joined: Thu Mar 08, 2007 2:01 pm
Posts: 37
Location: Fort Collins, CO
You could create what is called a combo autoupdater, one that executes 1 or more autoupdaters in succession, and insert logic to conditionally call a particular product autoupdater. An example of a combo autoupdater in the core ArcFM Solution would be the ArcFM Create Feeder Object, it calls the ArcFM Generic Electric Trace Weight AU followed by an ArcFM Internal FeederID Create AU. We list the rest of the combo autoupdaters in the Appendix of the ArcFM Solution Help.

You could do something similar in your code, by writing your own autoupdater, implementing IMMSpecialAUStrategyEx, that calls other autoupdaters:

Code:
private IMMSpecialAUStrategyEx _feederManagerWeightAU;
_feederManagerWeightAU = (IMMSpecialAUStrategyEx)new MMFeederGenericWtAU();


Then in the Execute method of your autoupdater, you can do the following, passing through the arguments you received when Execute was invoked:
Code:
// some custom logic here
_feederManagerWeightAU.Execute(object, mmAutoUpdateMode, mmEditEvent);
// more custom logic here


Daniel

_________________
Daniel Rouleau
Software Engineer
ImageArcFMBuzz.com
Imagewww.twitter.com/ArcFMBuzz
Imagetelvent.uservoice.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group