public override bool StillValidAfterEvent(Signal signal)
        {
            if (signal == null)
            {
                throw new ArgumentNullException("signal");
            }

            if (signal.Value == null)
            {
                return(false);
            }
            return(RationalValue.CanConvertLosslessFrom(signal.Value));
        }
Example #2
0
        public PowerArchitectures()
            : base(_entityId)
        {
            AddArchitecture(EntityId.DerivePrefix("Integer"),
                            IntegerValueCategory.IsIntegerValueMember,
                            delegate(Port port) { return(new ProcessBase[] { new GenericStdFunctionProcess <IntegerValue>(delegate() { return IntegerValue.One; }, IntegerValue.ConvertFrom, delegate(IntegerValue acc, IntegerValue item) { return acc.Power(item); }, port.InputSignalCount) }); });

            AddArchitecture(new MathIdentifier("RationalPowerIntegerRadix", "Std"),
                            delegate(Port port) { return(RationalValue.CanConvertLosslessFrom(port.InputSignals[0].Value) && IntegerValue.CanConvertLosslessFrom(port.InputSignals[1].Value)); },
                            delegate(Port port) { return(new ProcessBase[] { new GenericStdFunctionProcess <RationalValue>(delegate() { return IntegerValue.One; }, RationalValue.ConvertFrom, delegate(RationalValue acc, RationalValue item) { return acc.Power(item.Numerator); }, port.InputSignalCount) }); });

            AddArchitecture(EntityId.DerivePrefix("Real"),
                            RealValueCategory.IsRealValueMember,
                            delegate(Port port) { return(new ProcessBase[] { new GenericStdFunctionProcess <RealValue>(delegate() { return IntegerValue.One; }, RealValue.ConvertFrom, delegate(RealValue acc, RealValue item) { return acc.Power(item); }, port.InputSignalCount) }); });

            AddArchitecture(EntityId.DerivePrefix("Complex"),
                            ComplexValueCategory.IsComplexValueMember,
                            delegate(Port port) { return(new ProcessBase[] { new GenericStdFunctionProcess <ComplexValue>(delegate() { return ComplexValue.One; }, ComplexValue.ConvertFrom, ComplexValue.Power, port.InputSignalCount) }); });
        }
Example #3
0
 public static bool IsConstantRational(Signal signal)
 {
     return(IsConstant(signal) && RationalValue.CanConvertLosslessFrom(signal.Value));
 }