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 "exception.h"
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 Exception {
00047
00048
public:
00049
00050 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
private:
00062
00063 SteamErrorCode type;
00064
Pressure p;
00065
Temperature T;
00066 string message;
00067 };
00068
00069
class SteamAlmostSaturatedException:
public Exception {
00070
00071
public:
00072 string what();
00073
00074
protected:
00075
friend class Boundaries;
00076 SteamAlmostSaturatedException(
Pressure p = -1.0 * MPa,
Temperature T = -1.0 *Kelvin);
00077
00078
private:
00079
Pressure p;
00080
Temperature T;
00081 };
00082
00083
class OverPressureException :
public Exception {
00084 OverPressureException(string message);
00085 };
00086
00087
#endif