|
POST
|
well not the greatest programmer but basically here is my code all works fine and dandy yet if there is an update to the table while the Gallery Menu is open then she give me a 'Improper Argument Error' using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using ESRI.ArcGISExplorer; using ESRI.ArcGISExplorer.Application; using ESRI.ArcGISExplorer.Mapping; using ESRI.ArcGISExplorer.Geometry; using ESRI.ArcGISExplorer.Data; using ESRI.ArcGISExplorer.Threading; using WRMS.AVLDataSetTableAdapters; namespace WRMS { public class AvlGallery : ESRI.ArcGISExplorer.Application.Gallery { #region Fetch Data private AVLCurrentResourcesTableAdapter AvlTableAdapter = new AVLCurrentResourcesTableAdapter(); private AVLDataSet AvlDataSet = new AVLDataSet(); private int fetchCount; #endregion #region Icons Image t6resource = WRMS.Properties.Resources.T6Resource; #endregion public AvlGallery() { this.AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); fetchCount = AvlDataSet.AVLCurrentResources.Count; avlGalleryFill(); } public override void OnClick(GalleryItem item) { AvlInfoWindow avlInfo = new AvlInfoWindow(item.Caption.ToString()); avlInfo.Location = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.ConvertToScreenPoint(ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Center); avlInfo.StartPosition = FormStartPosition.Manual; avlInfo.Show(); } public override void OnUpdate() { base.OnUpdate(); if (AVL.isChecked) { this.Enabled = true; this.AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); if (fetchCount != AvlDataSet.AVLCurrentResources.Count) { this.Items.Clear(); avlGalleryFill(); } } else { this.Enabled = false; } } public void avlGalleryFill() { foreach (DataRow resource in AvlDataSet.AVLCurrentResources) { this.Items.Add(new GalleryItem(resource["Callsign"].ToString(), t6resource)); } } } } I am guessing that it would not be wise to alter the GalleryCollection while the Gallery is open???? any suggestions??
... View more
11-02-2012
05:41 PM
|
0
|
2
|
2484
|
|
POST
|
Not sure if this Helps at all but I Know that KML is really a XML file. Perhaps creating a XML reader will do the trick I have not tried this but looks good on paper key things would be the ReadToFollowing and ReadElementToString methods then the static Graphics.CreateFromXMLString() method might prove useful
... View more
11-02-2012
01:15 PM
|
0
|
0
|
504
|
|
POST
|
ahh thanks very much, yeah def still learning. have left ole VB and began using C# aww sooo much better!!!. Now I am still a bit stuck though looking at the Mapdisplay.graphics trying to pull a particular item from the Collection. still trying to figure out the Contains method kinda of seems 'not too powerful' I guess if you need to move it comes in help. Also doesn't look like you can use LINQ against the collection either??? Brian want-to-be-programmer
... View more
11-02-2012
01:03 PM
|
0
|
0
|
2357
|
|
POST
|
Has anyone attempted to Pre cache layers and attempt to have AGX run Quicker?
... View more
06-22-2012
09:23 AM
|
0
|
0
|
649
|
|
POST
|
ps you can give me a call at 541 267 1788 or cell 541 297 7469
... View more
06-22-2012
09:20 AM
|
0
|
0
|
740
|
|
POST
|
We have been starting to put agx in responding Type 6 fire engines for wildland and have started outfittin forestry with agx it is totally possible and even mounted machines in the vehicles like a MDT.
... View more
06-22-2012
09:19 AM
|
0
|
0
|
740
|
|
POST
|
Having the same issue, perhaps we have found a bug??
... View more
01-24-2012
02:06 PM
|
0
|
0
|
577
|
|
POST
|
I am actually looking into adding this functionality as well you doing it in CS or VB? I wouldn't mind helping, starting to look at the Arcglobe addin that brings multitouch features.
... View more
01-23-2012
10:40 AM
|
0
|
0
|
728
|
|
POST
|
So looking into things a bit more I see that there is the method .GetXMLSchema, so would this allow you to assign a XSD file to it and then when the .ToXMLString() method is called it will then put it out in that schema and appropriate elements??/
... View more
11-01-2011
03:33 PM
|
0
|
0
|
489
|
|
POST
|
XML Was this done in a specific way just for AGX or does it follow a standard such as GML ???? could you create a GML/GEORSS standard and use that to pass to a worker thread and still serialize also allowing for spatial data to be passed back and forth between Terminal Node Connectors and also SQL Server 2008 spatial DB's ??
... View more
11-01-2011
12:01 PM
|
0
|
1
|
1398
|
|
POST
|
was working fine and dandy was just addin little thing here a little thing there... went to run it and wham Exception when attempting to create an instance of the 'PLSSAddin.PLSSGoTo' System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at PLSSAddin.PLSSGoTo..ctor() --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at ExplorerCore.AddIn.CreateInstance() wt heck??? was up and working fine!... tested it on other machines same thing I was only changing labels and a couple names of some text boxes!!!!! this is the third time I have had this happen and each time the only way I can fix it is to totally start a new project and remake everything I have cleared the plugins cache and removed them, I have deleted the debug folder and have totally done a clean build.
... View more
10-31-2011
11:21 AM
|
0
|
1
|
2374
|
|
POST
|
I know that the Multipoint class show that a note can utilize a Multipoint geometry but when trying it is reports 'Multipoint not supported by the graphics class' I don't know if maybe this is something that should be reflected in the documentation?
... View more
10-21-2011
11:34 AM
|
0
|
0
|
678
|
|
POST
|
yeah I am trying to figure out how I would post a list(of Note) back to the UI and add them, any ideas here is what I have Public Class FlghtPthBtn
Inherits ESRI.ArcGISExplorer.Application.Button
'declarations
Private disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
Private CurrentMap As Map = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map
Private Pline As Geometry
Private RepString As StringBuilder
Private PtList As List(Of String)
Private WithEvents _bgWorker_FlightPath As ESRI.ArcGISExplorer.Threading.BackgroundWorker
Public Overrides Sub OnClick()
_bgWorker_FlightPath = New ESRI.ArcGISExplorer.Threading.BackgroundWorker
AddHandler _bgWorker_FlightPath.DoWork, AddressOf _bgWorker_FlightPath_DoWork
AddHandler _bgWorker_FlightPath.RunWorkerCompleted, AddressOf _bgWorker_FlightPath_RunWorkCompleted
Pline = disp.TrackPolyline(Color.Lime, 4)
If (Not _bgWorker_FlightPath.IsBusy) Then
_bgWorker_FlightPath.RunWorkerAsync(Pline.ToXmlString())
End If
End Sub
Private Sub _bgWorker_FlightPath_DoWork(ByVal sender As System.Object, ByVal e As ESRI.ArcGISExplorer.Threading.DoWorkEventArgs)
Dim PL As ESRI.ArcGISExplorer.Geometry.Polyline = ESRI.ArcGISExplorer.Geometry.Polyline.CreateFromXmlString(CStr(e.Argument))
Dim PLLat As String
Dim PLLong As String
Dim Brng As String
Dim PrWindow As New PrgrssFrm
Dim PtNote As String
PtList = New List(Of String)()
PrWindow.Show()
RepString = New StringBuilder()
For I = 0 To PL.PointCount - 1
PrWindow.PrgrssBrLbl.Text = "Doing " + (I + 1).ToString + " of " + PL.PointCount.ToString
PrWindow.FlghtPthPrgrssBr.Value = (I / PL.PointCount) * 100
PLLat = PL.GetPoint(I).GetLatitude.ToString("###.0000")
PLLong = PL.GetPoint(I).GetLongitude.ToString("###.0000")
If I + 1 <= PL.PointCount - 1 Then
Brng = BearingDetail(PL.GetPoint(I), PL.GetPoint(I + 1))
Else
Brng = "NA"
End If
RepString.Append((I + 1).ToString + " Lat: " + PLLat + " Long:" + PLLong + " Heading: " + Brng + " ")
'' PtNote = New Geometry(ESRI.ArcGISExplorer.Geometry.Point(PL.GetPoint(I))).ToXmlString
PtList.Add(PtNote)
e.Result = PtList
Next I
PrWindow.Close()
End Sub
Private Sub _bgWorker_FlightPath_RunWorkCompleted(ByVal sender As System.Object, ByVal e As ESRI.ArcGISExplorer.Threading.RunWorkerCompletedEventArgs)
'' Dim results As Graphic = New Geometry(ESRI.ArcGISExplorer.Geometry.Point.CreateFromXmlString(CStr(e.Result)))
MsgBox(RepString.ToString)
disp.Map.ChildItems.Add(Results)
End Sub
Public Function BearingDetail(ByVal Pt As ESRI.ArcGISExplorer.Geometry.Point, ByVal HeadPt As ESRI.ArcGISExplorer.Geometry.Point)
'Ported Over from SpotFires BearingdistanceDetail- Created by Mike Shuft and Steve O'Brien ported By Brian Locke
'Dim brg As String
Dim changex As Double
Dim changey As Double
'Dim length As Double
' Dim angle As Double
Dim quadrant As String = Nothing
changex = Pt.X - HeadPt.GetLongitude
changey = Pt.Y - HeadPt.GetLatitude
'Determine the Direction
If changex = 0 And changey = 0 Then quadrant = "You must pick two different points!"
If changex = 0 Then
If changey < 0 Then
quadrant = "S"
ElseIf changey > 0 Then
quadrant = "N"
End If
End If
If changey = 0 Then
If changex < 0 Then
quadrant = "W"
ElseIf changex > 0 Then
quadrant = "E"
End If
End If
If changey > 0 Then
If changex < 0 Then
quadrant = "NW"
ElseIf changex > 0 Then
quadrant = "NE"
End If
End If
If changey < 0 Then
If changex < 0 Then
quadrant = "SW"
ElseIf changex > 0 Then
quadrant = "SE"
End If
End If
Dim Dlon As Double = ESRI.ArcGISExplorer.Geometry.Unit.Angular.Degrees.Convert((HeadPt.GetLongitude - Pt.X), Unit.Angular.Radians)
Dim PtY As Double
Dim HeadPty As Double
PtY = ESRI.ArcGISExplorer.Geometry.Unit.Angular.Degrees.Convert(Pt.Y, Unit.Angular.Radians)
HeadPty = ESRI.ArcGISExplorer.Geometry.Unit.Angular.Degrees.Convert(HeadPt.GetLatitude, Unit.Angular.Radians)
Dim y As Double = Sin(Dlon) * Cos(HeadPty)
Dim x As Double = Cos(PtY) * Sin(HeadPty) - Sin(PtY) * Cos(HeadPty) * Cos(Dlon)
Dim brg As Double = Atan2(y, x)
Dim bearing As String = quadrant + " " + ((ESRI.ArcGISExplorer.Geometry.Unit.Angular.Radians.Convert(brg, Unit.Angular.Degrees) + 180) Mod 360).ToString("###.00°")
Return bearing 'Returns the bearing
End Function
... View more
10-20-2011
03:21 PM
|
0
|
0
|
1308
|
|
POST
|
.... Still no luck, I am getting ready to move everything over to a GDB.... Very frustrating, even the debugger seems to crash when I try to grab these reoccuring errors, they also seem to happen at anytime, even while not streaming and just idling ... not sure where to go from here to be honest.... have updated the 1750 build and the SDK, .NET 2.0 is at SP2 and have even updated our SDE to 10 and the DB to SQL Server 2008 R2 SP1 have applied all updates.... this error only seems to happen when there is SDE data present... I think.... I will know for certain after moving things off the SDE and into a GDB anyone else experiencing similar errors?
... View more
10-17-2011
09:39 AM
|
0
|
0
|
2267
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-22-2015 05:51 PM | |
| 1 | 07-22-2015 05:30 PM | |
| 1 | 07-14-2014 07:12 PM | |
| 1 | 07-29-2014 10:47 AM | |
| 1 | 07-14-2014 05:19 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2023
01:48 PM
|