Пример #1
0
 protected void RebuildGrid(IEnumerable<IMLDataPair> oldData)
 {
     int num;
     DataGridTextColumn column3;
     DataGridTextColumn column4;
     bool flag;
     this.dataGrid.get_Columns().Clear();
     if ((((uint) flag) & 0) == 0)
     {
         goto Label_06D7;
     }
     goto Label_042A;
     Label_02DA:
     flag = num < this.ErrorSize;
     if ((((uint) num) - ((uint) flag)) <= uint.MaxValue)
     {
         if (flag)
         {
             flag = this.EditMode == DataSetEditMode.CheckData;
             if (((((uint) num) + ((uint) flag)) >= 0) && flag)
             {
                 if (((uint) flag) <= uint.MaxValue)
                 {
                     goto Label_0311;
                 }
                 goto Label_03FD;
             }
             goto Label_0387;
         }
         this.DataCollection = new ObservableCollection<IMLDataPair>();
         if ((((uint) num) - ((uint) flag)) >= 0)
         {
             if (oldData == null)
             {
                 return;
             }
             IEnumerator<IMLDataPair> enumerator = oldData.GetEnumerator();
             try
             {
                 IMLDataPair pair;
                 BasicMLData data;
                 BasicMLData data2;
                 BasicMLData data3;
                 BasicMLData data4;
             Label_004D:
                 flag = enumerator.MoveNext();
                 if (flag)
                 {
                     goto Label_0272;
                 }
                 goto Label_04E3;
             Label_0062:
                 if (flag)
                 {
                     goto Label_0099;
                 }
                 goto Label_006F;
             Label_0068:
                 if (!flag)
                 {
                     goto Label_00E3;
                 }
             Label_006F:
                 this.DataCollection.Add(new BasicMLDataPair(data, data2, data3, data4));
                 if (((uint) num) >= 0)
                 {
                     goto Label_004D;
                 }
             Label_0099:
                 data4[num] = pair.ErrorArray[num];
                 num++;
             Label_00B1:
                 flag = num < Math.Min(this.CalcedSize, pair.ErrorArray.Length);
                 if (-1 == 0)
                 {
                     goto Label_0099;
                 }
                 goto Label_0062;
             Label_00E3:
                 num = 0;
                 goto Label_00B1;
             Label_00E9:
                 flag = num < Math.Min(this.CalcedSize, pair.CalcedArray.Length);
             Label_0102:
                 if (flag)
                 {
                     goto Label_013F;
                 }
                 goto Label_010C;
             Label_0108:
                 if (!flag)
                 {
                     goto Label_013B;
                 }
             Label_010C:
                 data4 = new BasicMLData(this.CalcedSize);
                 flag = pair.ErrorArray == null;
                 if (0 == 0)
                 {
                     goto Label_0068;
                 }
                 goto Label_04E3;
             Label_012D:
                 flag = pair.CalcedArray == null;
                 goto Label_0108;
             Label_013B:
                 num = 0;
                 goto Label_00E9;
             Label_013F:
                 data3[num] = pair.CalcedArray[num];
                 num++;
                 goto Label_00E9;
             Label_015C:
                 if (flag)
                 {
                     goto Label_01B6;
                 }
                 if ((((uint) flag) + ((uint) flag)) > uint.MaxValue)
                 {
                     goto Label_010C;
                 }
                 data3 = new BasicMLData(this.CalcedSize);
                 goto Label_012D;
             Label_018D:
                 flag = num < Math.Min(this.IdealSize, pair.IdealArray.Length);
                 goto Label_015C;
             Label_01A8:
                 num = 0;
                 if (8 == 0)
                 {
                     goto Label_0102;
                 }
                 goto Label_018D;
             Label_01B6:
                 data2[num] = pair.IdealArray[num];
                 num++;
             Label_01CE:
                 if (0xff == 0)
                 {
                     goto Label_01E2;
                 }
                 goto Label_018D;
             Label_01DC:
                 num++;
             Label_01E2:
                 flag = num < Math.Min(this.InputSize, pair.InputArray.Length);
                 if (flag)
                 {
                     goto Label_0239;
                 }
                 data2 = new BasicMLData(this.IdealSize);
                 if ((((uint) num) - ((uint) num)) <= uint.MaxValue)
                 {
                     goto Label_01A8;
                 }
                 goto Label_0272;
             Label_0229:
                 if (15 == 0)
                 {
                     goto Label_0068;
                 }
                 goto Label_0292;
             Label_0235:
                 num = 0;
                 goto Label_01E2;
             Label_0239:
                 data[num] = pair.InputArray[num];
                 if (-2147483648 == 0)
                 {
                     goto Label_01CE;
                 }
                 if ((((uint) num) | 8) == 0)
                 {
                     goto Label_018D;
                 }
                 goto Label_028B;
             Label_0272:
                 pair = enumerator.Current;
                 data = new BasicMLData(this.InputSize);
                 goto Label_0235;
             Label_028B:
                 if (3 != 0)
                 {
                     goto Label_0229;
                 }
             Label_0292:
                 if (1 != 0)
                 {
                     goto Label_01DC;
                 }
                 goto Label_01A8;
             }
             finally
             {
                 flag = enumerator == null;
                 while (!flag)
                 {
                     enumerator.Dispose();
                     break;
                 }
             }
         }
         goto Label_04E3;
     }
     Label_0311:
     column4 = new DataGridTextColumn();
     column4.set_Header("E" + (num + 1));
     column4.set_Width(new DataGridLength(60.0));
     column4.set_Binding(new Binding("Error[" + num + "]"));
     column4.set_IsReadOnly(true);
     this.dataGrid.get_Columns().Add(column4);
     Label_0387:
     num++;
     if (2 == 0)
     {
         goto Label_06C9;
     }
     goto Label_02DA;
     Label_03FD:
     flag = num < this.CalcedSize;
     Label_0408:
     if (flag)
     {
         flag = this.EditMode != DataSetEditMode.TrainData;
         goto Label_0465;
     }
     if ((((uint) num) & 0) == 0)
     {
         num = 0;
         goto Label_02DA;
     }
     goto Label_0311;
     Label_042A:
     num++;
     if ((((uint) flag) | uint.MaxValue) == 0)
     {
         goto Label_0408;
     }
     if ((((uint) num) | 0xff) != 0)
     {
         goto Label_03FD;
     }
     goto Label_0311;
     Label_0465:
     if (!flag)
     {
         goto Label_042A;
     }
     Label_0469:
     column3 = new DataGridTextColumn();
     column3.set_Header("Y" + (num + 1));
     column3.set_Width(new DataGridLength(60.0));
     column3.set_Binding(new Binding("Calced[" + num + "]"));
     column3.set_IsReadOnly(true);
     this.dataGrid.get_Columns().Add(column3);
     goto Label_042A;
     Label_04E3:
     if ((((uint) num) + ((uint) flag)) >= 0)
     {
         return;
     }
     goto Label_06D7;
     Label_0540:
     flag = num < this.IdealSize;
     if ((((uint) flag) + ((uint) flag)) > uint.MaxValue)
     {
         goto Label_0469;
     }
     if (flag)
     {
         flag = this.EditMode != DataSetEditMode.CalcData;
     }
     else
     {
         num = 0;
         goto Label_03FD;
     }
     if (flag)
     {
         DataGridTextColumn item = new DataGridTextColumn();
         item.set_Header("D" + (num + 1));
         item.set_Width(new DataGridLength(60.0));
         item.set_Binding(new Binding("Ideal[" + num + "]"));
         item.set_IsReadOnly(false);
         this.dataGrid.get_Columns().Add(item);
     }
     num++;
     goto Label_0540;
     Label_06BE:
     flag = num < this.InputSize;
     Label_06C9:
     if (flag)
     {
         DataGridTextColumn column = new DataGridTextColumn();
         column.set_Header("X" + (num + 1));
         column.set_Width(new DataGridLength(60.0));
         column.set_Binding(new Binding("Input[" + num + "]"));
         column.set_IsReadOnly(false);
         this.dataGrid.get_Columns().Add(column);
         num++;
         goto Label_06BE;
     }
     if (8 != 0)
     {
         if (0 != 0)
         {
             goto Label_0540;
         }
         if (0 == 0)
         {
             if ((((uint) num) - ((uint) flag)) <= uint.MaxValue)
             {
                 if ((((uint) num) + ((uint) num)) < 0)
                 {
                     goto Label_02DA;
                 }
                 if ((((uint) num) - ((uint) flag)) <= uint.MaxValue)
                 {
                     num = 0;
                 }
             }
             goto Label_0540;
         }
     }
     Label_06D7:
     num = 0;
     if ((((uint) num) | 4) == 0)
     {
         goto Label_0465;
     }
     goto Label_06BE;
 }
