コード例 #1
0
 protected override TypeOfZone EventHandler(DumpMessage msg)
 {
     SetLocation(msg.Location);
     if (SearchTruck(Location))
     {
         return(TypeOfZone.OnTruckZone);
     }
     return(TypeOfZone.None);
 }
コード例 #2
0
ファイル: Enterprise.cs プロジェクト: teilon/dispatching
        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");
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 protected abstract TypeOfZone EventHandler(DumpMessage msg);
コード例 #5
0
 public TypeOfZone AddMessage(DumpMessage msg)
 {
     return(EventHandler(msg));
 }