Exemplo n.º 1
0
        // Constructor including initialization of comboboxen in the various panels
        public LMConnectionParams(Detector candidate, AcquireParameters acq, bool isnew)
        {
            AddingNew = isnew;
            InitializeComponent();
            oTitle = this.Text;

            // Reposition the various panels on top of each other
            this.SelectorPanel.Top = 4;
            this.SelectorPanel.Left = 6;
            this.LMMMPanel.Top = 4;
            this.LMMMPanel.Left = 6;
            this.PTR32Panel.Top = 4;
            this.PTR32Panel.Left = 6;
            this.AddDetectorTypePanel.Top = 4;
            this.AddDetectorTypePanel.Left = 6;
            this.AddDetectorTypePanel.Top = 4;
            this.AddDetectorTypePanel.Left = 6;

            RefreshDetectorCombo();
            DetectorComboBox.SelectedItem = candidate;

            RefreshDetectorTypeCombo();
            AddDetectorTypeComboBox.SelectedItem = candidate.Id.SRType;

            det = candidate;
            this.acq = acq;
            PopulateParamFields();

        }
        public bool Insert(Detector value)
        {
            bool result = false;

            string sql = string.Format("insert into e_detector ({0}) values (:guid, :insert_user_id, :insert_time, :update_user_id, :update_time, :remark, :validity, :machine_id, :detector_type_id, :serial, minimum_a, maximum_a, minimum_b, maximum_b, null, null)", this.Asterisk(""));
            List<Parameter> parameters = new List<Parameter>();

            parameters.Add(new Parameter("guid", DatabaseHibernate.Parameter(DatabaseHibernate.GUID())));
            parameters.Add(new Parameter("insert_user_id", DatabaseHibernate.Parameter(value.InsertUserId)));
            parameters.Add(new Parameter("insert_time", DatabaseHibernate.Parameter(value.InsertTime)));
            parameters.Add(new Parameter("update_user_id", DatabaseHibernate.Parameter(value.UpdateUserId)));
            parameters.Add(new Parameter("update_time", DatabaseHibernate.Parameter(value.UpdateTime)));
            parameters.Add(new Parameter("remark", DatabaseHibernate.Parameter(value.Remark)));
            parameters.Add(new Parameter("validity", DatabaseHibernate.Parameter(value.Validity)));

            parameters.Add(new Parameter("machine_id", DatabaseHibernate.Parameter(value.MachineId)));
            parameters.Add(new Parameter("detector_type_id", DatabaseHibernate.Parameter(value.DetectorTypeId)));
            parameters.Add(new Parameter("serial", DatabaseHibernate.Parameter(value.Serial)));
            parameters.Add(new Parameter("minimum_a", DatabaseHibernate.Parameter(value.MinimumA)));
            parameters.Add(new Parameter("maximum_a", DatabaseHibernate.Parameter(value.MaximumA)));
            parameters.Add(new Parameter("minimum_b", DatabaseHibernate.Parameter(value.MinimumB)));
            parameters.Add(new Parameter("maximum_b", DatabaseHibernate.Parameter(value.MaximumB)));

            DatabaseHibernate hibernate = new DatabaseHibernate();

            result = hibernate.Write(Variable.Link, sql, parameters);

            return result;
        }
Exemplo n.º 3
0
        public IDDBackgroundSetup(Detector dt = null, BackgroundParameters bg = null)
        {
            InitializeComponent();
            if (det == null)
                det = Integ.GetCurrentAcquireDetector();
            else
                det = dt;
            if (bp == null)
                bp = Integ.GetCurrentBackgroundParams(det);
            else
                bp = bg;

            bp.modified = false;
            this.Text += " for detector " + det.Id.DetectorName;
            foreach (Control nt in this.Controls)
            {
                if (nt.GetType() == typeof(NumericTextBox))
                {
                    ((NumericTextBox)nt).NumberFormat = NumericTextBox.Formatter.F6;
                    ((NumericTextBox)nt).ToValidate = NumericTextBox.ValidateType.Float;
                    ((NumericTextBox)nt).Min = -100.0;
                    ((NumericTextBox)nt).Max = 100000.0;
                }
            }
            FieldFiller();
        }
