#pragma once //Base class for every Wafer Analysis class, providing often used functions. //Every non interface WaferAnalysis class inherits from this class. //pohl@physik.uni-bonn.de //Mar. 2012 #include #include #include #include #include #include #include #include #define __MAXCOL 80 #define __MAXROW 336 enum status {GREEN, YELLOW, RED, BLUE, GREY, SETGREEN, SETYELLOW, SETRED}; class WaferBasis { public: WaferBasis(void); ~WaferBasis(void); void setSourceFileName(std::string pSourceFileName); //helper functions bool fileExists(std::string& pFileName); //check if a file exists double StrToDouble(std::string const& pValue); //converts a std::string to a double std::string DoubleToStr(double const& pValue); //converts a double to a std::string bool isInf(double pValue); //checks if the value is infinite bool isNan(double pValue); //checks if the value is not a number bool isFinite(double pValue); //check if the value is neither NaN nor Inf bool getStringSeparated(std::string pLine, std::string pSeparator, std::string& pLeft, std::string& pRight); virtual void setErrorOutput(bool pToggle = true); virtual void setWarningOutput(bool pToggle = true); virtual void setInfoOutput(bool pToggle = true); virtual void setDebugOutput(bool pToggle = true); protected: //output debug, infos, warning, errors void debug(std::string pText, int pLine = -1); //writes the pText to the console, also reports the line pLine and the file where this function was called void info(std::string pText, int pLine = -1); //writes the pText to the console, also reports the line pLine and the file where this function was called void warning(std::string pText, int pLine = -1); //writes the pText to the console, also reports the line pLine and the file where this function was called void error(std::string pText, int pLine = -1); //writes the pText to the console, also reports the line pLine and the file where this function was called private: std::string _sourceFileName; //the file name of the cxx file bool _error; //toggle error output on/off bool _warning; //toggle warning output on/off bool _info; //toggle info output on/off bool _debug; //toggle debug output on/off };