优化了示例工程

This commit is contained in:
fengjiayi
2024-09-28 23:55:19 +08:00
parent 51bdbab4d1
commit 10e5d172c6
56 changed files with 9920 additions and 455 deletions

View File

@@ -12,22 +12,21 @@ namespace Net461DllTest.ViewModel
public class FromWorkBenchViewModel
{
[AutoInjection]
public PlcDevice Device { get; set; }
public SiemensPlcDevice Device { get; set; }
public string Name { get; set; }
public string GetDeviceInfo()
{
if(Device is null)
{
return string.Empty;
}
return "PLC ID:" + Device.PlcId + " - " + Device.MyData.Count.ToString();
return Device?.ToString();
}
public void Trigger(OrderSignal signal)
public void Trigger(OrderSignal signal,string spcaeNumber)
{
Device.TriggerSignal(signal, 0);
_ = Task.Run(() =>
{
Device.TriggerSignal(signal, spcaeNumber);
});
}