diff --git a/PocketFanController.sln b/PocketFanController.sln
index 243be5d..3fee368 100644
--- a/PocketFanController.sln
+++ b/PocketFanController.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.3
+VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PocketFanController", "PocketFanController\PocketFanController.csproj", "{8623A908-1563-46EE-98E5-0539DF3ED417}"
EndProject
diff --git a/PocketFanController/AboutWindow.xaml b/PocketFanController/AboutWindow.xaml
new file mode 100644
index 0000000..72be426
--- /dev/null
+++ b/PocketFanController/AboutWindow.xaml
@@ -0,0 +1,248 @@
+
+
+ Pocket Fan Controller
+ Version 0.4.0
+ © 2017 Takafumi Miyake
+
+ Third-Party Software Usage and Licenses
+
+
+
+
+
diff --git a/PocketFanController/AboutWindow.xaml.cs b/PocketFanController/AboutWindow.xaml.cs
new file mode 100644
index 0000000..6ce48b3
--- /dev/null
+++ b/PocketFanController/AboutWindow.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace PocketFanController
+{
+ ///
+ /// AboutWindow.xaml の相互作用ロジック
+ ///
+ public partial class AboutWindow : Window
+ {
+ public AboutWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
+ }
+}
diff --git a/PocketFanController/MainWindow.xaml b/PocketFanController/MainWindow.xaml
index ee3f1e7..01af84e 100644
--- a/PocketFanController/MainWindow.xaml
+++ b/PocketFanController/MainWindow.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PocketFanController"
mc:Ignorable="d"
- Title="Pocket Fan Controller Ver. 0.3.0" Height="100" Width="352" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Icon="Icon.ico" ShowInTaskbar="False">
+ Title="Pocket Fan Controller" Height="100" Width="352" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Icon="Icon.ico" ShowInTaskbar="False" ScrollViewer.VerticalScrollBarVisibility="Disabled">
diff --git a/PocketFanController/Model.cs b/PocketFanController/Model.cs
index 908416e..40b2581 100644
--- a/PocketFanController/Model.cs
+++ b/PocketFanController/Model.cs
@@ -1,7 +1,10 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
+using System.Globalization;
using Microsoft.Win32;
+using OpenHardwareMonitor.Hardware;
namespace PocketFanController
{
@@ -122,5 +125,33 @@ public void RestartService()
};
cmd.Start();
}
+
+ public string GetCpuTemp()
+ {
+ var computer = new Computer
+ {
+ MainboardEnabled = false,
+ CPUEnabled = true,
+ RAMEnabled = false,
+ GPUEnabled = false,
+ FanControllerEnabled = false,
+ HDDEnabled = false
+ };
+
+ computer.Open();
+
+ var temps = new List();
+
+ foreach (var item in computer.Hardware)
+ {
+ if (item.HardwareType != HardwareType.CPU) continue;
+ item.Update();
+ temps.AddRange(from sensor in item.Sensors where sensor.SensorType == SensorType.Temperature where sensor.Value != null select sensor.Value.Value.ToString(CultureInfo.CurrentCulture));
+ }
+
+ //最初に取得できるのが、現在の温度。
+ return temps[0];
+ }
+
}
}
\ No newline at end of file
diff --git a/PocketFanController/NotifyIconWrapper.Designer.cs b/PocketFanController/NotifyIconWrapper.Designer.cs
index f9240d5..e44f73a 100644
--- a/PocketFanController/NotifyIconWrapper.Designer.cs
+++ b/PocketFanController/NotifyIconWrapper.Designer.cs
@@ -32,15 +32,18 @@ private void InitializeComponent()
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotifyIconWrapper));
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.toolStripMenuItem_CpuTemp = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem_OpenWindow = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
- this.toolStripMenuItem_Exit = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem_SetDefault = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_SetFastest = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem_SetFast = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_SetSlow = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_SetSlowest = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripMenuItem_SetDefault = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripMenuItem_Exit = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem_OpenAbout = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1.SuspendLayout();
//
// notifyIcon1
@@ -54,7 +57,10 @@ private void InitializeComponent()
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripMenuItem_CpuTemp,
+ this.toolStripSeparator3,
this.toolStripMenuItem_OpenWindow,
+ this.toolStripMenuItem_OpenAbout,
this.toolStripSeparator1,
this.toolStripMenuItem_SetDefault,
this.toolStripMenuItem_SetFastest,
@@ -64,59 +70,75 @@ private void InitializeComponent()
this.toolStripSeparator2,
this.toolStripMenuItem_Exit});
this.contextMenuStrip1.Name = "contextMenuStrip1";
- this.contextMenuStrip1.Size = new System.Drawing.Size(174, 184);
+ this.contextMenuStrip1.Size = new System.Drawing.Size(212, 292);
+ //
+ // toolStripMenuItem_CpuTemp
+ //
+ this.toolStripMenuItem_CpuTemp.Name = "toolStripMenuItem_CpuTemp";
+ this.toolStripMenuItem_CpuTemp.Size = new System.Drawing.Size(211, 30);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(208, 6);
//
// toolStripMenuItem_OpenWindow
//
this.toolStripMenuItem_OpenWindow.Name = "toolStripMenuItem_OpenWindow";
- this.toolStripMenuItem_OpenWindow.Size = new System.Drawing.Size(173, 24);
- this.toolStripMenuItem_OpenWindow.Text = "Open Window";
+ this.toolStripMenuItem_OpenWindow.Size = new System.Drawing.Size(211, 30);
+ this.toolStripMenuItem_OpenWindow.Text = "Show Controller";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(170, 6);
+ this.toolStripSeparator1.Size = new System.Drawing.Size(208, 6);
//
- // toolStripMenuItem_Exit
+ // toolStripMenuItem_SetDefault
//
- this.toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit";
- this.toolStripMenuItem_Exit.Size = new System.Drawing.Size(173, 24);
- this.toolStripMenuItem_Exit.Text = "Exit";
+ this.toolStripMenuItem_SetDefault.Name = "toolStripMenuItem_SetDefault";
+ this.toolStripMenuItem_SetDefault.Size = new System.Drawing.Size(211, 30);
+ this.toolStripMenuItem_SetDefault.Text = "Auto(Default)";
//
// toolStripMenuItem_SetFastest
//
this.toolStripMenuItem_SetFastest.Name = "toolStripMenuItem_SetFastest";
- this.toolStripMenuItem_SetFastest.Size = new System.Drawing.Size(173, 24);
+ this.toolStripMenuItem_SetFastest.Size = new System.Drawing.Size(211, 30);
this.toolStripMenuItem_SetFastest.Text = "Fastest";
//
- // toolStripSeparator2
- //
- this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(170, 6);
- //
// toolStripMenuItem_SetFast
//
this.toolStripMenuItem_SetFast.Name = "toolStripMenuItem_SetFast";
- this.toolStripMenuItem_SetFast.Size = new System.Drawing.Size(173, 24);
+ this.toolStripMenuItem_SetFast.Size = new System.Drawing.Size(211, 30);
this.toolStripMenuItem_SetFast.Text = "Fast";
//
// toolStripMenuItem_SetSlow
//
this.toolStripMenuItem_SetSlow.Name = "toolStripMenuItem_SetSlow";
- this.toolStripMenuItem_SetSlow.Size = new System.Drawing.Size(173, 24);
+ this.toolStripMenuItem_SetSlow.Size = new System.Drawing.Size(211, 30);
this.toolStripMenuItem_SetSlow.Text = "Slow";
//
// toolStripMenuItem_SetSlowest
//
this.toolStripMenuItem_SetSlowest.Name = "toolStripMenuItem_SetSlowest";
- this.toolStripMenuItem_SetSlowest.Size = new System.Drawing.Size(173, 24);
+ this.toolStripMenuItem_SetSlowest.Size = new System.Drawing.Size(211, 30);
this.toolStripMenuItem_SetSlowest.Text = "Slowest";
//
- // toolStripMenuItem_SetDefault
+ // toolStripSeparator2
//
- this.toolStripMenuItem_SetDefault.Name = "toolStripMenuItem_SetDefault";
- this.toolStripMenuItem_SetDefault.Size = new System.Drawing.Size(173, 24);
- this.toolStripMenuItem_SetDefault.Text = "Auto(Default)";
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(208, 6);
+ //
+ // toolStripMenuItem_Exit
+ //
+ this.toolStripMenuItem_Exit.Name = "toolStripMenuItem_Exit";
+ this.toolStripMenuItem_Exit.Size = new System.Drawing.Size(211, 30);
+ this.toolStripMenuItem_Exit.Text = "Exit";
+ //
+ // toolStripMenuItem_OpenAbout
+ //
+ this.toolStripMenuItem_OpenAbout.Name = "toolStripMenuItem_OpenAbout";
+ this.toolStripMenuItem_OpenAbout.Size = new System.Drawing.Size(211, 30);
+ this.toolStripMenuItem_OpenAbout.Text = "Show About";
this.contextMenuStrip1.ResumeLayout(false);
}
@@ -134,5 +156,8 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_SetSlow;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_SetSlowest;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_CpuTemp;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_OpenAbout;
}
}
diff --git a/PocketFanController/NotifyIconWrapper.cs b/PocketFanController/NotifyIconWrapper.cs
index 60d2633..564b1d8 100644
--- a/PocketFanController/NotifyIconWrapper.cs
+++ b/PocketFanController/NotifyIconWrapper.cs
@@ -14,6 +14,7 @@ public NotifyIconWrapper()
toolStripMenuItem_Exit.Click += Exit;
toolStripMenuItem_OpenWindow.Click += OpenWindow;
+ toolStripMenuItem_OpenAbout.Click += OpenAbout;
toolStripMenuItem_SetDefault.Click += SetDefault;
toolStripMenuItem_SetFastest.Click += SetFastest;
@@ -69,8 +70,16 @@ private void OpenWindow(object sender, EventArgs e)
mainWindow.Show();
}
+ private void OpenAbout(object sender, EventArgs e)
+ {
+ var aboutWindow = new AboutWindow();
+ aboutWindow.Show();
+ }
+
private void UpdateCurrentStatus(object sender, EventArgs e)
{
+ toolStripMenuItem_CpuTemp.Text = "CPU " + Model.GetCpuTemp() + "℃";
+
Model.GetCurrentStatus();
switch (Model.CurrentState)
diff --git a/PocketFanController/NotifyIconWrapper.resx b/PocketFanController/NotifyIconWrapper.resx
index 7d104d1..d2ca1e1 100644
--- a/PocketFanController/NotifyIconWrapper.resx
+++ b/PocketFanController/NotifyIconWrapper.resx
@@ -118,7 +118,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- 17, 60
+ 17, 65
170, 17
diff --git a/PocketFanController/OpenHardwareMonitorLib.dll b/PocketFanController/OpenHardwareMonitorLib.dll
new file mode 100644
index 0000000..e059e78
Binary files /dev/null and b/PocketFanController/OpenHardwareMonitorLib.dll differ
diff --git a/PocketFanController/PocketFanController.csproj b/PocketFanController/PocketFanController.csproj
index c5e5865..6da85ba 100644
--- a/PocketFanController/PocketFanController.csproj
+++ b/PocketFanController/PocketFanController.csproj
@@ -40,6 +40,9 @@
Icon.ico
+
+ .\OpenHardwareMonitorLib.dll
+
@@ -63,6 +66,9 @@
MSBuild:Compile
Designer
+
+ AboutWindow.xaml
+
Component
@@ -72,6 +78,10 @@
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
diff --git a/PocketFanController/Properties/AssemblyInfo.cs b/PocketFanController/Properties/AssemblyInfo.cs
index 58a2ced..ae29543 100644
--- a/PocketFanController/Properties/AssemblyInfo.cs
+++ b/PocketFanController/Properties/AssemblyInfo.cs
@@ -51,7 +51,7 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.0.0")]
-[assembly: AssemblyFileVersion("0.3.0.0")]
+[assembly: AssemblyVersion("0.4.0.0")]
+[assembly: AssemblyFileVersion("0.4.0.0")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Screenshot.png b/Screenshot.png
index bbc8187..a163a7b 100644
Binary files a/Screenshot.png and b/Screenshot.png differ
diff --git a/Screenshot2.png b/Screenshot2.png
index a66a4ce..b9a2e5b 100644
Binary files a/Screenshot2.png and b/Screenshot2.png differ