Пример #2
0
 private void x2977a400fde1078f()
 {
     IDataProcessor processor;
     ErrorRec[] recArray;
     int num;
     double[] numArray;
     double[] numArray2;
     double num2;
     bool flag;
     xf8efd7615008d32e service = App.Services.GetService<xf8efd7615008d32e>();
     if (((uint) num) <= uint.MaxValue)
     {
         processor = App.Services.GetService<IDataProcessor>();
         recArray = new ErrorRec[this.ErrorSize];
         num = 0;
         goto Label_0546;
     }
     goto Label_0598;
     Label_0028:
     if (!flag)
     {
         goto Label_0253;
     }
     Label_002F:
     this.RebuildGrid(this.DataCollection);
     if ((((uint) num) + ((uint) num)) <= uint.MaxValue)
     {
         if ((((uint) flag) - ((uint) flag)) >= 0)
         {
             return;
         }
         goto Label_0598;
     }
     if ((((uint) num2) - ((uint) num)) >= 0)
     {
         goto Label_023F;
     }
     Label_0147:
     this.errorsGrid.get_Columns().Clear();
     if (((uint) num2) < 0)
     {
         goto Label_0546;
     }
     DataGridTextColumn item = new DataGridTextColumn();
     item.set_Header("Выход");
     item.set_Width(new DataGridLength(60.0));
     item.set_Binding(new Binding("Title"));
     item.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(item);
     if ((((uint) num) + ((uint) flag)) < 0)
     {
         goto Label_0028;
     }
     DataGridTextColumn column2 = new DataGridTextColumn();
     column2.set_Header("Средн. кв. отн. (%)");
     column2.set_Width(new DataGridLength(150.0));
     column2.set_Binding(new Binding("RME"));
     column2.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(column2);
     DataGridTextColumn column3 = new DataGridTextColumn();
     column3.set_Header("Отн. погрешность (%)");
     column3.set_Width(new DataGridLength(150.0));
     column3.set_Binding(new Binding("AvgErr"));
     column3.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(column3);
     DataGridTextColumn column4 = new DataGridTextColumn();
     column4.set_Header("Средн. кв. (норм.)");
     column4.set_Width(new DataGridLength(150.0));
     column4.set_Binding(new Binding("RMEN"));
     column4.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(column4);
     this.errorsGrid.ItemsSource = recArray;
     this.errorsGrid.Visibility = Visibility.Visible;
     goto Label_002F;
     Label_023F:
     flag = this.EditMode != DataSetEditMode.CheckData;
     if (0 == 0)
     {
         goto Label_0028;
     }
     Label_0253:
     this.errorsGrid.set_CanUserAddRows(false);
     goto Label_0147;
     Label_0509:
     num = 0;
     Label_02AE:
     flag = num < this.ErrorSize;
     if (flag)
     {
         recArray[num].RME = Math.Round(numArray2[num], 4);
         recArray[num].AvgErr = Math.Round(numArray[num], 4);
     }
     else if (((uint) num) >= 0)
     {
         goto Label_023F;
     }
     recArray[num].MaxErr = Math.Round(recArray[num].MaxErr, 4);
     if ((((uint) num2) + ((uint) flag)) >= 0)
     {
         num++;
         goto Label_02AE;
     }
     goto Label_0598;
     Label_0546:
     flag = num < this.ErrorSize;
     if (flag)
     {
         recArray[num] = new ErrorRec { Title = "Y" + (num + 1) };
         if ((((uint) num2) | uint.MaxValue) == 0)
         {
             return;
         }
     }
     else
     {
         if ((((uint) num2) - ((uint) num2)) >= 0)
         {
         }
         numArray = this.Data.x8e46c20a382f5c57();
         if (0 != 0)
         {
             goto Label_0546;
         }
         if ((((uint) flag) + ((uint) num2)) <= uint.MaxValue)
         {
             numArray2 = this.Data.xde3e9f8cc0169fde();
             IEnumerator<IMLDataPair> enumerator = this.DataCollection.GetEnumerator();
             try
             {
                 ErrorRec rec1;
                 IMLDataPair pair;
                 IMLData data;
                 IMLData data2;
                 IMLData data4;
                 IMLData data6;
                 goto Label_0316;
             Label_030A:
                 if (flag)
                 {
                     goto Label_04DF;
                 }
                 goto Label_0449;
             Label_0316:
                 flag = enumerator.MoveNext();
                 goto Label_030A;
             Label_0324:
                 if (!flag)
                 {
                     goto Label_03EA;
                 }
             Label_032B:
                 num++;
                 if (((uint) num) > uint.MaxValue)
                 {
                     goto Label_0324;
                 }
             Label_0342:
                 flag = num < data6.Count;
                 if (flag)
                 {
                     goto Label_047E;
                 }
                 goto Label_039F;
             Label_0358:
                 rec1 = recArray[num];
                 rec1.RME += num2 * num2;
                 recArray[num].MaxErr = Math.Max(recArray[num].MaxErr, Math.Abs(num2));
                 pair.ErrorArray[num] = Math.Round(num2, 4);
                 goto Label_032B;
             Label_039F:
                 if (0 == 0)
                 {
                     goto Label_0316;
                 }
                 goto Label_030A;
             Label_03AF:
                 flag = this.EditMode != DataSetEditMode.CheckData;
                 if (((uint) num2) < 0)
                 {
                     goto Label_03AF;
                 }
                 if ((((uint) num2) - ((uint) flag)) >= 0)
                 {
                     goto Label_0324;
                 }
             Label_03EA:
                 num2 = pair.CalcedArray[num] - pair.IdealArray[num];
                 ErrorRec rec2 = recArray[num];
                 rec2.AvgErr += Math.Abs(num2);
                 if ((((uint) num2) | 4) == 0)
                 {
                     goto Label_04A7;
                 }
                 if ((((uint) flag) + ((uint) num)) <= uint.MaxValue)
                 {
                     goto Label_0358;
                 }
             Label_0449:
                 if (3 != 0)
                 {
                     goto Label_0509;
                 }
                 goto Label_04DF;
             Label_0458:
                 if (((uint) num) > uint.MaxValue)
                 {
                     goto Label_0509;
                 }
                 data6 = processor.RestoreIdealVector(data4);
                 num = 0;
                 goto Label_0342;
             Label_047E:
                 pair.CalcedArray[num] = Math.Round(data6[num], 4);
                 goto Label_03AF;
             Label_0498:
                 data = new BasicMLData(pair.InputArray);
             Label_04A7:
                 data2 = processor.ProcessInputVector(data);
                 data4 = service.x5b0926ce641e48a7.Compute(data2);
                 IMLData data5 = processor.ProcessIdealVector(new BasicMLData(pair.IdealArray));
                 goto Label_0458;
             Label_04DF:
                 pair = enumerator.Current;
                 goto Label_0498;
             }
             finally
             {
                 flag = enumerator == null;
                 while (!flag)
                 {
                     enumerator.Dispose();
                     break;
                 }
             }
             goto Label_0509;
         }
     }
     Label_0598:
     recArray[num].RMEN = Math.Round(service.x5b0926ce641e48a7.CalculateError(processor.ProcessDataSet(this.Data)), 4);
     num++;
     goto Label_0546;
 }
