Esempio n. 1
0
        public ProgramSettings(Cumulus cumulus)
        {
            this.cumulus = cumulus;

            programOptionsFile = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "ProgramOptions.json";
            programSchemaFile  = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "ProgramSchema.json";
        }
Esempio n. 2
0
        public StationSettings(Cumulus cumulus)
        {
            this.cumulus = cumulus;

            stationOptionsFile = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationOptions.json";
            stationSchemaFile  = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationSchema.json";
        }
Esempio n. 3
0
        public Simulator(Cumulus cumulus) : base(cumulus)
        {
            cumulus.LogMessage("Station type = Simulator");

            cumulus.LogMessage("Last update time = " + cumulus.LastUpdateTime);

            cancellationToken = tokenSource.Token;

            random = new Random();

            currData = new DataSet();

            cumulus.StationOptions.CalculatedDP            = true;
            cumulus.StationOptions.CalculatedET            = true;
            cumulus.StationOptions.CalculatedWC            = true;
            cumulus.StationOptions.UseWind10MinAvg         = true;
            cumulus.StationOptions.UseCumulusPresstrendstr = true;
            cumulus.StationOptions.UseSpeedForAvgCalc      = false;

            WindAverage = 0;

            timerStartNeeded = true;
            LoadLastHoursFromDataLogs(cumulus.LastUpdateTime);
            DoDayResetIfNeeded();
            DoTrendValues(DateTime.Now);
        }
Esempio n. 4
0
        public WMR100Station(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.OREGONUSB;
            var devicelist = DeviceList.Local;
            var station    = devicelist.GetHidDeviceOrNull(Vendorid, Productid);

            if (station != null)
            {
                cumulus.LogMessage("WMR100 station found");

                if (station.TryOpen(out stream))
                {
                    cumulus.LogMessage("Stream opened");
                }

                packetBuffer = new byte[PacketBufferBound];

                WMR200ExtraTempValues = new double[11];
                WMR200ExtraHumValues  = new double[11];
                WMR200ChannelPresent  = new bool[11];
                WMR200ExtraDPValues   = new double[11];

                LoadLastHoursFromDataLogs(DateTime.Now);
            }
            else
            {
                cumulus.LogMessage("WMR100 station not found!");
                cumulus.LogConsoleMessage("WMR100 station not found!");
            }
        }
Esempio n. 5
0
        public StationSettings(Cumulus cumulus)
        {
            this.cumulus = cumulus;

            stationOptionsFile = AppDomain.CurrentDomain.BaseDirectory + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationOptions.json";
            stationSchemaFile  = AppDomain.CurrentDomain.BaseDirectory + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationSchema.json";
        }
Esempio n. 6
0
        /// <summary>
        /// Creates the FTP client
        /// </summary>
        /// <param name="cumulus">The parent object, required for all sorts of config "stuff"</param>
        public MxFtpClient(Cumulus cumulus, bool persist)
        {
            this.cumulus = cumulus;
            persistent   = persist;

            ftpClient = new FtpClient()
            {
                Host               = cumulus.FtpHostname,
                Port               = cumulus.FtpHostPort,
                Credentials        = new NetworkCredential(cumulus.FtpUsername, cumulus.FtpPassword),
                DataConnectionType = cumulus.ActiveFTPMode
                                        ? FtpDataConnectionType.AutoActive
                                        : FtpDataConnectionType.AutoPassive,
                SocketKeepAlive = true,
            };

            if (cumulus.DisableFtpsEPSV)
            {
                ftpClient.DataConnectionType = FtpDataConnectionType.PASV;
            }

            // Additional settings for SFTP
            if (cumulus.Sslftp == Cumulus.FtpProtocols.FTPS)
            {
                ftpClient.DataConnectionEncryption = true;
                ftpClient.ValidateAnyCertificate   = true;
                ftpClient.SslProtocols             = SslProtocols.Default | SslProtocols.Tls11 | SslProtocols.Tls12;
                ftpClient.EncryptionMode           = cumulus.DisableFtpsExplicit
                                        ? FtpEncryptionMode.Implicit
                                        : FtpEncryptionMode.Explicit;
            }
        }
