protected void setParameter(DimensionedParameter parameter)
 {
     dimensionedParameter = parameter;
     backupDimensionedParameter = new DimensionedParameter(parameter);
     if (ParameterChanged!=null)
         ParameterChanged(this, null);
 }
 public RetriggerOptions(RetriggerOptions copyMe)
 {
     this.retriggerOnEdge = copyMe.retriggerOnEdge;
     this.retriggerOnNegativeValueOrEdge = copyMe.retriggerOnNegativeValueOrEdge;
     this.retriggerTimeout = new DimensionedParameter(copyMe.retriggerTimeout);
     this.waitForRetrigger = copyMe.waitForRetrigger;
 }
 private static bool CompareParameters(string prestring, DimensionedParameter a, DimensionedParameter b, List <SequenceDifference> ans)
 {
     if (a.myParameter.variable != null || b.myParameter.variable != null)
     {
         if (a.myParameter.variable != null && b.myParameter.variable != null)
         {
             if (a.myParameter.variable.VariableName != b.myParameter.variable.VariableName)
             {
                 ans.Add(new SequenceDifference(prestring + "bound to variables of different name."));
                 return(true);
             }
         }
         else
         {
             ans.Add(new SequenceDifference(prestring + "one bound to variable, other manual."));
             return(true);
         }
     }
     else
     {
         if (a.getBaseValue() != b.getBaseValue())
         {
             ans.Add(new SequenceDifference(prestring + "different manual values."));
             return(true);
         }
     }
     return(false);
 }
 public RetriggerOptions(
     bool waitForRetrigger,
     bool retriggerOnNegativeValueOrEdge,
     bool retriggerOnEdge,
     DimensionedParameter retriggerTimeout
     )
 {
     this.waitForRetrigger = waitForRetrigger;
     this.retriggerTimeout = retriggerTimeout;
     this.retriggerOnEdge  = retriggerOnEdge;
     this.retriggerOnNegativeValueOrEdge = retriggerOnNegativeValueOrEdge;
 }
        public static bool Equivalent(DimensionedParameter a, DimensionedParameter b)
        {
            if (!Parameter.Equivalent(a.myParameter, b.myParameter))
                return false;
            if (a.ParameterString != b.ParameterString)
                return false;
            if (!Units.Equivalent(a.ParameterUnits, b.ParameterUnits))
                return false;
            if (a.ParameterValue != b.ParameterValue)
                return false;

            return true;
        }
Example #6
0
 public Pulse(Pulse copyMe)
 {
     this.endCondition = copyMe.endCondition;
     this.endDelay = new DimensionedParameter(copyMe.endDelay);
     this.endDelayed = copyMe.endDelayed;
     this.endDelayEnabled = copyMe.endDelayEnabled;
     this.pulseDescription = copyMe.pulseDescription;
     this.pulseDuration = new DimensionedParameter(copyMe.pulseDuration);
     this.pulseName = "Copy of " + copyMe.pulseName;
     this.pulseValue = copyMe.pulseValue;
     this.startCondition = copyMe.startCondition;
     this.startDelay = new DimensionedParameter(copyMe.startDelay);
     this.startDelayed = copyMe.startDelayed;
     this.startDelayEnabled = copyMe.startDelayEnabled;
 }
Example #7
0
        public Pulse()
        {
            this.PulseName = "Unnamed";
            this.endCondition = PulseTimingCondition.TimestepEnd;
            this.endDelay = new DimensionedParameter(Units.s, 0);
            this.endDelayed = false;
            this.endDelayEnabled = false;

            this.pulseDuration = new DimensionedParameter(Units.s, 0);

            this.pulseValue = true;

            this.startCondition = PulseTimingCondition.TimestepStart;
            this.startDelay = new DimensionedParameter(Units.s, 0);
            this.startDelayed = false;
            this.startDelayEnabled = false;
        }
Example #8
0
        public Pulse()
        {
            this.PulseName       = "Unnamed";
            this.endCondition    = PulseTimingCondition.TimestepEnd;
            this.endDelay        = new DimensionedParameter(Units.s, 0);
            this.endDelayed      = false;
            this.endDelayEnabled = false;

            this.pulseDuration = new DimensionedParameter(Units.s, 0);

            this.pulseValue = true;

            this.startCondition    = PulseTimingCondition.TimestepStart;
            this.startDelay        = new DimensionedParameter(Units.s, 0);
            this.startDelayed      = false;
            this.startDelayEnabled = false;
        }
Example #9
0
        public static bool Equivalent(DimensionedParameter a, DimensionedParameter b)
        {
            if (!Parameter.Equivalent(a.myParameter, b.myParameter))
            {
                return(false);
            }
            if (a.ParameterString != b.ParameterString)
            {
                return(false);
            }
            if (!Units.Equivalent(a.ParameterUnits, b.ParameterUnits))
            {
                return(false);
            }
            if (a.ParameterValue != b.ParameterValue)
            {
                return(false);
            }

            return(true);
        }
