public SpectrCalc(MethodSimple ms, int el_index, int formula_index)
        {
            MethodSimpleElement mse = ms.GetElHeader(el_index);

            Formula = mse.Formula[formula_index];
            double ly   = (double)Formula.Formula.analitParamCalc.methodLineCalc1.nmLy.Value;
            bool   next = Formula.Formula.analitParamCalc.methodLineCalc1.cbFromSnNum.SelectedIndex == 1;

            int pr_count = ms.GetProbCount();

            for (int pr = 0; pr < pr_count; pr++)
            {
                List <Data>      prob_data = new List <SpectrCalc.Data>();
                MethodSimpleProb msp       = ms.GetProbHeader(pr);
                int sp_count = msp.MeasuredSpectrs.Count;
                for (int sp = 0; sp < sp_count; sp++)
                {
                    MethodSimpleCell msc = ms.GetCell(el_index, pr);
                    MethodSimpleCellFormulaResult mscfr = msc.GetData(sp, formula_index);
                    MethodSimpleProbMeasuring     mspm  = msp.MeasuredSpectrs[sp];
                    if (mscfr.Enabled)
                    {
                        prob_data.Add(new Data(mspm.Sp, (float)msc.Con, ly, next));
                    }
                }
                DataSet.Add(prob_data);
            }
        }
        public static List <MethodData> getData(MethodSimple method, int element, int formula, bool use_all, out int used)
        {
            MethodSimpleElementFormula msef = method.GetElHeader(element).Formula[formula];

            bool[]            used_frames = msef.Formula.GetUsedFrames();
            List <MethodData> ret         = new List <MethodData>();
            int prob_count = method.GetProbCount();

            used = 0;
            for (int pr = 0; pr < prob_count; pr++)
            {
                MethodSimpleProb m_prob = method.GetProbHeader(pr);
                MethodSimpleCell m_cell = method.GetCell(element, pr);
                double           con    = m_cell.Con;
                if (con < 0)
                {
                    continue;
                }
                int sub_prob_count = method.GetSubProbCount(pr);
                for (int sub_pr = 0; sub_pr < sub_prob_count; sub_pr++)
                {
                    MethodSimpleProbMeasuring m_prob_measuring = m_prob.MeasuredSpectrs[sub_pr];
                    Spectr sp = m_prob_measuring.Sp;
                    if (sp == null)
                    {
                        continue;
                    }
                    bool en = m_cell.GetData(sub_pr, formula).Enabled;
                    if (use_all == true)
                    {
                        en = true;
                    }
                    int   short_count = sp.GetShotCount();
                    int[] shorts      = sp.GetShotIndexes();
                    for (int short_index = 0; short_index < shorts.Length; short_index++)
                    {
                        bool fl = en & used_frames[short_index];
                        if (fl)
                        {
                            used++;
                        }
                        MethodData md = new MethodData(con, fl, pr, sub_pr, short_index,
                                                       sp.GetViewsSet()[shorts[short_index]],
                                                       sp.GetNullFor(shorts[short_index]), sp.GetCommonDispers());
                        ret.Add(md);
                    }
                }
            }
            if (ret.Count == 0)
            {
                return(null);
            }
            return(ret);
        }
