Пример #1
0
        public IActionResult ViewAttribData()
        {
            //form entries
            var startTime   = Request.Form["startTime"];
            var endTime     = Request.Form["endTime"];
            var attribWebID = Request.Form["AttribWebID"];
            var attribName  = Request.Form["AttribName"];

            //get plot data for entered data
            string URL = "https://develop2/piwebapi/streams/" + attribWebID + "/plot?startTime=" + startTime + "&endTime=" + endTime;

            // not using kerberos authentication
            NetworkCredential credentials = GetNetworkCredentials();

            //get plot data of selected attribute for the time range entered.
            Task <string> task = Task.Run(async() => await GetPIDataAsync(URL, credentials));

            task.Wait();
            string content = task.Result;

            AFAttributeRecordedValues.RootObject attributevaluelist = JsonConvert.DeserializeObject <AFAttributeRecordedValues.RootObject>(content);

            ViewBag.attribWebID = attribWebID;
            ViewBag.attribName  = attribName;

            return(View(attributevaluelist));
        }
Пример #2
0
        public IActionResult ViewAttribData(string attribName, string attribWebID, string plotdatalink)
        {
            //link to plot data
            string URL = plotdatalink;

            //not using kerberos authentication
            NetworkCredential credentials = GetNetworkCredentials();

            //get plot data of selected attribute
            Task <string> task = Task.Run(async() => await GetPIDataAsync(URL, credentials));

            task.Wait();
            string content = task.Result;

            AFAttributeRecordedValues.RootObject attributevaluelist = JsonConvert.DeserializeObject <AFAttributeRecordedValues.RootObject>(content);


            ViewBag.attribWebID = attribWebID;
            ViewBag.attribName  = attribName;

            return(View(attributevaluelist));
        }