Пример #3
0
 public void xf4e7b53eedfb7d89()
 {
     BasicMLDataSet set2;
     bool flag;
     double[] numArray;
     double[] numArray2;
     double[] numArray3;
     double[] numArray4;
     DataSetEditor.ErrorRec[] recArray;
     int num;
     DataSetEditor.ErrorRec rec;
     DataGridTextColumn column2;
     DataGridTextColumn column5;
     bool flag2;
     BasicMLDataSet set = App.Services.GetService<ITrainData>().xd378208b5267f7e2();
     goto Label_042B;
     Label_001D:
     this.errorsGrid.ItemsSource = recArray;
     if ((((uint) flag) & 0) != 0)
     {
         goto Label_03DF;
     }
     return;
     Label_0108:
     column5 = new DataGridTextColumn();
     column5.set_Header("Отн. погр.(%)");
     column5.set_Width(new DataGridLength(100.0));
     column5.set_Binding(new Binding("AvgErr"));
     column5.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(column5);
     Label_0160:
     flag2 = !flag;
     if (!flag2)
     {
         DataGridTextColumn item = new DataGridTextColumn();
         item.set_Header("Ср.кв.отн.(Т)(%)");
         item.set_Width(new DataGridLength(100.0));
         item.set_Binding(new Binding("RMEN"));
         item.set_IsReadOnly(true);
         this.errorsGrid.get_Columns().Add(item);
     }
     else
     {
         goto Label_001D;
     }
     Label_01C4:
     column2 = new DataGridTextColumn();
     column2.set_Header("Отн. погр.(Т)(%)");
     column2.set_Width(new DataGridLength(100.0));
     column2.set_Binding(new Binding("MaxErr"));
     column2.set_IsReadOnly(true);
     this.errorsGrid.get_Columns().Add(column2);
     if ((((uint) flag2) | 1) == 0)
     {
         goto Label_03D0;
     }
     do
     {
         if ((((uint) flag) & 0) != 0)
         {
             goto Label_01C4;
         }
     }
     while ((((uint) flag2) + ((uint) flag2)) < 0);
     if ((((uint) flag) & 0) != 0)
     {
         goto Label_0160;
     }
     goto Label_001D;
     Label_0227:
     flag2 = num < set.IdealSize;
     if (!flag2)
     {
         DataGridTextColumn column3 = new DataGridTextColumn();
         column3.set_Header("Выход");
         column3.set_Width(new DataGridLength(50.0));
         column3.set_Binding(new Binding("Title"));
         column3.set_IsReadOnly(true);
         this.errorsGrid.get_Columns().Add(column3);
         DataGridTextColumn column4 = new DataGridTextColumn();
         column4.set_Header("Ср.кв.отн.(%)");
         column4.set_Width(new DataGridLength(100.0));
         column4.set_Binding(new Binding("RME"));
         column4.set_IsReadOnly(true);
         this.errorsGrid.get_Columns().Add(column4);
         goto Label_0108;
     }
     Label_0300:
     rec = new DataSetEditor.ErrorRec();
     rec.Title = "Y" + (num + 1);
     rec.RME = Math.Round(numArray[num], 4);
     rec.AvgErr = Math.Round(numArray2[num], 4);
     recArray[num] = rec;
     goto Label_03B9;
     Label_037F:
     this.errorsGrid.set_CanUserAddRows(false);
     this.errorsGrid.get_Columns().Clear();
     base.Height = 0x19 + (0x19 * set.IdealSize);
     recArray = new DataSetEditor.ErrorRec[set.IdealSize];
     if ((((uint) flag2) | 0xff) != 0)
     {
         num = 0;
         goto Label_0227;
     }
     Label_03B9:
     if (((uint) flag) <= uint.MaxValue)
     {
         if ((((uint) flag2) + ((uint) flag2)) <= uint.MaxValue)
         {
             flag2 = flag;
         }
         if (flag2 && (((uint) flag2) >= 0))
         {
             recArray[num].RMEN = Math.Round(numArray3[num], 4);
             recArray[num].MaxErr = Math.Round(numArray4[num], 4);
         }
         num++;
         goto Label_0227;
     }
     goto Label_042B;
     Label_03D0:
     numArray4 = set2.x8e46c20a382f5c57();
     if (2 != 0)
     {
         goto Label_037F;
     }
     Label_03DF:
     numArray2 = set.x8e46c20a382f5c57();
     numArray3 = null;
     numArray4 = null;
     flag2 = !flag;
     if ((((uint) flag) < 0) || !flag2)
     {
         numArray3 = set2.xde3e9f8cc0169fde();
         if ((((uint) num) - ((uint) flag)) <= uint.MaxValue)
         {
             goto Label_03D0;
         }
     }
     goto Label_037F;
     Label_042B:
     set2 = App.Services.GetService<ITestData>().xd378208b5267f7e2();
     flag = set2.Count > 0L;
     if (((uint) flag2) < 0)
     {
         goto Label_0108;
     }
     if ((((uint) flag) - ((uint) flag)) > uint.MaxValue)
     {
         goto Label_0300;
     }
     numArray = set.xde3e9f8cc0169fde();
     if (0 == 0)
     {
         goto Label_03DF;
     }
     goto Label_037F;
 }