Exemple #1
0
 public RealValueOnlyQueryResponse GetValueOnly([FromBody] RealDataRequest request)
 {
     if (DbInRunWebApi.SecurityManager.Manager.IsLogin(request.Token) && DbInRunWebApi.SecurityManager.Manager.CheckReaderPermission(request.Token, request.Group))
     {
         RealValueOnlyQueryResponse response = new RealValueOnlyQueryResponse()
         {
             Result = true, Datas = new List <object>()
         };
         var service = ServiceLocator.Locator.Resolve <IRealTagConsumer>();
         var ids     = service.GetTagIdByName(request.TagNames.Select(e => string.IsNullOrEmpty(request.Group) ? e : request.Group + "." + e).ToList());
         for (int i = 0; i < request.TagNames.Count; i++)
         {
             if (ids[i].HasValue)
             {
                 byte     quality;
                 DateTime time;
                 byte     tagtype = 0;
                 var      val     = service.GetTagValue(ids[i].Value, out quality, out time, out tagtype);
                 response.Datas.Add(val);
             }
         }
         return(response);
     }
     //ServiceLocator.Locator.Resolve<IRealTagComsumer>().GetTagValue()
     return(new RealValueOnlyQueryResponse()
     {
         Result = false
     });
 }
 public BasicResponse GetAllAnalogAlarm(RealDataRequest realDataRequest)
 {
     return(_PtQueryService.GetAllAnalogAlarm(realDataRequest));
 }
 public BasicResponse <List <RealDataAppDataContract> > GetRealData(RealDataRequest realDataRequest)
 {
     return(_PtQueryService.GetRealData(realDataRequest));
 }
Exemple #4
0
        public BasicResponse GetAllAnalogAlarm(RealDataRequest realDataRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/KJ73NApp/GetAllAnalogAlarm?token=" + Token, JSONHelper.ToJSONString(realDataRequest));

            return(JSONHelper.ParseJSONString <BasicResponse>(responsestr));
        }
Exemple #5
0
        public BasicResponse <List <RealDataAppDataContract> > GetRealData(RealDataRequest realDataRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/KJ73NApp/GetRealData?token=" + Token, JSONHelper.ToJSONString(realDataRequest));

            return(JSONHelper.ParseJSONString <BasicResponse <List <RealDataAppDataContract> > >(responsestr));
        }