Hardware/Mainboard/Mainboard.cs
changeset 135 51a15cf90d22
parent 133 9ad699538c89
child 136 fa2957aa0699
     1.1 --- a/Hardware/Mainboard/Mainboard.cs	Sun Jun 06 11:07:57 2010 +0000
     1.2 +++ b/Hardware/Mainboard/Mainboard.cs	Sun Jun 06 14:44:53 2010 +0000
     1.3 @@ -1,4 +1,4 @@
     1.4 -/*
     1.5 +/*
     1.6    
     1.7    Version: MPL 1.1/GPL 2.0/LGPL 2.1
     1.8  
     1.9 @@ -48,6 +48,7 @@
    1.10      private Image icon;
    1.11  
    1.12      private LPCIO lpcio;
    1.13 +    private LMSensors lmSensors;
    1.14      private IHardware[] superIOHardware;
    1.15  
    1.16      public Mainboard() {
    1.17 @@ -69,8 +70,16 @@
    1.18        }
    1.19  
    1.20        this.icon = Utilities.EmbeddedResources.GetImage("mainboard.png");
    1.21 -      this.lpcio = new LPCIO(); 
    1.22 -      ISuperIO[] superIO = lpcio.SuperIO;
    1.23 +      ISuperIO[] superIO;
    1.24 +      int p = (int)System.Environment.OSVersion.Platform;
    1.25 +      if ((p == 4) || (p == 128)) {
    1.26 +        this.lmSensors = new LMSensors();
    1.27 +        superIO = lmSensors.SuperIO;
    1.28 +      } else {
    1.29 +        this.lpcio = new LPCIO();       
    1.30 +        superIO = lpcio.SuperIO;
    1.31 +      }
    1.32 +      
    1.33        superIOHardware = new IHardware[superIO.Length];
    1.34        for (int i = 0; i < superIO.Length; i++)
    1.35          superIOHardware[i] = new SuperIOHardware(superIO[i], 
    1.36 @@ -105,7 +114,10 @@
    1.37  
    1.38      public void Update() { }
    1.39  
    1.40 -    public void Close() { }
    1.41 +    public void Close() {
    1.42 +      if (lmSensors != null)
    1.43 +        lmSensors.Close();
    1.44 +    }
    1.45  
    1.46      public IHardware[] SubHardware {
    1.47        get { return superIOHardware; }