Exemplo n.º 1
0
 /// <summary>
 /// Deep copy constructor
 /// </summary>
 /// <param name="source">Source instance</param>
 public PulseGeneratorSettings(PulseGeneratorSettings source)
 {
     Signal    = source.Signal;
     AvgPeriod = source.AvgPeriod;
     Mode      = source.Mode;
     return;
 }
Exemplo n.º 2
0
 //Constructors
 /// <summary>
 /// Constructs an initialized instance
 /// </summary>
 /// <param name="signal">Pulse signal</param>
 /// <param name="avgPeriod">Pulse average period</param>
 /// <param name="mode">Pulse timing mode</param>
 public PulseGeneratorSettings(double signal,
                               double avgPeriod,
                               PulseGenerator.TimingMode mode
                               )
 {
     Signal    = signal;
     AvgPeriod = Math.Abs(avgPeriod);
     Mode      = mode;
     Check();
     return;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an initialized instance.
        /// </summary>
        /// <param name="elem">Xml element containing the initialization settings</param>
        public PulseGeneratorSettings(XElement elem)
        {
            //Validation
            XElement settingsElem = Validate(elem, XsdTypeName);

            //Parsing
            Signal    = double.Parse(settingsElem.Attribute("signal").Value, CultureInfo.InvariantCulture);
            AvgPeriod = Math.Abs(double.Parse(settingsElem.Attribute("avgPeriod").Value, CultureInfo.InvariantCulture));
            Mode      = (PulseGenerator.TimingMode)Enum.Parse(typeof(PulseGenerator.TimingMode), settingsElem.Attribute("mode").Value);
            Check();
            return;
        }