Persist test fix

This commit is contained in:
luosheng
2023-03-01 09:36:40 +08:00
parent a8c9fefbce
commit 0fbdd36017

View File

@@ -99,7 +99,8 @@ ModbusMachine<int, string> machine3 = new ModbusMachine<int, string>(3, ModbusTy
},
}, true, 4, 1);
Random r = new Random();
await MachineJobSchedulerCreator.CreateScheduler("Trigger1", -1, 10).Result.ApplyTo(machine.Id + ".Apply", new Dictionary<string, double>() {{
await MachineJobSchedulerCreator.CreateScheduler("Trigger1", -1, 10).Result.Apply(machine.Id + ".Apply", null, MachineDataType.Address).Result.Query(machine.Id + ".Query", returnDef => {
return new Dictionary<string, double>() {{
"4X 1.0", r.Next() % 65536
},
{
@@ -108,8 +109,10 @@ await MachineJobSchedulerCreator.CreateScheduler("Trigger1", -1, 10).Result.Appl
{
"4X 3.0", r.Next() % 65536
}
}, MachineDataType.Address).Result.To(machine.Id + ".To", machine).Result.Deal().Result.Run();
await MachineJobSchedulerCreator.CreateScheduler("Trigger2", -1, 10).Result.ApplyTo(machine2.Id + ".Apply", new Dictionary<string, double>() {{
};
}).Result.To(machine.Id + ".To", machine).Result.Deal().Result.Run();
await MachineJobSchedulerCreator.CreateScheduler("Trigger2", -1, 10).Result.Apply(machine2.Id + ".Apply", null, MachineDataType.Address).Result.Query(machine2.Id + ".Query", returnDef => {
return new Dictionary<string, double>() {{
"4X 1.0", r.Next() % 65536
},
{
@@ -118,8 +121,10 @@ await MachineJobSchedulerCreator.CreateScheduler("Trigger2", -1, 10).Result.Appl
{
"4X 3.0", r.Next() % 65536
}
}, MachineDataType.Address).Result.To(machine2.Id + ".To", machine2).Result.Deal().Result.Run();
await MachineJobSchedulerCreator.CreateScheduler("Trigger3", -1, 10).Result.ApplyTo(machine3.Id + ".Apply", new Dictionary<string, double>() {{
};
}).Result.To(machine2.Id + ".To", machine2).Result.Deal().Result.Run();
await MachineJobSchedulerCreator.CreateScheduler("Trigger3", -1, 10).Result.Apply(machine3.Id + ".Apply", null, MachineDataType.Address).Result.Query(machine3.Id + ".Query", returnDef => {
return new Dictionary<string, double>() {{
"4X 1.0", r.Next() % 65536
},
{
@@ -128,5 +133,6 @@ await MachineJobSchedulerCreator.CreateScheduler("Trigger3", -1, 10).Result.Appl
{
"4X 3.0", r.Next() % 65536
}
}, MachineDataType.Address).Result.To(machine3.Id + ".To", machine3).Result.Deal().Result.Run();
};
}).Result.To(machine3.Id + ".To", machine3).Result.Deal().Result.Run();
Console.ReadLine();