Esempio n. 7
0
        public WMR100Station(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.OREGONUSB;
            devicelist           = DeviceList.Local;
            station = devicelist.GetHidDeviceOrNull(Vendorid, Productid);

            if (station != null)
            {
                cumulus.LogMessage(DateTime.Now.ToLongTimeString() + " WMR100 station found");

                if (station.TryOpen(out stream))
                {
                    cumulus.LogMessage(DateTime.Now.ToLongTimeString() + " Stream opened");
                }

                PacketBuffer = new byte[PacketBufferBound];

                WMR200ExtraTempValues = new double[11];
                WMR200ExtraHumValues  = new double[11];
                WMR200ChannelPresent  = new bool[11];
                WMR200ExtraDPValues   = new double[11];
            }
            else
            {
                cumulus.LogMessage(DateTime.Now.ToLongTimeString() + " WMR100 station not found!");
                Console.WriteLine("WMR100 station not found!");
            }
        }
Esempio n. 8
0
        public WS2300Station(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.LACROSSE;
            calculaterainrate    = true;

            cumulus.LogMessage("WS2300: Attempting to open " + cumulus.ComportName);

            comport = new SerialPort(cumulus.ComportName, 2400, Parity.None, 8, StopBits.One)
            {
                Handshake    = Handshake.None,
                DtrEnable    = false,
                RtsEnable    = true,
                ReadTimeout  = 500,
                WriteTimeout = 1000
            };

            try
            {
                comport.Open();
                cumulus.LogMessage("COM port opened");
            }
            catch (Exception ex)
            {
                cumulus.LogMessage(ex.Message);
                //MessageBox.Show(ex.Message);
            }

            if (comport.IsOpen)
            {
                // Read the data from the logger
                cumulus.CurrentActivity = "Reading archive data";
                startReadingHistoryData();
            }
        }
Esempio n. 9
0
 internal ApiTagProcessor(Cumulus cumulus)
 {
     this.cumulus         = cumulus;
     tokenParser          = new TokenParser();
     tokenParser.OnToken += cumulus.TokenParserOnToken;
     tokenParser.Encoding = new UTF8Encoding(false);
 }
Esempio n. 10
0
        internal StationSettings(Cumulus cumulus, WeatherStation station)
        {
            this.cumulus = cumulus;
            this.station = station;

            stationOptionsFile = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationOptions.json";
            stationSchemaFile  = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "StationSchema.json";
        }
Esempio n. 11
0
 internal ApiTagProcessor(Cumulus cumulus, WebTags webtags)
 {
     this.cumulus         = cumulus;
     this.webtags         = webtags;
     tokenParser          = new TokenParser();
     tokenParser.OnToken += cumulus.TokenParserOnToken;
     tokenParser.encoding = new UTF8Encoding(false);
 }
Esempio n. 12
0
        public TempestStation(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.WEATHERFLOW;
            calculaterainrate    = false;

            cumulus.LogMessage("Station type = Tempest");
            LoadLastHoursFromDataLogs(cumulus.LastUpdateTime);

            Task.Run(getAndProcessHistoryData);            // grab old data, then start the station
        }
Esempio n. 13
0
        public WM918Station(Cumulus cumulus)
            : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.OREGON;
            // station supplies rain rate
            calculaterainrate = false;

            cumulus.LogMessage("Station type = WM918");

            startReadingHistoryData();
        }
Esempio n. 14
0
        static void RunAsAConsole(int port, bool debug)
        {
            //Console.WriteLine("Current culture: " + CultureInfo.CurrentCulture.DisplayName);
            if (Type.GetType("Mono.Runtime") == null)
            {
                _ = new exitHandler();
            }

            cumulus = new Cumulus(port, debug, "");

            Console.WriteLine(DateTime.Now.ToString("G"));

            Console.WriteLine("Type Ctrl-C to terminate");
        }
Esempio n. 15
0
        public HttpStationWund(Cumulus cumulus) : base(cumulus)
        {
            cumulus.LogMessage("Starting HTTP Station (Wunderground)");

            cumulus.StationOptions.CalculatedWC = true;
            cumulus.Units.AirQualityUnitText    = "µg/m³";
            cumulus.Units.SoilMoistureUnitText  = "%";
            cumulus.Units.LeafWetnessUnitText   = "%";

            // Wunderground does not send the rain rate, so we will calculate it
            calculaterainrate = true;

            Start();
        }
