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); } }
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); }
private void _button_cr_forward_Click(object sender, EventArgs e) { ConveyorBasicController.crF(Convert.ToInt32(new Regex(@"\d+").Match(((Button)sender).Name).ToString()) - 1); }