Schneider Electric GIS Tech Support

Forum discussion for Schneider Electric GIS products, including ArcFM, ArcFM Viewer, Designer, Responder, and others.
It is currently Mon May 20, 2013 11:03 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Acessing ElectricSources through ArcFM server giving error
PostPosted: Mon Jun 07, 2010 9:39 am 
Offline

Joined: Fri Jan 08, 2010 5:26 am
Posts: 9
Location: India
Acessing ElectricSources through ArcFM server giving error. Following is the code sniplet, same works fine if implement in desktop

Code to execute on FeederManager Find button click

//get ServerContext from MapService
IServerContext sc = null;
string resourceName = "MapResourceItem0";
ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality mapfunc = Map1.GetFunctionality(resourceName);
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal mapResource = mapfunc.Resource as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal;
sc = mapResource.ServerContextInfo.ServerContext;

//Get IMap from ServerContext
IMapServer mapser = mapResource.MapServer;
IMapServerObjects mapObj = (IMapServerObjects)mapser;
IMap mapIObj = mapObj.get_Map(mapser.DefaultMapName);


//Get The GeometricNetwork name
INetworkClass pNetClass = null;
IGeometricNetwork pGeomNet = null;
IDataset pNetDataset = null;
IFeatureLayer pFLayer = null;
int count=0;
pFLayer = mapIObj.get_Layer(count++) as IFeatureLayer;
while(!(pFLayer.FeatureClass is INetworkClass))
{
pFLayer = mapIObj.get_Layer(count++) as IFeatureLayer;

}
ElectricSources eSource;

if (pFLayer.FeatureClass is INetworkClass)
{
pNetClass = (INetworkClass )pFLayer.FeatureClass;
pNetDataset = (IDataset )pNetClass.GeometricNetwork;
pGeomNet = pNetClass.GeometricNetwork;
eSource = new ElectricSources(pGeomNet);
}

Miner.Interop.IMMFeederSource fSource = eSource.AvailableFeeders["EV-01"];

IMMFeederSpace feederSpace = eSource.FeederSpace;

IPropertySet properties = new ESRI.ArcGIS.esriSystem.PropertySet();
properties.SetProperty("SearchType",0); // Convert.ToInt32 (drListFeeder.SelectedItem.Value));
properties.SetProperty("Phase", -1); //drEnergised.SelectedItem.Value);
properties.SetProperty("Feeders", fSource);
properties.SetProperty("LinesOnly", null);
properties.SetProperty("AutoZoom", null);
properties.SetProperty("FeederSpace",feederSpace);
properties.SetProperty("SelectableLayersOnly", null);

IMMSearchConfiguration config = new SearchConfiguration();
config.SearchParameters = properties;
Miner.Framework.Search.Strategies.FeederManagerSearch fSearch = new Miner.Framework.Search.Strategies.FeederManagerSearch();
MMSearchControl serchContol=new MMSearchControl();
IMMSearchResults result = fSearch.Find(config, serchContol);




Error while getting fSource
eSource evaluation fails with following exception
{Miner.Geodatabase.Integration.ElectricSources}
AvailableFeeders: Function evaluation timed out.
AvailableSubstations: Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
FeederSpace: Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
SourceEIDs: Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
SubSourceLookup: Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
SubSources: Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 07, 2010 2:29 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
It looks like you may be running into a timeout issue of some sort. Assuming you're using 9.3.1, I recommend checking the following ArcFM Help Documentation to tweak your timeout settings: Configuring ArcFM Solution > ArcFM Server > ArcFM Viewer for ArcGIS Server > Optional Configurations. There are a few sub-categories in there with articles on adjusting various timeouts.

Also, I recommend testing the functionality of this button against small networks to verify functionality. Because a Server application is a web application, it doesn't like to deal with 30,000+ features and can take a very, very long time to do so (unlike Desktop); that is likely the root of the issue here.

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
 Post subject: Acessing ElectricSources through ArcFM server giving error
PostPosted: Tue Jun 08, 2010 3:55 am 
Offline

Joined: Fri Jan 08, 2010 5:26 am
Posts: 9
Location: India
Thanks Denton for reply, but problem still not resolved

The same exception occurs even when we test the application only with one feeder left in the map service and increase time-outs in the configuration settings of the application for AJAX, sessionState, JavaScript and Network time-outs.

What we noticed here is the exception comes less than 20 Sec. We tested with the feeder data of around 1000 features also.