Exemplo n.º 4
0
 public Result decode(BinaryBitmap image, Dictionary<DecodeHintType, Object> hints)
 {
     DecoderResult decoderResult;
     ResultPoint[] points;
     if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
     {
         BitMatrix bits = extractPureBits(image.BlackMatrix);
         decoderResult = decoder.decode(bits);
         points = NO_POINTS;
     }
     else
     {
         DetectorResult detectorResult = new Detector(image.BlackMatrix).detect();
         decoderResult = decoder.decode(detectorResult.Bits);
         points = detectorResult.Points;
     }
     var result = new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.DATAMATRIX);
     if (decoderResult.ByteSegments != null)
     {
         result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.ByteSegments);
     }
     if (decoderResult.ECLevel != null)
     {
         result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, decoderResult.ECLevel.ToString());
     }
     return result;
 }
Exemplo n.º 5
0
        public void MillionSquare()
        {
            Polygon P = new Polygon(MillionSquarePoints);
            Detector D = new Detector(P);

            Assert.AreEqual(D.Result, 3999996000001);
        }
Exemplo n.º 6
0
		public IDDShiftRegisterSetup(Detector d)
		{
			InitializeComponent();
			bauds = new int[] { 75, 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 128000, 256000 };

			for (int i = 0; i < bauds.Length; i++) {
				BaudCombo.Items.Add(bauds[i].ToString());
			}
			det = d;

			ShiftRegisterTypeComboBox.Items.Clear();

			/* JFL added */
			if (det.ListMode) 
			{
				foreach (INCCDB.Descriptor dt in NC.App.DB.DetectorTypes.GetList()) {
					InstrType dty;
					Enum.TryParse<InstrType>(dt.Name, out dty);
					if (dty.IsListMode())
						ShiftRegisterTypeComboBox.Items.Add(dty.ToString());
				}
				ShiftRegisterTypeComboBox.SelectedItem = det.Id.SRType.ToString();
			} 
			else 
			{
				foreach (INCCDB.Descriptor dt in NC.App.DB.DetectorTypes.GetINCC5SRList()) {
					ShiftRegisterTypeComboBox.Items.Add(dt.Name);
				}
				ShiftRegisterTypeComboBox.SelectedItem = InstrTypeExtensions.INCC5ComboBoxString(det.Id.SRType);
			}

			EditBtn.Visible = false;
			if (det.Id.SRType < InstrType.NPOD) {

				Refre_Click(null, null);
				SetBaudRateSelectorVisibility(det.Id.SRType.IsSRWithVariableBaudRate());
			} 
			else if (det.ListMode) 
			{
				ShiftRegisterSerialPortComboBox.Visible = false;
				ShiftRegisterSerialPortLabel.Visible = false;
				ShiftRegisterSerialPortComboBox.Visible = false;
				ShiftRegisterSerialPortLabel.Visible = false;
				ShiftRegisterSerialPortComboBoxRefresh.Visible = false;
				SetBaudRateSelectorVisibility(false);
				EditBtn.Visible = true;
				EditBtn.Enabled = true;
			}

			SetLMVSRFATypeAndVis();

			InitializeNumericBoxes();

			ShiftRegisterTypeComboBox.SelectedItem = det.Id.SRType.ToString();
			BaudCombo.SelectedIndex = BaudCombo.FindStringExact(d.Id.BaudRate.ToString());
			BaudCombo.Refresh();

			this.Text += (" for " + det.Id.DetectorName);
		}
Exemplo n.º 7
0
	void Awake()
	{
		if(modelMesh == null)
			modelMesh = this.gameObject;
		startHealth = health;
		sensor = this.GetComponent<Detector>();
		movType = this.gameObject.AddComponent<MovementTypes>();
	}
Exemplo n.º 8
0
        public IDDStratumId()
        {
            InitializeComponent();
            det = Integ.GetCurrentAcquireDetector();
            currStrata = NC.App.DB.StrataList(det);
            DeleteStratumIdBtn.Enabled = (currStrata.Count >=1);

        }