Esempio n. 16
0
        public TempestStation(Cumulus cumulus) : base(cumulus)
        {
            calculaterainrate = false;

            cumulus.LogMessage("Station type = Tempest");

            // Tempest does not provide pressure trend strings
            cumulus.StationOptions.UseCumulusPresstrendstr = true;

            // Tempest does not provide wind chill
            cumulus.StationOptions.CalculatedWC = true;

            LoadLastHoursFromDataLogs(cumulus.LastUpdateTime);

            Task.Run(getAndProcessHistoryData);            // grab old data, then start the station
        }
Esempio n. 17
0
        public ImetStation(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.INSTROMET;
            cumulus.LogMessage("ImetUpdateLogPointer=" + cumulus.ImetOptions.ImetUpdateLogPointer);
            cumulus.LogMessage("ImetWaitTime=" + cumulus.ImetOptions.ImetWaitTime);
            cumulus.LogMessage("ImetReadDelay=" + cumulus.ImetOptions.ImetReadDelay);
            cumulus.LogMessage("ImetOptions.ImetBaudRate=" + cumulus.ImetOptions.ImetBaudRate);
            cumulus.LogMessage("Instromet: Attempting to open " + cumulus.ComportName);

            calculaterainrate = true;

            // Change the default dps for rain and sunshine from 1 to 2 for IMet stations
            cumulus.RainDPlaces           = cumulus.SunshineDPlaces = 2;
            cumulus.RainDPlaceDefaults[0] = 2;              // mm
            cumulus.RainDPlaceDefaults[1] = 3;              // in
            cumulus.RainFormat            = cumulus.SunFormat = "F2";

            comport = new SerialPort(cumulus.ComportName, cumulus.ImetOptions.ImetBaudRate, Parity.None, 8, StopBits.One)
            {
                Handshake = Handshake.None, RtsEnable = true, DtrEnable = true
            };

            try
            {
                comport.ReadTimeout = 1000;
                comport.Open();
                cumulus.LogMessage("COM port opened");
            }
            catch (Exception ex)
            {
                cumulus.LogMessage(ex.Message);
                //MessageBox.Show(ex.Message);
            }

            if (comport.IsOpen)
            {
                ImetSetLoggerInterval(cumulus.logints[cumulus.DataLogInterval]);
                if (cumulus.StationOptions.SyncTime)
                {
                    SetStationClock();
                }

                // Read the data from the logger
                cumulus.CurrentActivity = "Reading archive data";
                startReadingHistoryData();
            }
        }
Esempio n. 18
0
        private static void RunAsAConsole(int port, bool debug)
        {
            //Console.WriteLine("Current culture: " + CultureInfo.CurrentCulture.DisplayName);
            if (Type.GetType("Mono.Runtime") == null)
            {
                svcTextListener.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff ") + "Creating Windows Exit Handler");
                svcTextListener.Flush();

                _ = new ExitHandler();
            }

            cumulus = new Cumulus(port, debug, "");

            Console.WriteLine(DateTime.Now.ToString("G"));

            Console.WriteLine("Type Ctrl-C to terminate");
        }
Esempio n. 19
0
        public HttpStationEcowitt(Cumulus cumulus, WeatherStation station = null) : base(cumulus)
        {
            this.station = station;

            if (station == null)
            {
                cumulus.LogMessage("Creating HTTP Station (Ecowitt)");
            }
            else
            {
                cumulus.LogMessage("Creating Extra Sensors - HTTP Station (Ecowitt)");
            }

            //cumulus.StationOptions.CalculatedWC = true;
            // GW1000 does not provide average wind speeds
            // Do not set these if we are only using extra sensors
            if (station == null)
            {
                cumulus.StationOptions.UseWind10MinAve    = true;
                cumulus.StationOptions.UseSpeedForAvgCalc = false;
                // GW1000 does not send DP, so force MX to calculate it
                cumulus.StationOptions.CalculatedDP = true;
                // Same for Wind Chill
                cumulus.StationOptions.CalculatedWC = true;
            }

            cumulus.Manufacturer = cumulus.ECOWITT;
            if (station == null || (station != null && cumulus.EcowittExtraUseAQI))
            {
                cumulus.AirQualityUnitText = "µg/m³";
            }
            if (station == null || (station != null && cumulus.EcowittExtraUseSoilMoist))
            {
                cumulus.SoilMoistureUnitText = "%";
            }

            // Only perform the Start-up if we are a proper station, not a Extra Sensor
            if (station == null)
            {
                Start();
            }
            else
            {
                cumulus.LogMessage("Extra Sensors - HTTP Station (Ecowitt) - Waiting for data...");
            }
        }
