コード例 #1
0
 public static bool SetOverlapFilter(byte opType, ushort interval, out string errInfo)
 {
     errInfo = "";
     byte[] bval  = BitConverter.GetBytes(interval);
     byte[] stime = new byte[2];
     stime[0] = bval[1];
     stime[1] = bval[0];
     Invengo.NetAPI.Protocol.IRP1.FilterByTime msg = new FilterByTime(opType, stime);
     if (RfReader.Send(msg))
     {
         return(true);
     }
     else
     {
         if (msg.ErrInfo == null || msg.ErrInfo == "")
         {
             errInfo = string.Format("0x{0}", msg.StatusCode.ToString("X2"));
         }
         else
         {
             errInfo = msg.ErrInfo;
         }
     }
     return(false);
 }
コード例 #2
0
        public JsonResult GetSensorDataYear(FilterByTime filter = FilterByTime.All)
        {
            var fromDate    = DateTime.Now.AddYears(-1);
            var toDate      = DateTime.Now;
            var groupByTime = GroupByTime.Month;

            var model = GetSensorData(User.Identity.Name, fromDate, toDate, filter, groupByTime);

            return(new JsonNetResult {
                Data = model, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #3
0
        private SensorDataViewModel GetSensorData(string userName, DateTime fromDate, DateTime toDate, FilterByTime filter, GroupByTime group)
        {
            var request = new GetGroupedSensorDataRequest
            {
                UserName     = userName,
                FromDate     = fromDate,
                ToDate       = toDate,
                GroupByTime  = group,
                FilterByTime = filter
            };

            var data  = dataReposytory.GetData(request);
            var model = ChartHelper.GetDataSets(data);

            return(model);
        }