More info from GPS camera

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

More info from GPS camera

#1

Post by Jean-Francois »

Hello Robin,

I tried to read some additional information from the QHY174GPS camera in a script.
I know how to read or change the LED, or other GPS status (for example: SharpCap.SelectedCamera.Controls.FindByName("GPS Calibration LED").Value)
But how can I read in a script the GPS coordinates or the UTC time from the GPS receiver (camera) ?

I started to write a new script for the occultation observation.
I programmed a new Addin for OccultWatcher for the occultation event information.
Now, I wish to write in SharpCap a script for a little bit more automatism during the preparation of the observation.

So here my list of functions that I wish to call from the script ?

- UTC time (date) from the camera GPS receiver
- GPS coordinates + altitude (if available)
- Set the "Target Name" for the capture
- ... certainly more later

In addition I wish to show a countdown (where "0" is the programmed start time of the observation).
How can I program it in IronPython without using to much processor resource ?

Best regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13350
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: More info from GPS camera

#2

Post by admin »

Hi,

sounds like the easiest thing would be to work out some way of giving you access to the full GPS status object, from which you could pick and choose the data you need. I will see if there is a tidy way to do that.

On the countdown front, the way to go is to create a System.Windows.Forms.Timer on your countdown form. Add an event handler to the .Tick event, set the interval to 1000 (1000ms) and call .Start() on it. It will then call back your event handler every second until you call .Stop() and it does it in an efficient way.

cheers,

Robin
User avatar
admin
Site Admin
Posts: 13350
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: More info from GPS camera

#3

Post by admin »

How about this

Code: Select all

>>> print (SharpCap.SelectedCamera.LatestStatus.AdditionalStatus["GPS"])
Status     : PartialData
Sequence # : 5722
Latitude   : 0.0000000
Longitude  : 0.0000000
Altitude   : NaN
Start      : 2023-04-02T14:53:18.0000000Z
Start (us) : 21696.1
End        : 2023-04-02T14:53:18.0000000Z
End   (us) : 41732.6
Now        : 2023-04-02T14:53:18.0000000Z
Now   (us) : 41732.6
PPS Counter: 10000500
Exp. (us)  : 20036.5
Sys Clock  : 0.528s ahead of GPS
System/GPS offset stable for : 0:01:16
# Sats     : 0
FixTime    : 14:53:17
FixQuality : Invalid
Hdop       : 99.99
$GPRMC,145317.00,V,,,,,,,020423,,,N*7F
$GPVTG,,,,,,,,,N*30
$GPGGA,145317.00,,,,,0,00,99.99,,,,,,*63
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,4,1,16,03,,,22,07,,,27,08,,,23,13,,,23*70
$GPGSV,4,2,16,15,,,20,16,,,27,17,,,22,18,,,22*73
$GPGSV,4,3,16,24,,,21,25,,,22,27,,,34,28,,,22*73
$GPGSV,4,4,16,29,,,22,30,,,23,31,,,23,32,,,23*74
$GPGLL,,,,,145317.00,V,N*4F
$GPRMC,?3?DN*64
$GPTXT,01,01,02,ANTSTA

You can also access the fields of the GPS Status

Code: Select all

>>> print (SharpCap.SelectedCamera.LatestStatus.AdditionalStatus["GPS"].Altitude)
nan
>>> print (SharpCap.SelectedCamera.LatestStatus.AdditionalStatus["GPS"].FixQuality)
Invalid
Will be in the next SharpCap 4.1 update.

cheers,

Robin
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: More info from GPS camera

#4

Post by Jean-Francois »

Hello Robin,

Thanks for the help.
I will try next week the timer and the GPS additional status.

Good evening,
Jean-Francois
Post Reply