Example #1
0
        private void Obrabotka(List <Byte> buf00, out int[] Amp, out string time, out int[] nn1, out double[] Nul, out double[] sig, bool testT, out bool bad)
        {
            int[,] data     = new int[12, 1024];
            int[,] dataTail = new int[12, 20000];
            sig             = new Double[12];
            Nul             = new double[12];
            time            = "0";
            nn1             = new int[12];
            Amp             = new int[12];
            bad             = false;
            try
            {
                // byte[] bb = new byte[buf00.Count];
                //bb = buf00.ToArray();
                ParserBAAK12.ParseBinFileBAAK12.ParseBinFileBAAK200H(buf00.ToArray(), out data, out time, out dataTail);
                //  Amp = new int[12];
                // Nul = new int[12];
                //   sig = new Double[12];
                try
                {
                    if (grafOtob)
                    {
                        //  Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
                        //  {
                        Application.Current.Dispatcher.Invoke((Action) delegate { MyGrafic.AddPointRaz(data, "Кластер" + namKl, masnul); });
                        //  }));
                    }

                    if (windowChart != null && !testT)
                    {
                        // Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
                        // {
                        Application.Current.Dispatcher.Invoke((Action) delegate
                        {
                            windowChart.AddPointRaz(data);
                        });
                        //  }));
                    }
                    if (windowChartTail != null && !testT)
                    {
                        //Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
                        //  {
                        Application.Current.Dispatcher.Invoke((Action) delegate
                        {
                            windowChartTail.AddPointRaz(dataTail);
                        });
                        // }));
                    }
                }
                catch (NullReferenceException ee)
                {
                    Debug.WriteLine("Error 708");
                }
                catch (Exception ex)
                {
                    File.AppendAllText("D:\\Erroy_URAN_file.txt", "Ошибка графика" + ex.Message.ToString() + "\n" + "otobKl " + otobKl + "\t" + "NamKl " + NamKl); //допишет текст в конец файла
                }

                if (!testT)
                {
                    ParserBAAK12.ParseBinFileBAAK12.MaxAmpAndNul(data, ref sig, ref Amp, ref Nul, ref bad, true, 1, 6);
                    // MaxAmpAndNul(data, out Amp, out Nul, out sig);
                    // MessageBox.Show(Nul.ToString()+" "+ dataTail[3, 100]+" " + dataTail[3, 101] + " " + dataTail[3, 102] + " " + dataTail[3, 103] + " " + dataTail[3, 104] + " " + dataTail[3, 105] + " " + dataTail[3, 106] + " ");
                    // nn1 = new int[12];
                    Neutron(dataTail, BAAK12T.PorogNutron, BAAK12T.DlNutron, out nn1, time, testT, Nul, bad);
                }
            }
            catch (NullReferenceException ee)
            {
                //  File.AppendAllText("D:\\Erroy_URAN_file.txt", "Error 723" + "\n"); //допишет текст в конец файла
            }
            catch (Exception ex)
            {
                //  File.AppendAllText("D:\\Erroy_URAN_file.txt", "Ошибка обработки данных" + ex.Message.ToString() + "\n" + "Время " + time + "\n"); //допишет текст в конец файла
            }
        }
Example #2
0
        private void Obrabotka(List <Byte> buf00, out int[] Amp, out double[] Nul, int dl, out int dn, out bool neutron, ref ClassZapicBD100 classZapicBD100)
        {
            int[,] data = new int[12, 1024 * dl];

            Nul = new double[12];

            dn      = 0;
            neutron = false;
            bool bad = false;

            Amp = new int[12];

            int[] coutN1 = new int[12];
            int[] timeS  = new int[12];



            try
            {
                ParserBAAK12.ParseBinFileBAAK12.ParseBinFileBAAK200(buf00.ToArray(), dl, out data, out classZapicBD100.timeBD);
                if (grafOtob)
                {
                    //  Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
                    //  {
                    Application.Current.Dispatcher.Invoke((Action) delegate { MyGrafic.AddPointRaz(data, "Кластер" + namKl, masnul); });
                    //  }));
                }
                if (windowChart != null)
                {
                    // Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
                    // {
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        windowChart.AddPointRaz(data);
                    });
                    //  }));
                }
                // To Do
                ParserBAAK12.ParseBinFileBAAK12.MaxAmpAndNul(data, ref classZapicBD100.sig, ref Amp, ref Nul, ref bad, false, 0.6, 5);

                ObrabotcaURAN.Obrabotca.AmpAndTime(data, Nul, out classZapicBD100.TmaxACh, out classZapicBD100.Amp);



                classZapicBD100.TfACh = ObrabotcaURAN.Obrabotca.FirstTme(classZapicBD100.TmaxACh, classZapicBD100.Amp, data, Nul, ref classZapicBD100.TpmA, out classZapicBD100.TA34Ch, out classZapicBD100.TA14Ch);



                classZapicBD100.SCh  = ObrabotcaURAN.Obrabotca.ColSigVatias(data, Nul);
                classZapicBD100.SBCh = ObrabotcaURAN.Obrabotca.ColBin(data, Nul);

                for (int i = 0; i < 12; i++)
                {
                    int x = 0;
                    for (int j = 350; j < 1024; j++)
                    {
                        // Debug.WriteLine(data1[i, j].ToString());
                        //Debug.WriteLine(data1[i, j].ToString() +"-"+ Nul[i].ToString());
                        // data1S[i, j] = Convert.ToDouble(data1[i, j]) - Nul[i];
                        int AN = data[i, j] - Convert.ToInt32(Nul[i]);
                        if (AN > 5)
                        {
                            classZapicBD100.SumD[i] += AN;
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
        }