2011-12-31 17:31:04 +00:00
|
|
|
|
/*
|
|
|
|
|
|
2012-05-27 14:23:31 +00:00
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2011-12-31 17:31:04 +00:00
|
|
|
|
|
2012-05-27 14:23:31 +00:00
|
|
|
|
Copyright (C) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
|
|
|
|
|
Copyright (C) 2010 Paul Werelds
|
|
|
|
|
Copyright (C) 2011 Roland Reinl <roland-reinl@gmx.de>
|
|
|
|
|
|
2011-12-31 17:31:04 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace OpenHardwareMonitor.Hardware.HDD {
|
|
|
|
|
internal class HarddriveGroup : IGroup {
|
|
|
|
|
|
|
|
|
|
private const int MAX_DRIVES = 32;
|
|
|
|
|
|
|
|
|
|
private readonly List<AbstractHarddrive> hardware =
|
|
|
|
|
new List<AbstractHarddrive>();
|
|
|
|
|
|
|
|
|
|
public HarddriveGroup(ISettings settings) {
|
2020-05-04 23:11:33 +02:00
|
|
|
|
if (OperatingSystem.IsUnix)
|
|
|
|
|
return;
|
2011-12-31 17:31:04 +00:00
|
|
|
|
|
|
|
|
|
ISmart smart = new WindowsSmart();
|
|
|
|
|
|
|
|
|
|
for (int drive = 0; drive < MAX_DRIVES; drive++) {
|
|
|
|
|
AbstractHarddrive instance =
|
|
|
|
|
AbstractHarddrive.CreateInstance(smart, drive, settings);
|
|
|
|
|
if (instance != null) {
|
|
|
|
|
this.hardware.Add(instance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IHardware[] Hardware {
|
|
|
|
|
get {
|
|
|
|
|
return hardware.ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetReport() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Close() {
|
|
|
|
|
foreach (AbstractHarddrive hdd in hardware)
|
|
|
|
|
hdd.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|