File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public DeviceTemp(SWIGTYPE_p__ctl_temp_handle_t handle)
1414 using ( var properties = new ctl_temp_properties_t ( ) )
1515 {
1616 CtlLibrary . ctlTemperatureGetProperties ( handle , properties ) ;
17- Name = properties . type . ToString ( ) ;
17+ Name = TypeToString ( properties . type ) ;
1818 }
1919
2020 _handle = handle ;
@@ -33,5 +33,20 @@ public void Dispose()
3333 {
3434 CtlLibrary . delete_double_Ptr ( doublePtr ) ;
3535 }
36+
37+ private static string TypeToString ( ctl_temp_sensors_t type )
38+ {
39+ return type switch
40+ {
41+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_GLOBAL => "Global" ,
42+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_GPU => "GPU" ,
43+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_MEMORY => "Memory" ,
44+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_GLOBAL_MIN => "Global Min" ,
45+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_GPU_MIN => "GPU Min" ,
46+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_MEMORY_MIN => "Memory Min" ,
47+ ctl_temp_sensors_t . CTL_TEMP_SENSORS_MAX => "Max" ,
48+ _ => throw new ArgumentOutOfRangeException ( nameof ( type ) , type , null )
49+ } ;
50+ }
3651 }
3752}
You can’t perform that action at this time.
0 commit comments