protected override TypeOfZone EventHandler(DumpMessage msg) { SetLocation(msg.Location); if (SearchTruck(Location)) { return(TypeOfZone.OnTruckZone); } return(TypeOfZone.None); }
public string AddMessage(int id, double latitude, double longitude, DateTime datetime, int speedKPH) { DumpMessage msg = new DumpMessage(id, latitude, longitude, datetime, speedKPH); TypeOfZone toz; TypeOfDump tod; bool spd = speedKPH > SPEEDSTOPLIMIT; if (Dumps.IsExist(msg.Id)) { Dump dump = Dumps[msg.Id]; tod = dump.Tod; if (tod == TypeOfDump.Excavator) { Dumps.AddLoadingPoint(msg.Id.ToString(), msg.Location); } toz = dump.AddMessage(msg); return(DetermineState(dump, tod, toz, spd)); } return("NH"); }
protected override TypeOfZone EventHandler(DumpMessage msg) { SetLocation(msg.Location); TypeOfZone result = TypeOfZone.None; if (FindNearLoadingZone(Location)) { if (result == TypeOfZone.OnStoragePoint) { result = TypeOfZone.OnLoadingOrStorageZone; } else { result = TypeOfZone.OnLoadingZone; } } if (FindNearExcavator(Location)) { if (result == TypeOfZone.OnLoadingZone) { result = TypeOfZone.OnLoadingPoint; } } if (FindNearDepot(Location)) { if (result == TypeOfZone.OnLoadingPoint) { result = TypeOfZone.OnLoadingOrStorageZone; } else { result = TypeOfZone.OnStoragePoint; } } if (FindNearParking(Location)) { result = TypeOfZone.OnShiftChangePoint; } return(result); }
protected abstract TypeOfZone EventHandler(DumpMessage msg);
public TypeOfZone AddMessage(DumpMessage msg) { return(EventHandler(msg)); }