添加项目文件。
This commit is contained in:
28
Data/BoolSign.cs
Normal file
28
Data/BoolSign.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace 软胶囊弹性硬度测试仪.Data
|
||||
{
|
||||
|
||||
public class BoolSignal
|
||||
{
|
||||
private bool _previousValue;
|
||||
|
||||
public event Action OnRisingEdge;
|
||||
// bool value = true;
|
||||
public bool Value { get; set; }
|
||||
|
||||
public void CheckRisingEdge()
|
||||
{
|
||||
if (Value && !_previousValue)
|
||||
{
|
||||
OnRisingEdge?.Invoke();
|
||||
}
|
||||
_previousValue = Value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user