Commit f98769fe 几米阳光

AI模块分包修改

1 个父辈 0acddeec
...@@ -275,23 +275,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -275,23 +275,26 @@ namespace OnlineStore.DeviceLibrary
if (rdata.Length < currStartIndex + lengthIndex) if (rdata.Length < currStartIndex + lengthIndex)
{ {
LogUtil.error(clientipe.ToString() + "收到数据:" + str + "分包出错 [" + currStartIndex + "]"); LogUtil.error(clientipe.ToString() + "收到数据:" + str + "分包出错 [" + currStartIndex + "]");
break;
} }
else
{
dataLength = rdata[currStartIndex + lengthIndex];
allLength = lengthIndex + 1 + dataLength;
dataLength = rdata[currStartIndex + lengthIndex]; byte[] thisData = new byte[allLength];
allLength = lengthIndex + 1 + dataLength ; Array.Copy(rdata, currStartIndex, thisData, 0, allLength);
ushort id = BitConverter.ToUInt16(thisData, 0);
byte[] thisData = new byte[allLength]; byte function = thisData[7];
Array.Copy(rdata, currStartIndex, thisData, 0, allLength); DataProcess(clientipe.ToString(), id, function, thisData);
ushort id = BitConverter.ToUInt16(thisData, 0); //剩余的数据处理
byte function = thisData[7];
DataProcess(clientipe.ToString(), id, function, thisData);
//剩余的数据处理
if (rdata.Length <= currStartIndex + allLength) if (rdata.Length <= currStartIndex + allLength)
{ {
break; break;
}
currStartIndex = currStartIndex + allLength;
} }
currStartIndex = currStartIndex + allLength;
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -310,8 +310,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -310,8 +310,8 @@ namespace OnlineStore.DeviceLibrary
//} //}
//else //else
//{ //{
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1); UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove1);
LogUtil.info("回原点:反方向"); LogUtil.debug("回原点:反方向");
//} //}
Thread.Sleep(SleepMSendons); Thread.Sleep(SleepMSendons);
OpenAndCloseSTB(portName, slvAddr); OpenAndCloseSTB(portName, slvAddr);
......
...@@ -451,7 +451,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -451,7 +451,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IsHasCompress_Axis) if (IsHasCompress_Axis)
{ {
LogUtil.info("压紧轴绝对运动目标位置:"+targetPosition); LogUtil.debug("压紧轴绝对运动目标位置:"+targetPosition);
ShuoKeControls.AbsMove(Config.CompressAxis_Slv, targetPosition); ShuoKeControls.AbsMove(Config.CompressAxis_Slv, targetPosition);
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, targetPosition, false)); StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, targetPosition, false));
Thread.Sleep(100); Thread.Sleep(100);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!