Skip to content

Commit

Permalink
v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lich426 committed Mar 12, 2023
1 parent c977ce2 commit a7d9cb6
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 139 deletions.
2 changes: 1 addition & 1 deletion FanCtrl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PublisherName>Lich</PublisherName>
<SuiteName>FanCtrl</SuiteName>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.5.9.0</ApplicationVersion>
<ApplicationVersion>1.6.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
[assembly: AssemblyVersion("1.5.9")]
[assembly: AssemblyFileVersion("1.5.9")]
[assembly: AssemblyInformationalVersion("1.5.9")]
[assembly: AssemblyVersion("1.6.0")]
[assembly: AssemblyFileVersion("1.6.0")]
[assembly: AssemblyInformationalVersion("1.6.0")]
Binary file modified dll/LibreHardwareMonitorLib.dll
Binary file not shown.
194 changes: 105 additions & 89 deletions src/UI/ControlForm.Designer.cs

Large diffs are not rendered by default.

69 changes: 30 additions & 39 deletions src/UI/ControlForm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using DarkUI.Config;
using DarkUI.Forms;
using FanCtrl.Resources;
using HidSharp;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
Expand All @@ -20,8 +21,8 @@ namespace FanCtrl
{
public partial class ControlForm : ThemeForm
{
private Size mLastSize = new Size(1124, 623);
private Size mNormalLastSize = new Size(1124, 623);
private Size mLastSize = new Size(1219, 796);
private Size mNormalLastSize = new Size(1219, 796);

private bool mIsUpdateGraph = true;
private bool mIsResize = false;
Expand Down Expand Up @@ -243,14 +244,15 @@ private void initControl()
mPerformanceRadioButton.Click += onRadioButtonClick;
mGameRadioButton.Click += onRadioButtonClick;

mTempComboBox.SelectedIndexChanged += onTempComboBoxIndexChanged;
//this.mAddTempListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Clickable;
mAddTempListView.Columns.Add("MyColumn", 260, HorizontalAlignment.Center);
mAddTempListView.SelectedIndexChanged += onAddTempListViewIndexChanged;

mTempComboBox.DropDownHeight = 500;
mFanComboBox.DropDownHeight = 500;
//this.mAddFanListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Clickable;
mAddFanListView.Columns.Add("MyColumn", 210, HorizontalAlignment.Center);

mFanListView.Columns.Add("MyColumn", -2, HorizontalAlignment.Center);
mFanListView.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent);
mFanListView.GridLines = true;
//this.mFanListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Clickable;
mFanListView.Columns.Add("MyColumn", 260, HorizontalAlignment.Center);
mFanListView.SelectedIndexChanged += onFanListViewIndexChanged;

mUnitComboBox.Items.Add("1");
Expand All @@ -270,23 +272,12 @@ private void initControl()

for (int i = 0; i < tempBaseList.Count; i++)
{
mTempComboBox.Items.Add(tempBaseList[i].Name);
mAddTempListView.Items.Add(tempBaseList[i].Name);
}

for (int i = 0; i < controlBaseList.Count; i++)
{
mFanComboBox.Items.Add(controlBaseList[i].Name);
}

if (mTempComboBox.Items.Count > 0)
{
mTempComboBox.SelectedIndex = 0;
mSelectedTempIndex = 0;
}

if (mFanComboBox.Items.Count > 0)
{
mFanComboBox.SelectedIndex = 0;
mAddFanListView.Items.Add(controlBaseList[i].Name);
}
}

Expand Down Expand Up @@ -459,11 +450,17 @@ private void onRadioButtonClick(object sender, EventArgs e)
mPerformanceRadioButton.Checked = (mModeType == MODE_TYPE.PERFORMANCE);
mGameRadioButton.Checked = (mModeType == MODE_TYPE.GAME);

this.onTempComboBoxIndexChanged(null, EventArgs.Empty);
this.onAddTempListViewIndexChanged(null, EventArgs.Empty);
}

