/**************************************************************************** ** ** Copyright (C) 2019 Minnesota Department of Transportation ** Office of Materials & Road Research ** 1400 Gervais Avenue ** Saint Paul, Minnesota 55109-2044 ** USA ** http://www.dot.state.mn.us/materials/pvmtdesign/software.html ** ** ** $QT_BEGIN_LICENSE:GPL$ ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** If you did not receive a copy of the GNU General Public License ** see http://www.gnu.org/licenses ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef GLOBALS_H #define GLOBALS_H #include #include #include #include #include #include #include #include #include // ALL THE GLOBAL DECLARATIONS const int MAXDEC = 6; // Decimal places to use for different units const int DEC_T = 0; const int DEC_IN = 2; const int DECR_IN = 1; // rigid const int DEC_MM = 0; const int DEC_V = 0; // Unit conversion factors const double DEG_RAD = 0.01745329; const double IN_MM = 25.4; const double FT_M = 0.3048; const double MI_KM = 1.609344; const double LB_N = 4.448222; const double LB_KN = 0.004448222; const double TON_TONNE = 1.0; //don't use metric tonnes in this version //const double TON_TONNE = 0.9071847; const double PSI_KPA = 6.89475729; const double PSI_MPA = 0.00689475729; const double PCF_KNM3 = 0.1570875; // unit weight const double PCF_KGM3 = 16.01846; // bulk density const double C_K = 273.15; // add const double K_R = 1.8; // multiply const double F_R = 459.67; // add const double DAYS_WEEKS = 0.142466; const double WEEKS = 52.142857; // increment for spin buttons const double INC_IN = 0.5; const double INC_MM = 10.0; const double PI = 3.14159265358979323846; const double E3 = 1000.; const double E6 = 1000000.; const double EN3 = 0.001; const double EN6 = 0.000001; // baseconvert const quint64 MAX54 = 18446744073709550591; // 2^54-1 is the max value that works for the quint64 functions // Base alphabets const QString A10 = "0123456789"; const QString A16 = "0123456789ABCDEF"; const QString A32RFC4648 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; const QString A32EXTHEX = "0123456789ABCDEFGHIJKLMNOPQRSTUV"; const QString A64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // CFont orientation (check QFont methods) const int RIGHT = 0; const int UP = 900; const int LEFT = 1800; const int DOWN = 2700; // text const QString SPACE = " "; const QString PER = ". "; const QString COLON = ":"; const QString CR = "\n"; const QString ARIAL = "Arial"; const QString MS = "MS Sans Serif"; const QString TIMES = "Times New Roman"; const QString SYMBOL ="Symbol"; const QString WINGDING = "Wingdings"; // rectangle corners const int TL = 0; const int TR = 1; const int BR = 2; const int BL = 3; // colors const int NRED = 1; const int NGREEN = 2; const int NYELLOW = 3; const int NBLUE = 4; const int NPINK = 5; const int NCYAN = 6; const int NGRAY = 7; //registry const int READREG = 0; const int SETREG = 1; const int NOFILE = 2; const int SETBOOL = 3; const int READBOOL = 4; const QString DEFAULT_DIR_KEY = "defaultDir"; const QString RECENT_FILES_KEY = "recentFileList"; const QString UNITS_SI_KEY = "unitsSI"; // 0 units (False = English, True = SI) const QString WARN_H_KEY = "warnThickness"; // 1 show thickness warnings const QString WARN_B_KEY = "warnBinder"; // 2 show binder warnings const QString STRESS_ALWAYS = "stressAlways"; // 3 always show allowable stress const QString STRESS_FAILED = "stressFailed"; // 4 only show if failed const QString STRAIN_PERPET = "strainPerpetual"; // 5 use all strains (false) or ignore low (true) const QString FWD_E_MEAN = "fwdEmean"; // 6 FWD Emean -2SD (false) or Emean (true) const QColor BLACK = QColor(0,0,0); const QColor RED = QColor(255,0,0); const QColor DKRED = QColor(128,0,0); const QColor GREEN = QColor(0,255,0); const QColor DKGREEN = QColor(0,128,0); const QColor BLUE = QColor(0,0,255); const QColor DKBLUE = QColor(0,0,128); const QColor YELLOW = QColor(255,255,0); const QColor GOLD = QColor(128,128,0); const QColor PINK = QColor(255,0,255); const QColor PURPLE = QColor(128,0,218); const QColor TURQ = QColor(0,255,255); const QColor TEAL = QColor(0,128,128); const QColor DKTEAL = QColor(0,64,64); const QColor LTGRAY = QColor(224,224,224); const QColor GRAY = QColor(192,192,192); const QColor DKGRAY = QColor(128,128,128); const QColor WHITE = QColor(255,255,255); const QColor TRANSP = QColor(0,0,0,0); const QColor MNBLUE = QColor(0,56,101); const QColor MNGREEN = QColor(120,190,33); const QColor MNGRAY = QColor(137,138,141); const QColor MNTEAL = QColor(0,142,170); const QColor MNDKGREEN = QColor(13,82,87); const QColor MNORANGE = QColor(141,63,43); const QColor MNPURPLE = QColor(93,41,95); const QColor MNBLUEGRAY = QColor(164,188,194); const QColor MNCREAM = QColor(245,225,164); const QColor MNSKYBLUE = QColor(155,203,235); const QColor MNLTGRAY = QColor(217,217,214); const QColor MNMDGRAY = QColor(151,153,155); const QColor MNDKGRAY = QColor(83,86,90); extern bool setSpin(double oldval, double *newval, double incr); extern int decl(bool si, bool hma = true); extern int nint (double x); extern int deg2degmin(double decdeg, double *min, int minround); extern int pdfRect(QRect *rect, int wpage, int top, double ht, int ncells, int n); extern double degmin2deg(int deg, double min); extern long nlong(double x); extern int soilclass(double Silt, double Clay); extern double incl(bool si); extern double convt(bool insi, double tin, bool outsi = false); extern double convl(bool insi, double lin, bool outsi = false); extern double convll(bool insi, double lin, bool outsi = false); extern double convlll(bool insi, double lin, bool outsi = false); extern double convf(bool insi, double fin, bool outsi = false); extern double convp(bool insi, double pin, bool outsi = false); extern double convd(bool insi, double din, bool outsi = false); extern double log10(double val); extern double rnd2dec(double value, int dec, bool insigfig = false); extern QPoint rectIndex(bool ind, QRect* rect, QPoint pt, int xRects, int yRects); extern QString bas2bas54(QString tnum, const QString &talpha1, const QString &talpha2, quint64 *udec, bool bdec = false); extern QString txtt(bool si); extern QString txtl(bool si); extern QString txtll(bool si); extern QString txtlll(bool si); extern QString txtf(bool si); extern QString txtff(bool si); extern QString txtp(bool si); extern QString txte(bool si); extern QString txtu(bool si); extern QString txtv(bool si); extern QString trimright(QString txt, QString ttrim); extern QString txtdbl(double value, int dec, bool sigfig = false, bool trimzero = false, bool comma = false); extern QString txtdegmin(int deg, double min); extern QString txthrmin(int hour, int min, bool b24); extern QTime TimeText(QString *time, bool b24); extern QString tmat(bool bshort, int mat); extern QString tdet(bool bshort, int mat, int det); extern QPoint mpText(QPainter* painter, QFont font, QPoint start, QString text, int vert = 0, bool italOffset = false); extern void debugmsg(QString tmsg, QString tval = ""); // Note the important use of extern! #endif // GLOBALS_H