Пример #1
0
        public void CanGoOnVPointPage()
        {
            VPointPage onVPointPage = onDevtechHomePage.CanGoToVPointPage();

            Assert.IsTrue(onVPointPage.IsAtVPointPage());
            Debug.Write("vPoint Page on FireFox");
        }
Пример #2
0
        public ActionResult PointPage(int id)
        {
            var m   = new VPointPage();
            var tab = _ctx.DMesoscaleTabFiles.FirstOrDefault(t => t.Id == id);

            if (tab != null)
            {
                var imported = ImportFile(null, tab.Text);

                m.Lat = tab.Latitude;
                m.Lng = tab.Longitude;
                m.Db  = (tab.DatabaseId == (short)DbType.FNL) ? "FNL" : "MERRA";

                // === //
                m.VelocityFreq = imported.VelocityFreq.Select(t => new object[] { t.Dir, t.Frequency }).ToArray();

                // === //
                m.WindRose = new IEnumerable <object[]> [2];
                var i = 0;
                m.WindRose[0] = imported.FreqByDirs.Select(t => new object[] { i++ *360 / imported.NDirs, t });
                var j = 0;
                m.WindRose[1] = imported.MeanVelocityPerDir.Select(t => new object[] { j++ *360 / imported.NDirs, t });

                // === //
                CurrentDataJson(imported, m);

                ViewBag.Title = String.Format("{0} ({1}; {2})", m.Db, tab.Latitude, tab.Longitude);
                return(View(m));
            }
            return(View(m));
        }
Пример #3
0
        public JsonResult CurrentDataJson(VDataImport imported, VPointPage vpp)
        {
            var model = PopModel();

            if (model.SelectedPoint == null)
            {
                _log.WarnFormat("CurrentFile is not set");
                var dataEmpty = new { sEcho = 0, iTotalRecords = 0, iTotalDisplayRecords = 0, aaData = new List <decimal[]>() };
                return(Json(dataEmpty, JsonRequestBehavior.AllowGet));
            }

            //string DbDir = WebConfigurationManager.AppSettings["MesoWindTabDir" + Settings.DbType];
            //var imported = ImportFile(DbDir, model.SelectedPoint.Text);

            var final = new List <string[]>();
            var n     = imported.NDirs + 1;

            var freqs = new string[n];

            freqs[0] = "Frequencies";
            for (var i = 0; i < imported.FreqByDirs.Count; i++)
            {
                freqs[i + 1] = imported.FreqByDirs[i].ToString();
            }
            final.Add(freqs);

            for (var bIndex = 0; bIndex < imported.FreqByBins.Count; bIndex++)
            {
                var bin       = imported.FreqByBins[bIndex];
                var binWith13 = new string[n];
                binWith13[0] = (bIndex + 1).ToString();
                for (var i = 0; i < bin.Length; i++)
                {
                    binWith13[i + 1] = bin[i].ToString();
                }
                final.Add(binWith13);
            }

            var mean = new string[n];

            mean[0] = "Mean Vel.";
            for (var i = 0; i < imported.MeanVelocityPerDir.Count; i++)
            {
                mean[i + 1] = imported.MeanVelocityPerDir[i].ToString();
            }
            final.Add(mean);

            var data = new { sEcho = 0, iTotalRecords = imported.NBins, iTotalDisplayRecords = imported.NBins, aaData = final };

            vpp.iTotalRecords        = imported.NBins;
            vpp.iTotalDisplayRecords = imported.NBins;
            vpp.Data = final;
            return(Json(data, JsonRequestBehavior.AllowGet));
        }