public bool exe(float index) { switch (StartStep) { case 0: List <byte> temp = new List <byte>(); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(0)); temp.AddRange(Functions.NetworkBytes(index)); CommData = new BaseData(Addr, temp.ToArray()); movedriverZm.WriteRegister(CommData); StartOT.Restart(); StartStep = 1; return(false); case 1: if (CommData.Succeed == true) { StartStep = 0; CommData.Succeed = false; return(true); } if (StartOT.ElapsedMilliseconds > 10000) { StartStep = 0; } return(false); default: StartStep = 0; CommData.Succeed = false; return(false); } }
public bool exe(int x, int y, int z, int r, int t, float xPos, float yPos, float zPos, float rPos, float tPos, PolishDef polishDef, int PolishOpen) { switch (StartStep) { case 0: List <byte> temp = new List <byte>(); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(polishDef.mode)); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(x)); temp.AddRange(Functions.NetworkBytes(y)); temp.AddRange(Functions.NetworkBytes(z)); temp.AddRange(Functions.NetworkBytes(r)); temp.AddRange(Functions.NetworkBytes(t)); temp.AddRange(Functions.NetworkBytes(xPos)); temp.AddRange(Functions.NetworkBytes(yPos)); temp.AddRange(Functions.NetworkBytes(zPos)); temp.AddRange(Functions.NetworkBytes(rPos)); temp.AddRange(Functions.NetworkBytes(tPos)); temp.AddRange(Functions.NetworkBytes(polishDef.GoBackTimes)); temp.AddRange(Functions.NetworkBytes(polishDef.PolishSpeed)); temp.AddRange(Functions.NetworkBytes(polishDef.GoBackRange)); temp.AddRange(Functions.NetworkBytes(polishDef.PolishInterval)); temp.AddRange(Functions.NetworkBytes(polishDef.LiftHeight)); temp.AddRange(Functions.NetworkBytes(PolishOpen)); CommData = new BaseData(Addr, temp.ToArray()); movedriverZm.WriteRegister(CommData); StartOT.Restart(); StartStep = 1; return(false); case 1: if (CommData.Succeed == true) { FormMain.RunProcess.LogicData.RunData.polishtimes++; StartStep = 0; CommData.Succeed = false; return(true); } if (StartOT.ElapsedMilliseconds > 10000) { StartStep = 0; } return(false); default: StartStep = 0; CommData.Succeed = false; return(false); } }
public bool exe(int x, int y, int z, int r, int t, float xPos, float yPos, float zPos, float rPos, float tPos, int Rinse) { switch (StartStep) { case 0: List <byte> temp = new List <byte>(); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(x)); temp.AddRange(Functions.NetworkBytes(y)); temp.AddRange(Functions.NetworkBytes(z)); temp.AddRange(Functions.NetworkBytes(r)); temp.AddRange(Functions.NetworkBytes(t)); temp.AddRange(Functions.NetworkBytes(xPos)); temp.AddRange(Functions.NetworkBytes(yPos)); temp.AddRange(Functions.NetworkBytes(zPos)); //Z轴位置高度 temp.AddRange(Functions.NetworkBytes(rPos)); temp.AddRange(Functions.NetworkBytes(tPos)); temp.AddRange(Functions.NetworkBytes(FormMain.RunProcess.LogicData.RunData.moveSpd)); //速度 temp.AddRange(Functions.NetworkBytes(Rinse)); CommData = new BaseData(Addr, temp.ToArray()); movedriverZm.WriteRegister(CommData); StartOT.Restart(); StartStep = 1; return(false); case 1: if (CommData.Succeed == true) { StartStep = 0; CommData.Succeed = false; return(true); } if (StartOT.ElapsedMilliseconds > 10000) { StartStep = 0; } return(false); default: StartStep = 0; CommData.Succeed = false; return(false); } }
public bool exe(CleanDef cleanDef) { switch (StartStep) { case 0: List <byte> temp = new List <byte>(); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(cleanDef.Cleanmode)); temp.AddRange(Functions.NetworkBytes(cleanDef.CleanPos_X)); temp.AddRange(Functions.NetworkBytes(cleanDef.CleanPos_Z)); temp.AddRange(Functions.NetworkBytes(cleanDef.CleanPos_R)); temp.AddRange(Functions.NetworkBytes(cleanDef.GoBackTimes)); temp.AddRange(Functions.NetworkBytes(cleanDef.CleanSpeed)); temp.AddRange(Functions.NetworkBytes(cleanDef.GoBackRange)); temp.AddRange(Functions.NetworkBytes(cleanDef.CleanInterval)); CommData = new BaseData(Addr, temp.ToArray()); movedriverZm.WriteRegister(CommData); StartOT.Restart(); StartStep = 1; return(false); case 1: if (CommData.Succeed == true) { StartStep = 0; CommData.Succeed = false; return(true); } if (StartOT.ElapsedMilliseconds > 10000) { StartStep = 0; } return(false); default: StartStep = 0; CommData.Succeed = false; return(false); } }
public bool exe(int type, float xPos, float yPos, float zPos, float rPos, float tPos, SolderDef solderDef, int Rinse) { switch (StartStep) { case 0: List <byte> temp = new List <byte>(); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(type)); temp.AddRange(Functions.NetworkBytes(1)); temp.AddRange(Functions.NetworkBytes(xPos)); temp.AddRange(Functions.NetworkBytes(yPos)); temp.AddRange(Functions.NetworkBytes(zPos)); temp.AddRange(Functions.NetworkBytes(rPos)); temp.AddRange(Functions.NetworkBytes(tPos)); byte[] aaa = BytesConverter.ObjToBytes(solderDef); byte[] tempdata = temp.ToArray(); byte[] _rinsedata = BitConverter.GetBytes(Rinse); for (int i = 0; i < _rinsedata.Length; i++) { if (i % 2 == 0) { byte rdata = _rinsedata[i]; _rinsedata[i] = _rinsedata[i + 1]; _rinsedata[i + 1] = rdata; } } byte[] ndata = new byte[tempdata.Length + aaa.Length + _rinsedata.Length]; tempdata.CopyTo(ndata, 0); aaa.CopyTo(ndata, tempdata.Length); _rinsedata.CopyTo(ndata, tempdata.Length + aaa.Length); CommData = new BaseData(Addr, ndata); movedriverZm.WriteRegister(CommData); StartOT.Restart(); StartStep = 1; return(false); case 1: if (CommData.Succeed == true) { StartStep = 0; CommData.Succeed = false; if (Addr == 4400) { FormMain.RunProcess.LogicData.RunData.leftSoldertintimes++; } else { FormMain.RunProcess.LogicData.RunData.rightSoldertintimes++; } return(true); } if (StartOT.ElapsedMilliseconds > 10000) { StartStep = 0; } return(false); default: StartStep = 0; CommData.Succeed = false; return(false); } }