Exemplo n.º 9
0
 public IDDStratumIdDelete(Detector d)
 {
     InitializeComponent();
     det = d;
     RefreshCombo();
     if (StratumIdComboBox.Items.Count > 0)
         StratumIdComboBox.SelectedIndex = 0;
     this.Text += " for detector " + det.Id.DetectorName;
 }
        public bool Delete(Detector value)
        {
            bool result = false;

            DetectorHibernate hibernate = new DetectorHibernate();
            result = hibernate.Delete(value);

            return result;
        }
        public bool Insert(Detector value)
        {
            bool result = false;

            DetectorHibernate hibernate = new DetectorHibernate();
            result = hibernate.Insert(value);

            return result;
        }
Exemplo n.º 12
0
    void Awake()
    {
        character = GetComponent<CharacterController>();
        dude = gameObject.GetComponent<Dude>();
        swordzDude = gameObject.GetComponent<SwordzDude>();
        damageable = gameObject.GetComponent<Damageable>();
        detector = gameObject.GetComponentInChildren<Detector>();
        //controller = gameObject.GetComponent(typeof(DudeController)) as DudeController;

        attackers = new List<GameObject>();
    }
Exemplo n.º 13
0
 public IDDSetupUnattendedMeas(Detector d)
 {
     InitializeComponent();
     det = d;
     up = new UnattendedParameters();
     up.Copy(NC.App.DB.UnattendedParameters.GetMap()[det]);
     MaxTimeTextBox.Text = up.ErrorSeconds.ToString();
     AutoImportCheckBox.Checked = up.AutoImport;
     DoublesThresholdTextBox.Text = up.AASThreshold.ToString("F4");
     this.Text += " for detector " + det.Id.DetectorName;
 }
Exemplo n.º 14
0
 public IDDStratumIdAdd(Detector d)
 {
     det = d;
     InitializeComponent();
     RefreshCombo();
     if (CurrentStratumIdsComboBox.Items.Count > 0)
         CurrentStratumIdsComboBox.SelectedIndex = 0;
     else
         st = new INCCDB.StratumDescriptor();
     this.Text += " for detector " + det.Id.DetectorName;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            User sessionUser = this.Session[Constant.SESSION_KEY_USER] as User;
            DateTime now = DateTime.Now;

            SaveJsonData saveJsonData = new SaveJsonData();

            DetectorBusiness business = new DetectorBusiness();

            const int attributeCount = 3;
            int count = this.Request.Form.Count / attributeCount;
            List<Detector> detectors = new List<Detector>();
            for (int i = 0; i < count; i++)
            {
                Detector detector = new Detector();
                detector.Guid = this.Request.Form[(i * attributeCount) + 0];
                detector.UpdateUserId = sessionUser.Guid;
                detector.UpdateTime = now;
                try
                {
                    detector.PositionX = int.Parse(this.Request.Form[(i * attributeCount) + 1]);
                }
                catch (Exception exception)
                {
                    EnvironmentalMonitor.Support.Resource.Variable.Logger.Log(exception);
                }
                try
                {
                    detector.PositionY = int.Parse(this.Request.Form[(i * attributeCount) + 2]);
                }
                catch (Exception exception)
                {
                    EnvironmentalMonitor.Support.Resource.Variable.Logger.Log(exception);
                }
                detectors.Add(detector);
            }
            saveJsonData.success = business.UpdatePosition(detectors);
            if (saveJsonData.success)
            {
                saveJsonData.msg = "布局保存成功!";
            }
            else
            {
                saveJsonData.msg = "布局保存失败";
            }

            string json = JsonConvert.SerializeObject(saveJsonData);

            this.Response.Write(json);
            this.Response.Flush();
            this.Response.End();
        }
Exemplo n.º 16
0
        public MainWindow()
        {
            InitializeComponent();

            m_DG1 = new Diagram(Canvas1);
            m_DG2 = new Diagram(Canvas2);
            m_D = new Detector(m_DG1, m_DG2);

            waveIn = new WaveIn();
            waveIn.WaveFormat = new WaveFormat(44100, 1);
            waveIn.DataAvailable += waveIn_DataAvailable;
            waveIn.RecordingStopped += waveIn_RecordingStopped;
        }
        public bool Delete(Detector value)
        {
            bool result = false;

            string sql = string.Format("delete from e_detector as t where [t].[guid] = '{0}'", value.Guid);
            List<Parameter> parameters = new List<Parameter>();

            DatabaseHibernate hibernate = new DatabaseHibernate();

            result = hibernate.Write(Variable.Link, sql, parameters);

            return result;
        }
