# HG changeset patch
# User moel.mich
# Date 1284576195 0
# Node ID 010d719f9245bc1843541e2de11cc620726525a0
# Parent  edb59f3745e8d92e1e1feaaf25e2e4b95829b367
Added a check to verify the FTDI chip ID before opening the T-Balancer port.

diff -r edb59f3745e8 -r 010d719f9245 GUI/SensorGadget.cs
--- a/GUI/SensorGadget.cs	Tue Sep 14 19:23:11 2010 +0000
+++ b/GUI/SensorGadget.cs	Wed Sep 15 18:43:15 2010 +0000
@@ -339,7 +339,7 @@
         y += pair.Value.Count * sensorLineHeight;
       }
       y += bottomMargin;
-      y = Math.Max(y, topBorder + bottomBorder + 10);
+      y = Math.Max(y, topBorder + hardwareLineHeight + bottomBorder);
       this.Size = new Size(width, y);
     }
 
@@ -399,6 +399,13 @@
 
       int x;
       int y = topMargin;
+
+      if (sensors.Count == 0) {
+        x = leftBorder + 1;
+        g.DrawString("Add a sensor ...", smallFont, Brushes.White,
+          new Rectangle(x, y - 1, w - rightBorder - x, 0));
+      }
+
       foreach (KeyValuePair<IHardware, IList<ISensor>> pair in sensors) {
         if (hardwareNames.Value) {
           if (y > topMargin)
diff -r edb59f3745e8 -r 010d719f9245 Hardware/TBalancer/FTD2XX.cs
--- a/Hardware/TBalancer/FTD2XX.cs	Tue Sep 14 19:23:11 2010 +0000
+++ b/Hardware/TBalancer/FTD2XX.cs	Wed Sep 15 18:43:15 2010 +0000
@@ -41,11 +41,11 @@
 namespace OpenHardwareMonitor.Hardware.TBalancer {
 
   internal enum FT_DEVICE : uint {
-    FT_DEVICE_BM,
-    FT_DEVICE_AM,
+    FT_DEVICE_232BM,
+    FT_DEVICE_232AM,
     FT_DEVICE_100AX,
     FT_DEVICE_UNKNOWN,
-    FT_DEVICE_2232,
+    FT_DEVICE_2232C,
     FT_DEVICE_232R,
     FT_DEVICE_2232H,
     FT_DEVICE_4232H
diff -r edb59f3745e8 -r 010d719f9245 Hardware/TBalancer/TBalancerGroup.cs
--- a/Hardware/TBalancer/TBalancerGroup.cs	Tue Sep 14 19:23:11 2010 +0000
+++ b/Hardware/TBalancer/TBalancerGroup.cs	Wed Sep 15 18:43:15 2010 +0000
@@ -63,7 +63,15 @@
       for (int i = 0; i < numDevices; i++) {
         report.Append("Device Index: ");
         report.AppendLine(i.ToString(CultureInfo.InvariantCulture));
-        
+        report.Append("Device Type: ");
+        report.AppendLine(info[i].Type.ToString());
+
+        // the T-Balancer always uses an FT232BM
+        if (info[i].Type != FT_DEVICE.FT_DEVICE_232BM) {
+          report.AppendLine("Status: Wrong device type");
+          continue;
+        }
+
         FT_HANDLE handle;
         FT_STATUS status;
         status = FTD2XX.FT_Open(i, out handle);