Esempio n. 1
0
        public ActionResult ShowDashBoard4DayForm(JassWeatherAPI.VariableValueModel Model)  //list container
        {
            List <JassVariableStatus> variableStatusModel = apiCaller.listVariableStatus((int?)jassuserinfo.JassVariableGroupID);

            Model.gridValues = apiCaller.GetDayValues(Model.fileName);
            return(View(Model));
        }
Esempio n. 2
0
        public ActionResult ShowDashBoard4DayForm()  //list container
        {
            List <JassVariableStatus> variableStatusModel = apiCaller.listVariableStatus((int?)jassuserinfo.JassVariableGroupID);

            JassWeatherAPI.VariableValueModel Model = new JassWeatherAPI.VariableValueModel();
            return(View(Model));
        }
Esempio n. 3
0
        public ActionResult ShowDashBoard4DayFromFile(JassWeatherAPI.VariableValueModel Model)  //list container
        {
            #region select let lon
            ViewBag.LatLonGroupID = Session["LatLonGroupID"];
            int LatLonGroupID = (int)ViewBag.LatLonGroupID;
            var locations     = db.JassLatLons.Where(l => l.JassLatLonGroupID == LatLonGroupID).ToList();
            ViewBag.JassLatLonID = new SelectList(locations, "JassLatLonID", "Name");
            Model.JassLatLon     = db.JassLatLons.Find(Model.JassLatLonID);
            #endregion

            #region fix grid
            Model.JassGrid = db.JassGrids.Find(Model.JassGridID);
            #endregion

            if (Model.JassGridID != null)
            {
                Model.JassGrid = db.JassGrids.Find(Model.JassGridID);
                DateTime requestDate = new DateTime(Model.year, Model.monthIndex, Model.dayIndex);
                int      stepIndex   = Model.stepIndex * Model.JassGrid.StepsInDay / 8;
                Model.gridValues = apiCaller.GetDayValues(Model.JassGrid, Model.fileName, Model.startingDate, requestDate, stepIndex, Model.levelIndex);
                return(View(Model));
            }
            else
            {
                //inspect file schema
                string filePath  = apiCaller.AppDataFolder + "\\" + Model.fileName;
                var    fileModel = apiCaller.AnalyzeFileOnDisk(filePath);
                Model.schema        = fileModel.schema;
                Model.maxYaroundLoc = 25;
                Model.maxXaroundLoc = 25;

                ViewBag.JassGridID = new SelectList(db.JassGrids, "JassGridID", "Name", Model.JassGridID);
                return(View("ShowDashBoard4DayFromFileFirst", Model));
            }
        }
Esempio n. 4
0
        public ActionResult ShowDashBoard4Day(string variableName, int yearIndex, int monthIndex, int dayIndex, int stepIndex, int levelIndex)  //list container
        {
            List <JassVariableStatus> variableStatusModel = apiCaller.listVariableStatus((int?)jassuserinfo.JassVariableGroupID);

            int year  = yearIndex + (DateTime.Now.Year - yearsBackInHistory);
            int month = monthIndex + 1;
            int day   = dayIndex + 1;

            string fileName = apiCaller.fileNameBuilderByDay(variableName, year, month, day) + ".nc";

            apiCaller.DownloadFile2DiskIfNotThere(variableName.ToLower(), fileName, apiCaller.AppDataFolder + "\\" + fileName);
            JassWeatherAPI.VariableValueModel Model = apiCaller.AnalyzeFileOnDisk(fileName);
            ViewBag.JassGridID = new SelectList(db.JassGrids, "JassGridID", "Name", Model.JassGridID);

            Model.fileName     = fileName;
            Model.variableName = variableName;
            Model.gridValues   = apiCaller.GetDayValues(Model.JassGrid, Model.fileName, Model.startingDate, Model.startingDate, stepIndex, levelIndex);

            if (variableName.Contains("Sheridan"))
            {
                Model.colorCode = db.JassColorCodes.Find(1);
            }

            return(View(Model));
        }
Esempio n. 5
0
        public ActionResult ShowDashBoard4DayFromFile(string fileName, string containerName)  //list container
        {
            apiCaller.DownloadFile2DiskIfNotThere(containerName, fileName, apiCaller.AppDataFolder + "\\" + fileName);

            JassWeatherAPI.VariableValueModel Model = apiCaller.AnalyzeFileOnDisk(fileName);
            ViewBag.JassGridID = new SelectList(db.JassGrids, "JassGridID", "Name", Model.JassGridID);
            //hack for now:

            #region select let lon
            ViewBag.LatLonGroupID = Session["LatLonGroupID"];
            int LatLonGroupID = (int)ViewBag.LatLonGroupID;
            var locations     = db.JassLatLons.Where(l => l.JassLatLonGroupID == LatLonGroupID).ToList();
            ViewBag.JassLatLonID = new SelectList(locations, "JassLatLonID", "Name");
            #endregion
            Model.maxYaroundLoc = 25;
            Model.maxXaroundLoc = 25;

            Model.fileName = fileName;
            return(View("ShowDashBoard4DayFromFileFirst", Model));
        }
Esempio n. 6
0
        public ActionResult ShowDashBoard4DayFromInspectVariable()
        {
            JassWeatherAPI.VariableValueModel Model = new JassWeatherAPI.VariableValueModel();
            ViewBag.JassGridID = new SelectList(db.JassGrids, "JassGridID", "Name", Model.JassGridID);
            //hack for now:

            #region select let lon
            ViewBag.LatLonGroupID = Session["LatLonGroupID"];
            int LatLonGroupID = (int)ViewBag.LatLonGroupID;
            var locations     = db.JassLatLons.Where(l => l.JassLatLonGroupID == LatLonGroupID).ToList();
            ViewBag.JassLatLonID = new SelectList(locations, "JassLatLonID", "Name");
            #endregion

            #region select variable
            var variables = db.JassVariables.ToList();
            ViewBag.JassVariableID = new SelectList(variables, "JassVariableID", "Name");
            #endregion

            Model.maxYaroundLoc = 25;
            Model.maxXaroundLoc = 25;
            return(View("ShowDashBoard4DayFromInspectVariableFirst", Model));
        }