ArcPad Scripting Object Model
Satellites Property
See Also  Example  Send comments on this topic.
GPS Object : Satellites Property

Glossary Item Box

Description

Returns a reference to the Satellites collection.

Property type

Read-only property

Syntax

Set variable = object.Satellites ( [InView] )

Return Type

Satellites Object

Remarks

If the InView argument is True, the Satellites collection contains all Satellites communicating with ArcPad. If it is False (the default), the Satellites collection contains the Satellites used in the current position only.

Example

Satellite Object Example
Displays information about GPS Satellites communicating with ArcPad.
Satellite Object Example (VBScript)Copy Code
'++ call Handle_OnPosition in the GPS_OnPosition event handler
Sub Handle_OnPosition
      Dim a, b
      'a = PrintView()
      b = PrintUsed()

      'Console.Print "View: " &   CStr(a)
      Console.Print "Used: " & CStr(b)
End Sub


Function PrintUsed
  Dim u
Set u = GPS.Satellites
  Console.Print "------------"
Console.Print "SatellitesUsed: "   & CStr(u.Count)
Console.Print "------------"
  Dim s
For Each s In u
    Call PrintSat(s)
Next

  PrintUsed = u.count

End Function

Function PrintView
Dim v
  Set v = GPS.Satellites(True)
Console.Print "------------"
  Console.Print "GPS Protocol: " & GPS.Protocol
Console.Print "SatellitesView: "   & CStr(v.Count)
Console.Print "------------"
  Dim s
For Each s In v
    Call PrintSat(s)
Next

  PrintView = v.Count
End Function

Sub PrintSat(s)
      Dim blnString
      If (s.InUse) Then
            blnString = "True"
      Else
            blnString = "False"
      End If
      Console.Print "PRN: " & CStr(s.PRN)
      Console.Print "--InUse: "   & blnString
      Console.Print "--Elevation: " & CStr(s.Elevation)
      Console.Print "--Azimuth: "   & CStr(s.Azimuth)
      Console.Print "--SignalStrength: " & CStr(s.SignalStrength)
      Dim m
      For m = 0 to 3
            If (s.Properties("MeasurementID", m) <> 0) Then
                  Console.Print "--Measurement: "   & CStr(m)
                  Console.Print "----ID: " & CStr(s.Properties("MeasurementID", m))
                  Console.Print "----Type: " & CStr(s.Properties("MeasurementType", m))
                  Console.Print "----Units: " & CStr(s.Properties("MeasurementUnits", m))
                  Console.Print "----Value: " & CStr(s.Properties("MeasurementValue", m))
            End If
      Next
      If ("SiRF" = GPS.Protocol) Then
            Console.Print "--TimeTag: " & CStr(s.Properties("TimeTag"))
            Console.Print "--GPSSoftwareTime: " & CStr(s.Properties("GPSSoftwareTime"))
            Console.Print "--Pseudorange: " & CStr(s.Properties("Pseudorange"))
      End If
End Sub

See Also

© 2012 All Rights Reserved.