Inheritance: BaseLinkDevice
 internal static LinkDevicePSU CreateNew(USB.BaseUSBDevice usbDevice, byte channel)
 {
     LinkDevicePSU genericPSU = new LinkDevicePSU(usbDevice, channel);
     string psuName = genericPSU.GetInternalName();
     if (psuName == "AX1200i")
         return new LinkDevicePSUAX1200i(usbDevice, channel);
     if (psuName == "AX1500i")
         return new LinkDevicePSUAX1500i(usbDevice, channel);
     if (psuName.StartsWith("HX") && psuName != "HX1200i" && psuName != "HX1000i")
         return new LinkDevicePSUHXiNoRail(usbDevice, channel);
     if (psuName.StartsWith("HX"))
         return new LinkDevicePSUHX(usbDevice, channel);
     return genericPSU;
 }
Esempio n. 2
0
        internal static BaseLinkDevice CreateNew(USB.BaseUSBDevice usbDevice, byte channel, byte deviceType)
        {
            switch (deviceType)
            {
            case 0x5:
                return(new LinkDeviceModern(usbDevice, channel));

            case 0x3:
                return(new LinkDeviceAFP(usbDevice, channel));

            case 0x1:
                return(LinkDevicePSU.CreateNew(usbDevice, channel));

            default:
                return(null);
            }
        }
Esempio n. 3
0
        internal static LinkDevicePSU CreateNew(USB.BaseUSBDevice usbDevice, byte channel)
        {
            LinkDevicePSU genericPSU = new LinkDevicePSU(usbDevice, channel);
            string        psuName    = genericPSU.GetInternalName();

            if (psuName == "AX1200i")
            {
                return(new LinkDevicePSUAX1200i(usbDevice, channel));
            }
            if (psuName == "AX1500i")
            {
                return(new LinkDevicePSUAX1500i(usbDevice, channel));
            }
            if (psuName.StartsWith("HX") && psuName != "HX1200i" && psuName != "HX1000i")
            {
                return(new LinkDevicePSUHXiNoRail(usbDevice, channel));
            }
            if (psuName.StartsWith("HX"))
            {
                return(new LinkDevicePSUHX(usbDevice, channel));
            }
            return(genericPSU);
        }
        internal static PowerData Interpolate(PowerData rawData, double voltage, LinkDevicePSU psu)
        {
            bool psuIsHX = psu is LinkDevicePSUHX;
            double powerOut = 0.0;
            double powerOutSquare = 0.0;
            double powerIn = 0.0;
            double powerInSquare = 0.0;
            if (psuIsHX)
            {
                powerOut = rawData.powerOut;
                powerOutSquare = Math.Pow(powerOut, 2);
            }
            else
            {
                powerIn = rawData.powerIn;
                powerInSquare = Math.Pow(powerIn, 2);
            }

            bool voltageIs110V = (voltage < 180.0);

            switch (psu.GetInternalName())
            {
                case "AX1200i":
                    powerOut = (voltageIs110V ? (-5.398236E-05 * powerInSquare + 0.9791846 * powerIn - 14.75333) : (-3.724072E-05 * powerInSquare + 0.9792162 * powerIn - 13.2167));
                    break;
                case "AX860i":
                    powerOut = (voltageIs110V ? (-7.803814E-05 * powerInSquare + 0.9856293 * powerIn - 12.32274) : (-6.501415E-05 * powerInSquare + 0.9914832 * powerIn - 11.86228));
                    break;
                case "AX760i":
                    powerOut = (voltageIs110V ? (-8.497113E-05 * powerInSquare + 0.9882959 * powerIn - 12.28865) : (-6.94856E-05 * powerInSquare + 0.9947551 * powerIn - 12.14068));
                    break;
                case "HX1000i":
                    powerIn = (voltageIs110V ? (8.614363E-05 * powerOutSquare + 1.013681 * powerOut + 12.57297) : (6.625963E-05 * powerOutSquare + 1.013373 * powerOut + 11.67543));
                    break;
                case "HX850i":
                    powerIn = (voltageIs110V ? (9.402802E-05 * powerOutSquare + 1.01568 * powerOut + 12.40252) : (6.333025E-05 * powerOutSquare + 1.023295 * powerOut + 9.813914));
                    break;
                case "HX750i":
                    powerIn = (voltageIs110V ? (0.0001011842 * powerOutSquare + 1.015511 * powerOut + 12.08922) : (7.757325E-05 * powerOutSquare + 1.015346 * powerOut + 10.91073));
                    break;
                case "HX650i":
                    powerIn = (voltageIs110V ? (0.0001215054 * powerOutSquare + 1.015551 * powerOut + 9.62592) : (8.296032E-05 * powerOutSquare + 1.018958 * powerOut + 8.411756));
                    break;
                default:
                    powerOut = (voltageIs110V ? (-4.537257E-05 * powerInSquare + 0.9955244 * powerIn - 17.04104) : (-4.024153E-05 * powerInSquare + 1.002732 * powerIn - 19.12843));
                    break;
            }
            
            double efficiency = powerOut / powerIn;
            
            if (efficiency > 0.99 || efficiency < 0.4)
            {
                efficiency = Math.Min(Math.Max(efficiency, 0.4), 0.99);
                if (psuIsHX)
                    powerIn = powerOut / efficiency;
                else
                    powerOut = powerIn * efficiency;
            }

            return new PowerData(powerIn, powerOut, efficiency * 100.0);
        }
Esempio n. 5
0
        internal FanPSU(LinkDevicePSU device, int id)
            : base(device, id)
        {

        }
        internal ThermistorPSU(LinkDevicePSU device, int id)
            : base(device, id)
        {

        }
 internal Secondary12VCurrentSensor(LinkDevicePSU device, int id, string name)
     : base(device, id)
 {
     this.name = name;
     this.psuDevice = device;
 }