Strack01
Posts: 27
Joined: Thu Jun 09, 2016 7:02 pm

Direction Heading - Event Rule

Mon Oct 23, 2017 9:19 am

Hi,

I want to create an event rule where i am monitoring the direction in which the vehicle is moving. For basic explanation, a client of mine has vehicle either travelling south or north between two towns - and i would like to create a column header or tag - based on the result of reading the event rule.

e.g. if vehicle is travelling in NE direction - it would be called north - if traveling in SW direction - it would be called south.

However, i am struggling to just find a place where i can just pick the "heading" value - can someone please help me on this.

N -

User avatar
johan
GpsGate
Posts: 14330
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Direction Heading - Event Rule

Mon Oct 23, 2017 10:11 am

Method #1 - Use a Device mapper Script to create a Heading variable.

1. Create a variable named Heading under SiteAdmin -> Devices -> Variables

2. Create a Device Mapper Script that returns the trackPoint heading to the Heading variable
More info on Device Mapper Scripts here: http://gpsgate.com/blogComment/device_mapper_scripting

3. Create an Event Rule that uses the Header variable.

Method #2 - Use a Script Expression.

Using a scripted Event Rule you get a lot more flexibility. And you have the heading available in the API.

Script Expressions http://gpsgate.com/blogComment/script_expressions

Tips when developing Script Expressions.
http://forum.gpsgate.com/topic.asp?TOPIC_ID=18303
Regards,
Johan

GpsGate Support

Strack01
Posts: 27
Joined: Thu Jun 09, 2016 7:02 pm

Re: Direction Heading - Event Rule

Mon Oct 23, 2017 12:44 pm

Hi,

when i create the variavle "heading" what should the heading type be? Strng, Boolean or Double?

User avatar
johan
GpsGate
Posts: 14330
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

Re: Direction Heading - Event Rule

Mon Oct 23, 2017 12:56 pm

Double probably makes best sense.
Regards,
Johan

GpsGate Support

Strack01
Posts: 27
Joined: Thu Jun 09, 2016 7:02 pm

Re: Direction Heading - Event Rule

Mon Oct 23, 2017 4:35 pm

USED string and then both device mapper scripting and event rules to get the result i wanted.

thank you!!

Return to “GpsGate for Developers”