现场优化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
+1 -15
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
},