File indexing completed on 2024-05-12 03:47:44

0001 /*
0002     File                 : constants.h
0003     Project              : LabPlot
0004     Description          : definition of mathematical and physical constants
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2014 Alexander Semke <alexander.semke@web.de>
0007     SPDX-FileCopyrightText: 2014-2018 Stefan Gerlach <stefan.gerlach@uni.kn>
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef GSL_CONSTANTS_H
0012 #define GSL_CONSTANTS_H
0013 
0014 #include <QString>
0015 #include <functional>
0016 
0017 enum class ConstantGroups;
0018 
0019 struct cons {
0020     std::function<QString(void)> description;
0021     const char* name;
0022     double value;
0023     const char* unit;
0024     ConstantGroups group;
0025 };
0026 
0027 extern struct cons _constants[];
0028 extern const int _number_constants;
0029 
0030 enum class ConstantGroups : int {
0031     MathematicalConstants,
0032     FundamentalConstants,
0033     AstronomyAndAstrophysics,
0034     AtomicAndNuclearPhysics,
0035     MeasurementOfTime,
0036     ImperialUnits,
0037     SpeedAndNauticalUnits,
0038     PrintersUnits,
0039     VolumeAreaAndLength,
0040     MassAndWeight,
0041     ThermalEnergyAndPower,
0042     Pressure,
0043     Viscosity,
0044     LightAndIllumination,
0045     Radioactivity,
0046     ForceAndEnergy,
0047 
0048     //---------------
0049     END
0050 };
0051 
0052 QString constantGroupsToString(ConstantGroups group);
0053 
0054 #endif /* CONSTANTS_H */