mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 22:05:08 +00:00
Added support for T-Balancer sensorhub and miniNG. Added a Flow sensor-type.
This commit is contained in:
@@ -58,6 +58,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
typeNodes.Add(new TypeNode(SensorType.Temperature));
|
||||
typeNodes.Add(new TypeNode(SensorType.Load));
|
||||
typeNodes.Add(new TypeNode(SensorType.Fan));
|
||||
typeNodes.Add(new TypeNode(SensorType.Flow));
|
||||
|
||||
foreach (ISensor sensor in hardware.Sensors)
|
||||
SensorAdded(sensor);
|
||||
|
35
GUI/MainForm.Designer.cs
generated
35
GUI/MainForm.Designer.cs
generated
@@ -108,6 +108,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.flowsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.columnsContextMenuStrip.SuspendLayout();
|
||||
this.menuStrip.SuspendLayout();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
@@ -339,9 +340,10 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.clocksMenuItem,
|
||||
this.tempMenuItem,
|
||||
this.loadMenuItem,
|
||||
this.fansMenuItem});
|
||||
this.fansMenuItem,
|
||||
this.flowsMenuItem});
|
||||
this.sensorsToolStripMenuItem.Name = "sensorsToolStripMenuItem";
|
||||
this.sensorsToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
|
||||
this.sensorsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.sensorsToolStripMenuItem.Text = "Sensors";
|
||||
//
|
||||
// voltMenuItem
|
||||
@@ -350,7 +352,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.voltMenuItem.CheckOnClick = true;
|
||||
this.voltMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.voltMenuItem.Name = "voltMenuItem";
|
||||
this.voltMenuItem.Size = new System.Drawing.Size(147, 22);
|
||||
this.voltMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.voltMenuItem.Text = "Voltages";
|
||||
this.voltMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
@@ -360,7 +362,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.clocksMenuItem.CheckOnClick = true;
|
||||
this.clocksMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.clocksMenuItem.Name = "clocksMenuItem";
|
||||
this.clocksMenuItem.Size = new System.Drawing.Size(147, 22);
|
||||
this.clocksMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.clocksMenuItem.Text = "Clocks";
|
||||
this.clocksMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
@@ -370,7 +372,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.tempMenuItem.CheckOnClick = true;
|
||||
this.tempMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.tempMenuItem.Name = "tempMenuItem";
|
||||
this.tempMenuItem.Size = new System.Drawing.Size(147, 22);
|
||||
this.tempMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.tempMenuItem.Text = "Temperatures";
|
||||
this.tempMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
@@ -380,7 +382,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.loadMenuItem.CheckOnClick = true;
|
||||
this.loadMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.loadMenuItem.Name = "loadMenuItem";
|
||||
this.loadMenuItem.Size = new System.Drawing.Size(147, 22);
|
||||
this.loadMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.loadMenuItem.Text = "Load";
|
||||
this.loadMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
@@ -390,14 +392,14 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.fansMenuItem.CheckOnClick = true;
|
||||
this.fansMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.fansMenuItem.Name = "fansMenuItem";
|
||||
this.fansMenuItem.Size = new System.Drawing.Size(147, 22);
|
||||
this.fansMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.fansMenuItem.Text = "Fans";
|
||||
this.fansMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(111, 6);
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// plotMenuItem
|
||||
//
|
||||
@@ -405,7 +407,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.plotMenuItem.CheckOnClick = true;
|
||||
this.plotMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.plotMenuItem.Name = "plotMenuItem";
|
||||
this.plotMenuItem.Size = new System.Drawing.Size(114, 22);
|
||||
this.plotMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.plotMenuItem.Text = "Plot";
|
||||
this.plotMenuItem.CheckedChanged += new System.EventHandler(this.plotToolStripMenuItem_CheckedChanged);
|
||||
//
|
||||
@@ -420,10 +422,10 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.optionsToolStripMenuItem.Text = "Options";
|
||||
//
|
||||
// startMinimizedMenuItem
|
||||
// startMinMenuItem
|
||||
//
|
||||
this.startMinMenuItem.CheckOnClick = true;
|
||||
this.startMinMenuItem.Name = "startMinimizedMenuItem";
|
||||
this.startMinMenuItem.Name = "startMinMenuItem";
|
||||
this.startMinMenuItem.Size = new System.Drawing.Size(166, 22);
|
||||
this.startMinMenuItem.Text = "Start Minimized";
|
||||
//
|
||||
@@ -533,6 +535,16 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.sensorContextMenuStrip.Name = "sensorContextMenuStrip";
|
||||
this.sensorContextMenuStrip.Size = new System.Drawing.Size(61, 4);
|
||||
//
|
||||
// flowsMenuItem
|
||||
//
|
||||
this.flowsMenuItem.Checked = true;
|
||||
this.flowsMenuItem.CheckOnClick = true;
|
||||
this.flowsMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.flowsMenuItem.Name = "flowsMenuItem";
|
||||
this.flowsMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.flowsMenuItem.Text = "Flows";
|
||||
this.flowsMenuItem.CheckedChanged += new System.EventHandler(this.UpdateSensorTypeChecked);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@@ -607,6 +619,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||
private System.Windows.Forms.ContextMenuStrip sensorContextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem startMinMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem flowsMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -143,6 +143,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
loadMenuItem.Checked = Config.Get(loadMenuItem.Name, true);
|
||||
tempMenuItem.Checked = Config.Get(tempMenuItem.Name, true);
|
||||
fansMenuItem.Checked = Config.Get(fansMenuItem.Name, true);
|
||||
flowsMenuItem.Checked = Config.Get(flowsMenuItem.Name, true);
|
||||
|
||||
timer.Enabled = true;
|
||||
|
||||
@@ -259,6 +260,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
Config.Set(loadMenuItem.Name, loadMenuItem.Checked);
|
||||
Config.Set(tempMenuItem.Name, tempMenuItem.Checked);
|
||||
Config.Set(fansMenuItem.Name, fansMenuItem.Checked);
|
||||
Config.Set(flowsMenuItem.Name, flowsMenuItem.Checked);
|
||||
|
||||
if (WindowState != FormWindowState.Minimized) {
|
||||
Config.Set("mainForm.Location.X", Location.X);
|
||||
@@ -355,6 +357,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
node.SetVisible(SensorType.Load, loadMenuItem.Checked);
|
||||
node.SetVisible(SensorType.Temperature, tempMenuItem.Checked);
|
||||
node.SetVisible(SensorType.Fan, fansMenuItem.Checked);
|
||||
node.SetVisible(SensorType.Flow, flowsMenuItem.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,6 +62,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
case SensorType.Load: format = "{0:F1} %"; break;
|
||||
case SensorType.Temperature: format = "{0:F1} °C"; break;
|
||||
case SensorType.Fan: format = "{0:F0} RPM"; break;
|
||||
case SensorType.Flow: format = "{0:F0} L/h"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -152,6 +152,8 @@ namespace OpenHardwareMonitor.GUI {
|
||||
return string.Format("{0:F0}", sensor.Value);
|
||||
case SensorType.Fan:
|
||||
return string.Format("{0:F11}", 1e-3f * sensor.Value);
|
||||
case SensorType.Flow:
|
||||
return string.Format("{0:F11}", 1e-3f * sensor.Value);
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
@@ -224,6 +226,7 @@ namespace OpenHardwareMonitor.GUI {
|
||||
case SensorType.Load: format = "{0}\n{1}: {2:F1} %"; break;
|
||||
case SensorType.Temperature: format = "{0}\n{1}: {2:F1} °C"; break;
|
||||
case SensorType.Fan: format = "{0}\n{1}: {2:F0} RPM"; break;
|
||||
case SensorType.Flow: format = "{0}\n{1}: {2:F0} L/h"; break;
|
||||
}
|
||||
|
||||
notifyIcon.Text = string.Format(format, sensor.Hardware.Name, sensor.Name,
|
||||
|
@@ -70,6 +70,10 @@ namespace OpenHardwareMonitor.GUI {
|
||||
this.Image = Utilities.EmbeddedResources.GetImage("fan.png");
|
||||
this.Text = "Fans";
|
||||
break;
|
||||
case SensorType.Flow:
|
||||
this.Image = Utilities.EmbeddedResources.GetImage("flow.png");
|
||||
this.Text = "Flows";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,8 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
Clock,
|
||||
Temperature,
|
||||
Load,
|
||||
Fan
|
||||
Fan,
|
||||
Flow
|
||||
}
|
||||
|
||||
public interface ISensorEntry {
|
||||
|
@@ -46,36 +46,67 @@ using System.Text;
|
||||
namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
public class TBalancer : IHardware {
|
||||
|
||||
private string portName;
|
||||
private Image icon;
|
||||
private SerialPort serialPort;
|
||||
private byte protocolVersion;
|
||||
private Sensor[] digitalTemperatures = new Sensor[8];
|
||||
private Sensor[] analogTemperatures = new Sensor[4];
|
||||
private Sensor[] sensorhubTemperatures = new Sensor[6];
|
||||
private Sensor[] sensorhubFlows = new Sensor[2];
|
||||
private Sensor[] fans = new Sensor[4];
|
||||
private Sensor[] miniNGTemperatures = new Sensor[4];
|
||||
private Sensor[] miniNGFans = new Sensor[4];
|
||||
private List<ISensor> active = new List<ISensor>();
|
||||
private List<ISensor> deactivating = new List<ISensor>();
|
||||
private int[] data;
|
||||
private int[] primaryData = new int[0];
|
||||
private int[] alternativeData = new int[0];
|
||||
|
||||
public const byte STARTFLAG = 100;
|
||||
public const byte ENDFLAG = 254;
|
||||
|
||||
private delegate void MethodDelegate();
|
||||
private MethodDelegate alternativeRequest;
|
||||
|
||||
public TBalancer(string portName, byte protocolVersion) {
|
||||
icon = Utilities.EmbeddedResources.GetImage("bigng.png");
|
||||
this.portName = portName;
|
||||
this.icon = Utilities.EmbeddedResources.GetImage("bigng.png");
|
||||
this.protocolVersion = protocolVersion;
|
||||
|
||||
int offset = 0;
|
||||
for (int i = 0; i < digitalTemperatures.Length; i++)
|
||||
digitalTemperatures[i] = new Sensor("Digital Sensor #" + (i + 1),
|
||||
offset + i, SensorType.Temperature, this);
|
||||
offset += digitalTemperatures.Length;
|
||||
|
||||
for (int i = 0; i < analogTemperatures.Length; i++)
|
||||
analogTemperatures[i] = new Sensor("Analog Sensor #" + (i + 1),
|
||||
offset + i, SensorType.Temperature, this);
|
||||
offset += analogTemperatures.Length;
|
||||
|
||||
for (int i = 0; i < sensorhubTemperatures.Length; i++)
|
||||
sensorhubTemperatures[i] = new Sensor("Sensorhub Sensor #" + (i + 1),
|
||||
offset + i, SensorType.Temperature, this);
|
||||
offset += sensorhubTemperatures.Length;
|
||||
|
||||
for (int i = 0; i < sensorhubFlows.Length; i++)
|
||||
sensorhubFlows[i] = new Sensor("Flowmeter #" + (i + 1),
|
||||
offset + i, SensorType.Flow, this);
|
||||
offset += sensorhubFlows.Length;
|
||||
|
||||
for (int i = 0; i < miniNGTemperatures.Length; i++)
|
||||
miniNGTemperatures[i] = new Sensor("miniNG #" + (i / 2 + 1) +
|
||||
" Sensor #" + (i % 2 + 1), offset + i, SensorType.Temperature, this);
|
||||
offset += miniNGTemperatures.Length;
|
||||
|
||||
alternativeRequest = new MethodDelegate(DelayedAlternativeRequest);
|
||||
|
||||
try {
|
||||
serialPort = new SerialPort(portName, 19200, Parity.None, 8,
|
||||
StopBits.One);
|
||||
serialPort.Open();
|
||||
Update();
|
||||
} catch (IOException) { }
|
||||
|
||||
for (int i = 0; i < digitalTemperatures.Length; i++)
|
||||
digitalTemperatures[i] = new Sensor("Digital Sensor #" + (i + 1), i,
|
||||
SensorType.Temperature, this);
|
||||
|
||||
for (int i = 0; i < analogTemperatures.Length; i++)
|
||||
analogTemperatures[i] = new Sensor("Analog Sensor #" + (i + 1),
|
||||
i + digitalTemperatures.Length, SensorType.Temperature, this);
|
||||
} catch (IOException) { }
|
||||
}
|
||||
|
||||
private void ActivateSensor(Sensor sensor) {
|
||||
@@ -98,46 +129,110 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadminiNG(int[] data, int number) {
|
||||
int offset = 1 + number * 65;
|
||||
|
||||
if (data[offset + 61] != ENDFLAG)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Sensor sensor = miniNGTemperatures[number * 2 + i];
|
||||
if (data[offset + 7 + i] > 0) {
|
||||
sensor.Value = 0.5f * data[offset + 7 + i];
|
||||
ActivateSensor(sensor);
|
||||
} else {
|
||||
DeactivateSensor(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
float maxRPM = 20.0f * data[offset + 44 + 2 * i];
|
||||
|
||||
if (miniNGFans[number * 2 + i] == null)
|
||||
miniNGFans[number * 2 + i] =
|
||||
new Sensor("miniNG #" + (number + 1) + " Fan #" + (i + 1),
|
||||
4 + number * 2 + i, maxRPM, SensorType.Fan, this);
|
||||
|
||||
Sensor sensor = miniNGFans[number * 2 + i];
|
||||
|
||||
sensor.Value = 20.0f * data[offset + 43 + 2 * i];
|
||||
ActivateSensor(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadData() {
|
||||
int[] data = new int[285];
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
data[i] = serialPort.ReadByte();
|
||||
|
||||
if (data[0] != STARTFLAG || data[274] != protocolVersion) {
|
||||
if (data[0] != STARTFLAG) {
|
||||
serialPort.DiscardInBuffer();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < digitalTemperatures.Length; i++)
|
||||
if (data[238 + i] > 0) {
|
||||
digitalTemperatures[i].Value = 0.5f * data[238 + i];
|
||||
ActivateSensor(digitalTemperatures[i]);
|
||||
} else {
|
||||
DeactivateSensor(digitalTemperatures[i]);
|
||||
if (data[1] == 255) { // bigNG
|
||||
|
||||
if (data[274] != protocolVersion)
|
||||
return;
|
||||
|
||||
this.primaryData = data;
|
||||
|
||||
for (int i = 0; i < digitalTemperatures.Length; i++)
|
||||
if (data[238 + i] > 0) {
|
||||
digitalTemperatures[i].Value = 0.5f * data[238 + i];
|
||||
ActivateSensor(digitalTemperatures[i]);
|
||||
} else {
|
||||
DeactivateSensor(digitalTemperatures[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < analogTemperatures.Length; i++)
|
||||
if (data[260 + i] > 0) {
|
||||
analogTemperatures[i].Value = 0.5f * data[260 + i];
|
||||
ActivateSensor(analogTemperatures[i]);
|
||||
} else {
|
||||
DeactivateSensor(analogTemperatures[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < sensorhubTemperatures.Length; i++)
|
||||
if (data[246 + i] > 0) {
|
||||
sensorhubTemperatures[i].Value = 0.5f * data[246 + i];
|
||||
ActivateSensor(sensorhubTemperatures[i]);
|
||||
} else {
|
||||
DeactivateSensor(sensorhubTemperatures[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < sensorhubFlows.Length; i++)
|
||||
if (data[231 + i] > 0 && data[234] > 0) {
|
||||
float pulsesPerSecond = ((float)data[231 + i]) / data[234];
|
||||
const float pulsesPerLiter = 509;
|
||||
sensorhubFlows[i].Value = pulsesPerSecond * 3600 / pulsesPerLiter;
|
||||
ActivateSensor(sensorhubFlows[i]);
|
||||
} else {
|
||||
DeactivateSensor(sensorhubFlows[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < fans.Length; i++) {
|
||||
float maxRPM = 11.5f * ((data[149 + 2 * i] << 8) | data[148 + 2 * i]);
|
||||
|
||||
if (fans[i] == null)
|
||||
fans[i] = new Sensor("Fan #" + (i + 1), i, maxRPM, SensorType.Fan,
|
||||
this);
|
||||
|
||||
if ((data[136] & (1 << i)) == 0)
|
||||
fans[i].Value = maxRPM * 0.01f * data[156 + i]; // pwm mode
|
||||
else
|
||||
fans[i].Value = maxRPM * 0.01f * data[141 + i]; // analog mode
|
||||
ActivateSensor(fans[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < analogTemperatures.Length; i++)
|
||||
if (data[260 + i] > 0) {
|
||||
analogTemperatures[i].Value = 0.5f * data[260 + i];
|
||||
ActivateSensor(analogTemperatures[i]);
|
||||
} else {
|
||||
DeactivateSensor(analogTemperatures[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < fans.Length; i++) {
|
||||
float maxRPM = 11.5f * ((data[149 + 2 * i] << 8) | data[148 + 2 * i]);
|
||||
|
||||
if (fans[i] == null)
|
||||
fans[i] = new Sensor("Fan #" + (i + 1), i, maxRPM, SensorType.Fan,
|
||||
this);
|
||||
} else if (data[1] == 253) { // miniNG #1
|
||||
this.alternativeData = data;
|
||||
|
||||
if ((data[136] & (1 << i)) == 0)
|
||||
fans[i].Value = maxRPM * 0.01f * data[156 + i]; // pwm mode
|
||||
else
|
||||
fans[i].Value = maxRPM * 0.01f * data[141 + i]; // analog mode
|
||||
ActivateSensor(fans[i]);
|
||||
}
|
||||
this.data = data;
|
||||
ReadminiNG(data, 0);
|
||||
|
||||
if (data[66] == 252) // miniNG #2
|
||||
ReadminiNG(data, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Image Icon {
|
||||
@@ -150,7 +245,7 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
|
||||
public string Identifier {
|
||||
get { return "/bigng/" +
|
||||
serialPort.PortName.TrimStart(new char[]{'/'}).ToLower(); }
|
||||
this.portName.TrimStart(new char[]{'/'}).ToLower(); }
|
||||
}
|
||||
|
||||
public ISensor[] Sensors {
|
||||
@@ -164,31 +259,62 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
|
||||
r.AppendLine();
|
||||
r.Append("Port Name: "); r.AppendLine(serialPort.PortName);
|
||||
r.AppendLine();
|
||||
r.AppendLine("System Information Answer");
|
||||
r.AppendLine();
|
||||
|
||||
r.AppendLine("Primary System Information Answer");
|
||||
r.AppendLine();
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0x11; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X3")); r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
int index = ((i << 4) | j);
|
||||
if (index < data.Length) {
|
||||
if (index < primaryData.Length) {
|
||||
r.Append(" ");
|
||||
r.Append(data[index].ToString("X2"));
|
||||
r.Append(primaryData[index].ToString("X2"));
|
||||
}
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
r.AppendLine();
|
||||
|
||||
if (alternativeData.Length > 0) {
|
||||
r.AppendLine("Alternative System Information Answer");
|
||||
r.AppendLine();
|
||||
r.AppendLine(" 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F");
|
||||
r.AppendLine();
|
||||
for (int i = 0; i <= 0x11; i++) {
|
||||
r.Append(" "); r.Append((i << 4).ToString("X3")); r.Append(" ");
|
||||
for (int j = 0; j <= 0xF; j++) {
|
||||
int index = ((i << 4) | j);
|
||||
if (index < alternativeData.Length) {
|
||||
r.Append(" ");
|
||||
r.Append(alternativeData[index].ToString("X2"));
|
||||
}
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
r.AppendLine();
|
||||
}
|
||||
|
||||
return r.ToString();
|
||||
}
|
||||
|
||||
private void DelayedAlternativeRequest() {
|
||||
System.Threading.Thread.Sleep(500);
|
||||
try {
|
||||
if (serialPort.IsOpen)
|
||||
serialPort.Write(new byte[] { 0x37 }, 0, 1);
|
||||
} catch (Exception) { }
|
||||
}
|
||||
|
||||
public void Update() {
|
||||
while (serialPort.BytesToRead >= 285)
|
||||
ReadData();
|
||||
if (serialPort.BytesToRead == 1)
|
||||
serialPort.ReadByte();
|
||||
|
||||
serialPort.Write(new byte[] { 0x38 }, 0, 1);
|
||||
alternativeRequest.BeginInvoke(null, null);
|
||||
}
|
||||
|
||||
public void Close() {
|
||||
|
@@ -68,6 +68,7 @@
|
||||
<Compile Include="Hardware\HDD\HDD.cs" />
|
||||
<Compile Include="Hardware\HDD\HDDGroup.cs" />
|
||||
<Compile Include="Hardware\HDD\SMART.cs" />
|
||||
<Compile Include="Hardware\IParameter.cs" />
|
||||
<Compile Include="Hardware\LPC\Chip.cs" />
|
||||
<Compile Include="Hardware\LPC\F718XX.cs" />
|
||||
<Compile Include="Hardware\LPC\LPCHardware.cs" />
|
||||
@@ -153,6 +154,9 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\smallicon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\flow.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio AllowExistingFolder="true" />
|
||||
|
@@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.22.1")]
|
||||
[assembly: AssemblyFileVersion("0.1.22.1")]
|
||||
[assembly: AssemblyVersion("0.1.23.1")]
|
||||
[assembly: AssemblyFileVersion("0.1.23.1")]
|
||||
|
BIN
Resources/flow.png
Normal file
BIN
Resources/flow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 857 B |
Reference in New Issue
Block a user