Esempio n. 20
0
        public ImetStation(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.INSTROMET;
            cumulus.LogMessage("ImetUpdateLogPointer=" + cumulus.ImetUpdateLogPointer);
            cumulus.LogMessage("ImetWaitTime=" + cumulus.ImetWaitTime);
            cumulus.LogMessage("ImetBaudRate=" + cumulus.ImetBaudRate);
            cumulus.LogMessage("Instromet: Attempting to open " + cumulus.ComportName);

            calculaterainrate = true;

            comport = new SerialPort(cumulus.ComportName, cumulus.ImetBaudRate, Parity.None, 8, StopBits.One)
            {
                Handshake = Handshake.None, RtsEnable = true, DtrEnable = true
            };

            try
            {
                comport.ReadTimeout = 1000;
                comport.Open();
                cumulus.LogMessage("COM port opened");
            }
            catch (Exception ex)
            {
                cumulus.LogMessage(ex.Message);
                //MessageBox.Show(ex.Message);
            }

            if (comport.IsOpen)
            {
                ImetSetLoggerInterval(cumulus.logints[cumulus.DataLogInterval]);
                if (cumulus.SyncTime)
                {
                    SetStationClock();
                }

                // Read the data from the logger
                cumulus.CurrentActivity = "Reading archive data";
                startReadingHistoryData();
            }
        }
Esempio n. 21
0
        public HttpStationAmbient(Cumulus cumulus, WeatherStation station = null) : base(cumulus)
        {
            this.station = station;

            if (station == null)
            {
                cumulus.LogMessage("Creating HTTP Station (Ambient)");
            }
            else
            {
                cumulus.LogMessage("Creating Extra Sensors - HTTP Station (Ambient)");
            }


            //cumulus.StationOptions.CalculatedWC = true;
            // Ambient does not provide average wind speeds
            cumulus.StationOptions.UseWind10MinAve    = true;
            cumulus.StationOptions.UseSpeedForAvgCalc = false;
            // Ambient does not send the rain rate, so we will calculate it
            calculaterainrate = true;
            // Ambient does not send DP, so force MX to calculate it
            //cumulus.StationOptions.CalculatedDP = true;

            cumulus.Manufacturer = cumulus.AMBIENT;
            if (station == null || (station != null && cumulus.AmbientExtraUseAQI))
            {
                cumulus.AirQualityUnitText = "µg/m³";
            }
            if (station == null || (station != null && cumulus.AmbientExtraUseSoilMoist))
            {
                cumulus.SoilMoistureUnitText = "%";
            }

            // Only perform the Start-up if we are a proper station, not a Extra Sensor
            if (station == null)
            {
                Start();
            }
        }
Esempio n. 22
0
 public MxWebSocket(string urlPath, Cumulus cumulus) : base(urlPath, true)
 {
     this.cumulus = cumulus;
 }
Esempio n. 23
0
 public InternetSettings(Cumulus cumulus)
 {
     this.cumulus = cumulus;
 }
