Пример #1
0
        public string GetCalibrationAlpacaFormData()
        {
            //var InvC = new CultureInfo("");
            var offsets = new JsonCalibrationSettingsOffsets()
            {
                pressure    = cumulus.PressOffset,
                temperature = cumulus.TempOffset,
                indoortemp  = cumulus.InTempoffset,
                humidity    = cumulus.HumOffset,
                winddir     = cumulus.WindDirOffset,
                solar       = cumulus.SolarOffset,
                uv          = cumulus.UVOffset,
                wetbulb     = cumulus.WetBulbOffset
            };
            var multipliers = new JsonCalibrationSettingsMultipliers()
            {
                pressure    = cumulus.PressMult,
                windspeed   = cumulus.WindSpeedMult,
                windgust    = cumulus.WindGustMult,
                humidity    = cumulus.HumMult,
                outdoortemp = cumulus.TempMult,
                rainfall    = cumulus.RainMult,
                solar       = cumulus.SolarMult,
                uv          = cumulus.UVMult,
                wetbulb     = cumulus.WetBulbMult
            };

            var spikeremoval = new JsonCalibrationSettingsSpikeRemoval()
            {
                humidity      = cumulus.SpikeHumidityDiff,
                windgust      = cumulus.SpikeGustDiff,
                windspeed     = cumulus.SpikeWindDiff,
                outdoortemp   = cumulus.SpikeTempDiff,
                maxhourlyrain = cumulus.SpikeMaxHourlyRain,
                maxrainrate   = cumulus.SpikeMaxRainRate,
                pressure      = cumulus.SpikePressDiff
            };

            var limits = new JsonCalibrationSettingsLimits()
            {
                temphigh  = cumulus.LimitTempHigh,
                templow   = cumulus.LimitTempLow,
                dewhigh   = cumulus.LimitDewHigh,
                presshigh = cumulus.LimitPressHigh,
                presslow  = cumulus.LimitPressLow,
                windhigh  = cumulus.LimitWindHigh
            };


            var data = new JsonCalibrationSettingsData()
            {
                offsets      = offsets,
                multipliers  = multipliers,
                spikeremoval = spikeremoval,
                limits       = limits,
                log          = cumulus.ErrorLogSpikeRemoval
            };

            return(JsonConvert.SerializeObject(data));
        }
Пример #2
0
        public string GetCalibrationAlpacaFormData()
        {
            //var InvC = new CultureInfo("");
            var offsets = new JsonCalibrationSettingsOffsets()
            {
                pressure    = cumulus.Calib.Press.Offset,
                temperature = cumulus.Calib.Temp.Offset,
                indoortemp  = cumulus.Calib.InTemp.Offset,
                humidity    = (int)cumulus.Calib.Hum.Offset,
                winddir     = (int)cumulus.Calib.WindDir.Offset,
                solar       = cumulus.Calib.Solar.Offset,
                uv          = cumulus.Calib.UV.Offset,
                wetbulb     = cumulus.Calib.WetBulb.Offset
            };
            var multipliers = new JsonCalibrationSettingsMultipliers()
            {
                pressure    = cumulus.Calib.Press.Mult,
                windspeed   = cumulus.Calib.WindSpeed.Mult,
                windgust    = cumulus.Calib.WindGust.Mult,
                humidity    = cumulus.Calib.Hum.Mult,
                outdoortemp = cumulus.Calib.Temp.Mult,
                rainfall    = cumulus.Calib.Rain.Mult,
                solar       = cumulus.Calib.Solar.Mult,
                uv          = cumulus.Calib.UV.Mult,
                wetbulb     = cumulus.Calib.WetBulb.Mult
            };

            var spikeremoval = new JsonCalibrationSettingsSpikeRemoval()
            {
                humidity      = cumulus.Spike.HumidityDiff,
                windgust      = cumulus.Spike.GustDiff,
                windspeed     = cumulus.Spike.WindDiff,
                outdoortemp   = cumulus.Spike.TempDiff,
                maxhourlyrain = cumulus.Spike.MaxHourlyRain,
                maxrainrate   = cumulus.Spike.MaxRainRate,
                pressure      = cumulus.Spike.PressDiff
            };

            var limits = new JsonCalibrationSettingsLimits()
            {
                temphigh  = cumulus.Limit.TempHigh,
                templow   = cumulus.Limit.TempLow,
                dewhigh   = cumulus.Limit.DewHigh,
                presshigh = cumulus.Limit.PressHigh,
                presslow  = cumulus.Limit.PressLow,
                windhigh  = cumulus.Limit.WindHigh
            };


            var data = new JsonCalibrationSettingsData()
            {
                offsets      = offsets,
                multipliers  = multipliers,
                spikeremoval = spikeremoval,
                limits       = limits,
                log          = cumulus.ErrorLogSpikeRemoval
            };

            return(data.ToJson());
        }