@@ -18,30 +18,30 @@ internal sealed class Octo : Hardware
1818 private readonly Sensor [ ] _currents = new Sensor [ 8 ] ;
1919 private readonly Sensor [ ] _powers = new Sensor [ 8 ] ;
2020
21- public Octo ( HidDevice dev , ISettings settings ) : base ( "Octo" , new Identifier ( dev . DevicePath ) , settings )
21+ public Octo ( HidDevice dev , ISettings settings ) : base ( "Octo" , new Identifier ( dev ) , settings )
2222 {
2323 if ( dev . TryOpen ( out _stream ) )
2424 {
2525 //Reading output report instead of feature report, as the measurements are in the output report
2626 _stream . Read ( _rawData ) ;
27-
27+
2828 Name = "OCTO" ;
2929 FirmwareVersion = GetConvertedValue ( OctoDataIndexes . FIRMWARE_VERSION ) . GetValueOrDefault ( 0 ) ;
3030
3131 // Initialize the 4 temperature sensors
3232 for ( int i = 0 ; i < 4 ; i ++ )
3333 {
34- _temperatures [ i ] = new Sensor ( $ "Temperature { i + 1 } ", i , SensorType . Temperature , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
34+ _temperatures [ i ] = new Sensor ( $ "Temperature { i + 1 } ", i , SensorType . Temperature , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
3535 ActivateSensor ( _temperatures [ i ] ) ;
3636 }
3737
3838 // Initialize the 8 fan speed sensors
3939 for ( int i = 0 ; i < 8 ; i ++ )
4040 {
41- _rpmSensors [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Fan , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
41+ _rpmSensors [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Fan , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
4242 ActivateSensor ( _rpmSensors [ i ] ) ;
4343 }
44-
44+
4545 // Initialize the input voltage sensor
4646 _voltages [ 0 ] = new Sensor ( "Input" , 0 , SensorType . Voltage , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
4747 ActivateSensor ( _voltages [ 0 ] ) ;
@@ -52,18 +52,18 @@ internal sealed class Octo : Hardware
5252 _voltages [ i ] = new Sensor ( $ "Fan { i } ", i , SensorType . Voltage , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
5353 ActivateSensor ( _voltages [ i ] ) ;
5454 }
55-
55+
5656 // Initialize the 8 fan current sensors
5757 for ( int i = 0 ; i < 8 ; i ++ )
5858 {
59- _currents [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Current , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
59+ _currents [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Current , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
6060 ActivateSensor ( _currents [ i ] ) ;
6161 }
62-
62+
6363 // Initialize the 8 fan power sensors
6464 for ( int i = 0 ; i < 8 ; i ++ )
6565 {
66- _powers [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Power , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
66+ _powers [ i ] = new Sensor ( $ "Fan { i + 1 } ", i , SensorType . Power , this , Array . Empty < ParameterDescription > ( ) , settings ) ;
6767 ActivateSensor ( _powers [ i ] ) ;
6868 }
6969 }
@@ -86,7 +86,7 @@ public override void Update()
8686 {
8787 //Reading output report instead of feature report, as the measurements are in the output report
8888 _stream . Read ( _rawData ) ;
89-
89+
9090 _temperatures [ 0 ] . Value = GetConvertedValue ( OctoDataIndexes . TEMP_1 ) / 100f ; // Temp 1
9191 _temperatures [ 1 ] . Value = GetConvertedValue ( OctoDataIndexes . TEMP_2 ) / 100f ; // Temp 2
9292 _temperatures [ 2 ] . Value = GetConvertedValue ( OctoDataIndexes . TEMP_3 ) / 100f ; // Temp 3
@@ -100,7 +100,7 @@ public override void Update()
100100 _rpmSensors [ 5 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_SPEED_6 ) ; // Fan 6 speed
101101 _rpmSensors [ 6 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_SPEED_7 ) ; // Fan 7 speed
102102 _rpmSensors [ 7 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_SPEED_8 ) ; // Fan 8 speed
103-
103+
104104 _voltages [ 0 ] . Value = GetConvertedValue ( OctoDataIndexes . VOLTAGE ) / 100f ; // Input voltage
105105 _voltages [ 1 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_VOLTAGE_1 ) / 100f ; // Fan 1 voltage
106106 _voltages [ 2 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_VOLTAGE_2 ) / 100f ; // Fan 2 voltage
@@ -110,7 +110,7 @@ public override void Update()
110110 _voltages [ 6 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_VOLTAGE_6 ) / 100f ; // Fan 6 voltage
111111 _voltages [ 7 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_VOLTAGE_7 ) / 100f ; // Fan 7 voltage
112112 _voltages [ 8 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_VOLTAGE_8 ) / 100f ; // Fan 8 voltage
113-
113+
114114 _currents [ 0 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_1 ) / 1000f ; // Fan 1 current
115115 _currents [ 1 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_2 ) / 1000f ; // Fan 2 current
116116 _currents [ 2 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_3 ) / 1000f ; // Fan 3 current
@@ -119,7 +119,7 @@ public override void Update()
119119 _currents [ 5 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_6 ) / 1000f ; // Fan 6 current
120120 _currents [ 6 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_7 ) / 1000f ; // Fan 7 current
121121 _currents [ 7 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_CURRENT_8 ) / 1000f ; // Fan 8 current
122-
122+
123123 _powers [ 0 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_POWER_1 ) / 100f ; // Fan 1 power
124124 _powers [ 1 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_POWER_2 ) / 100f ; // Fan 2 power
125125 _powers [ 2 ] . Value = GetConvertedValue ( OctoDataIndexes . FAN_POWER_3 ) / 100f ; // Fan 3 power
@@ -133,7 +133,7 @@ public override void Update()
133133 private sealed class OctoDataIndexes
134134 {
135135 public const int FIRMWARE_VERSION = 13 ;
136-
136+
137137 public const int TEMP_1 = 61 ;
138138 public const int TEMP_2 = 63 ;
139139 public const int TEMP_3 = 65 ;
@@ -147,7 +147,7 @@ private sealed class OctoDataIndexes
147147 public const int FAN_SPEED_6 = 198 ;
148148 public const int FAN_SPEED_7 = 211 ;
149149 public const int FAN_SPEED_8 = 224 ;
150-
150+
151151 public const int FAN_POWER_1 = 131 ;
152152 public const int FAN_POWER_2 = 144 ;
153153 public const int FAN_POWER_3 = 157 ;
@@ -166,7 +166,7 @@ private sealed class OctoDataIndexes
166166 public const int FAN_VOLTAGE_6 = 192 ;
167167 public const int FAN_VOLTAGE_7 = 205 ;
168168 public const int FAN_VOLTAGE_8 = 218 ;
169-
169+
170170 public const int FAN_CURRENT_1 = 129 ;
171171 public const int FAN_CURRENT_2 = 142 ;
172172 public const int FAN_CURRENT_3 = 155 ;
@@ -181,7 +181,7 @@ private sealed class OctoDataIndexes
181181 {
182182 if ( _rawData [ index ] == sbyte . MaxValue )
183183 return null ;
184-
184+
185185 return Convert . ToUInt16 ( _rawData [ index + 1 ] | ( _rawData [ index ] << 8 ) ) ;
186186 }
187- }
187+ }
0 commit comments