File indexing completed on 2024-05-05 05:46:10

0001 /***************************************************************************
0002  *   Copyright (C) 2006 by William Hillerby - william.hillerby@ntlworld.com*
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  ***************************************************************************/
0009 
0010 #ifndef VOLTAGEREGULATOR_H
0011 #define VOLTAGEREGULATOR_H
0012 
0013 #include <component.h>
0014 
0015 /**
0016 @author William Hillerby
0017  */
0018 
0019 /** @todo FOA Discrete, Liner, Non-Linear and arrange items in itemlib.h and libItem() */
0020 
0021 /*
0022 
0023 A voltage regulator is an integrated circuit whose function is to keep a voltage at a specific level. Some regulators are
0024 adjustable, others are not. Voltage regulators come in both positive and negative voltages. They have three pins, the input,
0025 output and reference. The input is usually on the left side of the square and is where the unregulated input voltage is applied.
0026 The reference is usually on the bottom of the square and is where the reference voltage is applied. For fixed regulators, this
0027 reference is usually ground. For variable regulators, this reference is usually a small variable voltage just above ground. The
0028 last connection is the output, and is usually located on the right side of the square. This is where the regulated output voltage
0029 is taken from. On most schematics, the connections are numbered and labeled.
0030 
0031 */
0032 
0033 const double maxVoltageOut = 50.0;
0034 
0035 class VoltageRegulator : public Component
0036 {
0037 public:
0038     VoltageRegulator(ICNDocument *icnDocument, bool newItem, const QString &id = nullptr);
0039     ~VoltageRegulator() override;
0040 
0041     static Item *construct(ItemDocument *itemDocument, bool newItem, const char *id);
0042     static LibraryItem *libraryItem();
0043 
0044 private:
0045     void dataChanged() override;
0046     void drawShape(QPainter &p) override;
0047 
0048     // Input.
0049     // Output.
0050     // Reference = ground for fixed regulators.
0051 };
0052 
0053 #endif