void initParas() { ioMgr = new IOMgr(); var normal = transform.Find("normal"); labWin = normal.Find("win").GetChild(0).GetComponent <Text> (); labLose = normal.Find("lose").GetChild(0).GetComponent <Text> (); labMinTime = normal.Find("mTime").GetChild(0).GetComponent <Text> (); labAvgTime = normal.Find("aTime").GetChild(0).GetComponent <Text> (); labRate = normal.Find("rate").GetChild(0).GetComponent <Text> (); labCount = normal.Find("count").GetChild(0).GetComponent <Text> (); labMaxWinSteak = normal.Find("mWinSteak").GetChild(0).GetComponent <Text> (); labCurWinSteak = normal.Find("nWinSteak").GetChild(0).GetComponent <Text> (); var big = transform.Find("big"); labWinSP = big.Find("win").GetChild(0).GetComponent <Text> (); labLoseSP = big.Find("lose").GetChild(0).GetComponent <Text> (); labMinTimeSP = big.Find("mTime").GetChild(0).GetComponent <Text> (); labAvgTimeSP = big.Find("aTime").GetChild(0).GetComponent <Text> (); labRateSP = big.Find("rate").GetChild(0).GetComponent <Text> (); labCountSP = big.Find("count").GetChild(0).GetComponent <Text> (); labMaxWinSteakSP = big.Find("mWinSteak").GetChild(0).GetComponent <Text> (); labCurWinSteakSP = big.Find("nWinSteak").GetChild(0).GetComponent <Text> (); }
private void EvenAddHardware() { GlobalVariable.g_eventStationStateChanged += StationStateChangedHandler; alarmtimer.Elapsed += new System.Timers.ElapsedEventHandler((object senders, ElapsedEventArgs es) => { // if(!bStartAlarmTimer) { try { if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", !IOMgr.GetInstace().ReadIoOutBit("蜂鸣")); } bStartAlarmTimer = true; } catch (Exception ex) { return; } } }); IOMgr.GetInstace().m_deltgateSystemSingl += ProcessSysIo; MotionMgr.GetInstace().m_eventAxisSingl += ProcessSysIo; // 注册安全函数 UserConfig.AddIoSafeOperate(); UserConfig.AddAxisSafeOperate(); }
public void MotionBackRun(bool bRunDir = false) { if (nAxisOnLine != -1) { MotionMgr.GetInstace().JogMove(nAxisOnLine, !bOutMotorRunDirOnLine, 0, (double)SpeedType.High); return; } if (IOMotionDir == null || IOMotionDir == "") { if (BackMotorIo != null && BackMotorIo != "") { IOMgr.GetInstace().WriteIoBit(BackMotorIo, true); } if (ForwardMotorIo != null && ForwardMotorIo != "") { IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false); } } else { if (ForwardMotorIo != null && ForwardMotorIo != "") { IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, true); } if (IOMotionDir != null && IOMotionDir != "") { IOMgr.GetInstace().WriteIoBit(IOMotionDir, bRunDir); } } }
/// <summary> /// 在启动/恢复程序前,检查安全门光栅 /// </summary> /// <returns></returns> public bool IsSafeDoorAndGrating() { if (ParamSetMgr.GetInstance().GetBoolParam("启用安全门")) { if (IOMgr.GetInstace().GetOutputDic().ContainsKey("安全门") && !IOMgr.GetInstace().ReadIoInBit("安全门")) { MessageBox.Show("安全门打开", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error); // WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("安全门打开", null, DlgWaranType.WaranOK); return(false); } } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("气源检测") && IOMgr.GetInstace().GetInputDic().ContainsKey("气源检测")) { if (!IOMgr.GetInstace().ReadIoInBit("气源检测")) { MessageBox.Show("气源检测失败,请打开气源", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error); // WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("气源检测失败,请打开气源", null, DlgWaranType.WaranOK); return(false); } } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("真空气源检测") && IOMgr.GetInstace().GetInputDic().ContainsKey("真空气源检测")) { if (!IOMgr.GetInstace().ReadIoInBit("真空气源检测")) { MessageBox.Show("真空气源检测失败,请打开真空气源", "Warn", MessageBoxButtons.OK, MessageBoxIcon.Error); // WaranResult waranResult = AlarmMgr.GetIntance().WarnWithDlg("真空气源检测失败,请打开真空气源", null, DlgWaranType.WaranOK); return(false); } } return(true); }
/// <summary> /// 报警提示 /// </summary> /// <param name="i"></param> public static void AlarmTips(int i) { if (i % 2 == 0) { if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯")) { IOMgr.GetInstace().WriteIoBit("红灯", true); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", true); } } else { if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯")) { IOMgr.GetInstace().WriteIoBit("红灯", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", false); } } }
public void UpDataAllIo() { Dictionary <string, IOMgr.IoDefine> dicInput = IOMgr.GetInstace().GetInputDic(); int indexIn = 0; foreach (var tem in dicInput) { m_labelControl_IoInput[indexIn++].State = IOMgr.GetInstace().ReadIoInBit(tem.Key); } Dictionary <string, IOMgr.IoDefine> dicOutput = IOMgr.GetInstace().GetOutputDic(); int indexOut = 0; foreach (var tem in dicOutput) { if (!ParamSetMgr.GetInstance().GetBoolParam("是否用平行光管或中继镜气缸")) { if (tem.Key == "平行光管升降气缸") { continue; } } m_labelControl_IoOutput[indexOut++].State = IOMgr.GetInstace().ReadIoOutBit(tem.Key); } }
public void MotionStop() { if (nAxisOnLine != -1) { MotionMgr.GetInstace().StopAxis(nAxisOnLine); return; } if (IOMotionDir == null || IOMotionDir == "") { if (BackMotorIo != null && BackMotorIo != "") { IOMgr.GetInstace().WriteIoBit(BackMotorIo, false); } if (ForwardMotorIo != null && ForwardMotorIo != "") { IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false); } } else { if (ForwardMotorIo != null && ForwardMotorIo != "") { IOMgr.GetInstace().WriteIoBit(ForwardMotorIo, false); } if (IOMotionDir != null && IOMotionDir != "") { IOMgr.GetInstace().WriteIoBit(IOMotionDir, false); } } }
public static void CloseHardWork() { CameraMgr.GetInstance().Close(); TcpMgr.GetInstance().CloseAllEth(); MotionMgr.GetInstace().Close(); IOMgr.GetInstace().Close(); }
public void CheckBuzzerPlaneAndUp(bool bManual = false) { if (IOMgr.GetInstace().ReadIoInBit("右装料平台有无感应器")) { Task task0 = new Task(() => { ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", false); Info("装料步进运动"); int pos = MotionMgr.GetInstace().GetAxisPos(AxisZ); pos = pos + (int)(ParamSetMgr.GetInstance().GetDoubleParam("装料步长") * nResolutionZ); MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, bManual ? null : this); ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true); }); task0.Start(); } else { Task task = new Task(() => { Info("回到原始位置"); double pos = GetStationPointDic()["装料原始位"].pointZ; MoveSigleAxisPosWaitInpos(AxisZ, pos, MotionMgr.GetInstace().GetAxisMovePrm(AxisZ).VelH, 20, bManual, this); //AlarmMgr.GetIntance().WarnWithDlg("右剥料工站 装料平台无料,请添加蜂鸣片", bManual ? null : this, CommonDlg.DlgWaranType.WaranOK); AlarmMgr.GetIntance().WarnWithDlg("右剥料工站 装料平台无料,请添加蜂鸣片,添加完成点击OK", this, CommonDlg.DlgWaranType.WaranOK); FindBuzzer(bManual); ParamSetMgr.GetInstance().SetBoolParam("右装料平台上升到位", true); }); task.Start(); task.Wait(); } }
private void Start() { IOMgr.Init(); IOMgr.ReadConfig(); // store last thrust prevSetThrust = IOMgr.GetControl(IOMgr.Control.Thrust_Set_To); }
public static IOMgr getInstance() { if (mgr == null) { mgr = new IOMgr(); } return(mgr); }
private void button_start_Click(object sender, EventArgs e) { // ProcessSysIo("启动", true); if (GlobalVariable.g_StationState == StationState.StationStateStop) { if (!IsSafeDoorAndGrating()) { return; } ParamSetMgr.GetInstance().SetBoolParam("启动清料", false); if (IOMgr.GetInstace().GetOutputDic().ContainsKey("绿灯")) { IOMgr.GetInstace().WriteIoBit("绿灯", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯")) { IOMgr.GetInstace().WriteIoBit("红灯", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("黄灯")) { IOMgr.GetInstace().WriteIoBit("黄灯", true); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", false); } StationMgr.GetInstance().Run(); // sys.g_StationState = StationState.StationStateRun; } else if (GlobalVariable.g_StationState == StationState.StationStateRun) { // sys.g_StationState = StationState.StationStatePause; //暂停 StationMgr.GetInstance().Pause(); } else if (GlobalVariable.g_StationState == StationState.StationStatePause) { if (!IsSafeDoorAndGrating()) { return; } IOMgr.GetInstace().WriteIoBit("绿灯", false); IOMgr.GetInstace().WriteIoBit("红灯", false); IOMgr.GetInstace().WriteIoBit("黄灯", true); IOMgr.GetInstace().WriteIoBit("蜂鸣", false); StationMgr.GetInstance().Resume(); } else if (GlobalVariable.g_StationState == StationState.StationStateEmg) { MessageBox.Show("发生错误,请先复位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Parse() { if (strIoName != null && strIoName != "") { if (IOMgr.GetInstace().GetOutputDic().ContainsKey(strIoName)) { nCardIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._CardIndex; nAxisNo = IOMgr.GetInstace().GetOutputDic()[strIoName]._AxisIndex; nIoIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._IoIndex; } } }
private void button_start_Click(object sender, EventArgs e) { UserTest.RunLog.Write($"【点击启动】", LogType.Info, PathHelper.LogPathManual); //ProcessSysIo("启动", true); if (GlobalVariable.g_StationState == StationState.StationStateStop) { if (!IsSafeDoorAndGrating()) { return; } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("绿灯")) { IOMgr.GetInstace().WriteIoBit("绿灯", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯")) { IOMgr.GetInstace().WriteIoBit("红灯", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("黄灯")) { IOMgr.GetInstace().WriteIoBit("黄灯", true); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", false); } StationMgr.GetInstance().Run(); // sys.g_StationState = StationState.StationStateRun; } else if (GlobalVariable.g_StationState == StationState.StationStateRun) { // sys.g_StationState = StationState.StationStatePause; //暂停 StationMgr.GetInstance().Pause(); } else if (GlobalVariable.g_StationState == StationState.StationStatePause) { if (!IsSafeDoorAndGrating()) { return; } IOMgr.GetInstace().WriteIoBit("绿灯", false); IOMgr.GetInstace().WriteIoBit("红灯", false); IOMgr.GetInstace().WriteIoBit("黄灯", true); IOMgr.GetInstace().WriteIoBit("蜂鸣", false); StationMgr.GetInstance().Resume(); } else if (GlobalVariable.g_StationState == StationState.StationStateEmg) { MessageBox.Show("发生错误,请先复位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); } }
private void Start() { thesaurusls = BaseManager <IOMgr> .GetInstance(); jumpToScene = GetComponent <UIPoint>(); SVC = GameObject.Find("Scroll View").GetComponentInChildren <ScrollViewContral>(); LoadThesaurusls(inputWord); jumpToScene.jumpSceneName = SceneName.startScene; //监听输入框输入 inputField = GameObject.Find("InputField").GetComponent <InputField>(); inputField.GetComponent <InputField>().onEndEdit.AddListener(EndEdit); }
private APP() { MotionMgr = MotionMgr.GetInstace(); IOMgr = IOMgr.GetInstace(); AlarmMgr = AlarmMgr.GetIntance(); ConfigToolMgr = ConfigToolMgr.GetInstance(); StationMgr = StationMgr.GetInstance(); ParamSetMgr = ParamSetMgr.GetInstance(); ComMgr = ComMgr.GetInstance(); TcpMgr = TcpMgr.GetInstance(); SocketSeverMgr = SocketSeverMgr.GetInstace(); }
public bool IsSafeWhenURun(string SoketName) { string Soket = SoketName; if (IOMgr.GetInstace().ReadIoInBit($"{Soket}治具盖上检测")) { return(true); } else { return(false); } }
/// <summary> /// 初始化Epson 4轴机械手 /// </summary> public static void InitEpson4Robot() { if (IsHaveEpson == false) { return; } Task.Run(() => { IOMgr.GetInstace().WriteIoBit("机器人程序启动", true); Thread.Sleep(10000); ScaraRobot.GetInstance().Init(out string msg); }); }
void Update() { if (Globals.paused) { return; } // legacy way, fixed bindings /*flight.thrust = Input.GetButton ("Jump") ? 1 : 0; * flight.roll = Input.GetAxis ("Horizontal"); * flight.pitch = Input.GetAxis ("Vertical");*/ // legacy way, configurable bindings var setThrust = IOMgr.GetControl(IOMgr.Control.Thrust_Set_To); if (prevSetThrust != setThrust) { // if "set thrust" value changed, get new value flight.thrust = setThrust; prevSetThrust = setThrust; } var deltaThrust = IOMgr.GetControl(IOMgr.Control.Thrust_Increase) - IOMgr.GetControl(IOMgr.Control.Thrust_Decrease); flight.thrust += thrustSensitivity * deltaThrust * Time.deltaTime; flight.roll = IOMgr.GetControl(IOMgr.Control.Roll_Right) - IOMgr.GetControl(IOMgr.Control.Roll_Left); flight.pitch = IOMgr.GetControl(IOMgr.Control.Nose_Up) - IOMgr.GetControl(IOMgr.Control.Nose_Down); laser.trigger = IOMgr.GetControl(IOMgr.Control.Fire_Guns) > .5f; if (camFollow) { camFollow.SetCurrentView(IOMgr.GetControl(IOMgr.Control.Look_Back) > .5f ? 1 : 0); } // new input system, abandoned as too buggy at the time /*var val = aaThrottleSet.ReadValue<float> (); * if (prevSetThrust != val) { * if (prevSetThrust != -1f) flight.thrust = val; * prevSetThrust = val; * } * var deltaThrust = aaThrottle.ReadValue<float> (); * flight.thrust = flight.thrust + thrustSensitivity * deltaThrust * Time.deltaTime; * var move = aaMove.ReadValue<Vector2> (); * flight.roll = move.x; * flight.pitch = move.y; * laser.trigger = aaFire.ReadValue<float> () > .5f; * if (camFollow) camFollow.setCurrentView (aaLookBack.ReadValue<float> () > .5f ? 1 : 0);*/ }
public static void InitHandWareWithUI() { // IOMgr.GetInstace().WriteIoBit("点胶机", false); IOMgr.GetInstace().WriteIoBit("相机光源", false); IOMgr.GetInstace().WriteIoBit("平行光管升降气缸", false); IOMgr.GetInstace().WriteIoBit("OK指示绿灯", false); IOMgr.GetInstace().WriteIoBit("NG指示红灯", false); IOMgr.GetInstace().WriteIoBit("蜂鸣", false); IOMgr.GetInstace().WriteIoBit("红灯", false); IOMgr.GetInstace().WriteIoBit("黄灯", false); IOMgr.GetInstace().WriteIoBit("绿灯", false); IOMgr.GetInstace().WriteIoBit("黄灯", true); IOMgr.GetInstace().WriteIoBit("UV固化", false); }
private void OnVisibleChanged(object sender, EventArgs e) { if (Visible == true) { UpDataAllIo(); IOMgr.GetInstace().m_eventIoInputChanage += ChangedIoInState; IOMgr.GetInstace().m_eventIoOutputChanage += ChangedIoOutState; } else { IOMgr.GetInstace().m_eventIoInputChanage -= ChangedIoInState; IOMgr.GetInstace().m_eventIoOutputChanage -= ChangedIoOutState; } }
UIPoint jumpToSence; //跳转到游戏开始场景 private void Start() { IOMgr = BaseManager <IOMgr> .GetInstance(); WSC = GameObject.Find("WordsView").GetComponentInChildren <WordScrollContral>(); USC = GameObject.Find("UsedView").GetComponentInChildren <UsedScrollContral>(); tipsText = GameObject.Find("TipsText").GetComponentInChildren <Text>(); jumpToSence = GetComponent <UIPoint>(); LoadThesaurusls(inputWord); LoadChooseWord(); //监听输入框输入 inputField = GameObject.Find("InputField").GetComponent <InputField>(); inputField.GetComponent <InputField>().onEndEdit.AddListener(EndEdit); }
protected override bool InitStation() { ParamSetMgr.GetInstance().SetBoolParam("点胶工站初始化完成", false); //IOMgr.GetInstace().WriteIoBit("点胶机", false); IOMgr.GetInstace().WriteIoBit("相机光源", false); TableData.GetInstance().ResetStartCmd("A_UnLoadLoad"); TableData.GetInstance().ResetStartCmd("B_UnLoadLoad"); ClearAllStep(); PushMultStep((int)StationStep.Step_Init); // x = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.x; // y = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.y; // z = dispCalibParam.pointDispenseCalibs.Find(t => t.strPointName == "吐胶点").MachinePoint.z; Info("点胶站加载完成"); return(true); }
public void PlaceToSocket(int index, bool bmanual = false) { WaranResult waranResult; string name = index == 1 ? "A" : "B"; string strCloseSocketIoControlName = $"{name}Lens升降气缸"; retry_up: IOMgr.GetInstace().WriteIoBit(strCloseSocketIoControlName, true); Thread.Sleep(20); waranResult = CheckIobyName($"{name}Lens上升到位", true, $"手动取料时,{name}#Lens气缸上升失败 ", bmanual); if (waranResult == WaranResult.Retry) { goto retry_up; } }
public void ULoad(string SoketName, bool bManual) { string Soket = SoketName; retry_open_cliyder: IOMgr.GetInstace().WriteIoBit($"{Soket}工位夹紧", false); WaranResult waranResult = stationAAT.CheckIobyName($"{Soket}治具松开检测", true, $"{Soket}治具松开检测 失败,请检查气缸及感应器", bManual); if (waranResult == WaranResult.Retry) { goto retry_open_cliyder; } retry_close_checkVac: IOMgr.GetInstace().WriteIoBit($"{Soket}真空吸", false); }
public bool IsLoadOK(string SoketName, bool bManual) { string Soket = SoketName; if ( IOMgr.GetInstace().ReadIoInBit($"{Soket}治具盖上检测") && IOMgr.GetInstace().ReadIoInBit($"{Soket}治具LENS检测") ) { return(true); } else { return(false); } }
/// <summary> /// 报警提示后 处理 /// </summary> public static void AlarmAfterTips() { try { if (IOMgr.GetInstace().GetOutputDic().ContainsKey("蜂鸣")) { IOMgr.GetInstace().WriteIoBit("蜂鸣", false); } if (IOMgr.GetInstace().GetOutputDic().ContainsKey("红灯")) { IOMgr.GetInstace().WriteIoBit("红灯", true); } } catch (Exception E) { } }
public void UpDataAllIo() { Dictionary <string, IOMgr.IoDefine> dicInput = IOMgr.GetInstace().GetInputDic(); int indexIn = 0; foreach (var tem in dicInput) { m_labelControl_IoInput[indexIn++].State = IOMgr.GetInstace().ReadIoInBit(tem.Key); } Dictionary <string, IOMgr.IoDefine> dicOutput = IOMgr.GetInstace().GetOutputDic(); int indexOut = 0; foreach (var tem in dicOutput) { m_labelControl_IoOutput[indexOut++].State = IOMgr.GetInstace().ReadIoOutBit(tem.Key); } }
public static void CloseHardWork() { //for (int i = 0; i < 6; i++) // LightControl.GetInstance().CloseLight(i); ResetIO(); AlarmMgr.GetIntance().StopAlarmBeet(); CameraMgr.GetInstance().Close(); TcpMgr.GetInstance().CloseAllEth(); MotionMgr.GetInstace().Close(); IOMgr.GetInstace().Close(); if (ParamSetMgr.GetInstance().GetBoolParam("是否选择程控电源")) { OtherDevices.ckPower.SetVoltage(1, 0); OtherDevices.ckPower.SetVoltage(2, 0); } // LightControl.GetInstance().Close(); // Weighing.GetInstance().Close(); }
public bool IsLoadOK(string SoketName, bool bManual) { string Soket = SoketName; if ( IOMgr.GetInstace().ReadIoInBit($"{Soket}治具夹紧检测") && ( sys.g_AppMode == AppMode.Run && IOMgr.GetInstace().ReadIoInBit($"{Soket}治具真空检测") || sys.g_AppMode == AppMode.AirRun) && IOMgr.GetInstace().ReadIoInBit($"{Soket}治具LENS检测") ) { return(true); } else { return(false); } }