//第三次拍照结果 public void WriteData3(Point4D point) { try { //数据超限 if (!BlDataOverFlow(point, 1)) { return; } string cmd = NoCamera.ToString() + "3";//命令 string value = Head + point.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
bool BlDataOverFlow(Point4D p, int pos) { try { return(true); int index = NoCamera * ParCameraWork.P_I[NoCamera] + pos; if (p.DblValue1 < ParSetRobot.P_I.dataLimitRobot_L[index].DblXMin || p.DblValue1 > ParSetRobot.P_I.dataLimitRobot_L[index].DblXMax || p.DblValue2 <ParSetRobot.P_I.dataLimitRobot_L[index].DblYMin || p.DblValue2> ParSetRobot.P_I.dataLimitRobot_L[index].DblYMax || p.DblValue3 <ParSetRobot.P_I.dataLimitRobot_L[index].DblRMin || p.DblValue3> ParSetRobot.P_I.dataLimitRobot_L[index].DblRMax || p.DblValue4 <ParSetRobot.P_I.dataLimitRobot_L[index].DblTMin || p.DblValue4> ParSetRobot.P_I.dataLimitRobot_L[index].DblTMax ) { string strStd = ParSetRobot.P_I.dataLimitRobot_L[index].DblXMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblXMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblYMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblYMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblRMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblRMax.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblTMin.ToString() + "," + ParSetRobot.P_I.dataLimitRobot_L[index].DblTMax.ToString(); if (ParSetRobot.P_I.BlDataOverflow) { string strError = "Camera" + NoCamera.ToString() + "Pos" + pos.ToString() + ":Error:" + p.strValue + ",Std:" + strStd; DataError_event(strError); LogComInterface.L_I.WriteData("Overflow", strError); return(false); } } return(true); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); return(false); } }
public void SendDataNG93_Camera(Point4D p) { try { string cmd = NoCamera.ToString() + "93";//命令 string value = Head + p.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
//NG public void SendDataNG(Point4D p) { try { string cmd = NoCamera.ToString() + "9";//命令 string str = Head + p.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + p.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + cmd.PadLeft(7, ' '); g_PortRobotBase.WriteData(str); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }
public void WriteStdData(int noPos, Point4D point) { try { string cmd = NoCamera.ToString() + "1";//命令 string value = "PData".PadLeft(7, ' ') + " " + noPos.ToString().PadLeft(7, ' ') + " " + point.DblValue1.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue2.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue3.ToString("f2").PadLeft(7, ' ') + " " + point.DblValue4.ToString("f2").PadLeft(7, ' ') + " " + "0".PadLeft(7, ' ') + " " + "0".PadLeft(7, ' '); WriteRobot(value); } catch (Exception ex) { Log.L_I.WriteError("LogicRobot", ex); } }