private void onTempComboBoxIndexChanged(object sender, EventArgs e)
private void onAddTempListViewIndexChanged(object sender, EventArgs e)
{
if (mAddTempListView.SelectedItems.Count == 0)
{
Console.WriteLine("mAddTempListView.SelectedItems.Count : {0}", mAddTempListView.SelectedItems.Count);
return;
}

mPresetLabel.Visible = false;
mPresetLoadButton.Visible = false;
mPresetSaveButton.Visible = false;
Expand All @@ -481,14 +478,14 @@ private void onTempComboBoxIndexChanged(object sender, EventArgs e)
mSelectedFanData = null;

mListViewBaseControlList.Clear();
mFanListView.BeginUpdate();
mFanListView.Clear();
mFanListView.Items.Clear();

mSelectedTempIndex = mAddTempListView.SelectedItems[0].Index;
Console.WriteLine("mAddTempListView.SelectedItems[0].Index : {0}", mSelectedTempIndex);

mSelectedTempIndex = mTempComboBox.SelectedIndex;
var controlData = this.getControlData(mSelectedTempIndex);
if(controlData == null)
{
mFanListView.EndUpdate();
return;
}

Expand All @@ -507,7 +504,6 @@ private void onTempComboBoxIndexChanged(object sender, EventArgs e)
mListViewBaseControlList.Add(device);
mFanListView.Items.Add(device.Name);
}
mFanListView.EndUpdate();
}

private void onStepCheckBoxCheckedChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -607,9 +603,9 @@ private void setPoint(double y)

public void onUpdateTimer()
{
if (mTempComboBox.Items.Count == 0 ||
if (mAddTempListView.Items.Count == 0 ||
mSelectedTempIndex == -1 ||
mFanComboBox.Items.Count == 0 ||
mAddFanListView.Items.Count == 0 ||
mSelectedFanData == null ||
mNowPoint == null ||
mIsUpdateGraph == false)
Expand Down Expand Up @@ -826,12 +822,12 @@ private void onDelayTimeUpDownValueChanged(object sender, EventArgs e)

private void onAddButtonClick(object sender, EventArgs e)
{
if (mTempComboBox.Items.Count == 0 || mFanComboBox.Items.Count == 0)
if (mAddTempListView.SelectedItems.Count == 0 || mAddFanListView.SelectedItems.Count == 0)
return;

int modeIndex = (int)mModeType;
int tempIndex = mSelectedTempIndex;
int fanIndex = mFanComboBox.SelectedIndex;
int fanIndex = mAddFanListView.SelectedItems[0].Index;

var tempBaseList = HardwareManager.getInstance().TempBaseList;
var controlBaseList = HardwareManager.getInstance().ControlBaseList;
Expand All @@ -849,19 +845,16 @@ private void onAddButtonClick(object sender, EventArgs e)
mControlDataList[modeIndex].Add(controlData);
}

mFanListView.BeginUpdate();

var fanData = this.getFanData(tempIndex, controlDevice.ID);
if(fanData == null)
{
fanData = new FanData(controlDevice.ID, FanValueUnit.Size_5, true, 0, 0, 0);
controlData.FanDataList.Add(fanData);

mListViewBaseControlList.Add(controlDevice);
mFanListView.Items.Add(controlDevice.Name);
var item = mFanListView.Items.Add(controlDevice.Name);
item.SubItems.Add(controlDevice.Name);
}

mFanListView.EndUpdate();
}

private void onRemoveButtonClick(object sender, EventArgs e)
Expand All @@ -880,9 +873,7 @@ private void onRemoveButtonClick(object sender, EventArgs e)
controlData.FanDataList.RemoveAt(itemIndex);

mSelectedFanData = null;
mFanListView.BeginUpdate();
mFanListView.Items.Remove(item);
mFanListView.EndUpdate();
}

private void onPresetLoadButtonClick(object sender, EventArgs e)
Expand Down
6 changes: 0 additions & 6 deletions src/UI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/UI/Theme/ThemePanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace FanCtrl
{
Expand Down

0 comments on commit a7d9cb6

Please sign in to comment.