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 25, 2013 8:28 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: ArcFM Silverlight SDK
PostPosted: Wed Sep 21, 2011 10:30 am 
Offline

Joined: Thu Sep 15, 2011 4:31 pm
Posts: 17
I created a new silverlight project using the template provided by Telvent and confgured it to work with our data. Everything works fine, but now I am trying to build a custom query tool which makes a query using ArcGIS API for Silverlight 2.1 and I am trying to show the results in the AttributeViewer control which is created as a part of Telvent's template. For some reason the attribute viewer does not show any of the attributes. Please let me know if I am using it correctly.

QueryTask queryTask = new QueryTask("XXXXXXX");
Query query = new Query();
query.Where = ""XXXXXX";
query.OutFields.Add("*");
query.ReturnGeometry = true;
AttributesViewer.LoadingResults = true;
queryTask.ExecuteCompleted += new EventHandler<QueryEventArgs>(queryTask_ExecuteCompleted);



void queryTask_ExecuteCompleted(object sender, QueryEventArgs e)
{
Miner.Server.Client.Tasks.IResultSet resultsSet = new Miner.Server.Client.Tasks.ResultSet(e.FeatureSet);// e.FeatureSet does have features in it
resultsSet.ID = 0;
resultsSet.Service = "XXXXXXX";
List<Miner.Server.Client.Tasks.IResultSet> resultSets = new List<Miner.Server.Client.Tasks.IResultSet>();
resultSets.Add(resultsSet);
AttributesViewer.AutoZoomToResults = true;
AttributesViewer.LoadingResults = false;
AttributesViewer.Results = resultSets;
}

Thanks,
Sai Dhalli


Top
 Profile  
 
 Post subject: Re: ArcFM Silverlight SDK
PostPosted: Wed Sep 28, 2011 1:44 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
If you look at the Identify task in MainPage.xaml in the ArcFM Silverlight sample page, around line 191-ish, notice the following two lines:
Identifying="Control_Working"
Identified="Control_WorkCompletedNoZoom"
Have a look at Control_WorkCompletedNoZoom (or Control_WorkCompleted) in MainPage.xaml.cs, this is where the results are being assigned to the Attribute Viewer. What's going on with the Identify control is that there are two events, Identifying and Identified that we are assigning an event handler to, Control_Working and Control_WorkCompletedNoZoom.

So I think that with your code, what you need to do is to raise one or more events while your control is processing, and when it has finished, assign the Control_WorkCompleted or Control_WorkCompletedNoZoom handlers to it.

Attached is a sample that I'd previously written based on the electric trace task on the resource center ( http://server.arcfmsolution.com/ ):

the xaml in mainpage.xaml:
Code:
<local:RibbonPanel>
<local:ElectricTracing x:Name="ElecTrace" MapControl="{Binding ElementName=MapControl}"
Traced="Control_WorkCompleted"/>
</local:RibbonPanel>


If you follow a model similar to this with your events, you should see your results populate into the Attribute Viewer automatically.

I hope this helps. Let me know if you need any additional explanation.


Attachments:
File comment: ElectricTracing.xaml
ElectricTracing.xaml.cs

ElectricTracing.zip [2.12 KiB]
Downloaded 76 times

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric
Top
 Profile  
 
 Post subject: Re: ArcFM Silverlight SDK
PostPosted: Wed Sep 28, 2011 6:11 pm 
Offline

Joined: Thu Sep 15, 2011 4:31 pm
Posts: 17
Am doing the same thing. I still cant get it work.

Do we need to enable the ArcFM server extension on those map services for this to work ?


Top
 Profile  
 
 Post subject: Re: ArcFM Silverlight SDK
PostPosted: Thu Sep 29, 2011 2:39 pm 
Offline
Telvent North America Rep
User avatar

Joined: Fri Nov 20, 2009 4:46 pm
Posts: 74
Not that I know of. The client shouldn't be able to tell if a given map service has the ArcFMMapServer capability checked and will behave the same regardless. Instead, if that capability isn't assigned, the server will respond differently to the client.

If you intercept the URL that the silverlight app is sending to the REST endpoints (such as with wireshark or fiddler), and then enter that URL into a web browser yourself, what do you get? Do you actually get results?

_________________
Matt Denton
Senior Technical Support Engineer
Schneider Electric


Top
 Profile  
 
 Post subject: Re: ArcFM Silverlight SDK
PostPosted: Fri Sep 30, 2011 10:43 am 
Offline

Joined: Thu Sep 15, 2011 4:31 pm
Posts: 17
Yes, I am able to work through the rest end point and perform all the queries from there.


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