Exemplo n.º 18
0
 public IDDCurveType()
 {
     InitializeComponent();
     det = Integ.GetCurrentAcquireDetector();
     Text += " for detector " + det.Id.DetectorName;
     CurveTypeComboBox.Items.Clear();
     foreach (INCCAnalysisParams.CurveEquation cs in Enum.GetValues(typeof(INCCAnalysisParams.CurveEquation)))
     {
         CurveTypeComboBox.Items.Add(cs.ToDisplayString());
     }
     CurveTypeComboBox.Refresh();
     CurveTypeComboBox.SelectedIndex = 0;
     CalcDataList = new CalibrationCurveList();
 }
Exemplo n.º 19
0
 public IDDSetupUnattendedMeas(Detector d)
 {
     InitializeComponent();
     det = d;
     up = new UnattendedParameters();
     if (det == null)
         return;
     if (NC.App.DB.UnattendedParameters.Map.ContainsKey(det))
         up.Copy(NC.App.DB.UnattendedParameters.Map[det]);
     MaxTimeTextBox.Text = up.ErrorSeconds.ToString();
     AutoImportCheckBox.Checked = up.AutoImport;
     DoublesThresholdTextBox.Text = up.AASThreshold.ToString("F1");
     Text += " for detector " + det.Id.DetectorName;
 }
Exemplo n.º 20
0
 public IDDReanalysisAssay(Measurement m, Detector det)
 {
     InitializeComponent();
     // Generate an instance of the generic acquire dialog event handlers object (this now includes the AcquireParameters object used for change tracking)
     ah = new AcquireHandlers(m.AcquireState, det);
     ah.mo = AssaySelector.MeasurementOption.verification;
     Text = "Select measurement for detector " + ah.det.Id.DetectorName;
     toolTip1.SetToolTip(StratumIdComboBox, "You must select an existing stratum.");
     toolTip1.SetToolTip(MaterialTypeComboBox, "You must select an existing material type.");
     toolTip1.SetToolTip(UseCurrentCalibCheckBox, "x = use current calibration parameters for the selected material type.\r\nblank = use calibration parameters from the original measurement.");
     normmodified = false;
     meas = m;
     norm = new VTuple(meas.Norm.currNormalizationConstant);  // fill from m
     FieldFiller();
 }
Exemplo n.º 21
0
 public EqCoeffViewer(INCCAnalysisParams.CurveEquationVals coeff, INCCAnalysisParams.CurveEquation eq, CalibrationCurveList cclist)
 {
     InitializeComponent();
     det = Integ.GetCurrentAcquireDetector();
     Text += " for detector " + det.Id.DetectorName;
     disprows = new List<DataLoad>();
     CurveEquation = eq;
     Coefficients = coeff;
     CalcDataList = cclist;
     BuildRep();
     BuildRows();
     BuildCurveCombo();
     LowerMassLimitTextBox.Text = CalcDataList.LowerMassLimit.ToString("N4");
     UpperMassLimitTextBox.Text = CalcDataList.UpperMassLimit.ToString("N4");
     _reg = new Regex("[1-9][0-9]*\\.?[0-9]*([Ee][+-]?[0-9]+)?");  // reg ex for number test
 }
Exemplo n.º 22
0
 public LMAcquire(AcquireParameters _ap, Detector _det, bool fromINCC5Acq = false)
 {
     InitializeComponent();
     FromINCC5Acquire = fromINCC5Acq;
     Text += (_det.Id.DetectorId);
     det = _det;
     ap = _ap;
     if (!FromINCC5Acquire)  // reset and build occurs in the INCC5 acquire handler code
     {
         ResetMeasurement();
         Integ.BuildMeasurement(ap, det, AssaySelector.MeasurementOption.unspecified);
     }
     PreserveAnalyzerChanges = AnalyzersLoaded = LMParamUpdate = AcqParamUpdate = false;
     BuildAnalyzerCombo();
     Swap(ap.data_src.Live());
     SelectTheBestINCC5AcquireVSRRow();
 }
