public void LoadData()
        {
            try
            {
                var AlphaList = Alpharepo.GetAlphasAsync().Result.ToList();
                ObservableCollection <Alpha> POData = new ObservableCollection <Alpha>();
                foreach (var item in AlphaList)
                {
                    POData.Add(item);
                }
                Alphas = POData;

                var BetaList = Betarepo.GetBetasAsync().Result.ToList();
                ObservableCollection <Beta> BetaData = new ObservableCollection <Beta>();
                foreach (var item in BetaList)
                {
                    BetaData.Add(item);
                }
                Betas = BetaData;

                var GammaList = Gammarepo.GetGammasAsync().Result.ToList();
                ObservableCollection <Gamma> GammaData = new ObservableCollection <Gamma>();
                foreach (var item in GammaList)
                {
                    GammaData.Add(item);
                }
                Gammas = GammaData;

                var DeltaList = DeltaRepo.GetDeltasAsync().Result.ToList();
                ObservableCollection <Delta> DeltaData = new ObservableCollection <Delta>();
                foreach (var item in DeltaList)
                {
                    DeltaData.Add(item);
                }
                Deltas = DeltaData;

                var ThetaList = ThetaRepo.GetThetasAsync().Result.ToList();
                ObservableCollection <Theta> ThetaData = new ObservableCollection <Theta>();
                foreach (var item in ThetaList)
                {
                    ThetaData.Add(item);
                }
                Thetas = ThetaData;

                SelectedBeta  = Betas.First(x => x.Id.Equals(1));
                SelectedGamma = Gammas.First(x => x.Id.Equals(1));
                SelectedAlpha = Alphas.First(x => x.Id.Equals(1));
                SelectedDelta = Deltas.First(x => x.Id.Equals(1));
                SelectedTheta = Thetas.First(x => x.Id.Equals(1));
                SaveText      = null;
            }
            catch (Exception e)
            {
                _logger.Error("Some error have AddRecordViewModel Load data , stacktarce =" + e.StackTrace);
                _logger.Error("AddRecordViewModel error message is " + e.Message + " inner error is " + e.InnerException.Message);
            }
        }
Exemplo n.º 2
0
 private void genSigmaOfR_Click(object sender, EventArgs e)
 {
     var thetas = new Thetas
     {
         I = (double)numThetaI.Value,
         R = 0
     };
     var series = GenerateSigmaSeries((angle, ts) => ts.R = angle, thetas);
 }
        private void OnAdd()
        {
            Theta _theta = new Theta()
            {
                Name = NewThetaName
            };

            NewThetaName = "";
            repo.AddThetaAsync(_theta);
            Thetas.Add(_theta);
        }
        private void ResetUI()
        {
            SelectedBeta  = Betas.First(x => x.Id.Equals(1));
            SelectedGamma = Gammas.First(x => x.Id.Equals(1));
            SelectedAlpha = Alphas.First(x => x.Id.Equals(1));
            SelectedDelta = Deltas.First(x => x.Id.Equals(1));
            SelectedTheta = Thetas.First(x => x.Id.Equals(1));
            Zeus          = null;
            Hera          = null;
            BeginDate     = null;
            EndDate       = null;

            TargetDate = null;
            Artemis    = null;
            Ares       = null;
            Athena     = null;
            Apollo     = null;
            Poseidon   = null;
            Remarks    = null;
        }
Exemplo n.º 5
0
        public List <List <string> > GetPDFDAta()
        {
            List <List <string> > ListOfRecord = new List <List <string> >();


            foreach (var item in ReportRecords)
            {
                List <string> SingleRecord = new List <string>();
                if (PdfFilterZeus)
                {
                    SingleRecord.Add(item.Zeus);
                }

                if (PdfFilterStatus)
                {
                    SingleRecord.Add(Statuses.First(x => x.Id.Equals(item.StatusID)).Name.ToString());
                }

                if (PdfFilterEndDate)
                {
                    SingleRecord.Add(item.EndDate);
                }

                if (PdfFilterGamma)
                {
                    SingleRecord.Add(Gammas.First(x => x.Id.Equals(item.GammaID)).Name.ToString());
                }

                if (PdfFilterBeta)
                {
                    SingleRecord.Add(Betas.First(x => x.Id.Equals(item.BetaID)).Name.ToString());
                }

                if (PdfFilterAlpha)
                {
                    SingleRecord.Add(Alphas.First(x => x.Id.Equals(item.AlphaID)).Name.ToString());
                }

                if (PdfFilterHera)
                {
                    SingleRecord.Add(item.Hera);
                }

                if (PdfFilterDelta)
                {
                    SingleRecord.Add(Deltas.First(x => x.Id.Equals(item.DeltaID)).Name.ToString());
                }

                if (PdfFilterBeginDate)
                {
                    SingleRecord.Add(item.BeginDate);
                }

                if (PdfFilterPoseidon)
                {
                    SingleRecord.Add(item.Poseidon);
                }

                if (PdfFilterAres)
                {
                    SingleRecord.Add(item.Ares);
                }

                if (PdfFilterAthena)
                {
                    SingleRecord.Add(item.Athena);
                }

                if (PdfFilterTheta)
                {
                    SingleRecord.Add(Thetas.First(x => x.Id.Equals(item.ThetaID)).Name.ToString());
                }

                if (PdfFilterArtemis)
                {
                    SingleRecord.Add(item.Artemis);
                }

                if (PdfFilterTargetDate)
                {
                    SingleRecord.Add(item.TargetDate);
                }

                if (PdfFilterApollo)
                {
                    SingleRecord.Add(item.Apollo);
                }
                ListOfRecord.Add(SingleRecord);
            }

            return(ListOfRecord);
        }
Exemplo n.º 6
0
        private Dictionary <double, double> GenerateSigmaSeries(Action <double, Thetas> thetasUpdater, Thetas thetas)
        {
            var results = new Dictionary <double, double>();
            var sigma0  = (double)numSigma0.Value;
            var tau     = (double)numTau.Value;

            for (double angle = 0; angle <= 90.0; angle += 0.1)
            {
                thetasUpdater(angle, thetas);

                var thetaI = thetas.I / 180 * Math.PI;
                var thetaR = thetas.R / 180 * Math.PI;

                var Ki = Math.Tan(thetaI) * MMath.Erfc(tau / (2 * sigma0) / Math.Tan(thetaI));
                var Kr = Math.Tan(thetaR) * MMath.Erfc(tau / (2 * sigma0) / Math.Tan(thetaR));
                var K  = (Ki + Kr) / 4;

                var y     = 2 * K * K / Math.PI;
                var x     = solve_xexpx(y);
                var sigma = sigma0 / Math.Sqrt(1 + x);
                results.Add(angle, sigma);
            }

            return(results);
        }
 private void OnDelete()
 {
     repo.DeleteThetaAsync(SelectedTheta.Id);
     Thetas.Remove(SelectedTheta);
 }