initial commit
This commit is contained in:
37
Cs_HMI/Project/Device/CFlag.cs
Normal file
37
Cs_HMI/Project/Device/CFlag.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Project.Device
|
||||
{
|
||||
public class CFlag : COMM.Flag
|
||||
{
|
||||
public CFlag() : base(64)
|
||||
{
|
||||
|
||||
}
|
||||
public bool get(EFlag flag)
|
||||
{
|
||||
return Get((int)flag);
|
||||
}
|
||||
public void set(EFlag flag, bool value)
|
||||
{
|
||||
var idx = (int)flag;
|
||||
Set(idx, value);
|
||||
}
|
||||
public void Toggle(EFlag flag)
|
||||
{
|
||||
int idx = (int)flag;
|
||||
var curValue = Get(idx);
|
||||
Set(idx, !curValue);
|
||||
}
|
||||
|
||||
public void Toggle(int idx)
|
||||
{
|
||||
var curValue = Get(idx);
|
||||
Set(idx, !curValue);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user