Skip to content

Commit

Permalink
v1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
lich426 committed May 2, 2020
1 parent 2f96201 commit ca5f9bb
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 115 deletions.
115 changes: 58 additions & 57 deletions FanControl/Hardware/LHMManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,25 @@ public void createFan(ref List<BaseSensor> fanList)
var sensorArray = hardwareArray[i].Sensors;
for (int j = 0; j < sensorArray.Length; j++)
{
if (sensorArray[j].SensorType != LibreHardwareMonitor.Hardware.SensorType.Fan)
continue;

if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var fan = new HardwareFanSpeed(sensorArray[j], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
if (sensorArray[j].SensorType == LibreHardwareMonitor.Hardware.SensorType.Fan)
{
string name = sensorArray[j].Name;
if (this.isExistFan(ref fanList, name) == true)
if (hardwareArray[i].HardwareType == HardwareType.SuperIO ||
sensorArray[j].SensorType == LibreHardwareMonitor.Hardware.SensorType.Fan)
{
name = name + " #" + otherFanNum++;
var fan = new HardwareFanSpeed(sensorArray[j], "Fan #" + fanNum++);
fanList.Add(fan);
}
var fan = new HardwareFanSpeed(sensorArray[j], name);
fanList.Add(fan);
}
else
{
string name = sensorArray[j].Name;
if (this.isExistFan(ref fanList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var fan = new HardwareFanSpeed(sensorArray[j], name);
fanList.Add(fan);
}
}
}

var subHardwareArray = hardwareArray[i].SubHardware;
Expand All @@ -177,23 +178,23 @@ public void createFan(ref List<BaseSensor> fanList)
var subSensorArray = subHardwareArray[j].Sensors;
for (int k = 0; k < subSensorArray.Length; k++)
{
if (subSensorArray[k].SensorType != LibreHardwareMonitor.Hardware.SensorType.Fan)
continue;

if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
var fan = new HardwareFanSpeed(subSensorArray[k], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
if (subSensorArray[k].SensorType == LibreHardwareMonitor.Hardware.SensorType.Fan)
{
string name = subSensorArray[k].Name;
if (this.isExistFan(ref fanList, name) == true)
if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
name = name + " #" + otherFanNum++;
var fan = new HardwareFanSpeed(subSensorArray[k], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
{
string name = subSensorArray[k].Name;
if (this.isExistFan(ref fanList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var fan = new HardwareFanSpeed(subSensorArray[k], name);
fanList.Add(fan);
}
var fan = new HardwareFanSpeed(subSensorArray[k], name);
fanList.Add(fan);
}
}
}
Expand Down Expand Up @@ -238,23 +239,23 @@ public void createControl(ref List<BaseControl> controlList)
var sensorArray = hardwareArray[i].Sensors;
for (int j = 0; j < sensorArray.Length; j++)
{
if (sensorArray[j].SensorType != LibreHardwareMonitor.Hardware.SensorType.Control || sensorArray[j].Control == null)
continue;

if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(sensorArray[j], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
if (sensorArray[j].SensorType == LibreHardwareMonitor.Hardware.SensorType.Control)
{
string name = sensorArray[j].Name;
if (this.isExistControl(ref controlList, name) == true)
if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(sensorArray[j], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
{
name = name + " #" + otherFanNum++;
string name = sensorArray[j].Name;
if (this.isExistControl(ref controlList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var control = new HardwareControl(sensorArray[j], name);
controlList.Add(control);
}
var control = new HardwareControl(sensorArray[j], name);
controlList.Add(control);
}
}

Expand All @@ -264,23 +265,23 @@ public void createControl(ref List<BaseControl> controlList)
var subSensorList = subHardwareArray[j].Sensors;
for (int k = 0; k < subSensorList.Length; k++)
{
if (subSensorList[k].SensorType != LibreHardwareMonitor.Hardware.SensorType.Control || subSensorList[k].Control == null)
continue;

if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(subSensorList[k], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
if (subSensorList[k].SensorType == LibreHardwareMonitor.Hardware.SensorType.Control)
{
string name = subSensorList[k].Name;
if (this.isExistControl(ref controlList, name) == true)
if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
name = name + " #" + otherFanNum++;
var control = new HardwareControl(subSensorList[k], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
{
string name = subSensorList[k].Name;
if (this.isExistControl(ref controlList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var control = new HardwareControl(subSensorList[k], name);
controlList.Add(control);
}
var control = new HardwareControl(subSensorList[k], name);
controlList.Add(control);
}
}
}
Expand Down
115 changes: 57 additions & 58 deletions FanControl/Hardware/OHMManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,24 @@ public void createFan(ref List<BaseSensor> fanList)
var sensorArray = hardwareArray[i].Sensors;
for (int j = 0; j < sensorArray.Length; j++)
{
if (sensorArray[j].SensorType != OpenHardwareMonitor.Hardware.SensorType.Fan)
continue;

if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var fan = new HardwareFanSpeed(sensorArray[j], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
if (sensorArray[j].SensorType == OpenHardwareMonitor.Hardware.SensorType.Fan)
{
string name = sensorArray[j].Name;
if (this.isExistFan(ref fanList, name) == true)
if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
name = name + " #" + otherFanNum++;
var fan = new HardwareFanSpeed(sensorArray[j], "Fan #" + fanNum++);
fanList.Add(fan);
}
var fan = new HardwareFanSpeed(sensorArray[j], name);
fanList.Add(fan);
}
else
{
string name = sensorArray[j].Name;
if (this.isExistFan(ref fanList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var fan = new HardwareFanSpeed(sensorArray[j], name);
fanList.Add(fan);
}
}
}

var subHardwareArray = hardwareArray[i].SubHardware;
Expand All @@ -177,23 +177,23 @@ public void createFan(ref List<BaseSensor> fanList)
var subSensorArray = subHardwareArray[j].Sensors;
for (int k = 0; k < subSensorArray.Length; k++)
{
if (subSensorArray[k].SensorType != OpenHardwareMonitor.Hardware.SensorType.Fan)
continue;

if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
var fan = new HardwareFanSpeed(subSensorArray[k], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
if (subSensorArray[k].SensorType == OpenHardwareMonitor.Hardware.SensorType.Fan)
{
string name = subSensorArray[k].Name;
if (this.isExistFan(ref fanList, name) == true)
if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
name = name + " #" + otherFanNum++;
var fan = new HardwareFanSpeed(subSensorArray[k], "Fan #" + fanNum++);
fanList.Add(fan);
}
else
{
string name = subSensorArray[k].Name;
if (this.isExistFan(ref fanList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var fan = new HardwareFanSpeed(subSensorArray[k], name);
fanList.Add(fan);
}
var fan = new HardwareFanSpeed(subSensorArray[k], name);
fanList.Add(fan);
}
}
}
Expand Down Expand Up @@ -238,50 +238,49 @@ public void createControl(ref List<BaseControl> controlList)
var sensorArray = hardwareArray[i].Sensors;
for (int j = 0; j < sensorArray.Length; j++)
{
if (sensorArray[j].SensorType != OpenHardwareMonitor.Hardware.SensorType.Control || sensorArray[j].Control == null)
continue;

if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(sensorArray[j], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
if (sensorArray[j].SensorType == OpenHardwareMonitor.Hardware.SensorType.Control)
{
string name = sensorArray[j].Name;
if (this.isExistControl(ref controlList, name) == true)
if (hardwareArray[i].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(sensorArray[j], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
{
name = name + " #" + otherFanNum++;
string name = sensorArray[j].Name;
if (this.isExistControl(ref controlList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var control = new HardwareControl(sensorArray[j], name);
controlList.Add(control);
}
var control = new HardwareControl(sensorArray[j], name);
controlList.Add(control);
}
}

var subHardwareArray = hardwareArray[i].SubHardware;
for (int j = 0; j < subHardwareArray.Length; j++)
{
bool isExist2 = false;
var subSensorList = subHardwareArray[j].Sensors;
for (int k = 0; k < subSensorList.Length; k++)
{
if (subSensorList[k].SensorType != OpenHardwareMonitor.Hardware.SensorType.Control || subSensorList[k].Control == null)
continue;

if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
var control = new HardwareControl(subSensorList[k], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
if (subSensorList[k].SensorType == OpenHardwareMonitor.Hardware.SensorType.Control)
{
string name = subSensorList[k].Name;
if (this.isExistControl(ref controlList, name) == true)
if (subHardwareArray[j].HardwareType == HardwareType.SuperIO)
{
name = name + " #" + otherFanNum++;
var control = new HardwareControl(subSensorList[k], "Fan Control #" + fanNum++);
controlList.Add(control);
}
else
{
string name = subSensorList[k].Name;
if (this.isExistControl(ref controlList, name) == true)
{
name = name + " #" + otherFanNum++;
}
var control = new HardwareControl(subSensorList[k], name);
controlList.Add(control);
}
var control = new HardwareControl(subSensorList[k], name);
controlList.Add(control);
}
}
}
Expand Down
Binary file modified Portable/FanControl_v1.0.8.zip
Binary file not shown.

0 comments on commit ca5f9bb

Please sign in to comment.