Esempio n. 1
0
        //getstate
        string DetermineState(Dump dump, TypeOfDump tod, TypeOfZone toz, bool spd)
        {
            string curstate = dump.State.Current;
            string state    = dump.State.Current;

            if (checkLoadZone(tod, toz, false) && curstate == state)
            {
                state = OnLoadingZone(dump);
            }
            if (checkLoad(tod, toz, (spd || dump.State.Current == "LL")) && curstate == state)
            {
                state = OnLoad(dump);
            }
            if (checkUnload(tod, toz, (spd || dump.State.Current == "UU")) && curstate == state)
            {
                state = OnUnload(dump);
            }
            if (checkShiftChange(tod, toz, (spd || dump.State.Current == "PP")) && curstate == state)
            {
                state = OnShiftChange(dump);
            }
            if (checkOutage(tod, toz, spd) && curstate == state)
            {
                state = OnOutage(dump);
            }
            if (checkMove(tod, toz, spd) && curstate == state)
            {
                state = OnMove(dump);
            }
            return(state);
        }
Esempio n. 2
0
 public Zone(string id, TypeOfZone toz, List <Point> list)
 {
     Index  = Count;
     Id     = id;
     Type   = toz;
     Points = list;
     Count++;
 }
Esempio n. 3
0
        public void Add(string id, TypeOfZone type, List <Point> points)
        {
            bool havenot = true;

            foreach (Zone z in _list)
            {
                if (z.Id == id)
                {
                    havenot = false;
                }
            }
            if (havenot)
            {
                _list.Add(new Zone(id, type, points));
            }
        }
Esempio n. 4
0
        public usedExcavator ToucheExcavator(string truckimei, double latitude, double longitude, DateTime datetime, int speedKPH)
        {
            int excav = -1;

            excav = Dumps.SearchExcavator(latitude, longitude);
            if (excav == -1)
            {
                return(null);
            }

            TypeOfZone toz      = TypeOfZone.OnTruckZone;
            TypeOfDump tod      = TypeOfDump.Excavator;
            Dump       dump     = Dumps[excav];
            bool       spd      = false;
            string     newState = DetermineState(dump, tod, toz, spd);

            return(new usedExcavator()
            {
                id = excav, newstate = newState
            });
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
 //check zone
 bool checkLoadZone(TypeOfDump tod, TypeOfZone toz, bool spd)
 {
     return(tod == TypeOfDump.Dumptruck && (toz == TypeOfZone.OnLoadingZone || toz == TypeOfZone.OnLoadingOrStorageZone))
            //|| (tod == TypeOfDump.Excavator && toz == TypeOfZone.OnTruckZone)
     ;
 }
Esempio n. 7
0
 bool checkMove(TypeOfDump tod, TypeOfZone toz, bool spd)
 {
     return((tod == TypeOfDump.Excavator && toz == TypeOfZone.None && spd) ||
            (tod == TypeOfDump.Dumptruck && toz == TypeOfZone.None && spd));
 }
Esempio n. 8
0
 bool checkShiftChange(TypeOfDump tod, TypeOfZone toz, bool spd)
 {
     return((tod == TypeOfDump.Dumptruck && toz == TypeOfZone.OnShiftChangePoint && !spd) ||
            (tod == TypeOfDump.Dumptruck && toz == TypeOfZone.OnGarage && !spd));
 }
Esempio n. 9
0
 bool checkUnload(TypeOfDump tod, TypeOfZone toz, bool spd)
 {
     return(tod == TypeOfDump.Dumptruck && (toz == TypeOfZone.OnStoragePoint || toz == TypeOfZone.OnLoadingOrStorageZone) && !spd);
 }
Esempio n. 10
0
 bool checkLoad(TypeOfDump tod, TypeOfZone toz, bool spd)
 {
     return((tod == TypeOfDump.Dumptruck && toz == TypeOfZone.OnLoadingPoint && !spd) ||
            (tod == TypeOfDump.Excavator && toz == TypeOfZone.OnTruckZone));
 }