Exemplo n.º 1
0
 public TrackerAlarm(VT310eAlarmLocationMessage msg)
 {
     _msg = msg;
     base.SetTrackerInfo(msg);
     Time     = msg.ClientRecordedDateTime;
     _alarmId = _msg.AlarmID;
 }
Exemplo n.º 2
0
        protected string _eventDescriptionTemplate = "GPS Tracking for {0} has been turned on";// we should be pulling this from the DB per client for each type? TODO

        public TrackerTurnedOn(VT310eAlarmLocationMessage msg) : base(msg)
        {
        }
Exemplo n.º 3
0
        protected string _eventDescriptionTemplate = "Battery is critically low on {0}";// we should be pulling this from the DB per client for each type? TODO

        public LowBattery(VT310eAlarmLocationMessage msg) : base(msg)
        {
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the list of events from a location Message analysis for the vt310e
        /// </summary>
        /// <returns></returns>
        public List <Event> GetVT310eEvents(GTSLocationMessage locationMessage, GTSLocationMessage prevMessage)
        {
            List <Event> events = new List <Event>();


            // should link geofence checking in here

            // Need to check all known events
            // Currently we have no case where an event can point to more than one event at a time - this may change when geo fencing is put in!!!! TODO
            // Wondering If there should be a separation of events by a level of priority for reporting here or in the DB? In the DB


            if (prevMessage != null && locationMessage.Id == 0)
            {
                locationMessage.Id = prevMessage.Id;
            }

            Event theEvent;

            if (locationMessage.Speed > 0)
            {
                theEvent = createSpeedingEvent(locationMessage, prevMessage);
                if (theEvent != null)
                {
                    events.Add(theEvent);
                }
            }
            else
            {
                theEvent = createIdleEvent(locationMessage, prevMessage);
                if (theEvent != null)
                {
                    events.Add(theEvent);
                }
            }

            // Get Alarms
            if (locationMessage.GetType() == (typeof(VT310eAlarmLocationMessage)))
            {
                VT310eAlarmLocationMessage msg = (VT310eAlarmLocationMessage)locationMessage;
                // tests for different alarm types
                switch (msg.AlarmID)
                {
                // Should find a better, more configurable way to get names for Inputs - TODO
                // Configurable by client and probably type, including tempat for description

                case "01": theEvent = new TrackerEvents.InputActive(msg, 1, "SOS Button"); break;

                case "02": theEvent = new TrackerEvents.InputActive(msg, 2); break;

                case "03": theEvent = new TrackerEvents.InputActive(msg, 3); break;

                case "04": theEvent = new TrackerEvents.InputActive(msg, 4); break;

                case "05": theEvent = new TrackerEvents.InputActive(msg, 5, "Engine"); break;

                case "10": theEvent = new TrackerEvents.LowBattery(msg); break;

                case "14": theEvent = new TrackerEvents.TrackerTurnedOn(msg); break;

                case "15": theEvent = new TrackerEvents.GPSBlindAreaEntered(msg); break;

                case "16": theEvent = new TrackerEvents.GPSBlindAreaExited(msg); break;

                case "31": theEvent = new TrackerEvents.InputInactive(msg, 1, "SOS Button"); break;

                case "32": theEvent = new TrackerEvents.InputInactive(msg, 2); break;

                case "33": theEvent = new TrackerEvents.InputInactive(msg, 3); break;

                case "34": theEvent = new TrackerEvents.InputInactive(msg, 4); break;

                case "35": theEvent = new TrackerEvents.InputInactive(msg, 5, "Engine"); break;

                case "50": theEvent = new TrackerEvents.ExternalPowerCut(msg); break;

                case "53": theEvent = new TrackerEvents.GPSAntennaCut(msg); break;

                default: theEvent = new TrackerEvents.TrackerAlarm(msg); break;
                }
                if (theEvent != null)
                {
                    events.Add(theEvent);
                }
            }

            List <Event> entryExitEvents = new List <Event>();

            try
            {
                entryExitEvents = retrieveGeoFenceEventList(locationMessage, prevMessage);
            }
            catch (System.Exception ex)
            {
            }

            foreach (Event item in entryExitEvents)
            {
                events.Add(item);
            }

            return(events);
        }
Exemplo n.º 5
0
 public InputActive(VT310eAlarmLocationMessage msg, int input)
     : base(msg)
 {
     _inputNum  = input;
     _inputName = "Input " + input;
 }
Exemplo n.º 6
0
        protected string _eventDescriptionTemplate = "{0} was made active on {1}";// we should be pulling this from the DB per client for each type? TODO

        public InputActive(VT310eAlarmLocationMessage msg, int input, string name) : base(msg)
        {
            _inputNum  = input;
            _inputName = name;
        }
Exemplo n.º 7
0
        protected string _eventDescriptionTemplate = "External Power has been cut to {0}!";// we should be pulling this from the DB per client for each type? TODO

        public ExternalPowerCut(VT310eAlarmLocationMessage msg)
            : base(msg)
        {
        }
Exemplo n.º 8
0
        protected string _eventDescriptionTemplate = "{0} has exited a GPS blind area";// we should be pulling this from the DB per client for each type? TODO

        public GPSBlindAreaExited(VT310eAlarmLocationMessage msg)
            : base(msg)
        {
        }
Exemplo n.º 9
0
        protected string _eventDescriptionTemplate = "The GPS Antenna has been cut on {0}!";// we should be pulling this from the DB per client for each type? TODO

        public GPSAntennaCut(VT310eAlarmLocationMessage msg)
            : base(msg)
        {
        }