29 lines
617 B
C#
29 lines
617 B
C#
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|