Math2mat
|
00001 00019 package m2m.backend.processing; 00020 00025 public class Errors { 00026 00027 static private Errors lastError=new Errors(); 00028 00029 private ErrorNum errorNum; 00030 00031 private String message; 00032 00033 static public Errors lastError() { 00034 return lastError; 00035 } 00036 00037 public ErrorNum getNum() { 00038 return errorNum; 00039 } 00040 00041 public String errorMessage() { 00042 switch (errorNum) { 00043 case QUESTALICENSE: return "Can not find QuestaSim license. Please check your license."; 00044 case QUESTANOTFOUND: return "Can not find vsim, the executable of QuestaSim. Please check the external tools properties."; 00045 case OCTAVENOTFOUND: return "Can not find Octave. Please check the external tools properties."; 00046 case ISENOTFOUND: return "Can not find Xilinx tools. Please check the external tools properties."; 00047 case UBIDULECONNECTIONERROR: return "Can not connect to Ubidule. Please check the connection."; 00048 case DOTNOTFOUND: return "Can not find dot tool. Please check the external tools properties."; 00049 case DIVERSE: return message; 00050 } 00051 return "Strange error..."; 00052 } 00053 00054 static public void setLastError(ErrorNum error) { 00055 lastError.errorNum=error; 00056 } 00057 00058 static public void setLastErrorMessage(String mess) { 00059 lastError.message = mess; 00060 lastError.errorNum = ErrorNum.DIVERSE; 00061 } 00062 00063 static public void clearError() { 00064 lastError.errorNum = ErrorNum.NOERROR; 00065 } 00066 00067 public enum ErrorNum { 00068 NOERROR, 00069 OCTAVELICENSE, 00070 OCTAVENOTFOUND, 00071 QUESTALICENSE, 00072 QUESTANOTFOUND, 00073 ISENOTFOUND, 00074 UBIDULECONNECTIONERROR, 00075 DOTNOTFOUND, 00076 DIVERSE 00077 } 00078 }