Example #10
0
        public static bool Equivalent(Pulse a, Pulse b)
        {
            if (a.endCondition != b.endCondition)
            {
                return(false);
            }
            if (!DimensionedParameter.Equivalent(a.endDelay, b.endDelay))
            {
                return(false);
            }
            if (a.endDelayed != b.endDelayed)
            {
                return(false);
            }
            if (a.endDelayEnabled != b.endDelayEnabled)
            {
                return(false);
            }
            if (a.PulseDescription != b.PulseDescription)
            {
                return(false);
            }
            if (!DimensionedParameter.Equivalent(a.pulseDuration, b.pulseDuration))
            {
                return(false);
            }
            if (a.PulseName != b.PulseName)
            {
                return(false);
            }
            if (a.PulseValue != b.PulseValue)
            {
                return(false);
            }
            if (a.startCondition != b.startCondition)
            {
                return(false);
            }
            if (!DimensionedParameter.Equivalent(a.startDelay, b.startDelay))
            {
                return(false);
            }
            if (a.startDelayed != b.startDelayed)
            {
                return(false);
            }
            if (a.startDelayEnabled != b.startDelayEnabled)
            {
                return(false);
            }
            if (a.ValueFromVariable != b.ValueFromVariable)
            {
                return(false);
            }
            if (a.ValueVariable != b.ValueVariable)
            {
                return(false);
            }

            return(true);
        }
 public ToolStripNumericOrVariableEditor(DimensionedParameter param, bool showUnitSelector)
     : base(new HorizontalParameterEditor(param, showUnitSelector))
 {
     (this.Control as HorizontalParameterEditor).updateGUI += new EventHandler(ToolStripNumericOrVariableEditor_updateGUI);
 }
Example #12
0
 public DimensionedParameter(DimensionedParameter parameter)
 {
     this.parameter = parameter.parameter;
     this.units     = parameter.units;
 }
 public TimeStep()
 {
     digitalData = new Dictionary<int, DigitalDataPoint>();
     stepDuration = new DimensionedParameter(Units.Dimension.s);
 }
        private void downButton_Click(object sender, EventArgs e)
        {
            if (currentWaveform.interpolationType.referencesOtherWaveforms)
            {
                // add a new referencable waveform
                currentWaveform.ReferencedWaveforms.Add(null);
                currentWaveform.WaveformCombiners.Add(Waveform.InterpolationType.CombinationOperators.Plus);
            }
            else
            {
                // add a new xy point
                DimensionedParameter x = new DimensionedParameter(Units.s, 0);
                DimensionedParameter y = new DimensionedParameter(new Units(currentWaveform.YUnits, Units.Multiplier.unity), 0);
                if (currentWaveform.XValues.Count > 0)
                {
                    x.parameter.ManualValue = currentWaveform.XValues[currentWaveform.XValues.Count - 1].parameter.ManualValue + 1;
                }
                currentWaveform.XValues.Add(x);
                currentWaveform.YValues.Add(y);
            }

            this.layOutParameters();
            if (updateGraph != null)
                updateGraph(sender, e);
        }
 public StringParameterString()
 {
     prefix = "";
     postfix = "";
     parameter = new DimensionedParameter(Units.Dimension.unity);
 }
 public VerticalParameterEditor(DimensionedParameter parameter)
     : base(parameter)
 {
     this.convertToVertical();
 }
 public void setParameterData(DimensionedParameter parameter)
 {
     this.setParameter(parameter);
 }
 public ModeControl(ModeControl copyMe)
 {
     Mode     = copyMe.Mode;
     Selected = copyMe.Selected;
     Delay    = new DimensionedParameter(copyMe.Delay);
 }
 public HorizontalParameterEditor(DimensionedParameter parameter)
     : this()
 {
     this.setParameter(parameter);
 }
 public ModeControl(int newModeID)
 {
     Mode     = new SequenceMode(newModeID);
     Selected = false;
     Delay    = new DimensionedParameter(Units.s, 0);
 }
Example #21
0
 public TimeStep()
 {
     digitalData  = new Dictionary <int, DigitalDataPoint>();
     stepDuration = new DimensionedParameter(Units.Dimension.s);
 }
Example #22
0
        public Waveform(Waveform copyMe)
        {
            if (copyMe.combiners != null)
                this.combiners = new List<InterpolationType.CombinationOperators>(copyMe.combiners);
            if (copyMe.extraParameters != null)
                this.extraParameters = new List<DimensionedParameter>(copyMe.extraParameters);

            this.myInterpolationType = copyMe.myInterpolationType;

            if (copyMe.referencedWaveforms != null)
                this.referencedWaveforms = new List<Waveform>(copyMe.referencedWaveforms);
            if (copyMe.waveformDuration != null)
                this.waveformDuration = new DimensionedParameter(copyMe.waveformDuration);
            if (copyMe.waveformName != null)
                this.waveformName = copyMe.waveformName;
            if (copyMe.xValues != null)
                this.xValues = new List<DimensionedParameter>(copyMe.xValues);
            if (copyMe.yValues != null)
                this.yValues = new List<DimensionedParameter>(copyMe.yValues);

            this.YUnits = copyMe.YUnits;

            this.equationString = copyMe.equationString;
            this.dataFileName = copyMe.dataFileName;
            this.dataFromFile = copyMe.dataFromFile;

        }
 public DimensionedParameter(DimensionedParameter parameter)
 {
     this.parameter = parameter.parameter;
     this.units = parameter.units;
 }
 public HorizontalParameterEditor(DimensionedParameter parameter, bool showUnitSelector)
     : this(parameter)
 {
     UnitSelectorVisibility = showUnitSelector;
 }
 public StringParameterString()
 {
     prefix    = "";
     postfix   = "";
     parameter = new DimensionedParameter(Units.Dimension.unity);
 }