Beispiel #3
0
        public void Add(MethodSimple method, int prob, int sub_prob)
        {
            DateTime now = DateTime.Now;

            Element[]        elem = method.GetElementList();
            MethodSimpleProb msp  = method.GetProbHeader(prob);

            for (int el = 0; el < elem.Length; el++)
            {
                MethodSimpleCell    cell = method.GetCell(el, prob);
                MethodSimpleElement mse  = method.GetElHeader(el);
                for (int f = 0; f < mse.Formula.Count; f++)
                {
                    MethodSimpleElementFormula    formula = mse.Formula[f];
                    MethodSimpleCellFormulaResult mscfr   = cell.GetData(sub_prob, f);
                    Records.Add(new StandartHistryRecord(mse, f, formula, mscfr, now));
                }
            }
            Save();
        }
        private void btPrint_Click(object sender, EventArgs e)
        {
            try
            {
                //StoreReport(cbReportType.Text);
                cbReportType_SelectedIndexChanged(null, null);

                Result = new PrintDoc();
                Result.Docs.Add(new PrintTextDoc(tbHeaderText.Text));
                PrintTableDoc tbl = new PrintTableDoc(Common.MLS.Get(MLSConst, "Пробы"));
                Result.Docs.Add(tbl);
                Result.Docs.Add(new PrintTextDoc(tbFooterText.Text));

                int el_count = Task.Data.GetElementCount();
                int pr_count = Task.Data.GetProbCount();
                int col_count = el_count, row_count = 0;
                for (int pr = 0; pr < pr_count; pr++)
                {
                    if (chlProbList.GetItemChecked(pr) == false)
                    {
                        continue;
                    }
                    row_count++;
                    if (chbPrintAllMeasuring.Checked)
                    {
                        row_count += Task.Data.GetProbHeader(pr).MeasuredSpectrs.Count;
                    }
                }
                if (chbPrintAllMeasuringDate.Checked)
                {
                    tbl.SetupSize(col_count + 1, row_count);
                }
                else
                {
                    tbl.SetupSize(col_count, row_count);
                }
                int    row = 0;
                double sko, real_sko, con, good_sko;
                bool   is_first = true;
                for (int pr = 0; pr < pr_count; pr++)
                {
                    if (chlProbList.GetItemChecked(pr) == false)
                    {
                        continue;
                    }
                    MethodSimpleProb mpr = Task.Data.GetProbHeader(pr);
                    tbl.SetupRowHeader(row, mpr.Name);
                    for (int el = 0; el < el_count; el++)
                    {
                        if (is_first)
                        {
                            MethodSimpleElement mse = Task.Data.GetElHeader(el);
                            tbl.SetupColHeader(el, mse.Element.Name);
                        }
                        MethodSimpleCell msc = Task.Data.GetCell(el, pr);
                        con = msc.CalcRealCon(out sko, out real_sko);
                        string tmp        = "" + serv.GetGoodValue(con, 2);
                        bool   plus_minus = false;
                        if (real_sko > 0)
                        {
                            if (chbPrintEverSko.Checked)
                            {
                                double tmpp;
                                if (sko > real_sko && real_sko > 0)
                                {
                                    tmpp = real_sko;
                                }
                                else
                                {
                                    tmpp = sko;
                                }
                                tmpp       = 100 * tmpp / con;
                                tmp       += (char)0xB1 + serv.GetGoodValue(tmpp, 1) + "%";
                                plus_minus = true;
                            }
                            if (chbPrintEverAbsError.Checked)
                            {
                                if (plus_minus == false)
                                {
                                    tmp += (char)0xB1;
                                }
                                if (real_sko > 0)
                                {
                                    tmp += serv.GetGoodValue(real_sko, 2);
                                }
                                else
                                {
                                    tmp += serv.GetGoodValue(sko, 2);
                                }
                            }
                        }
                        tbl.SetupData(el, row, tmp);
                    }
                    is_first = false;
                    row++;
                    if (chbPrintAllMeasuring.Checked)
                    {
                        for (int sp = 0; sp < mpr.MeasuredSpectrs.Count; sp++)
                        {
                            if (chbPrintAllMeasuringDate.Checked &&
                                mpr.MeasuredSpectrs[sp].Sp != null)
                            {
                                tbl.SetupData(col_count, row, mpr.MeasuredSpectrs[sp].Sp.CreatedDate.ToString());
                            }
                            tbl.SetupRowHeader(row, " ");
                            for (int el = 0; el < el_count; el++)
                            {
                                MethodSimpleCell    msc = Task.Data.GetCell(el, pr);
                                MethodSimpleElement mse = Task.Data.GetElHeader(el);
                                string cel_text         = "";
                                for (int f = 0; f < mse.Formula.Count; f++)
                                {
                                    MethodSimpleCellFormulaResult mscfr = msc.GetData(sp, mse.Formula[f].FormulaIndex);
                                    if (mscfr == null || mscfr.ReCalcCon == null || mscfr.Enabled == false)
                                    {
                                        continue;
                                    }
                                    con = mscfr.GetEver(out sko, out good_sko);
                                    //sko = mscfr.GetSKO();
                                    if (sko > good_sko)
                                    {
                                        sko = good_sko;
                                    }
                                    string tmp = "" + serv.GetGoodValue(con, 2);
                                    if (sko > 0)
                                    {
                                        bool plus_minus = false;
                                        if (chbPrintAllMeasuringSko.Checked)
                                        {
                                            double tmpp;
                                            tmpp       = sko;
                                            tmpp       = 100 * tmpp / con;
                                            tmp       += (char)0xB1 + serv.GetGoodValue(tmpp, 1) + "%";
                                            plus_minus = true;
                                        }
                                        if (chbPrintAllMeasuringAbsError.Checked)
                                        {
                                            if (plus_minus == false)
                                            {
                                                tmp += (char)0xB1;
                                            }
                                            tmp += serv.GetGoodValue(sko, 2);
                                        }
                                    }
                                    cel_text += tmp + " ";
                                }
                                tbl.SetupData(el, row, cel_text);
                            }
                            row++;
                        }
                    }
                }

                /*tbl.SetupSize(10, 50);
                 * for (int c = 0; c < 10; c++)
                 * {
                 *  tbl.SetupColHeader(c, "" + c);
                 *  for (int r = 0; r < 50; r++)
                 *  {
                 *      tbl.SetupRowHeader(r, "" + r);
                 *      tbl.SetupData(c, r, "____" + c + "_" + r+"____");
                 *  }
                 * }*/
            }
            catch (Exception ex)
            {
                Result = null;
                Common.Log(ex);
            }
            Visible = false;
        }
        static public List <DataShot> extract(MethodSimple method, string element, int formula,
                                              double ly, int widthPlusMinus, bool useConDlt,
                                              double min, double max, bool relative)
        {
            int             mul_k   = (int)Common.Conf.MultFactor;
            int             is_ok   = 0;
            int             is_over = 0;
            List <DataShot> ret     = new List <DataShot>();

            Element[] list = method.GetElementList();
            for (int el = 0; el < list.Length; el++)
            {
                if (list[el].Name.Equals(element) || element == null)
                {
                    MethodSimpleElementFormula calcFormula = method.GetElHeader(el).Formula[formula];
                    bool[] frames = calcFormula.Formula.GetUsedFrames();
                    for (int prob_index = 0; prob_index < method.GetProbCount(); prob_index++)
                    {
                        MethodSimpleProb prob = method.GetProbHeader(prob_index);
                        MethodSimpleCell msc  = method.GetCell(el, prob_index);
                        if (useConDlt == false)
                        {
                            double fkVal = msc.Con;
                            double con   = fkVal;

                            /*if (useConDlt)
                             * {
                             *  double sko, sko1;
                             *  double rcon = //msc.CalcRealCon(out sko, out sko1);
                             *  fkVal -= rcon;
                             * }//*/
                            for (int measuring_index = 0; measuring_index < prob.MeasuredSpectrs.Count; measuring_index++)
                            {
                                MethodSimpleCellFormulaResult mscfr = msc.GetData(measuring_index, formula);
                                if (mscfr.Enabled == false)
                                {
                                    continue;
                                }
                                MethodSimpleProbMeasuring mspm = prob.MeasuredSpectrs[measuring_index];
                                Spectr sp = mspm.Sp;
                                if (sp == null)
                                {
                                    continue;
                                }
                                List <SpectrDataView> viewSet = sp.GetViewsSet();
                                int[]      shotIndexes        = sp.GetShotIndexes();
                                Dispers    disp    = sp.GetCommonDispers();
                                List <int> sensors = disp.FindSensors(ly);
                                bool       isEnabled;
                                if (con >= 0)
                                {
                                    isEnabled = msc.Enabled;
                                }
                                else
                                {
                                    isEnabled = false;
                                }
                                for (int shot_index = 0; shot_index < shotIndexes.Length; shot_index++)
                                {
                                    if (frames[shot_index] == false)
                                    {
                                        continue;
                                    }
                                    SpectrDataView sig = viewSet[shotIndexes[shot_index]];
                                    SpectrDataView nul = sp.GetNullFor(shotIndexes[shot_index]);
                                    for (int sn = 0; sn < 1 && sn < sensors.Count; sn++)
                                    {
                                        int     sensorIndex = sensors[sn];
                                        int     n           = (int)disp.GetLocalPixelByLy(sensorIndex, ly);
                                        float[] sigData     = sig.GetSensorData(sensorIndex);
                                        float[] nulData     = nul.GetSensorData(sensorIndex);
                                        float   minSignal   = float.MaxValue;
                                        float[] signal      = new float[sigData.Length];
                                        for (int i = 0; i < signal.Length; i++)
                                        {
                                            signal[i] = sigData[i] - nulData[i];
                                        }
                                        for (int i = 500; i < sigData.Length - 500; i++)
                                        {
                                            float val = (signal[i - 1] + signal[i] + signal[i + 1]) / 3;
                                            if (val < minSignal)
                                            {
                                                minSignal = val;
                                            }
                                        }

                                        float[] data      = new float[widthPlusMinus * 2 + 1];
                                        double  maxSignal = -double.MaxValue;
                                        for (int i = 0; i < data.Length; i++)
                                        {
                                            int index = n - widthPlusMinus + i;
                                            if (index < 0 || index >= sigData.Length)
                                            {
                                                data[i]   = -float.MaxValue;
                                                isEnabled = false;
                                                continue;
                                            }
                                            data[i] = signal[index];//sigData[index] - nulData[index];
                                            if (data[i] > max)
                                            {
                                                isEnabled = false;
                                            }
                                            if (data[i] > maxSignal && i > widthPlusMinus - 4 && i < widthPlusMinus + 4)
                                            {
                                                maxSignal = data[i];
                                            }
                                        }
                                        if (maxSignal < min)
                                        {
                                            isEnabled = false;
                                        }
                                        if (isEnabled)
                                        {
                                            is_ok++;
                                        }
                                        else
                                        {
                                            is_over++;
                                        }
                                        DataShot dsh = new DataShot(ly, fkVal, data, isEnabled);
                                        ret.Add(dsh);
                                    }
                                }
                            }
                        }
                        else
                        {
                            for (int measuring_index = 0; measuring_index < prob.MeasuredSpectrs.Count; measuring_index++)
                            {
                                MethodSimpleProbMeasuring mspm = prob.MeasuredSpectrs[measuring_index];
                                Spectr sp = mspm.Sp;
                                if (sp == null)
                                {
                                    continue;
                                }
                                List <SpectrDataView> viewSet = sp.GetViewsSet();
                                int[]      shotIndexes        = sp.GetShotIndexes();
                                Dispers    disp    = sp.GetCommonDispers();
                                List <int> sensors = disp.FindSensors(ly);
                                bool       isEnabled;
                                if (msc.Con >= 0)
                                {
                                    isEnabled = msc.Enabled;
                                }
                                else
                                {
                                    isEnabled = false;
                                }
                                MethodSimpleCellFormulaResult result = msc.GetData(measuring_index, formula);
                                int data_index = 0;
                                for (int shot_index = 0; shot_index < shotIndexes.Length; shot_index++)
                                {
                                    if (frames[shot_index] == false)
                                    {
                                        continue;
                                    }
                                    double tmpAnalit = result.AnalitValue[data_index];
                                    double fkVal;
                                    if (relative == false)
                                    {
                                        fkVal = calcFormula.Formula.CalcCon(0, tmpAnalit, 0) - msc.Con;
                                    }
                                    else
                                    {
                                        if (msc.Con > 0.01)
                                        {
                                            fkVal = (calcFormula.Formula.CalcCon(0, tmpAnalit, 0) - msc.Con) / msc.Con;
                                        }
                                        else
                                        {
                                            fkVal = Double.NaN;
                                        }
                                    }
                                    SpectrDataView sig = viewSet[shotIndexes[shot_index]];
                                    SpectrDataView nul = sp.GetNullFor(shotIndexes[shot_index]);
                                    for (int sn = 0; sn < sensors.Count; sn++)
                                    {
                                        int     sensorIndex = sensors[sn];
                                        int     n           = (int)disp.GetLocalPixelByLy(sensorIndex, ly);
                                        float[] sigData     = sig.GetSensorData(sensorIndex);
                                        float[] nulData     = nul.GetSensorData(sensorIndex);

                                        float[] data = new float[widthPlusMinus * 2 + 1];
                                        for (int i = 0; i < data.Length; i++)
                                        {
                                            int index = n - widthPlusMinus + i;
                                            if (index < 0 || index >= sigData.Length)
                                            {
                                                data[i]   = -float.MaxValue;
                                                isEnabled = false;
                                                continue;
                                            }
                                            data[i] = sigData[index] - nulData[index];
                                            if (data[i] > max)
                                            {
                                                isEnabled = false;
                                            }
                                        }
                                        if (isEnabled)
                                        {
                                            is_ok++;
                                        }
                                        else
                                        {
                                            is_over++;
                                        }
                                        DataShot dsh = new DataShot(ly, fkVal, data, isEnabled);
                                        ret.Add(dsh);
                                    }
                                    data_index++;
                                }
                            }
                        }
                    }
                    break;
                }
            }
            if (is_ok == 0 || is_over / is_ok > 0.1)
            {
                return(null);
            }
            return(ret);
        }
