protected override void UpdateData()
        {
            var to   = Settings.Settings.Default.TestModeActive ? new DateTime(2018, 07, 02, 13, 37, 00) : DateTime.Now;
            var from = to - new TimeSpan(HoursToDisplay, 0, 0);

            var newPcbCameraSelfCheckData = _productionServices.Context.GetPcbCameraSelfCheckValues(from, to);

            if (!CompareLogic.AreEqual(newPcbCameraSelfCheckData, _oldPcbCameraSelfCheckData))
            {
                PcbCameraSelfCheckData = new ObservableCollection <KeyValuePair <DateTime, IPcbCameraSelfCheckValue> >(newPcbCameraSelfCheckData);

                if (PcbCameraSelfCheckData.Count > 1)
                {
                    var valuesX = new List <double>();
                    var valuesZ = new List <double>();

                    foreach (var value in PcbCameraSelfCheckData)
                    {
                        valuesX.Add(value.Value.XValue);
                        valuesZ.Add(value.Value.ZValue);
                    }

                    AverageX      = Math.Round(Spc.GetAverage(valuesX), 2);
                    StdDeviationX = Math.Round(Spc.GetStandardDeviation(valuesX), 2);
                    CmX           = Math.Round(Spc.GetCm(valuesX, PcbCameraSelfCheckData[0].Value.XTolerancePos, PcbCameraSelfCheckData[0].Value.XToleranceNeg), 2);
                    CmkX          = Math.Round(Spc.GetCmk(valuesX, 0.0, PcbCameraSelfCheckData[0].Value.XTolerancePos, PcbCameraSelfCheckData[0].Value.XToleranceNeg), 2);

                    AverageZ      = Math.Round(Spc.GetAverage(valuesZ), 2);
                    StdDeviationZ = Math.Round(Spc.GetStandardDeviation(valuesZ), 2);
                    CmZ           = Math.Round(Spc.GetCm(valuesZ, PcbCameraSelfCheckData[0].Value.ZTolerancePos, PcbCameraSelfCheckData[0].Value.ZToleranceNeg), 2);
                    CmkZ          = Math.Round(Spc.GetCmk(valuesZ, 0.0, PcbCameraSelfCheckData[0].Value.ZTolerancePos, PcbCameraSelfCheckData[0].Value.ZToleranceNeg), 2);
                }
            }

            _oldPcbCameraSelfCheckData = newPcbCameraSelfCheckData;
        }
示例#2
0
文件: SCSI.cs 项目: morefun0302/Aaru
        public static void Scsi(string devPath, Device dev)
        {
            while (true)
            {
                System.Console.Clear();
                AaruConsole.WriteLine("Device: {0}", devPath);
                AaruConsole.WriteLine("Send a SCSI command to the device:");
                AaruConsole.WriteLine("1.- Send an Adaptec vendor command to the device.");
                AaruConsole.WriteLine("2.- Send an Archive vendor command to the device.");
                AaruConsole.WriteLine("3.- Send a Certance vendor command to the device.");
                AaruConsole.WriteLine("4.- Send a Fujitsu vendor command to the device.");
                AaruConsole.WriteLine("5.- Send an HL-DT-ST vendor command to the device.");
                AaruConsole.WriteLine("6.- Send a Hewlett-Packard vendor command to the device.");
                AaruConsole.WriteLine("7.- Send a Kreon vendor command to the device.");
                AaruConsole.WriteLine("8.- Send a SCSI MultiMedia Command to the device.");
                AaruConsole.WriteLine("9.- Send a NEC vendor command to the device.");
                AaruConsole.WriteLine("10.- Send a Pioneer vendor command to the device.");
                AaruConsole.WriteLine("11.- Send a Plasmon vendor command to the device.");
                AaruConsole.WriteLine("12.- Send a Plextor vendor command to the device.");
                AaruConsole.WriteLine("13.- Send a SCSI Block Command to the device.");
                AaruConsole.WriteLine("14.- Send a SCSI Media Changer command to the device.");
                AaruConsole.WriteLine("15.- Send a SCSI Primary Command to the device.");
                AaruConsole.WriteLine("16.- Send a SCSI Streaming Command to the device.");
                AaruConsole.WriteLine("17.- Send a SyQuest vendor command to the device.");
                AaruConsole.WriteLine("0.- Return to command class menu.");
                AaruConsole.Write("Choose: ");

                string strDev = System.Console.ReadLine();

                if (!int.TryParse(strDev, out int item))
                {
                    AaruConsole.WriteLine("Not a number. Press any key to continue...");
                    System.Console.ReadKey();

                    continue;
                }

                switch (item)
                {
                case 0:
                    AaruConsole.WriteLine("Returning to command class menu...");

                    return;

                case 1:
                    Adaptec.Menu(devPath, dev);

                    continue;

                case 2:
                    ArchiveCorp.Menu(devPath, dev);

                    continue;

                case 3:
                    Certance.Menu(devPath, dev);

                    continue;

                case 4:
                    Fujitsu.Menu(devPath, dev);

                    continue;

                case 5:
                    HlDtSt.Menu(devPath, dev);

                    continue;

                case 6:
                    Hp.Menu(devPath, dev);

                    continue;

                case 7:
                    Kreon.Menu(devPath, dev);

                    continue;

                case 8:
                    Mmc.Menu(devPath, dev);

                    continue;

                case 9:
                    Nec.Menu(devPath, dev);

                    continue;

                case 10:
                    Pioneer.Menu(devPath, dev);

                    continue;

                case 11:
                    Plasmon.Menu(devPath, dev);

                    continue;

                case 12:
                    Plextor.Menu(devPath, dev);

                    continue;

                case 13:
                    Sbc.Menu(devPath, dev);

                    continue;

                case 14:
                    Smc.Menu(devPath, dev);

                    continue;

                case 15:
                    Spc.Menu(devPath, dev);

                    continue;

                case 16:
                    Ssc.Menu(devPath, dev);

                    continue;

                case 17:
                    SyQuest.Menu(devPath, dev);

                    continue;

                default:
                    AaruConsole.WriteLine("Incorrect option. Press any key to continue...");
                    System.Console.ReadKey();

                    continue;
                }
            }
        }