예제 #1
0
 private void FetchFromGateway(bool combineMeasurements, List <MeasurementFileFormatHeader> files = null)
 {
     try
     {
         var measurement = _measurementService.GetMeasurements(Gateway, KellerDevice);
         if (combineMeasurements && files != null)
         {
             _fileService.WriteFileCombinedWith(measurement, files);
         }
         else
         {
             _fileService.WriteFileFormat(measurement);
         }
         SelectedRecord.Instance.SelectLocalRecord(File);
     }
     catch (Exception e)
     {
         Logger.Warn(e, "Failed to fetch measurements from the ChirpNest");
     }
 }
예제 #2
0
        private void Download(bool combineMeasurements, KellerDevice device, List <MeasurementFileFormatHeader> files = null)
        {
            var gateway = new Gateway(GatewayIp);

            try
            {
                var measurement = _measurementService.GetMeasurements(gateway, device);
                if (combineMeasurements && files != null)
                {
                    _fileService.WriteFileCombinedWith(measurement, files);
                }
                else
                {
                    _fileService.WriteFileFormat(measurement);
                }
                _measurementService.RemoveMeasurements(gateway, device);
                LoadLocal();
            }
            catch (Exception e)
            {
                Logger.Warn(e, "Failed to read measurements from Chirpnest");
            }
        }