|
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 [ 191.52 KiB | Viewed 1522 times ]
|

ExceptionDetail.JPG [ 178.41 KiB | Viewed 1522 times ]
|
|