Пример #1
0
 /// <summary>
 /// initScanner() loads scanner objects from serialized scanner files
 // </summary>
 /// <exception cref="SN17001Exception">SN17001Exception</exception>
 public void initScanner()
 {
     try
     {
         //Get the scanner objects
         CRObjSerializer cros = new CRObjSerializer();
         Icrscanner = cros.LoadCRScanner(iScanner);
         Acrscanner = cros.LoadCRScanner(aScanner);
     }
     catch (Exception ex)
     {
         throw new SN17001Exception(ex.Message);
     }
 }
Пример #2
0
 /// <summary>
 /// Opens a saved scanner file
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void scannerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog.
         if (result == DialogResult.OK)                      // Test result.
         {
             CRObjSerializer cros = new CRObjSerializer();
             crs = cros.LoadCRScanner(openFileDialog1.FileName);
             //set drop down box
             comboBox1.Items.Clear();
             foreach (var p in crs.Patterns)
             {
                 comboBox1.Items.Add(p);
             }
             //set the save path
             fileSavePath = openFileDialog1.FileName;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error"
                         , MessageBoxButtons.OK, MessageBoxIcon.Error);
         crl.WriteLog(CRLogger.CRLogTitle.Error, "Error opening a scanner file " +
                      ex.Message);
     }
 }
Пример #3
0
        public CRVData Scan()
        {
            //Get the scanner object
            CRObjSerializer cros      = new CRObjSerializer();
            CRScanner       crscanner = cros.LoadCRScanner(sPath);

            //Call the ICRISE implementation for this scanner
            ICRISE             icrise     = new SN171001IndicatorScan();
            List <CRIndicator> indicators = icrise.GetIndicators(dPath, crscanner);

            //Call the ICRIAE implementation for this scanner
            ICRIAE  icriae = new SN17001AnalyzerScan();
            CRVData crd    = icriae.GetCRVData(indicators, null);

            return(null);
        }