Example #1
0
 public void CopyFrom(TireDataSetSelector other)
 {
     CorneringDataSelector  = other.CorneringDataSelector;
     DriveBrakeDataSelector = other.DriveBrakeDataSelector;
     TransientDataSelector  = other.TransientDataSelector;
     State = TireDataSetSelectorState.Changed;
 }
Example #2
0
 public TireDataSetSelector(IDataSet dataset)
 {
     idataset = dataset;
     CorneringDataSelector  = new TireDataSelector();
     DriveBrakeDataSelector = new TireDataSelector();
     TransientDataSelector  = new TransientTireDataSelector();
     Reset();
 }
Example #3
0
 public TireDataSelector(TireDataSelector other)
 {
     Target = other.Target;
     //if(Maxmin != null )
     Maxmin           = other.Maxmin;
     Constrains       = StaticFunctions.DeepCopy(other.Constrains);
     ExtractedData    = new List <TireData>();
     NotExtractedData = new List <TireData>();
     ExtractData(0);
 }
Example #4
0
 public void Load(Stream reader)
 {
     using (ZipArchive archive = new ZipArchive(reader, ZipArchiveMode.Read, false))
     {
         var set             = idataset.GetDataSet();
         var corneringEntry  = archive.GetEntry("CorneringSelector");
         var driveBrakeEntry = archive.GetEntry("DriveBrakeSelector");
         var transientEntry  = archive.GetEntry("TransientSelector");
         var tstate          = TireDataSetSelectorState.NotChanged;
         using (Stream s = corneringEntry.Open())
         {
             var corneringDataSelector = TireDataSelector.Load(s, set.CorneringTable, set.MaxminSet.CorneringTableLimit);
             if (corneringDataSelector == null)
             {
                 tstate = TireDataSetSelectorState.Changed;
             }
             else
             {
                 CorneringDataSelector = corneringDataSelector;
             }
         }
         using (Stream s = driveBrakeEntry.Open())
         {
             var driveBrakeDataSelector = TireDataSelector.Load(s, set.DriveBrakeTable, set.MaxminSet.DriveBrakeTableLimit);
             if (driveBrakeDataSelector == null)
             {
                 tstate = TireDataSetSelectorState.Changed;
             }
             else
             {
                 DriveBrakeDataSelector = driveBrakeDataSelector;
             }
         }
         using (Stream s = transientEntry.Open())
         {
             var transientDataSelector = TransientTireDataSelector.Load(s, set.TransientTable, set.MaxminSet.TransientTableLimit, set.TransientTableIndexHolder);
             if (transientDataSelector == null)
             {
                 tstate = TireDataSetSelectorState.Changed;
             }
             else
             {
                 TransientDataSelector = transientDataSelector;
             }
         }
         State = tstate;
     }
 }
Example #5
0
        public void Run(CancellationTokenSource cancel, IProgress <ProgressNotification> prg)
        {
            var pn = new ProgressNotification();

            if (!(Solver is NoFitting))
            {
                if (!Initialized)
                {
                    throw new Exception("初期化されていません");
                }
                var dataset = IDataset.GetDataSet();

                //PureFY

                pn.Stage = 1;
                prg.Report(pn);
                if (FittingPFY)
                {
                    solver.Run(MagicFormula.FY, dataset.CorneringTable, cancel, prg);
                }


                //PureFX
                pn       = new ProgressNotification();
                pn.Stage = 2;
                prg.Report(pn);
                if (FittingPFX)
                {
                    TireDataSelector fxSelector = new TireDataSelector();
                    fxSelector.AddConstrain(new TireDataConstrain("fx", TireDataColumn.SA, 5, -5));
                    fxSelector.Update(dataset.DriveBrakeTable, dataset.MaxminSet.DriveBrakeTableLimit);
                    solver.Run(MagicFormula.FX, fxSelector.ExtractedData, cancel, prg);
                }

                var list = dataset.GetDataList(Table.StaticTable);

                //CombinedFY
                pn       = new ProgressNotification();
                pn.Stage = 3;
                prg.Report(pn);
                if (FittingCFY)
                {
                    solver.Run(MagicFormula.CFY, list, cancel, prg);
                }
                //CombinedFX
                pn       = new ProgressNotification();
                pn.Stage = 4;
                prg.Report(pn);
                if (FittingCFX)
                {
                    solver.Run(MagicFormula.CFX, list, cancel, prg);
                }
                if (FittingSAT)
                {
                    //PnumaticTrail
                    pn       = new ProgressNotification();
                    pn.Stage = 5;
                    prg.Report(pn);
                    solver.Run(MagicFormula.MZ.PT, dataset.CorneringTable, cancel, prg);
                    //CombinedMzMember
                    pn       = new ProgressNotification();
                    pn.Stage = 6;
                    prg.Report(pn);
                    solver.Run(MagicFormula.MZ.CMZM, dataset.DriveBrakeTable, cancel, prg);

                    //MzR
                    pn       = new ProgressNotification();
                    pn.Stage = 7;
                    prg.Report(pn);
                    solver.Run(MagicFormula.MZ.MZR, list, cancel, prg);
                }
            }



            FittingResolved = true;

            pn          = new ProgressNotification();
            pn.finished = true;
            prg.Report(pn);
        }