Beispiel #6
0
        private void btSeachStart_Click(object sender, EventArgs e)
        {
            try
            {
                tbLog.Text = "";
                Log("Поиск линий...");
                int prc = Method.GetProbCount();
                //List<int> found_sn = new List<int>();
                //List<double> found_ly = new List<double>();
                List <SpectrData> found_lines = new List <SpectrData>();
                Dispers           disp        = null;
                for (int pr = 0; pr < prc; pr++)
                {
                    MethodSimpleProb msp = Method.GetProbHeader(pr);
                    int sprc             = msp.MeasuredSpectrs.Count;
                    for (int spr = 0; spr < sprc; spr++)
                    {
                        if (msp.MeasuredSpectrs[spr].Sp != null)
                        {
                            disp = msp.MeasuredSpectrs[spr].Sp.GetCommonDispers();
                            break;
                        }
                    }
                }
                int[] ss   = disp.GetSensorSizes();
                int   step = (int)(numMinWidth.Value / 2);
                for (int sn = 0; sn < ss.Length; sn++)
                {
                    double prev_found_ly = 0;
                    for (int p = 15; p < ss[sn] - 15; p += step)
                    {
                        double         ly;
                        List <float[]> spectr_data = null;
                        List <double>  vals        = HasLine(sn, disp.GetLyByLocalPixel(sn, p), disp, step, out ly, out spectr_data);
                        if (vals == null)
                        {
                            continue;
                        }
                        if (Math.Abs(prev_found_ly - ly) < 0.1)
                        {
                            continue;
                        }
                        found_lines.Add(new SpectrData(sn, ly, vals, spectr_data));
                        prev_found_ly = ly;
                    }
                }
                Log("Найдено " + found_lines.Count + " линий.");
                for (int i = 0; i < found_lines.Count - 1; i++)
                {
                    if (found_lines[i].Value.Count != found_lines[i + 1].Value.Count)
                    {
                        for (i = 0; i < found_lines.Count - 3; i++)
                        {
                            if (found_lines[i].Value.Count == found_lines[i + 1].Value.Count &&
                                found_lines[i + 1].Value.Count == found_lines[i + 2].Value.Count &&
                                found_lines[i + 2].Value.Count == found_lines[i + 3].Value.Count)
                            {
                                int real_num = found_lines[i].Value.Count;
                                int skipped  = 0;
                                for (i = 0; i < found_lines.Count - 3; i++)
                                {
                                    if (found_lines[i].Value.Count == real_num)
                                    {
                                        found_lines.RemoveAt(i);
                                        i--;
                                        skipped++;
                                    }
                                }
                                Log("Отбраковано по количеству " + skipped + " линий.");
                                break;
                            }
                        }
                        break;
                    }
                }

                //List<ProbInfo> pairs = new List<ProbInfo>();
                MethodSimpleElementFormula msef = Method.GetElHeader(Element).Formula[Formula];
                msef.Formula.Founds.Clear();
                msef.Formula.Pairs.Clear();
                bool[] used          = msef.Formula.GetUsedFrames();
                int[]  used_to_index = new int[used.Length];
                int    to_index      = 0;
                // формируем массив пересчёта индекса в массиве отношений в номер кадра
                for (int i = 0; i < used_to_index.Length; i++)
                {
                    if (used[i] == false)
                    {
                        continue;
                    }
                    used_to_index[to_index] = i;
                    to_index++;
                }
                for (int pr = 0; pr < prc; pr++)
                {
                    MethodSimpleCell msc = Method.GetCell(Element, pr);
                    MethodSimpleProb msp = Method.GetProbHeader(pr);
                    int sub_prob_count   = msp.MeasuredSpectrs.Count;
                    for (int sub_prob_i = 0; sub_prob_i < sub_prob_count; sub_prob_i++)
                    {
                        if (msp.MeasuredSpectrs[sub_prob_i].Sp != null)
                        {
                            MethodSimpleProbMeasuring     mspm  = msp.MeasuredSpectrs[sub_prob_i];
                            MethodSimpleCellFormulaResult mscfr = msc.GetData(sub_prob_i, Formula);
                            if (mscfr.Enabled == false)
                            {
                                continue;
                            }
                            double ever_analit = 0;
                            for (int i = 0; i < mscfr.ReCalcCon.Length; i++)
                            {
                                ever_analit += mscfr.AnalitValue[i];
                            }
                            ever_analit /= mscfr.AnalitValue.Length;
                            List <SpectrDataView> data = msp.MeasuredSpectrs[sub_prob_i].Sp.GetViewsSet();
                            int[] active_sp            = msp.MeasuredSpectrs[sub_prob_i].Sp.GetShotIndexes();
                            for (int i = 0; i < mscfr.AnalitValue.Length; i++)
                            {
                                //pr, spr, used_to_index[i],
                                SpectrDataView sig = data[active_sp[used_to_index[i]]];
                                SpectrDataView nul = msp.MeasuredSpectrs[sub_prob_i].Sp.GetNullFor(active_sp[used_to_index[i]]);
                                float[][]      d   = msp.MeasuredSpectrs[sub_prob_i].Sp.OFk.GetCorrectedData(sig, nul).GetFullDataNoClone();
                                msef.Formula.Pairs.Add(new ProbInfo(pr, sub_prob_i, used_to_index[i], ever_analit, mscfr.AnalitValue[i],
                                                                    d, msp.MeasuredSpectrs[sub_prob_i].Sp.GetCommonDispers()));
                            }
                        }
                    }
                }
                Log("Сформирован список из " + msef.Formula.Pairs.Count + " отклонений от среднего.");
                string tmp      = (string)tbLog.Text.Clone();
                int    ps_max   = found_lines.Count * (found_lines.Count / 2 - 1);
                int    ps_count = 0;
                for (int i = 0; i < found_lines.Count; i++)
                {
                    for (int j = i + 1; j < found_lines.Count; j++)
                    {
                        if (chTheSameLine.Checked && found_lines[i].Sn != found_lines[j].Sn)
                        {
                            continue;
                        }
                        CorellFounds rez;
                        try
                        {
                            rez = Corel(msef.Formula.Pairs, found_lines[i].Ly, found_lines[i].Sn, found_lines[j].Ly, found_lines[j].Sn);
                            if (rez.CorellAbs > 0.1)
                            {
                                bool inserted = false;
                                for (int k = 0; k < msef.Formula.Founds.Count; k++)
                                {
                                    if (rez.CorellAbs > msef.Formula.Founds[k].CorellAbs)
                                    {
                                        msef.Formula.Founds.Insert(k, rez);
                                        inserted = true;
                                        break;
                                    }
                                }
                                if (inserted == false)
                                {
                                    msef.Formula.Founds.Add(rez);
                                }
                                while (msef.Formula.Founds.Count > 80)
                                {
                                    msef.Formula.Founds.RemoveAt(msef.Formula.Founds.Count - 1);
                                }
                            }
                            if (msef.Formula.Founds.Count > 0)
                            {
                                tbLog.Text = "Проверено " + Math.Round(ps_count * 100.0 / ps_max, 1) + "% пар... K=" +
                                             msef.Formula.Founds[0].Corell + serv.Endl + tmp;
                            }
                            else
                            {
                                tbLog.Text = "Проверено " + Math.Round(ps_count * 100.0 / ps_max, 1) + "% пар..." +
                                             serv.Endl + tmp;
                            }
                            tbLog.Refresh();
                        }
                        catch (Exception ex)
                        {
                        }
                        ps_count++;
                    }
                }
                tbLog.Text = tmp;
                if (msef.Formula.Founds.Count == 0)
                {
                    Log("Поиск зависимостей завершён.Зависимостей нет.");
                }
                else
                {
                    Log("Поиск зависимостей завершён.Максимальный коэффициент корелляции = " +
                        msef.Formula.Founds[0].Corell);
                }
                InitList();//*/
            }
            catch (Exception ex)
            {
                Common.Log(ex);
            }
        }