public static InjLogicManager getInstance() { if (injlogicmanager == null) { injlogicmanager = new InjLogicManager(); } return(injlogicmanager); }
public void runLoop(double time) { double dt = time - lasttime; if (dt < 500) { return; } lasttime = time; //更新卡 UpdataResInfoList(); if (resinfo_list.Count == 0 && InjLogicManager.getInstance().action_tree.Count == 0) { return; } foreach (var resinfo in resinfo_list) { Logic(resinfo, dt); } ////离心逻辑 foreach (var cent in cenMrg.CentrifugeMDevices) { //如果当前离心机在跑或已满卡就添加到下一个离心机中 if (CenRunLogic(cent)) { return; // 离心启动逻辑 } break; } //机器手空闲回零 if (actionmanager.getAllActionsCount(handDevice) == 0 && handDevice.Hand.XMotor.CurrentDistance != 0) { hand_wait_time += dt; if (hand_wait_time > 1000) { var act = Sequence.create(MoveTo.create(handDevice, 10000, 0, 0, 0), InitXyz.create(20000, true, true, true)); act.runAction(handDevice); hand_wait_time = 0; } } }