Exemple #1
0
        static void safeUploadGoodThreadMain(object po)
        {
            object[] pa   = (object[])po;
            int      chId = (int)pa[0];
            // parameters deserialization finished
            int crId = chId % 2;

            lock (Locker[(int)ConveyorPart.Crossover1 + crId])
            {
                if (UploadCount[(chId + 2) % 4] > 0)
                {
                    if (UploadCount[chId] == 0)
                    {
                        if (chId >= 2)
                        {
                            ConveyorBasicController.crB(crId);
                            ConveyorCleverController.waitForCrossover(crId, ConveyorCrState.Backward, TimeC);
                        }
                        else
                        {
                            ConveyorBasicController.crF(crId);
                            ConveyorCleverController.waitForCrossover(crId, ConveyorCrState.Forward, TimeC);
                        }
                    }
                    else
                    {
                        return;
                    }
                }
                ConveyorBasicController.crS(crId);
                ConveyorCleverController.waitForCrossover(crId, ConveyorCrState.Stop, TimeA);
                unsafeUploadGoodThreadMain(po);
            }
        }
Exemple #2
0
 static void onEveryWorkingUnit(int unitTime)
 {
     if (stopWhenNoTask && taskCount == 0)
     {
         ConveyorBasicController.mrS(0);
         ConveyorCleverController.cleanDelegate();
         RfidCleverController.cleanDelegate();
         running = false;
     }
     else if (!stopWhenNoTask)
     {
         for (int t = 0; t < ChQueue.Length; t++)
         {
             goodPositionBetweenSpecificNumber__minLimit = ChTime[t] - TimeD;
             goodPositionBetweenSpecificNumber__maxLimit = goodPositionBetweenSpecificNumber__minLimit + unitTime;
             GoodOnConveyor good = Goods.Find(goodPositionBetweenSpecificNumber);
             if (good != null && good.rfidTag != null && GoodsHandleMethod.ContainsKey(good.rfidTag))
             {
                 HandleMethod handleMethod = GoodsHandleMethod[good.rfidTag];
                 if (handleMethod.exitPoint == t)
                 {
                     handleGood(ChQueue[t], good, handleMethod.upload);
                 }
             }
         }
     }
 }
 private void MainForm_Load(object sender, EventArgs e)
 {
     Server.init(this);
     ConveyorBasicController.init(this);
     ConveyorCleverController.init();
     RfidBasicController.init();
     RfidCleverController.init();
     _timer_update.Enabled = true;
 }
Exemple #4
0
        static void chHoldNextGoodThreadMain(object po)
        {
            object[] pa   = (object[])po;
            int      chId = (int)pa[0];
            // parameters deserialization finished
            int stId          = (int)chId * 2 + (chId <= 1 ? 1 : 0);
            int inputBitIndex = (int)ConveyorInputDevice.Senser5 + chId;

            ConveyorCleverController.waitForInput(inputBitIndex, false, 1);
            ConveyorCleverController.waitForInput(inputBitIndex, true, 1);
            ConveyorBasicController.stU(stId);
            ConveyorCleverController.waitForMainRoller(ConveyorMRState.Clockwise, TimeB);
            ConveyorBasicController.mrS(chId);
            ConveyorBasicController.chU(chId);
            ConveyorCleverController.waitForChangeover(chId, ConveyorChState.Up, TimeA);
        }
Exemple #5
0
        static void throwGoodThreadMain(object po)
        {
            object[] pa   = (object[])po;
            int      chId = (int)pa[0];
            // parameters deserialization finished
            int crId = chId % 2;

            if (chId >= 2)
            {
                ConveyorBasicController.chB(chId);
                ConveyorCleverController.waitForChangeover(chId, ConveyorChState.Up | ConveyorChState.Backward, TimeC);
            }
            else
            {
                ConveyorBasicController.chF(chId);
                ConveyorCleverController.waitForChangeover(chId, ConveyorChState.Up | ConveyorChState.Forward, TimeC);
            }
            ConveyorBasicController.chS(chId);
        }
Exemple #6
0
        static void unsafeUploadGoodThreadMain(object po)
        {
            object[] pa   = (object[])po;
            int      chId = (int)pa[0];
            // parameters deserialization finished
            int crId = chId % 2;

            UploadCount[chId]++;
            if (chId >= 2)
            {
                ConveyorBasicController.chF(chId);
                ConveyorBasicController.crF(crId);
                ConveyorCleverController.waitForCrossover(crId, ConveyorCrState.Forward, TimeC);
            }
            else
            {
                ConveyorBasicController.chB(chId);
                ConveyorBasicController.crB(crId);
                ConveyorCleverController.waitForCrossover(crId, ConveyorCrState.Backward, TimeC);
            }
            ConveyorBasicController.chS(chId);
            ConveyorBasicController.crS(crId);
        }