private void Init(Multiplicity src = null) { if (src != null) { FA = src.FA; backgroundGateTimeStepInTics = src.backgroundGateTimeStepInTics; accidentalsGateDelayInTics = src.accidentalsGateDelayInTics; SR = new ShiftRegisterParameters(src.SR); reason = string.Copy(src.reason); Rank = src.Rank; } else { //10240 NOT a reasonable default value for FA analysis per Martyn. HN 6.24.2015 if (FA == FAType.FAOn) { backgroundGateTimeStepInTics = 10; accidentalsGateDelayInTics = 10; // 1Mhz } else { backgroundGateTimeStepInTics = 40960; //Not used for slow? HN accidentalsGateDelayInTics = 40960; // Per Daniela } SR = new ShiftRegisterParameters(); } }
private void Init(Multiplicity src = null) { if (src != null) { FA = src.FA; backgroundGateTimeStepInTics = src.backgroundGateTimeStepInTics; accidentalsGateDelayInTics = src.accidentalsGateDelayInTics; SR = new ShiftRegisterParameters(src.SR); reason = string.Copy(src.reason); } else { //10240 NOT a reasonable default value for FA analysis per Martyn. HN 6.24.2015 if (FA == FAType.FAOn) { backgroundGateTimeStepInTics = 2; accidentalsGateDelayInTics = 2; } else { backgroundGateTimeStepInTics = 10240; accidentalsGateDelayInTics = 10240; // 10240 matches some traditional HW, larger values produce more accurate results, but slow down the processing } SR = new ShiftRegisterParameters(); } }
public Coincidence() : base() { backgroundGateTimeStepInTics = 40960; accidentalsGateDelayInTics = 40960; // what are good defaults here? same as SR? gateWidthTics = 240; _sr = new ShiftRegisterParameters(); }
public INCCSR(ShiftRegisterParameters sr, DataSourceIdentifier id, AcquireParameters acq, TestParameters test, LMLoggers.LognLM log) { sr_parms = new ShiftRegisterParameters(sr); dsid = new DataSourceIdentifier(id); dsid.SerialPort -= 1; // serial ports are 0 based at the HW layer acquire_parms = new AcquireParameters(acq); test_parms = new TestParameters(test); this.log = log; }
public MeasSetup() { InitializeComponent(); Detector d = (Detector)detectors.SelectedItem; if (d == null) sr = new ShiftRegisterParameters(); else sr = new ShiftRegisterParameters(d.SRParams); }
public MeasSetup() { InitializeComponent(); Detector d = (Detector)detectors.SelectedItem; if (d == null) sr = new ShiftRegisterParameters(); else sr = new ShiftRegisterParameters(d.SRParams); WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; }
public void CopyValues(Multiplicity mul) { if (mul == null) { return; } FA = mul.FA; backgroundGateTimeStepInTics = mul.backgroundGateTimeStepInTics; accidentalsGateDelayInTics = mul.accidentalsGateDelayInTics; SR = new ShiftRegisterParameters(mul.SR); reason = string.Copy(mul.reason); }
public MeasSetup() { InitializeComponent(); Detector d = (Detector)detectors.SelectedItem; if (d == null) { sr = new ShiftRegisterParameters(); } else { sr = new ShiftRegisterParameters(d.SRParams); } }
public MeasSetup() { InitializeComponent(); Detector d = (Detector)detectors.SelectedItem; if (d == null) { sr = new ShiftRegisterParameters(); } else { sr = new ShiftRegisterParameters(d.SRParams); } WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; }
public bool EqualsButForLMValues(ShiftRegisterParameters other) { if (other != null && SR.dieAwayTime.Equals(other.dieAwayTime) && SR.efficiency.Equals(other.efficiency) && SR.doublesGateFraction.Equals(other.doublesGateFraction) && SR.triplesGateFraction.Equals(other.triplesGateFraction) && SR.deadTimeCoefficientTinNanoSecs.Equals(other.deadTimeCoefficientTinNanoSecs) && SR.deadTimeCoefficientAinMicroSecs.Equals(other.deadTimeCoefficientAinMicroSecs) && SR.deadTimeCoefficientBinPicoSecs.Equals(other.deadTimeCoefficientBinPicoSecs) && SR.deadTimeCoefficientCinNanoSecs.Equals(other.deadTimeCoefficientCinNanoSecs) && SR.highVoltage.Equals(other.highVoltage)) { return(true); } else { return(false); } }
private void OKButton_Click(object sender, EventArgs e) { // check for modifications to detector and srparams, do the copy back to the real det. bool mod = false; if (det.Id.SRType < InstrType.NPOD) { string c = (String)(ShiftRegisterSerialPortComboBox.SelectedItem); //"COM PORT nnn (some text)" // HA, I crashed this. I disconnected the JSR-15 with INCC6 running, so COM3 went away and this was fubar // need to check for existence. Do we need to do something to check at startup also? hn 5.7.2015 if (!String.IsNullOrEmpty(c)) { string[] s = c.Split(); if (s.Length > 2) { Int32 p = 0; Int32.TryParse(s[2], out p); if (p != det.Id.SerialPort) { det.Id.SerialPort = p; mod = true; } } } } if (det.Id.SRType.isVirtualAMSR()) { string c = (String)(BaudCombo.SelectedItem); Int32 p = 0; Int32.TryParse(c, out p); if (p != det.Id.BaudRate) { det.Id.BaudRate = p; mod = true; } } //Was not storing all predelays and gate lengths because of order op to get a ulong hn 5.7.2015 double pd = PredelayTextBox.Value * 10; double gl = GateLengthTextBox.Value * 10; ShiftRegisterParameters sr1 = new ShiftRegisterParameters((ulong)pd,(ulong)gl,HighVoltageTextBox.Value,DieAwayTimeTextBox.Value*10, EfficiencyTextBox.Value,DoublesGateFractionTextBox.Value,TriplesGateFractionTextBox.Value, DeadtimeCoefficientATextBox.Value,DeadtimeCoefficientBTextBox.Value, DeadtimeCoefficientCTextBox.Value,MultiplicityDeadtimeTextBox.Value); bool modified = sr1.CompareTo(det.SRParams) != 0; if (m_bgateTriggerTypeChange) { AcquireParameters acq = Integ.GetCurrentAcquireParamsFor(det); acq.lm.FADefault = m_curGateTriggerType; NC.App.DB.UpdateAcquireParams(acq, isLM: true); // update it } if (det.Id.modified) // type changed only, so gotta save the change in the Detectors table, as well as the sr_parms table { if (modified || mod) // also updates the params in one step /* Update SR Params */ det.SRParams.CopyValues(sr1); NC.App.DB.UpdateDetector(det); // also updates the params in one step det.Id.modified = false; DialogResult = System.Windows.Forms.DialogResult.OK; } else if (modified || mod) // only SR params changed { DialogResult = System.Windows.Forms.DialogResult.OK; /* Update SR Params */ det.SRParams.CopyValues(sr1); NC.App.DB.UpdateDetectorParams(det); // detector must exist in DB prior to this call } else DialogResult = System.Windows.Forms.DialogResult.Ignore; this.Close(); }
private void OKButton_Click(object sender, EventArgs e) { // check for modifications to detector and srparams, do the copy back to the real det. bool mod = false; if (det.Id.SRType < InstrType.NPOD) { string c = (String)(ShiftRegisterSerialPortComboBox.SelectedItem); //"COM PORT nnn (some text)" // HA, I crashed this. I disconnected the JSR-15 with INCC6 running, so COM3 went away and this was fubar // need to check for existence. Do we need to do something to check at startup also? hn 5.7.2015 if (!String.IsNullOrEmpty(c)) { string[] s = c.Split(); if (s.Length > 2) { Int32 p = 0; Int32.TryParse(s[2], out p); if (p != det.Id.SerialPort) { det.Id.SerialPort = p; mod = true; } } } } if (det.Id.SRType.isVirtualAMSR()) { string c = (String)(BaudCombo.SelectedItem); Int32 p = 0; Int32.TryParse(c, out p); if (p != det.Id.BaudRate) { det.Id.BaudRate = p; mod = true; } } //Was not storing all predelays and gate lengths because of order op to get a ulong hn 5.7.2015 double pd = PredelayTextBox.Value * 10; double gl = GateLengthTextBox.Value * 10; ShiftRegisterParameters sr1 = new ShiftRegisterParameters((ulong)pd, (ulong)gl, HighVoltageTextBox.Value, DieAwayTimeTextBox.Value * 10, EfficiencyTextBox.Value, DoublesGateFractionTextBox.Value, TriplesGateFractionTextBox.Value, DeadtimeCoefficientATextBox.Value, DeadtimeCoefficientBTextBox.Value, DeadtimeCoefficientCTextBox.Value, MultiplicityDeadtimeTextBox.Value); bool modified = sr1.CompareTo(det.SRParams) != 0; if (m_bgateTriggerTypeChange) { AcquireParameters acq = Integ.GetCurrentAcquireParamsFor(det); acq.lm.FADefault = m_curGateTriggerType; NC.App.DB.UpdateAcquireParams(acq, isLM: true); // update it } if (det.Id.modified) // type changed only, so gotta save the change in the Detectors table, as well as the sr_parms table { if (modified || mod) // also updates the params in one step /* Update SR Params */ { det.SRParams.CopyValues(sr1); } NC.App.DB.UpdateDetector(det); // also updates the params in one step det.Id.modified = false; DialogResult = System.Windows.Forms.DialogResult.OK; } else if (modified || mod) // only SR params changed { DialogResult = System.Windows.Forms.DialogResult.OK; /* Update SR Params */ det.SRParams.CopyValues(sr1); NC.App.DB.UpdateDetectorParams(det); // detector must exist in DB prior to this call } else { DialogResult = System.Windows.Forms.DialogResult.Ignore; } this.Close(); }
private void detectors_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { Detector d = (Detector)detectors.SelectedItem; sr = new ShiftRegisterParameters(d.SRParams); int idx = -1, i = 0; foreach (object o in this.TypeCombo.Items) { if (o.ToString().CompareTo(d.Id.SRType.ToString()) == 0) { idx = i; break; } i++; } //int idx = this.TypeCombo.Items( d.Id.SRType.ToString()); this.TypeCombo.SelectedIndex = idx; this.predelay.Text = sr.predelayMS.ToString(); this.dieaway.Text = sr.dieAwayTimeMS.ToString(); this.MDTA.Text = sr.deadTimeCoefficientAinMicroSecs.ToString(); this.MDTB.Text = sr.deadTimeCoefficientBinPicoSecs.ToString(); this.MDTC.Text = sr.deadTimeCoefficientCinNanoSecs.ToString(); this.mdeadtime.Text = sr.deadTimeCoefficientMultiplicityinNanoSecs.ToString(); this.DoublesGateFrac.Text = sr.doublesGateFraction.ToString(); this.TriplesGateFrac.Text = sr.triplesGateFraction.ToString(); this.efficiency.Text = sr.efficiency.ToString(); this.hv.Text = sr.highVoltage.ToString(); this.gatelength.Text = sr.gateLengthMS.ToString(); if (d.Id.SRType < InstrType.NPOD) { COMvNetLabel.Content = "Serial Port"; string cur = "COM" + d.Id.SerialPort.ToString(); idx = -1; i = 0; string[] ports = System.IO.Ports.SerialPort.GetPortNames(); CommComboBox.Items.Clear(); foreach (string p in ports) { CommComboBox.Items.Add(p); if (p.CompareTo(cur) == 0) { idx = i; } i++; } if (idx >= 0) { CommComboBox.SelectedIndex = idx; } else { CommComboBox.Items.Add(cur); CommComboBox.SelectedIndex = 0; } } else if (d.Id.SRType < InstrType.MCNPX) { COMvNetLabel.Content = "TCP/IP Addr"; } else { COMvNetLabel.Content = "Whah?"; } }
private void detectors_SelectionChanged_1(object sender, SelectionChangedEventArgs e) { Detector d = (Detector)detectors.SelectedItem; sr = new ShiftRegisterParameters(d.SRParams); int idx = -1, i = 0; foreach (object o in this.TypeCombo.Items) { if (o.ToString().CompareTo( d.Id.SRType.ToString()) == 0) { idx = i; break; } i++; } //int idx = this.TypeCombo.Items( d.Id.SRType.ToString()); this.TypeCombo.SelectedIndex = idx; this.predelay.Text = sr.predelayMS.ToString(); this.dieaway.Text = sr.dieAwayTimeMS.ToString(); this.MDTA.Text = sr.deadTimeCoefficientAinMicroSecs.ToString(); this.MDTB.Text = sr.deadTimeCoefficientBinPicoSecs.ToString(); this.MDTC.Text = sr.deadTimeCoefficientCinNanoSecs.ToString(); this.mdeadtime.Text = sr.deadTimeCoefficientMultiplicityinNanoSecs.ToString(); this.DoublesGateFrac.Text = sr.doublesGateFraction.ToString(); this.TriplesGateFrac.Text = sr.triplesGateFraction.ToString(); this.efficiency.Text = sr.efficiency.ToString(); this.hv.Text = sr.highVoltage.ToString(); this.gatelength.Text = sr.gateLengthMS.ToString(); if (d.Id.SRType < InstrType.NPOD) { COMvNetLabel.Content = "Serial Port"; string cur = "COM" + d.Id.SerialPort.ToString(); idx = -1; i = 0; string[] ports = System.IO.Ports.SerialPort.GetPortNames(); CommComboBox.Items.Clear(); foreach (string p in ports) { CommComboBox.Items.Add(p); if (p.CompareTo(cur) == 0) { idx = i; } i++; } if (idx >= 0) CommComboBox.SelectedIndex = idx; else { CommComboBox.Items.Add(cur); CommComboBox.SelectedIndex = 0; } } else if (d.Id.SRType < InstrType.MCNPX) { COMvNetLabel.Content = "TCP/IP Addr"; } else { COMvNetLabel.Content = "Whah?"; } }