本文整理汇总了C#中Signal.IsFlagEnabled方法的典型用法代码示例。如果您正苦于以下问题:C# Signal.IsFlagEnabled方法的具体用法?C# Signal.IsFlagEnabled怎么用?C# Signal.IsFlagEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal.IsFlagEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsAlwaysReal
/// <summary>
/// Whether the signal is restricted to be a real.
/// </summary>
public static bool IsAlwaysReal(Signal signal)
{
return signal.IsFlagEnabled(StdAspect.RealConstraintFlag)
|| IsConstantReal(signal);
}
示例2: IsAlwaysInteger
/// <summary>
/// Whether the signal is restricted to be an integer, that is one of ...,-3,-2,-1,0,1,2,3,...
/// </summary>
public static bool IsAlwaysInteger(Signal signal)
{
return signal.IsFlagEnabled(StdAspect.IntegerConstraintFlag)
|| IsConstantInteger(signal);
}
示例3: IsAlwaysPositive
//public static bool IsConstantZero(Signal signal)
//{
// return IsConstant(signal) && (signal.Value.ToString() == "0");
//}
//public static bool IsConstantOne(Signal signal)
//{
// return IsConstant(signal) && (signal.Value.ToString() == "1");
//}
/// <summary>
/// Whether the signal is restricted to be > 0
/// </summary>
public static bool IsAlwaysPositive(Signal signal)
{
if(signal == null)
throw new ArgumentNullException("signal");
return signal.IsFlagEnabled(StdAspect.PositiveWithoutZeroConstraingFlag)
|| IsConstant(signal) && RealValue.CanConvertLosslessFrom(signal.Value) && RealValue.ConvertFrom(signal.Value).Value > 0d;
}
示例4: IsAlwaysComplex
/// <summary>
/// Whether the signal is restricted to be a complex (of real parts).
/// </summary>
public static bool IsAlwaysComplex(Signal signal)
{
return signal.IsFlagEnabled(StdAspect.ComplexConstraintFlag)
|| IsConstantComplex(signal);
}