const.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. #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]
  25. #define URL_REMOTE 1
  26. #define URL_LOCAL 0
  27. #define URL_NONE 2
  28. #define URL_RESTORE 3
  29. #define REFRESH_NONE 0
  30. #define REFRESH_VIEW 1
  31. #define REFRESH_DATA 2
  32. // 如何处理commoneditor action 类型调用的返回值
  33. #define ACTION_SAVE_DATA 0
  34. #define ACTION_FILL_SECTION 1
  35. #define RESULT_BARCODE_ERROR -50
  36. //#define RESULT_NET_NOTAVAILABLE -4
  37. //#define RESULT_NET_ERROR -3
  38. //#define RESULT_FALSE 0
  39. //#define RESULT_VER_LOW -15
  40. #define MAX_ROW 100
  41. #define MAX_COLUMN 100
  42. #define BEHAVIOR_SEARCH 0
  43. #define BEHAVIOR_RESULT 1
  44. #define AP_USER_AUTH 1
  45. #define AP_USER_NOT_AUTH 2
  46. #define AP_USER_NOT_EXIST 3
  47. #define AP_SESSION_EXPIRED 4
  48. #define AP_MESSAGE_NEW 5
  49. #define AP_MESSAGE_NONE 6
  50. //const int RESULT_FALSE = 0;
  51. //#define RESULT_TRUE -1
  52. //const int RESULT_NET_ERROR = -3;
  53. //const int RESULT_NET_NOTAVAILABLE = -4;
  54. //#define RESULT_ERROR -5
  55. //#define RESULT_LOCALFILE_ERROR -7
  56. //#define RESULT_USERAUTH_ERROR -9
  57. //#define RESULT_UPDATE_USERAUTH_ERROR -11
  58. //#define RESULT_SESSION_EXPIRED -13
  59. #define RESULT_FALSE 0
  60. #define RESULT_NO_RESPONSE -1024
  61. #define RESULT_TRUE 2
  62. #define RESULT_NO_EMAIL_ADDRESS 3
  63. #define RESULT_NET_SERVER_ERR -111
  64. #define RESULT_NET_ERROR -3
  65. #define RESULT_NET_NOTAVAILABLE -4
  66. #define RESULT_ERROR -5
  67. #define RESULT_LOCALFILE_ERROR -7
  68. #define RESULT_USERAUTH_ERROR -9
  69. #define RESULT_UPDATE_USERAUTH_ERROR -11
  70. #define RESULT_SESSION_EXPIRED -13
  71. #define RESULT_VER_LOW -15
  72. #define RESULT_BACKEND_CRASH -20
  73. #define RESULT_RESPONSE_ERROR -30
  74. #define RESULT_TIMEOUT 99
  75. #define RESULT_LOGIN_DEVICE -18
  76. #define RESULT_NO_MODEL 8
  77. #define JSON_TIMEOUT 60
  78. #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."
  79. #define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later."
  80. #define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check."
  81. #define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
  82. #define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
  83. #define MSG_SUCCESS @"Success."
  84. #define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check."
  85. #define MSG_TIMEOUT @"Request timeout."
  86. #define MSG_OFFLINE_SUBMIT @"Offline order will be submitted when you login online mode and sync with server."
  87. #define TITLE_OFFLINE_SUBMIT @"Offline Submit"
  88. #endif /* config_h */