00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef STEAMCALCULATOREXCEPTION_H
00023 #define STEAMCALCULATOREXCEPTION_H
00024
00025 #include "common.h"
00026
00027 #ifndef STEAMCALCULATOR_H
00028 class SteamCalculator;
00029 class Boundaries;
00030 class SteamState;
00031 #endif
00032
00033 #include <stdexcept>
00034
00035 typedef enum {
00036 STM_UNKNOWN_ERROR =
00037 0, STM_RANGE_OVERALL, STM_BEYOND_SAT_CURVE, STM_NOT_SAT,
00038 REG1_RANGE_T_HIGH, REG1_RANGE_P_LOW, REG3_RANGE_T_LOW_TB,
00039 REG3_RANGE_P_LOW_PB, REG2_RANGE_T_LOW_TS, REG2_RANGE_P_HIGH_PB,
00040 REG2_RANGE_TB_LOW, REG2_RANGE_TB_HIGH, REG2_RANGE_PB_LOW,
00041 REG2_RANGE_PB_HIGH, STM_UNABLE_DET_REGION, STM_SAT_INEXACT,
00042 STM_ILLEGAL_WRAP_REG3_PRES_ERR, STM_PRESSURE_HIGH,
00043 STM_PRESSURE_LOW, STM_TEMPERATURE_HIGH, STM_TEMPERATURE_LOW
00044 } SteamErrorCode;
00045
00046 class SteamCalculatorException : public std::runtime_error {
00047
00048 public:
00049
00050 virtual std::string what();
00051 SteamErrorCode getType();
00052
00053 protected:
00054 friend class SteamCalculator;
00055 friend class Boundaries;
00056 friend class SteamState;
00057
00058 SteamCalculatorException(Pressure p = -1.0 * MPa, Temperature T =
00059 -1.0 * Kelvin, SteamErrorCode c = STM_UNKNOWN_ERROR);
00060
00061 ~SteamCalculatorException() throw(){}
00062
00063 private:
00064
00065 SteamErrorCode type;
00066 Pressure p;
00067 Temperature T;
00068 std::string message;
00069 };
00070
00071 class SteamAlmostSaturatedException : public std::runtime_error {
00072
00073 public:
00074 virtual std::string what();
00075
00076 protected:
00077 friend class Boundaries;
00078 SteamAlmostSaturatedException(Pressure p = -1.0 * MPa, Temperature T = -1.0 *Kelvin);
00079
00080 private:
00081 Pressure p;
00082 Temperature T;
00083 };
00084
00085 class OverPressureException : public std::runtime_error {
00086 OverPressureException(std::string message);
00087 };
00088
00089 #endif