Magellan eXplorist: Automation

A new (hopefully) iteration with Magellan eXplorist tools – an automation objects to script GPS data processing. The idea is to provide scriptable objects to access GPS data for various tasks from just logging into file to [the target is believable to be] publishing geolocation information in real time through Jabber/XMPP server in conformance with XEP-0080: User Geolocation.

Currently, it is a lower layer serial connection object to GPS communication port, AlaxInfo.MagExpToo.SerialConnection.

The script below prints GPS NMEA-0183 output to console:

C:\>cscript 01.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Assumed Port: COM10
Input: $GPGSV,3,1,12,07,87,031,,24,79,094,,06,77,089,,21,55,222,*71
Input: $GPGSV,3,2,12,10,33,059,,16,31,309,,30,30,164,,31,21,253,*7F
Input: $GPGSV,3,3,12,05,14,159,,18,05,178,,12,03,151,,02,02,056,*73
Input: $PMGNST,02.03,3,F,819,04.6,-00096,20*59
Input: $GPGSV,3,1,12,07,87,031,,24,79,094,,06,77,089,,21,55,222,*71
Input: $GPGSV,3,2,12,10,33,059,,16,31,309,,30,30,164,,31,21,253,*7F
Input: $GPGSV,3,3,12,05,14,159,,18,05,178,,12,03,151,,02,02,056,*73
Input: $PMGNST,02.03,3,F,819,04.6,-00096,20*59
...


Copy paste sample code into 01.js file:

function SerialConnection_Error(Code)
{
WScript.Echo("Error: " + Code.toString());
}
function SerialConnection_Input(Lines)
{
LineArray = (new VBArray(Lines)).toArray();
for(Index = 0; Index < LineArray.length; Index++) WScript.Echo("Input: " + LineArray[Index]); }

SerialConnection = WScript.CreateObject("AlaxInfo.MagExpToo.SerialConnection");
WScript.Echo("Assumed Port: " + SerialConnection.AssumedPort);
SerialConnection.Port = SerialConnection.AssumedPort;
WScript.ConnectObject(SerialConnection, "SerialConnection_");
try
{
SerialConnection.Connect();
while(true)
{
WScript.Sleep(1000);
// NOTE: Dead loop
}
}
catch(Error)
{
WScript.DisconnectObject(SerialConnection);
throw Error;
}
WScript.DisconnectObject(SerialConnection);

There will be more to interpret certain NMEA sequences, in particular the ones that refer to fixed position.

Application Name: Alax.Info Magellan eXplorist Tools
License: Free for personal use, request commercial licenses via email or contact form
Latest Version: 1.0.3
Download Link: See updated version 1.0.4

Leave a Reply