现场优化5

This commit is contained in:
2026-08-15 23:28:19 +08:00
parent 92eab2f626
commit 2bb8313f99
10 changed files with 4149 additions and 43 deletions
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
-14
View File
@@ -394,19 +394,7 @@ namespace DeviceCommand.Devices
// 启动三轴联动
await ();
// 等待到达待定位置
await (xHome, yHome, zHome, , );
// 7. 到达后清零绝对位置寄存器
await Task.Delay(500, );
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_ABS_AXIS1_POS, Int32ToUshorts(0), );
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_ABS_AXIS2_POS, Int32ToUshorts(0), );
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_ABS_AXIS3_POS, Int32ToUshorts(0), );
// 清零目标寄存器
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_HD_X_TARGET, Int32ToUshorts(0), );
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_HD_Y_TARGET, Int32ToUshorts(0), );
await WriteMultipleRegistersAsync(_slaveAddress, ADDR_HD_Z_TARGET, Int32ToUshorts(0), );
}
// 8. 更新当前位置为待定位置
@@ -580,8 +568,6 @@ namespace DeviceCommand.Devices
// 3. 启动三轴联动
await ();
await ();
await ();
// 5. 到达后更新当前位置(累加偏移)
_originX += X偏移量;
+2 -1
View File
@@ -23,7 +23,8 @@ namespace DeviceCommand.Devices
public async Task (byte , ushort , bool data)
{
await Modbus.WriteSingleCoilAsync(, , data);
bool[] mydata = { data };
await (, , mydata);
}
public async Task (byte , ushort , bool[] datas)
{
+10 -10
View File
@@ -52,37 +52,37 @@ namespace DeviceCommand.Devices
{ 1, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(1, 5) }, // Y6 -> 5
{ ., new IoPortInfo(1, 0) }, // Y1 -> 0
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 15) } // Y9 -> 8
}},
{ 2, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(1, 6) }, // Y7 -> 6
{ ., new IoPortInfo(1, 2) }, // Y3 -> 2
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 1) }, // Y3 -> 2
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 14) } // Y10 -> 9
}},
{ 3, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(1, 7) }, // Y8 -> 7
{ ., new IoPortInfo(1, 3) }, // Y4 -> 3
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 2) }, // Y4 -> 3
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 13) } // Y11 -> 10
}},
{ 4, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(1, 8) }, // Y9 -> 8
{ ., new IoPortInfo(1, 4) }, // Y5 -> 4
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 3) }, // Y5 -> 4
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 12) } // Y12 -> 11
}},
{ 5, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(2, 4) }, // Y5 -> 4
{ ., new IoPortInfo(2, 0) }, // Y1 -> 0
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 11) } // Y13 -> 12
}},
{ 6, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(2, 5) }, // Y6 -> 5
{ ., new IoPortInfo(2, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1,4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 10) } // Y14 -> 13
}},
{ 7, new Dictionary<, IoPortInfo> {
@@ -94,7 +94,7 @@ namespace DeviceCommand.Devices
{ 8, new Dictionary<, IoPortInfo> {
{ ., new IoPortInfo(2, 7) }, // Y8 -> 7
{ ., new IoPortInfo(2, 3) }, // Y4 -> 3
{ ., new IoPortInfo(1, 1) }, // Y2 -> 1
{ ., new IoPortInfo(1, 4) }, // Y2 -> 1
{ ., new IoPortInfo(2, 8) } // Y16 -> 15
}}
};
+6
View File
@@ -255,6 +255,7 @@ namespace UIShare
tmpParameters.Clear();
TestRoundID = Guid.NewGuid();
}
int initialLoopStackCount = loopStack.Count;
foreach (var item in program.Parameters)
{
tmpParameters.TryAdd(item.ID, item);
@@ -435,7 +436,12 @@ namespace UIShare
await SaveStepRecordAsync(step, depth, false);
}
}
bool finalResult = loopStack.Count == initialLoopStackCount && stepSuccess;
if (depth > 0) // 子程序
{
return finalResult;
}
return loopStack.Count == 0 && stepSuccess;
}
+9 -17
View File
@@ -51,28 +51,20 @@ namespace UIShare.GlobalVariable
Name = "台架序号",
Value = 1,
IsEditable=false
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "直流负载通道",
Value = 1,
IsEditable=false
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "交流电源通道",
Value = 1,
IsEditable=false
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "CAN通道",
Name = "CAN通道1",
Value = 0,
IsEditable=false
},
new ParameterVM
{
Category = ParameterCategory.Input,
Type = typeof(int),
Name = "CAN通道2",
Value = 0,
IsEditable=false
},