Esempio n. 24
0
 public DataStruct(Cumulus cumulus, double outdoorTemp, int outdoorHum, double avgTempToday, double indoorTemp, double outdoorDewpoint, double windChill, int indoorHum, double pressure, double windLatest, double windAverage, double recentmaxgust, double windRunToday, int bearing, int avgbearing, double rainToday, double rainYesterday, double rainMonth, double rainYear, double rainRate, double rainLastHour, double heatIndex, double humidex, double appTemp, double tempTrend, double pressTrend, double highGustToday, string highGustTodayTime, double highWindToday, int highGustBearingToday, string windUnit, int bearingRangeFrom10, int bearingRangeTo10, string windRoseData, double highTempToday, double lowTempToday, string highTempTodayToday, string lowTempTodayTime, double highPressToday, double lowPressToday, string highPressTodayTime, string lowPressTodayTime, double highRainRateToday, string highRainRateTodayTime, int highHumToday, int lowHumToday, string highHumTodayTime, string lowHumTodayTime, string pressUnit, string tempUnit, string rainUnit, double highDewpointToday, double lowDewpointToday, string highDewpointTodayTime, string lowDewpointTodayTime, double lowWindChillToday, string lowWindChillTodayTime, int solarRad, int highSolarRadToday, string highSolarRadTodayTime, double uvindex, double highUVindexToday, string highUVindexTodayTime, string forecast, string sunrise, string sunset, string moonrise, string moonset, double highHeatIndexToday, string highHeatIndexTodayTime, double highAppTempToday, double lowAppTempToday, string highAppTempTodayTime, string lowAppTempTodayTime, int currentSolarMax, double alltimeHighPressure, double alltimeLowPressure, double sunshineHours, string domWindDir, string lastRainTipISO, double highHourlyRainToday, string highHourlyRainTodayTime, string highBeaufortToday, string beaufort, string beaufortDesc, string lastDataRead, bool dataStopped, double stormRain, string stormRainStart, int cloudbase, string cloudbaseUnit, double last24hourRain)
 {
     this.cumulus          = cumulus;
     OutdoorTemp           = outdoorTemp;
     HighTempToday         = highTempToday;
     LowTempToday          = lowTempToday;
     HighTempTodayTime     = highTempTodayToday;
     LowTempTodayTime      = lowTempTodayTime;
     OutdoorHum            = outdoorHum;
     AvgTempToday          = avgTempToday;
     IndoorTemp            = indoorTemp;
     OutdoorDewpoint       = outdoorDewpoint;
     WindChill             = windChill;
     LowWindChillToday     = lowWindChillToday;
     LowWindChillTodayTime = lowWindChillTodayTime;
     IndoorHum             = indoorHum;
     Pressure                = pressure;
     HighPressToday          = highPressToday;
     LowPressToday           = lowPressToday;
     HighPressTodayTime      = highPressTodayTime;
     LowPressTodayTime       = lowPressTodayTime;
     WindLatest              = windLatest;
     WindAverage             = windAverage;
     Recentmaxgust           = recentmaxgust;
     WindRunToday            = windRunToday;
     Bearing                 = bearing;
     Avgbearing              = avgbearing;
     RainToday               = rainToday;
     RainYesterday           = rainYesterday;
     RainMonth               = rainMonth;
     RainYear                = rainYear;
     RainRate                = rainRate;
     HighRainRateToday       = highRainRateToday;
     HighRainRateTodayTime   = highRainRateTodayTime;
     HighHourlyRainToday     = highHourlyRainToday;
     HighHourlyRainTodayTime = highHourlyRainTodayTime;
     RainLastHour            = rainLastHour;
     RainLast24Hour          = last24hourRain;
     HeatIndex               = heatIndex;
     HighHeatIndexToday      = highHeatIndexToday;
     HighHeatIndexTodayTime  = highHeatIndexTodayTime;
     Humidex                 = humidex;
     AppTemp                 = appTemp;
     HighAppTempToday        = highAppTempToday;
     LowAppTempToday         = lowAppTempToday;
     HighAppTempTodayTime    = highAppTempTodayTime;
     LowAppTempTodayTime     = lowAppTempTodayTime;
     TempTrend               = tempTrend;
     PressTrend              = pressTrend;
     HighGustToday           = highGustToday;
     HighGustTodayTime       = highGustTodayTime;
     HighWindToday           = highWindToday;
     HighGustBearingToday    = highGustBearingToday;
     BearingRangeFrom10      = bearingRangeFrom10;
     BearingRangeTo10        = bearingRangeTo10;
     WindRoseData            = windRoseData;
     WindUnit                = windUnit;
     PressUnit               = pressUnit;
     TempUnit                = tempUnit;
     RainUnit                = rainUnit;
     HighHumToday            = highHumToday;
     LowHumToday             = lowHumToday;
     HighHumTodayTime        = highHumTodayTime;
     LowHumTodayTime         = lowHumTodayTime;
     HighDewpointToday       = highDewpointToday;
     LowDewpointToday        = lowDewpointToday;
     HighDewpointTodayTime   = highDewpointTodayTime;
     LowDewpointTodayTime    = lowDewpointTodayTime;
     SolarRad                = solarRad;
     HighSolarRadToday       = highSolarRadToday;
     HighSolarRadTodayTime   = highSolarRadTodayTime;
     CurrentSolarMax         = currentSolarMax;
     UVindex                 = uvindex;
     HighUVindexToday        = highUVindexToday;
     HighUVindexTodayTime    = highUVindexTodayTime;
     AlltimeHighPressure     = alltimeHighPressure;
     AlltimeLowPressure      = alltimeLowPressure;
     SunshineHours           = sunshineHours;
     Forecast                = forecast;
     Sunrise                 = sunrise;
     Sunset   = sunset;
     Moonrise = moonrise;
     Moonset  = moonset;
     DominantWindDirection = domWindDir;
     LastRainTipISO        = lastRainTipISO;
     HighBeaufortToday     = highBeaufortToday;
     Beaufort       = beaufort;
     BeaufortDesc   = beaufortDesc;
     LastDataRead   = lastDataRead;
     DataStopped    = dataStopped;
     StormRain      = stormRain;
     StormRainStart = stormRainStart;
     Cloudbase      = cloudbase;
     CloudbaseUnit  = cloudbaseUnit;
 }