We had run the downstream trace on one of the biggeste feeder and it got executed successfuly in web but while accessing ElectricSources we are getting the error. NOt able to understand why it is happening


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2010 5:04 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
What sort of work have you done thus far in terms of debugging? It would be really helpful to know what line is choking the tool. I recommend inserting some debug text, or stepping through the code one line at a time to find out exactly where it crashes. That might give some additional insight as to what is happening.

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2010 5:15 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
As an additional note, I searched the ArcFM Server Developer Help Guide, and didn't find mention of IMMFeederSource, or FeederSource. Since the error message in the Miner Event Log seems to indicate that the error occurs getting fSource, I would say that if, during your debugging, you find that the line which causes the tool to crash is:
Miner.Interop.IMMFeederSource fSource = ....
then, the problem is because that isn't available in Server. That conclusion is supported by the fact that your code works as-is in a desktop environment.

Let me know how the debugging goes.

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
 Post subject: Re: Acessing ElectricSources through ArcFM server giving err
PostPosted: Thu Jul 15, 2010 10:13 am 
Offline

Joined: Fri Jan 08, 2010 5:26 am
Posts: 9
Location: India
We able to get the electric sources now with the code given below but not able to run the feeder manager search, code attached and also attaching the screenshots of debugger

protected void btFind_Click(object sender, EventArgs e)
{

//get server context
IServerContext sc = null;
string resourceName = "MapResourceItem0";
ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality mapfunc = Map1.GetFunctionality(resourceName);
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal mapResource = mapfunc.Resource as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal;
sc = mapResource.ServerContextInfo.ServerContext;
IMapServer mapser = mapResource.MapServer;
IMapServerObjects mapObj = (IMapServerObjects)mapser;
IMap mapIObj = mapObj.get_Map(mapser.DefaultMapName);

/******************************************************************************************************************************/
//get Geometric network

INetworkClass pNetClass = null;
IGeometricNetwork pGeomNet = null;
IDataset pNetDataset = null;
//IEnumLayer pEnum = null;
IFeatureLayer pFLayer = null;

int count=0;
pFLayer = mapIObj.get_Layer(count++) as IFeatureLayer; //Search the map only for IGeoFeatureLayer

while(!(pFLayer.FeatureClass is INetworkClass))
{
pFLayer = mapIObj.get_Layer(count++) as IFeatureLayer;

}
ElectricSources eSource=null;

if (pFLayer.FeatureClass is INetworkClass)
{
pNetClass = (INetworkClass )pFLayer.FeatureClass;
pNetDataset = (IDataset )pNetClass.GeometricNetwork;
pGeomNet = pNetClass.GeometricNetwork;
eSource = new ElectricSources(pGeomNet);
}


Miner.Interop.IMMFeederSource fSource = eSource.AvailableFeeders["EV-01"];

IMMFeederSpace feederSpace = eSource.FeederSpace;
Miner.Interop.IMMEnumFeederSource fEnumSource = feederSpace.FeederSources;
IPropertySet properties = new ESRI.ArcGIS.esriSystem.PropertySet();
properties.SetProperty("SearchType", mmFeederManagerSearchType.mmFMSearchAllFeeders); // Convert.ToInt32 (drListFeeder.SelectedItem.Value));
properties.SetProperty("Phase", mmPhasesToTrace.mmPTT_Any); //drEnergised.SelectedItem.Value);
properties.SetProperty("Feeders", fEnumSource);
properties.SetProperty("LinesOnly", mmTriState.mmTSFalse);
properties.SetProperty("AutoZoom", mmTriState.mmTSFalse);
properties.SetProperty("FeederSpace",feederSpace);
properties.SetProperty("SelectableLayersOnly", false);

IMMSearchConfiguration config = new SearchConfiguration();

Miner.Framework.Search.Strategies.FeederManagerSearch fSearch = new Miner.Framework.Search.Strategies.FeederManagerSearch();
config.SearchParameters = properties;





IMMSearchResults result = fSearch.Find(config, serchContol);
}


Attachments:
Editor.JPG
Editor.JPG [ 191.52 KiB | Viewed 1522 times ]
ExceptionDetail.JPG
ExceptionDetail.JPG [ 178.41 KiB | Viewed 1522 times ]
Top
 Profile  
 
 Post subject: Re: Acessing ElectricSources through ArcFM server giving err
PostPosted: Wed Jan 05, 2011 3:28 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
After a chat with a developer, it is likely that the problem here is that a map is needed for Feeder Manager to do its stuff. In a Desktop or Engine environment, we rely on grabbing that focus map from a runtime environment. But, unfortunately, that's not available to us in Server - this is why you're basically getting a null object error; the map is null.

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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