Exemplo n.º 23
0
        protected void ButtonOK_Click(object sender, EventArgs e)
        {
            bool done = false;
            StringBuilder stringBuilder = new StringBuilder();

            DetectorBusiness business = new DetectorBusiness();

            if (this.CheckBoxListDetectors.Items != null)
            {
                List<Detector> detectors = new List<Detector>();
                for (int i = 0; i < this.CheckBoxListDetectors.Items.Count; i++)
                {
                    if (this.CheckBoxListDetectors.Items[i].Selected)
                    {
                        Detector detector = new Detector();
                        detector.Guid = this.CheckBoxListDetectors.Items[i].Value;
                        detectors.Add(detector);
                    }
                }

                if ((detectors != null) && (detectors.Count > 0))
                {
                    int success = 0;
                    int fail = 0;
                    for (int i = 0; i < detectors.Count; i++)
                    {
                        done = business.Delete(detectors[i]);
                        if (done)
                        {
                            success++;
                        }
                        else
                        {
                            fail++;
                        }
                    }
                    stringBuilder.Append(string.Format("删除{0}个探头成功!", success));
                    stringBuilder.Append(string.Format("删除{0}个探头失败!", fail));
                }
            }

            this.LabelMessage.Text = stringBuilder.ToString();

            this.InitializeBind();
        }
Exemplo n.º 24
0
 public IDDMeasurementList(AssaySelector.MeasurementOption filter, bool alltypes, EndGoal goal, Detector detector = null)
 {
     InitializeComponent();
     System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
     try
     {
         InitSort();
         PrepNotepad();
         SetTitlesAndChoices(filter, alltypes, goal,
             detector == null ? string.Empty : detector.Id.DetectorId, string.Empty);
         mlist = N.App.DB.MeasurementsFor(detector == null ? string.Empty : detector.Id.DetectorId, filter);
         bGood = PrepList(filter, detector);
     } finally
     {
         System.Windows.Input.Mouse.OverrideCursor = null;
     }
     SummarySelections = null;
 }
Exemplo n.º 25
0
        public Encoding Detect(Stream stream, bool acceptProbable = true)
        {
            long originalStreamPosition = stream.Position;

            byte[] detectionBuffer = new byte[4096];
            int length;

            bool detectionDone    = false;
            bool isAsciiEncoding  = true;

            Detector detector          = new Detector((int)InputLanguage);
            DetectionObserver observer = new DetectionObserver();
            detector.Init(observer);

            while ((length
                = stream.Read(detectionBuffer, 0, detectionBuffer.Length))
                != 0
                && !detectionDone)
            {
                if (isAsciiEncoding)
                {
                    isAsciiEncoding = detector.isAscii(detectionBuffer, length);
                }
                else
                {
                    detectionDone
                        = detector.DoIt(detectionBuffer, length, true);
                }
            }

            stream.Position = originalStreamPosition;

            detector.DataEnd();

            if (isAsciiEncoding)
                return Encoding.ASCII;
            else if (observer.Charset != String.Empty)
                return Encoding.GetEncoding(observer.Charset);
            else if (acceptProbable)
                return Encoding.GetEncoding(detector.getProbableCharsets()[0]);
            else
                return null;
        }
Exemplo n.º 26
0
        public IDDDetectorAdd()
        {
            InitializeComponent();
            srtype = true;
            SR.Checked = true;
            LM.Checked = false;
            RefreshDetectorCombo();
            model = (Detector)CurrentDetectorsComboBox.SelectedItem;

            // load the LM type combo selector
            LMTypes.Items.Clear();
            foreach (INCCDB.Descriptor dt in NC.App.DB.DetectorTypes.GetLMList())
            {
                InstrType dty;
                System.Enum.TryParse<InstrType>(dt.Name, out dty);
                if (dty.IsListMode())
                    LMTypes.Items.Add(dty);
            }
            LMTypes.SelectedItem = InstrType.MCA527;
        }