Esempio n. 25
0
 public EasyWeather(Cumulus cumulus) : base(cumulus)
 {
     tmrDataRead = new Timer();
 }
Esempio n. 26
0
 public EmailSender(Cumulus cumulus)
 {
     this.cumulus = cumulus;
     _writeLock   = new SemaphoreSlim(1);
 }
Esempio n. 27
0
 public ExtraSensorSettings(Cumulus cumulus)
 {
     this.cumulus = cumulus;
 }
Esempio n. 28
0
 internal GW1000Api(Cumulus cuml)
 {
     cumulus = cuml;
 }
Esempio n. 29
0
 public NOAASettings(Cumulus cumulus)
 {
     this.cumulus    = cumulus;
     noaaOptionsFile = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "NoaaOptions.json";
     noaaSchemaFile  = cumulus.AppDir + "interface" + Path.DirectorySeparatorChar + "json" + Path.DirectorySeparatorChar + "NoaaSchema.json";
 }
Esempio n. 30
0
        internal FOStation(Cumulus cumulus) : base(cumulus)
        {
            cumulus.Manufacturer = cumulus.EW;
            var data = new byte[32];

            tmrDataRead = new Timer();

            calculaterainrate = true;

            hasSolar = cumulus.StationType == StationTypes.FineOffsetSolar;

            if (hasSolar)
            {
                FOentrysize       = 0x14;
                FOMaxAddr         = 0xFFEC;
                maxHistoryEntries = 3264;
            }
            else
            {
                FOentrysize       = 0x10;
                FOMaxAddr         = 0xFFF0;
                maxHistoryEntries = 4080;
            }

            devicelist = DeviceList.Local;

            int VID = (cumulus.VendorID < 0 ? defaultVID : cumulus.VendorID);
            int PID = (cumulus.ProductID < 0 ? defaultPID : cumulus.ProductID);

            cumulus.LogMessage("Looking for Fine Offset station, VendorID=0x" + VID.ToString("X4") + " ProductID=0x" + PID.ToString("X4"));
            Console.WriteLine("Looking for Fine Offset station, VendorID=0x" + VID.ToString("X4") + " ProductID=0x" + PID.ToString("X4"));

            hidDevice = devicelist.GetHidDeviceOrNull(vendorID: VID, productID: PID);

            if (hidDevice != null)
            {
                cumulus.LogMessage("Fine Offset station found");
                Console.WriteLine("Fine Offset station found");

                if (hidDevice.TryOpen(out stream))
                {
                    cumulus.LogMessage("Stream opened");
                    Console.WriteLine("Connected to station");
                    // Get the block of data containing the abs and rel pressures
                    cumulus.LogMessage("Reading pressure offset");
                    ReadAddress(0x20, data);
                    double relpressure = ((data[1] * 256) + data[0]) / 10.0f;
                    double abspressure = ((data[3] * 256) + data[2]) / 10.0f;
                    pressureOffset = relpressure - abspressure;
                    cumulus.LogMessage("Rel pressure = " + relpressure);
                    cumulus.LogMessage("Abs pressure = " + abspressure);
                    cumulus.LogMessage("Offset       = " + pressureOffset);

                    // Read the data from the logger
                    startReadingHistoryData();
                }
                else
                {
                    cumulus.LogMessage("Stream open failed");
                    Console.WriteLine("Unable to connect to station");
                }
            }
            else
            {
                cumulus.LogMessage("Fine Offset station not found");
                Console.WriteLine("Fine Offset station not found");
            }
        }