* Refactored NC_ERRORS

+ Added client configuration api
* Refactored serverconfig
This commit is contained in:
Lucio Maranta
2018-01-11 15:56:33 +01:00
parent 904db3d09c
commit fec3d00ff9
13 changed files with 70 additions and 51 deletions
+13 -13
View File
@@ -112,11 +112,11 @@ public static class ThreadsFunctions
{
// Try reconnection
CmsError cmsError = ncHandler.Connect();
if (cmsError.errorCode == SIEMENS_ENVIRONMENT_NOT_FOUND || cmsError.errorCode == SIEMENS_HMI_NOT_RUNNING)
if (cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING)
{
ManageLibraryError(cmsError);
}
else if ( cmsError.errorCode != OK)
else if ( cmsError.errorCode != CMS_ERROR_CODES.OK)
ncHandler.Dispose();
Thread.Sleep(1000);
@@ -149,28 +149,28 @@ public static class ThreadsFunctions
{
switch (cmsError.errorCode)
{
case NC_PROD_ERROR:
case CMS_ERROR_CODES.NC_PROD_ERROR:
TryNcConnection();
break;
case NOT_CONNECTED:
case CMS_ERROR_CODES.NOT_CONNECTED:
TryNcConnection(); // If not connected try reconnection
break;
case PROC_NOT_FOUND:
case CMS_ERROR_CODES.PROC_NOT_FOUND:
break;
case FUNCTION_NOT_ALLOWED:
case CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED:
break;
case BIT_NOT_IN_RANGE:
case CMS_ERROR_CODES.BIT_NOT_IN_RANGE:
break;
case BYTE_NOT_IN_RANGE:
case CMS_ERROR_CODES.BYTE_NOT_IN_RANGE:
break;
case INTERNAL_ERROR:
case CMS_ERROR_CODES.INTERNAL_ERROR:
break;
case INCORRECT_PARAMETERS:
case CMS_ERROR_CODES.INCORRECT_PARAMETERS:
break;
case NC_LANGUAGE_ERROR:
case CMS_ERROR_CODES.NC_LANGUAGE_ERROR:
break;
case SIEMENS_ENVIRONMENT_NOT_FOUND:
case SIEMENS_HMI_NOT_RUNNING:
case CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND:
case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING:
Manage(ERROR_LEVEL.FATAL, cmsError.message);
break;
}