Exemplo n.º 27
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (target == null)
                return;
            if (null != NC.App.DB.Detectors.Find(d => String.Compare(d.Id.DetectorName, target.Id.DetectorName, true) == 0))
            {
                DialogResult r = MessageBox.Show(
                    String.Format("Do you want to delete detector {0}, including all its measurements and all its database parameters?", target.Id.DetectorName),
                     "Confirm Delete", MessageBoxButtons.YesNo);
                if (r == System.Windows.Forms.DialogResult.Yes)
                {
                    if (Integ.DeleteDetectorAndAssociations(target)) // removes from DB then from Detectors list, just like isotopics
                    {
                        target = null;
                        RefreshDetectorCombo();
                    }
                }
            }

        }
Exemplo n.º 28
0
 public IDDReviewCalibration()
 {
     InitializeComponent();
     det = Integ.GetCurrentAcquireDetector();
     acq = Integ.GetCurrentAcquireParams();
     if (acq.review_detector_parms)
         DetectorParametersCheckBox.Checked = true;
     if (acq.review_isotopics)
         IsotopicsCheckBox.Checked = true;
     if (acq.review_run_raw_data)
         IndividualCycleRawDataCheckBox.Checked = true;
     if (acq.review_run_rate_data)
         IndividualCycleRateDataCheckBox.Checked = true;
     if (acq.review_summed_raw_data)
         SummedRawCoincidenceDataCheckBox.Checked = true;
     if (acq.review_summed_mult_dist)
         SummedMultiplicityDistributionsCheckBox.Checked = true;
     if (acq.review_run_mult_dist)
         SummedRawCoincidenceDataCheckBox.Checked = true;
     if (acq.print)
         PrintTextCheckBox.Checked = true; 
 }
Exemplo n.º 29
0
        // Constructor including initialization of comboboxen in the various panels
        public LMConnectionParams(Detector candidate, AcquireParameters acq, bool isnew)
        {
            AddingNew = isnew;
            InitializeComponent();
            oTitle = Text;

            // Reposition the various panels on top of each other
            SelectorPanel.Top = 4;
            SelectorPanel.Left = 6;
            LMMMPanel.Top = 4;
            LMMMPanel.Left = 6;
            PTR32Panel.Top = 4;
            PTR32Panel.Left = 6;
            AddDetectorTypePanel.Top = 4;
            AddDetectorTypePanel.Left = 6;
            AddDetectorTypePanel.Top = 4;
            AddDetectorTypePanel.Left = 6;

            RefreshDetectorCombo();
            DetectorComboBox.SelectedItem = candidate;

            RefreshDetectorTypeCombo();
            AddDetectorTypeComboBox.SelectedItem = candidate.Id.SRType;

            det = candidate;
            this.acq = acq;
            MCAComboBox.Visible = false;
            if (det != null)
            {
                if (det.Id.SRType == InstrType.MCA527)
                {
                    PopulateMCA527ParamFields();
                } else
                {
                    PopulateLMMM_PTR32ParamFields();
                }
            }
        }
Exemplo n.º 30
0
        public IDDNormalizationSetup()
        {
            InitializeComponent();

            det = Integ.GetCurrentAcquireDetector();
            np = Integ.GetCurrentNormParams(det);
            this.Text += " for detector " + det.Id.DetectorName;
            switch (np.biasMode)
            {
                case NormTest.AmLiSingles:
                    UseAmLiRadioButton.Checked = true;
                    break;
                case NormTest.Cf252Doubles:
                    UseCf252DoublesRadioButton.Checked = true;
                    break;
                case NormTest.Cf252Singles:
                    UseCf252SinglesRadioButton.Checked = true;
                    break;
                case NormTest.Collar:
                    CollarRadioButton.Checked = true;
                    break;
            }
        }
Exemplo n.º 31
0
 private static void Detect(Detector detector, Particle particle, out bool r)
 {
     r = detector.InDirectionOfDetector(particle);
 }
Exemplo n.º 32
0
 public void Initialize(IOpenRPAClient client, Detector InEntity)
 {
     Entity  = InEntity;
     watcher = new FileSystemWatcher();
     Start();
 }