mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
上传了新的示例工程
This commit is contained in:
35
Net461DllTest/ViewModel/FromWorkBenchViewModel.cs
Normal file
35
Net461DllTest/ViewModel/FromWorkBenchViewModel.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Net461DllTest.Device;
|
||||
using Net461DllTest.Signal;
|
||||
using Serein.Library.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Net461DllTest.ViewModel
|
||||
{
|
||||
public class FromWorkBenchViewModel
|
||||
{
|
||||
[AutoInjection]
|
||||
public PlcDevice 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();
|
||||
}
|
||||
|
||||
|
||||
public void Trigger(OrderSignal signal)
|
||||
{
|
||||
Device.TriggerSignal(signal, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user