mirror of
https://github.com/ckaczor/WeatherService.git
synced 2026-01-18 09:45:37 -05:00
Code modernization
This commit is contained in:
@@ -70,13 +70,13 @@ namespace WeatherService.Devices
|
||||
_valueList = new Dictionary<WeatherValueType, Value>();
|
||||
|
||||
// Store properties of the device
|
||||
_deviceAddress = device.ID.Name;
|
||||
_deviceAddress = device.Id.Name;
|
||||
_deviceType = deviceType;
|
||||
_session = session;
|
||||
_device = device;
|
||||
|
||||
// Default the display name
|
||||
_displayName = device.ID.Name;
|
||||
_displayName = device.Id.Name;
|
||||
|
||||
// Default the read interval
|
||||
if (Type == DeviceType.WindDirection || Type == DeviceType.WindSpeed)
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace WeatherService.Devices
|
||||
|
||||
PrepPioForWrite();
|
||||
|
||||
owAdapter.Select(_writeDevice.ID);
|
||||
owAdapter.Select(_writeDevice.Id);
|
||||
|
||||
data[dataCount++] = ChannelAccessCommand;
|
||||
data[dataCount++] = ConfigWrite;
|
||||
@@ -172,7 +172,7 @@ namespace WeatherService.Devices
|
||||
|
||||
PrepPioForRead();
|
||||
|
||||
owAdapter.Select(_readDevice.ID);
|
||||
owAdapter.Select(_readDevice.Id);
|
||||
|
||||
data[dataCount++] = ChannelAccessCommand;
|
||||
data[dataCount++] = ConfigRead;
|
||||
@@ -192,7 +192,7 @@ namespace WeatherService.Devices
|
||||
|
||||
PrepPioForWrite();
|
||||
|
||||
owAdapter.Select(_readDevice.ID);
|
||||
owAdapter.Select(_readDevice.Id);
|
||||
|
||||
data[dataCount++] = ChannelAccessCommand;
|
||||
data[dataCount++] = ConfigPulseRead;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace WeatherService
|
||||
device.Errors++;
|
||||
|
||||
// TODO - Error event
|
||||
Tracer.WriteLine(String.Format("{0} - Error in device {1}: {2}", DateTime.Now, exception.DeviceID.Name, exception.Message));
|
||||
Tracer.WriteLine(String.Format("{0} - Error in device {1}: {2}", DateTime.Now, exception.DeviceId.Name, exception.Message));
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ namespace WeatherService
|
||||
owIdentifier deviceID; // Identifier for the other device
|
||||
|
||||
// Select this device
|
||||
owAdapter.Select(device.ID);
|
||||
owAdapter.Select(device.Id);
|
||||
|
||||
// Setup to try to open the pressure sensor file
|
||||
fileEntry.Name = System.Text.Encoding.ASCII.GetBytes("8570");
|
||||
@@ -152,7 +152,7 @@ namespace WeatherService
|
||||
break;
|
||||
|
||||
case 0x1D:
|
||||
if (device.ID.Name == "4000000004A4081D")
|
||||
if (device.Id.Name == "4000000004A4081D")
|
||||
{
|
||||
// Create a new rain device and add it to the list
|
||||
Devices.Add(new RainDevice(this, device));
|
||||
|
||||
Reference in New Issue
Block a user