const.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //
  2. // config.h
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/1.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #ifndef const_h
  9. #define const_h
  10. #define DEBUGLOG 1
  11. #ifdef DEBUGLOG
  12. #ifdef DEBUG
  13. // #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
  14. #define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  15. #define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  16. #else
  17. #define DebugLog( s, ... )
  18. #define blockDebugLog( s, ... )
  19. #endif
  20. #else
  21. #define DebugLog( s, ... )
  22. #define blockDebugLog( s, ... )
  23. #endif
  24. //
  25. //#ifdef DEBUGLOG
  26. //#ifdef DEBUG
  27. //// #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
  28. //#define DebugLog( s, ... ) fprintf(stderr, "<%p T%p %s:(%d)> %s \n", self,[NSThread currentThread], [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  29. //
  30. //#define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
  31. //
  32. //#else
  33. //#define DebugLog( s, ... )
  34. //
  35. //#define blockDebugLog( s, ... )
  36. //#endif
  37. //#else
  38. //#define DebugLog( s, ... )
  39. //
  40. //#define blockDebugLog( s, ... )
  41. //#endif
  42. #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  43. #define UIColorFromRGBAlpha(rgbValue,alp) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(alp)]
  44. #define URL_REMOTE 1
  45. #define URL_LOCAL 0
  46. #define URL_NONE 2
  47. #define URL_RESTORE 3
  48. #define REFRESH_NONE 0
  49. #define REFRESH_VIEW 1
  50. #define REFRESH_DATA 2
  51. // 如何处理commoneditor action 类型调用的返回值
  52. #define ACTION_SAVE_DATA 0
  53. #define ACTION_FILL_SECTION 1
  54. #define RESULT_BARCODE_ERROR -50
  55. //#define RESULT_NET_NOTAVAILABLE -4
  56. //#define RESULT_NET_ERROR -3
  57. //#define RESULT_FALSE 0
  58. //#define RESULT_VER_LOW -15
  59. #define MAX_ROW 100
  60. #define MAX_COLUMN 100
  61. #define BEHAVIOR_SEARCH 0
  62. #define BEHAVIOR_RESULT 1
  63. #define AP_USER_AUTH 1
  64. #define AP_USER_NOT_AUTH 2
  65. #define AP_USER_NOT_EXIST 3
  66. #define AP_SESSION_EXPIRED 4
  67. #define AP_MESSAGE_NEW 5
  68. #define AP_MESSAGE_NONE 6
  69. //const int RESULT_FALSE = 0;
  70. //#define RESULT_TRUE -1
  71. //const int RESULT_NET_ERROR = -3;
  72. //const int RESULT_NET_NOTAVAILABLE = -4;
  73. //#define RESULT_ERROR -5
  74. //#define RESULT_LOCALFILE_ERROR -7
  75. //#define RESULT_USERAUTH_ERROR -9
  76. //#define RESULT_UPDATE_USERAUTH_ERROR -11
  77. //#define RESULT_SESSION_EXPIRED -13
  78. #define RESULT_FALSE 0
  79. #define RESULT_NO_RESPONSE -1024
  80. #define RESULT_TRUE 2
  81. #define RESULT_NO_EMAIL_ADDRESS 3
  82. #define RESULT_NET_SERVER_ERR -111
  83. #define RESULT_NET_ERROR -3
  84. #define RESULT_NET_NOTAVAILABLE -4
  85. #define RESULT_ERROR -5
  86. #define RESULT_LOCALFILE_ERROR -7
  87. #define RESULT_USERAUTH_ERROR -9
  88. #define RESULT_UPDATE_USERAUTH_ERROR -11
  89. #define RESULT_SESSION_EXPIRED -13
  90. #define RESULT_VER_LOW -15
  91. #define RESULT_BACKEND_CRASH -20
  92. #define RESULT_RESPONSE_ERROR -30
  93. #define RESULT_TIMEOUT 99
  94. #define RESULT_LOGIN_DEVICE -18
  95. #define RESULT_NO_MODEL 8
  96. #define JSON_TIMEOUT 60
  97. #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."
  98. #define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later."
  99. #define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check."
  100. #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
  101. #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
  102. #define MSG_SUCCESS @"Success."
  103. #define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check."
  104. #define MSG_TIMEOUT @"Request timeout."
  105. #define MSG_OFFLINE_SUBMIT @"Offline order will be submitted when you login online mode and sync with server."
  106. #define TITLE_OFFLINE_SUBMIT @"Offline Submit"
  107. #endif /* config_h */