X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..9bfa0c13066918f440ac2b5461fb3f8847f43fd6:/Exception.h diff --git a/Exception.h b/Exception.h index 32b2e49..608bc55 100644 --- a/Exception.h +++ b/Exception.h @@ -20,41 +20,73 @@ supp. infos : saved in UTF-8 [éè] #include // exceptions for file accesses -#define CONFIGFILE_NOACCESS 1 -#define CONFIGFILE_CORRUPTED 2 +#define CONFIGFILE_NOACCESS 101 +#define CONFIGFILE_CORRUPTED 102 -#define PROJECTFILE_NOACCESS 3 -#define PROJECTFILE_CORRUPTED 4 +#define PROJECTFILE_NOACCESS 201 +#define PROJECTFILE_CORRUPTED 202 -#define BLOCKPATH_NOACCESS 5 -#define IMPLPATH_NOACCESS 6 +#define BLOCKFILE_NOACCESS 301 +#define BLOCKFILE_CORRUPTED 302 -#define BLOCKFILE_NOACCESS 7 -#define BLOCKFILE_CORRUPTED 8 +#define IMPLFILE_NOACCESS 401 +#define IMPLFILE_CORRUPTED 402 +#define IMPLFILE_NOPATTERN 403 -#define IMPLFILE_NOACCESS 9 -#define IMPLFILE_CORRUPTED 10 +#define VHDLFILE_NOACCESS 501 +#define VHDLFILE_CORRUPTED 502 -#define VHDLFILE_NOACCESS 11 +#define BLOCKPATH_NOACCESS 601 + +#define IMPLPATH_NOACCESS 701 // exceptions for block manipulations -#define BLOCK_NULL 100 -#define BLOCK_INVALID_TYPE 101 +#define BLOCK_NULL 1001 +#define BLOCK_INVALID_TYPE 1002 + // exceptions for interfaces manipulations -#define IFACE_NULL 200 -#define IFACE_INVALID_TYPE 201 -#define IFACE_MULTIPLICITY_REACHED 202 +#define IFACE_NULL 2001 +#define IFACE_INVALID_TYPE 2002 +#define IFACE_MULTIPLICITY_REACHED 2003 +#define IFACE_BLOCK_NOCLKRST 2004 +#define IFACE_GROUP_NOCLKRST 2005 +#define IFACE_TOP_NOCLKRSTGEN 2006 // exceptions for block items manipulations -#define BLOCKITEM_NULL 300 -#define BLOCKITEM_INVALID_TYPE 301 +#define BLOCKITEM_NULL 3001 +#define BLOCKITEM_INVALID_TYPE 3002 // exceptions for width interfaces validation -#define WIDTHS_NOT_EQUALS 400 +#define WIDTHS_NOT_EQUALS 4001 // exceptions for VHDL generation -#define INVALID_VALUE 500 +#define INVALID_VALUE 5001 + +// exception for patterns +#define INVALID_REFBLOCK_USE 10001 +#define INVALID_GROUPBLOCK_USE 10002 +#define INVALID_DELTA_CP 10003 // delta and CP are not consistent (NB: used during admittance computation) + +#define EVAL_PARAM_UNKNOWN 10101 // a variable used in an expression is not defined as a block parameter +#define EVAL_PARAM_NOVALUE 10102 // can't get the double value of a block parameter +#define EVAL_INVALID_EXPR 10103 // invalid arithmetic expression (in a block parameter/pattern) + +#define INVALID_IFACE_PATTERN 10201 // the pattern of an interface is invalid (not correct grammar) +#define INVALID_IFACE_PC 10202 // the production counter of an interface is invalid (not correct grammar) + +#define INVALID_IFACE_CP_LENGTH 10301 // the size of CP for an interface differs from others +#define NO_IFACE_CP 10302 // an interface has no CP defined in reference block + +#define INVALID_IFACE_PP_LENGTH 10401 // the size of PP for an interface differs from others +#define NO_IFACE_PP 10402 // an interface has no PP defined in reference block + +#define NO_IFACE_IP 10501 // an interface has no IP +#define IP_AP_NOTCOMPAT 10502 // IP and AP not compatible +#define IP_END_NULLCOL 10503 // IP ends with anull column (normally not possible during compat. check) +#define AP_TOO_SHORT 10504 // AP has been badly computed, leading to a AP shorter than needed (NB: it is an abnormal case) + +#define IFACE_NOT_CONNECTED 10601 // an interface with control is not connected => impossible to analyz the graph using namespace std; using namespace Qt; @@ -63,17 +95,19 @@ class Exception : public QObject { public: - Exception(int _id); + Exception(int _id, void* _source = NULL); Exception(const Exception& other); inline int getType() { return id; } inline void setMessage(QString _message) { message = _message; } inline QString getMessage() { return message; } QString getDefaultMessage(); + inline void* getSource() { return source; } private: int id; QString message; + void* source; };