svn-gvsig-desktop / tags / v1_1_2_1_Build_1046 / libraries / libjni-readecw-linux / include / NCSErrors.h @ 44114
History | View | Annotate | Download (32.5 KB)
1 | 1448 | igbrotru | /********************************************************
|
---|---|---|---|
2 | ** Copyright 1999 Earth Resource Mapping Ltd.
|
||
3 | ** This document contains proprietary source code of
|
||
4 | ** Earth Resource Mapping Ltd, and can only be used under
|
||
5 | ** one of the three licenses as described in the
|
||
6 | ** license.txt file supplied with this distribution.
|
||
7 | ** See separate license.txt file for license details
|
||
8 | ** and conditions.
|
||
9 | **
|
||
10 | ** This software is covered by US patent #6,442,298,
|
||
11 | ** #6,102,897 and #6,633,688. Rights to use these patents
|
||
12 | ** is included in the license agreements.
|
||
13 | **
|
||
14 | ** FILE: NCSError.h
|
||
15 | ** CREATED: Thu Feb 25 09:19:00 WST 1999
|
||
16 | ** AUTHOR: Simon Cope
|
||
17 | ** PURPOSE: NCS Error handling enum/routines.
|
||
18 | ** EDITS:
|
||
19 | [01] ny 26Apr00 Added NCS_NET_PACKET_RECV_ZERO_LENGTH error
|
||
20 | [02] sjc 30May00 Merge Mac SDK port in to main source stream
|
||
21 | [03] ny 12May00 Added lost of connection error
|
||
22 | [04] ny 07Jul00 Added Metabase query errors
|
||
23 | [05] ny 19Jul00 Added Timeout errors
|
||
24 | [06] mjs 25Aug00 Added errors for Java JNI functionality
|
||
25 | [07] jmp 31Aug00 Moved extra symbol server errors to end of enum
|
||
26 | [08] sjc 12Oct00 Added NCS_MAX_ERROR_NUMBER to enable range check
|
||
27 | [10] ny 30Oct00 Merge WinCE/Palm SDK
|
||
28 | [11] rar 19Jan01 Mac port changes
|
||
29 | [12] sjc 06Mar01 Strings were swapped
|
||
30 | [13] jmp 17May01 Added SetExtents error
|
||
31 | [14] jmp 25Sep01 Layer errors
|
||
32 | [15] ajd 22Nov01 added 1.65 gdt errors
|
||
33 | [16] ajd 15Jan02 added NCS_GDT_TRANSFORM_OUT_OF_BOUNDS
|
||
34 | [17] jmp 17Jan02 Layer errors
|
||
35 | [18] jmp 24Apr02 Layer Parameter Errors
|
||
36 | [19] mjs 15Nov02 Added PIPE errors for CGI server
|
||
37 | [20] rar 20Nov02 Added errors for NCSMakeDir
|
||
38 | [21] tfl 17Nov04 Added errors for JPEG 2000 geodata I/O
|
||
39 | *******************************************************/
|
||
40 | |||
41 | |||
42 | #ifndef NCSERRORS_H
|
||
43 | #define NCSERRORS_H
|
||
44 | |||
45 | #ifdef __cplusplus
|
||
46 | extern "C" { |
||
47 | #endif
|
||
48 | |||
49 | #ifndef NCSDEFS_H
|
||
50 | #include "NCSDefs.h" |
||
51 | #endif
|
||
52 | |||
53 | #if (defined(WIN32) && !defined(_WIN32_WCE))/*||defined(MACINTOSH)*/ /**[10]**/ |
||
54 | #include <crtdbg.h> |
||
55 | #else
|
||
56 | #define _CRT_WARN 1 |
||
57 | #if !defined(_DEBUG) && !defined(DEBUG)
|
||
58 | #ifndef _ASSERT
|
||
59 | #define _ASSERT(a)
|
||
60 | #endif
|
||
61 | #define _RPT0(a, b)
|
||
62 | #define _RPT1(a, b, a1)
|
||
63 | #define _RPT2(a, b, a1, a2)
|
||
64 | #define _RPT3(a, b, a1, a2, a3)
|
||
65 | #define _RPT4(a, b, a1, a2, a3, a4)
|
||
66 | #else /* _DEBUG */ |
||
67 | #ifndef _ASSERT
|
||
68 | #define _ASSERT(a)
|
||
69 | #endif
|
||
70 | #define _RPT0(a, b) fprintf(stderr, b)
|
||
71 | #define _RPT1(a, b, a1) fprintf(stderr, b, a1)
|
||
72 | #define _RPT2(a, b, a1, a2) fprintf(stderr, b, a1, a2)
|
||
73 | #define _RPT3(a, b, a1, a2, a3) fprintf(stderr, b, a1, a2, a3)
|
||
74 | #define _RPT4(a, b, a1, a2, a3, a4) fprintf(stderr, b, a1, a2, a3, a4)
|
||
75 | #endif /* _DEBUG */ |
||
76 | #endif /* WIN32 || MACINTOSH */ |
||
77 | |||
78 | #ifdef PALM
|
||
79 | #include <PalmTypes.h> |
||
80 | #include <FileStream.h> |
||
81 | #endif
|
||
82 | |||
83 | /*
|
||
84 | ** Error Enum.
|
||
85 | */
|
||
86 | |||
87 | /*
|
||
88 | ** IMPORTANT: Add new errors to the end of this list so we can retain some
|
||
89 | ** backwards binary compatibilty. Also, don't forget to add the
|
||
90 | ** error text!
|
||
91 | */
|
||
92 | |||
93 | /**
|
||
94 | * @enum
|
||
95 | * An enumerated type specifying all the errors associated with the SDK. Each error
|
||
96 | * code is associated with a string of explanatory text.
|
||
97 | */
|
||
98 | typedef enum { |
||
99 | /* NCS Raster Errors */
|
||
100 | NCS_SUCCESS = 0, /**< No error */ |
||
101 | NCS_QUEUE_NODE_CREATE_FAILED, /**< Queue node creation failed */
|
||
102 | NCS_FILE_OPEN_FAILED, /**< File open failed */
|
||
103 | NCS_FILE_LIMIT_REACHED, /**< The Image Web Server's licensed file limit has been reached */
|
||
104 | NCS_FILE_SIZE_LIMIT_REACHED, /**< The requested file is larger than is permitted by the license on this Image Web Server */
|
||
105 | NCS_FILE_NO_MEMORY, /**< Not enough memory for new file */
|
||
106 | NCS_CLIENT_LIMIT_REACHED, /**< The Image Web Server's licensed client limit has been reached */
|
||
107 | NCS_DUPLICATE_OPEN, /**< Detected duplicate open from net layer */
|
||
108 | NCS_PACKET_REQUEST_NYI, /**< Packet request type not yet implemented */
|
||
109 | NCS_PACKET_TYPE_ILLEGAL, /**< Packet type is illegal */
|
||
110 | NCS_DESTROY_CLIENT_DANGLING_REQUESTS, /**< Client closed while requests outstanding */
|
||
111 | |||
112 | /* NCS Network Errors */
|
||
113 | NCS_UNKNOWN_CLIENT_UID, /**< Client UID unknown */
|
||
114 | NCS_COULDNT_CREATE_CLIENT, /**< Could not create new client */
|
||
115 | NCS_NET_COULDNT_RESOLVE_HOST, /**< Could not resolve address of Image Web Server */
|
||
116 | NCS_NET_COULDNT_CONNECT, /**< Could not connect to host */
|
||
117 | NCS_NET_RECV_TIMEOUT, /**< Receive timeout */
|
||
118 | NCS_NET_HEADER_SEND_FAILURE, /**< Error sending header */
|
||
119 | NCS_NET_HEADER_RECV_FAILURE, /**< Error receiving header */
|
||
120 | NCS_NET_PACKET_SEND_FAILURE, /**< Error sending packet */
|
||
121 | NCS_NET_PACKET_RECV_FAILURE, /**< Error receiving packet */
|
||
122 | NCS_NET_401_UNAUTHORISED, /**< 401 Unauthorised: SDK doesn't do authentication so this suggests a misconfigured server */
|
||
123 | NCS_NET_403_FORBIDDEN, /**< 403 Forbidden: could be a 403.9 from IIS or PWS meaning that the maximum simultaneous request limit has been reached */
|
||
124 | NCS_NET_404_NOT_FOUND, /**< 404 Not Found: this error suggests that the server hasn't got Image Web Server installed */
|
||
125 | NCS_NET_407_PROXYAUTH, /**< 407 Proxy Authentication: the SDK doesn't do proxy authentication yet either, so this also suggests misconfiguration */
|
||
126 | NCS_NET_UNEXPECTED_RESPONSE, /**< Unexpected HTTP response could not be handled */
|
||
127 | NCS_NET_BAD_RESPONSE, /**< HTTP response received outside specification */
|
||
128 | NCS_NET_ALREADY_CONNECTED, /**< Already connected */
|
||
129 | NCS_INVALID_CONNECTION, /**< Connection is invalid */
|
||
130 | NCS_WINSOCK_FAILURE, /**< A Windows sockets failure occurred */
|
||
131 | |||
132 | /* NCS Symbol Errors */
|
||
133 | NCS_SYMBOL_ERROR, /**< Symbology error */
|
||
134 | NCS_OPEN_DB_ERROR, /**< Could not open database */
|
||
135 | NCS_DB_QUERY_FAILED, /**< Could not execute the requested query on database */
|
||
136 | NCS_DB_SQL_ERROR, /**< SQL statement could not be executed */
|
||
137 | NCS_GET_LAYER_FAILED, /**< Open symbol layer failed */
|
||
138 | NCS_DB_NOT_OPEN, /**< The database is not open */
|
||
139 | NCS_QT_TYPE_UNSUPPORTED, /**< This type of quadtree is not supported */
|
||
140 | |||
141 | /* Preference errors */
|
||
142 | NCS_PREF_INVALID_USER_KEY, /**< Invalid local user key name specified */
|
||
143 | NCS_PREF_INVALID_MACHINE_KEY, /**< Invalid local machine key name specified */
|
||
144 | NCS_REGKEY_OPENEX_FAILED, /**< Failed to open registry key */
|
||
145 | NCS_REGQUERY_VALUE_FAILED, /**< Registry query failed */
|
||
146 | NCS_INVALID_REG_TYPE, /**< Type mismatch in registry variable */
|
||
147 | |||
148 | /* Misc Errors */
|
||
149 | NCS_INVALID_ARGUMENTS, /**< Invalid arguments passed to function */
|
||
150 | NCS_ECW_ERROR, /**< ECW error */
|
||
151 | /* unspecified, but coming out of ecw */
|
||
152 | NCS_SERVER_ERROR, /**< Server error */
|
||
153 | /* unspecified server error */
|
||
154 | NCS_UNKNOWN_ERROR, /**< Unknown error */
|
||
155 | NCS_EXTENT_ERROR, /**< Extent conversion failed */
|
||
156 | NCS_COULDNT_ALLOC_MEMORY, /**< Could not allocate enough memory */
|
||
157 | NCS_INVALID_PARAMETER, /**< An invalid parameter was used */
|
||
158 | |||
159 | /* Compression Errors */
|
||
160 | NCS_FILEIO_ERROR, /**< Error reading or writing file */
|
||
161 | NCS_COULDNT_OPEN_COMPRESSION, /**< Compression task could not be initialised */
|
||
162 | NCS_COULDNT_PERFORM_COMPRESSION, /**< Compression task could not be processed */
|
||
163 | NCS_GENERATED_TOO_MANY_OUTPUT_LINES, /**< Trying to generate too many output lines */
|
||
164 | NCS_USER_CANCELLED_COMPRESSION, /**< Compression task was cancelled by client application */
|
||
165 | NCS_COULDNT_READ_INPUT_LINE, /**< Could not read line from input data */
|
||
166 | NCS_INPUT_SIZE_EXCEEDED, /**< Input image size was exceeded for this version of the SDK */
|
||
167 | |||
168 | /* Decompression Errors */
|
||
169 | NCS_REGION_OUTSIDE_FILE, /**< Specified image region is outside image extents */
|
||
170 | NCS_NO_SUPERSAMPLE, /**< Supersampling is not supported by the SDK functions */
|
||
171 | NCS_ZERO_SIZE, /**< Specified image region has a zero width or height */
|
||
172 | NCS_TOO_MANY_BANDS, /**< More bands specified than exist in the input file */
|
||
173 | NCS_INVALID_BAND_NR, /**< An invalid band number has been specified */
|
||
174 | |||
175 | /* NEW Compression Error */
|
||
176 | NCS_INPUT_SIZE_TOO_SMALL, /**< Input image size is too small to compress - for ECW compression there is a minimum output file size */
|
||
177 | |||
178 | /* NEW Network error */
|
||
179 | NCS_INCOMPATIBLE_PROTOCOL_VERSION, /**< The ECWP client version is incompatible with this server */
|
||
180 | NCS_WININET_FAILURE, /**< Windows Internet Client error */
|
||
181 | NCS_COULDNT_LOAD_WININET, /**< wininet.dll could not be loaded - usually indicates Internet Explorer should be upgraded */
|
||
182 | |||
183 | /* NCSFile && NCSRenderer class errors */
|
||
184 | NCS_FILE_INVALID_SETVIEW, /**< The parameters specified for setting a file view were invalid, or the view was not set */
|
||
185 | NCS_FILE_NOT_OPEN, /**< No file is open */
|
||
186 | |||
187 | /* NEW JNI Java Errors */
|
||
188 | NCS_JNI_REFRESH_NOT_IMPLEMENTED, /**< Class does not implement ECWProgressiveDisplay interface */
|
||
189 | /* A class is trying to use RefreshUpdate() method, but has not implemented ECWProgressiveDisplay*/
|
||
190 | |||
191 | /* NEW Coordinate Errors*/
|
||
192 | NCS_INCOMPATIBLE_COORDINATE_SYSTEMS, /**< Incompatible coordinate systems */
|
||
193 | NCS_INCOMPATIBLE_COORDINATE_DATUM, /**< Incompatible coordinate datum types */
|
||
194 | NCS_INCOMPATIBLE_COORDINATE_PROJECTION, /**< Incompatible coordinate projection types */
|
||
195 | NCS_INCOMPATIBLE_COORDINATE_UNITS, /**< Incompatible coordinate units types */
|
||
196 | NCS_COORDINATE_CANNOT_BE_TRANSFORMED, /**< Non-linear coordinate systems not supported */
|
||
197 | NCS_GDT_ERROR, /**< Error involving the GDT database */
|
||
198 | |||
199 | /* NEW NCScnet error */
|
||
200 | NCS_NET_PACKET_RECV_ZERO_LENGTH, /**< Zero length packet received */
|
||
201 | /**[01]**/
|
||
202 | |||
203 | /* Macintosh SDK specific errors */
|
||
204 | NCS_UNSUPPORTEDLANGUAGE, /**< Must use Japanese version of the ECW SDK */
|
||
205 | /**[02]**/
|
||
206 | |||
207 | /* Loss of connection */
|
||
208 | NCS_CONNECTION_LOST, /**< Connection to server was lost */
|
||
209 | /**[03]**/
|
||
210 | |||
211 | NCS_COORD_CONVERT_ERROR, /**< NCSGDT coordinate conversion failed */
|
||
212 | |||
213 | /* Metabase Stuff */
|
||
214 | NCS_METABASE_OPEN_FAILED, /**< Failed to open metabase */
|
||
215 | /**[04]**/
|
||
216 | NCS_METABASE_GET_FAILED, /**< Failed to get value from metabase */
|
||
217 | /**[04]**/
|
||
218 | NCS_NET_HEADER_SEND_TIMEOUT, /**< Timeout sending header */
|
||
219 | /**[05]**/
|
||
220 | |||
221 | NCS_JNI_ERROR, /**< Java JNI error */
|
||
222 | /**[06]**/
|
||
223 | |||
224 | NCS_DB_INVALID_NAME, /**< No data source passed */
|
||
225 | /**[07]**/
|
||
226 | NCS_SYMBOL_COULDNT_RESOLVE_HOST, /**< Could not resolve address of Image Web Server Symbol Server Extension */
|
||
227 | /**[07]**/
|
||
228 | |||
229 | NCS_INVALID_ERROR_ENUM, /**< The value of an NCSError error number was invalid! */
|
||
230 | /**[08]**/
|
||
231 | |||
232 | /* NCSFileIO errors [10] */
|
||
233 | NCS_FILE_EOF, /**< End of file reached */
|
||
234 | NCS_FILE_NOT_FOUND, /**< File not found */
|
||
235 | NCS_FILE_INVALID, /**< File was invalid or corrupt */
|
||
236 | NCS_FILE_SEEK_ERROR, /**< Attempted to read, write or seek past file limits */
|
||
237 | NCS_FILE_NO_PERMISSIONS, /**< Permissions not available to access file */
|
||
238 | NCS_FILE_OPEN_ERROR, /**< Error opengin file */
|
||
239 | NCS_FILE_CLOSE_ERROR, /**< Error closing file */
|
||
240 | NCS_FILE_IO_ERROR, /**< Miscellaneous error involving file input or output */
|
||
241 | |||
242 | NCS_SET_EXTENTS_ERROR, /**< Illegal or invalid world coordinates supplied */
|
||
243 | /**[09]**/
|
||
244 | |||
245 | NCS_FILE_PROJECTION_MISMATCH, /**< Image projection does not match that of the controlling layer */
|
||
246 | /** 1.65 gdt errors [15]**/
|
||
247 | NCS_GDT_UNKNOWN_PROJECTION, /**< Unknown map projection */
|
||
248 | NCS_GDT_UNKNOWN_DATUM, /**< Unknown geodetic datum */
|
||
249 | NCS_GDT_USER_SERVER_FAILED, /**< User specified Geographic Projection Database data server failed */
|
||
250 | NCS_GDT_REMOTE_PATH_DISABLED, /**< Remote Geographic Projection Database file downloading has been disabled and no local GDT data is available */
|
||
251 | NCS_GDT_BAD_TRANSFORM_MODE, /**< Invalid mode of transform */
|
||
252 | NCS_GDT_TRANSFORM_OUT_OF_BOUNDS,/**< Coordinate to be transformed is out of bounds */
|
||
253 | NCS_LAYER_DUPLICATE_LAYER_NAME, /**< A layer already exists with the specified name */
|
||
254 | /**[17]**/
|
||
255 | NCS_LAYER_INVALID_PARAMETER, /**< The specified layer does not contain the specified parameter */
|
||
256 | /**[18]**/
|
||
257 | NCS_PIPE_CREATE_FAILED, /**< Failed to create pipe */
|
||
258 | /**[19]**/
|
||
259 | |||
260 | /* Directory creation errors */
|
||
261 | NCS_FILE_MKDIR_EXISTS, /**< Directory to be created already exists */ /*[20]*/ |
||
262 | NCS_FILE_MKDIR_PATH_NOT_FOUND, /**< The path specified for directory creation does not exist */ /*[20]*/ |
||
263 | NCS_ECW_READ_CANCELLED, /**< File read was cancelled */
|
||
264 | |||
265 | /* JP2 georeferencing errors */
|
||
266 | NCS_JP2_GEODATA_READ_ERROR, /**< Error reading geodata from a JPEG 2000 file */ /*[21]*/ |
||
267 | NCS_JP2_GEODATA_WRITE_ERROR, /**< Error writing geodata to a JPEG 2000 file */ /*[21]*/ |
||
268 | NCS_JP2_GEODATA_NOT_GEOREFERENCED, /**< JPEG 2000 file not georeferenced */ /*[21]*/ |
||
269 | |||
270 | // Insert new errors before here!
|
||
271 | |||
272 | NCS_MAX_ERROR_NUMBER /**< The maximum error value in this enumerated type - should not itself be reported, must always be defined last */ /*[08]*/ |
||
273 | } NCSError; |
||
274 | |||
275 | |||
276 | #ifdef NCSERROR_DEFINE_GLOBALS
|
||
277 | |||
278 | static char *NCSErrorTextArray[] = {"No Error", /* NCS_SUCCESS */ |
||
279 | /* NCS Raster Errors */
|
||
280 | "Queue node creation failed", /* NCS_QUEUE_NODE_CREATE_FAILED */ |
||
281 | "File open failed", /* NCS_FILE_OPEN_FAILED */ |
||
282 | "The Image Web Server's licensed file limit has been reached", /* NCS_FILE_LIMIT_REACHED */ |
||
283 | "The requested file is larger than is permitted by the license on this Image Web Server", /* NCS_FILE_SIZE_LIMIT_REACHED */ |
||
284 | "Not enough memory for new file", /* NCS_FILE_NO_MEMORY */ |
||
285 | "The Image Web Server's licensed client limit has been reached", /* NCS_CLIENT_LIMIT_REACHED */ |
||
286 | "Detected duplicate open from net layer", /* NCS_DUPLICATE_OPEN */ |
||
287 | "Packet request type not yet implemented", /* NCS_PACKET_REQUEST_NYI */ |
||
288 | "Packet type is illegal", /* NCS_PACKET_TYPE_ILLEGAL */ |
||
289 | "Client closed while requests outstanding", /* NCS_DESTROY_CLIENT_DANGLING_REQUESTS */ |
||
290 | |||
291 | /* NCS Network Errors */
|
||
292 | "Client UID unknown", /* NCS_UNKNOWN_CLIENT_UID */ |
||
293 | "Could not create new client", /* NCS_COULDNT_CREATE_CLIENT */ |
||
294 | "Could not resolve address of Image Web Server", /* NCS_NET_COULDNT_RESOLVE_HOST */ |
||
295 | "Could not connect to host", /* NCS_NET_COULDNT_CONNECT */ |
||
296 | "Receive timeout", /* NCS_NET_RECV_TIMEOUT */ |
||
297 | "Error sending header", /* NCS_NET_HEADER_SEND_FAILURE */ |
||
298 | "Error receiving header", /* NCS_NET_HEADER_RECV_FAILURE */ |
||
299 | "Error sending packet", /* NCS_NET_PACKET_SEND_FAILURE */ |
||
300 | "Error receiving packet", /* NCS_NET_PACKET_RECV_FAILURE */ |
||
301 | "401 Unauthorised", /* NCS_NET_401_UNAUTHORISED */ |
||
302 | "403 Forbidden", /* NCS_NET_403_FORBIDDEN */ |
||
303 | "Is the host an Image Web Server?", /* NCS_NET_404_NOT_FOUND */ |
||
304 | "Your HTTP proxy requires authentication", /* NCS_NET_407_PROXYAUTH */ |
||
305 | "Unexpected HTTP response", /* NCS_NET_UNEXPECTED_RESPONSE */ |
||
306 | "Bad HTTP response", /* NCS_NET_BAD_RESPONSE */ |
||
307 | "Already connected", /* NCS_NET_ALREADY_CONNECTED */ |
||
308 | "The connection is invalid", /* NCS_INVALID_CONNECTION */ |
||
309 | "Windows sockets failure", /* NCS_WINSOCK_FAILURE */ |
||
310 | |||
311 | /* NCS Symbol Errors */
|
||
312 | "Symbology error", /* NCS_SYMBOL_ERROR */ |
||
313 | "Could not open database", /* NCS_OPEN_DB_ERROR */ |
||
314 | "Could not execute the requested query on database",/* NCS_DB_QUERY_FAILED */ |
||
315 | "SQL statement could not be executed", /* NCS_DB_SQL_ERROR */ |
||
316 | "Open symbol layer failed", /* NCS_GET_LAYER_FAILED */ |
||
317 | "The database is not open", /* NCS_DB_NOT_OPEN */ |
||
318 | "This type of quad tree is not supported", /* NCS_QT_TYPE_UNSUPPORTED */ |
||
319 | /* Preference errors */
|
||
320 | "Invalid local user key name specified", /* NCS_PREF_INVALID_USER_KEY */ |
||
321 | "Invalid local machine key name specified", /* NCS_PREF_INVALID_MACHINE_KEY */ |
||
322 | "Failed to open registry key", /* NCS_REGKEY_OPENEX_FAILED */ |
||
323 | "Registry query failed", /* NCS_REGQUERY_VALUE_FAILED */ |
||
324 | "Type mismatch in registry variable", /* NCS_INVALID_REG_TYPE */ |
||
325 | /* Misc errors */
|
||
326 | "Invalid arguments passed to function", /* NCS_INVALID_ARGUMENTS */ |
||
327 | "ECW error", /* NCS_ECW_ERROR */ |
||
328 | "Server error", /* NCS_SERVER_ERROR */ |
||
329 | "Unknown error", /* NCS_UNKNOWN_ERROR */ |
||
330 | "Extent conversion failed", /* NCS_EXTENT_ERROR */ |
||
331 | "Could not allocate enough memory", /* NCS_COULDNT_ALLOC_MEMORY [12] */ |
||
332 | "An invalid parameter was used", /* NCS_INVALID_PARAMETER */ |
||
333 | /* Compress errors */
|
||
334 | "Could not perform Read/Write on file", /* NCS_FILEIO_ERROR */ |
||
335 | "Could not open compression task", /* NCS_COULDNT_OPEN_COMPRESSION */ |
||
336 | "Could not perform compression", /* NCS_COULDNT_PERFORM_COMPRESSION */ |
||
337 | "Trying to generate too many output lines", /* NCS_GENERATED_TOO_MANY_OUTPUT_LINES */ |
||
338 | "User cancelled compression", /* NCS_USER_CANCELLED_COMPRESSION */ |
||
339 | "Could not read line from input image file", /* NCS_COULDNT_READ_INPUT_LINE */ |
||
340 | "Input image size exceeded for this version", /* NCS_INPUT_SIZE_EXCEEDED */ |
||
341 | /* Decompression Errors */
|
||
342 | "Specified image region is outside image area", /* NCS_REGION_OUTSIDE_FILE */ |
||
343 | "Supersampling not supported", /* NCS_NO_SUPERSAMPLE */ |
||
344 | "Specified image region has a zero width or height",/* NCS_ZERO_SIZE */ |
||
345 | "More bands specified than exist in this file", /* NCS_TOO_MANY_BANDS */ |
||
346 | "An invalid band number has been specified", /* NCS_INVALID_BAND_NR */ |
||
347 | /* New Compression Error */
|
||
348 | "Input image size is too small to compress", /* NCS_INPUT_SIZE_TOO_SMALL */ |
||
349 | /* NEW Network error */
|
||
350 | "The ECWP client version is incompatible with this server", /* NCS_INCOMPATIBLE_PROTOCOL_VERSION */ |
||
351 | "Windows Internet Client error", /* NCS_WININET_FAILURE */ |
||
352 | "Could not load wininet.dll", /* NCS_COULDNT_LOAD_WININET */ |
||
353 | |||
354 | /* NCSFile && NCSRenderer class errors */
|
||
355 | "Invalid SetView parameters or SetView not called.",/* NCS_FILE_INVALID_SETVIEW */ |
||
356 | "There is no open ECW file.", /* NCS_FILE_NOT_OPEN */ |
||
357 | |||
358 | /* NEW JNI Java Errors */
|
||
359 | "Class does not implement ECWProgressiveDisplay interface.",/* NCS_JNI_REFRESH_NOT_IMPLEMENTED */ |
||
360 | |||
361 | /* NEW Coordinate Errors */
|
||
362 | "Incompatible coordinate systems", /* NCS_INCOMPATIBLE_COORDINATE_SYSTEMS */ |
||
363 | "Incompatible coordinate datum types", /* NCS_INCOMPATIBLE_COORDINATE_DATUM */ |
||
364 | "Incompatible coordinate projection types", /* NCS_INCOMPATIBLE_COORDINATE_PROJECTION*/ |
||
365 | "Incompatible coordinate units types", /* NCS_INCOMPATIBLE_COORDINATE_UNITS */ |
||
366 | "Non-linear coordinate systems not supported", /* NCS_COORDINATE_CANNOT_BE_TRANSFORMED */ |
||
367 | "GDT Error", /* NCS_GDT_ERROR */ |
||
368 | "Zero length packet", /* NCS_NET_PACKET_RECV_ZERO_LENGTH */ /**[01]**/ |
||
369 | "Must use Japanese version of the ECW SDK", /* NCS_UNSUPPORTEDLANGUAGE */ /**[02]**/ |
||
370 | "Loss of connection to server", /* NCS_CONNECTION_LOST */ /**[03]**/ |
||
371 | "NCSGdt coordinate conversion failed", /* NCS_COORD_CONVERT_ERROR */ |
||
372 | "Failed to open metabase", /* NCS_METABASE_OPEN_FAILED*/ /**[04]**/ |
||
373 | "Failed to get value from metabase", /* NCS_METABASE_GET_FAILED*/ /**[04]**/ |
||
374 | "Timeout sending header", /* NCS_NET_HEADER_SEND_TIMEOUT*/ /**[05]**/ |
||
375 | "Java JNI error", /* NCS_JNI_ERROR */ /**[06]**/ |
||
376 | "No data source passed", /* NCS_DB_INVALID_NAME */ /**[07]**/ |
||
377 | "Could not resolve address of Image Web Server Symbol Server Extension", /* NCS_SYMBOL_COULDNT_RESOLVE_HOST*/ /**[07]**/ |
||
378 | "Invalid NCSError value!", /* NCS_INVALID_ERROR_ENUM */ /**[08]**/ |
||
379 | /* NCSFileIO errors [10] */
|
||
380 | "End Of File reached", /* NCS_FILE_EOF [10] */ |
||
381 | "File not found", /* NCS_FILE_NOT_FOUND [10] */ |
||
382 | "File is invalid or corrupt", /* NCS_FILE_INVALID [10] */ |
||
383 | "Attempted to read, write or seek past file limits",/* NCS_FILE_SEEK_ERROR [10] */ |
||
384 | "Permissions not available to access file", /* NCS_FILE_NO_PERMISSIONS [10] */ |
||
385 | "File open error", /* NCS_FILE_OPEN_ERROR [10] */ |
||
386 | "File close error", /* NCS_FILE_CLOSE_ERROR [10] */ |
||
387 | "File IO error", /* NCS_FILE_IO_ERROR [10] */ |
||
388 | |||
389 | "Illegal World Coordinates", /* NCS_SET_EXTENTS_ERROR [13] */ |
||
390 | |||
391 | "Image projection doesn't match controlling layer", /* NCS_FILE_PROJECTION_MISMATCH [14] */ |
||
392 | |||
393 | /** 1.65 gdt errors [15]**/
|
||
394 | "Unknown map projection", /*NCS_GDT_UNKNOWN_PROJECTION,*/ |
||
395 | "Unknown datum", /*NCS_GDT_UNKNOWN_DATUM,*/ |
||
396 | "User specified Geographic Projection Database data server failed", /*NCS_GDT_USER_SERVER_FAILED*/ |
||
397 | "Remote Geographic Projection Database file downloading has been disable and no Geographic Projection Database data is locally available", /*NCS_GDT_REMOTE_PATH_DISABLED*/ |
||
398 | "Invalid transform mode", /*NCS_GDT_BAD_TRANSFORM_MODE,*/ |
||
399 | |||
400 | "coordinate to be transformed is out of bounds", /*NCS_GDT_TRANSFORM_OUT_OF_BOUNDS*/ |
||
401 | |||
402 | "Layer already exists with this layer name", /*NCS_LAYER_DUPLICATE_LAYER_NAME*/ /**[17]**/ |
||
403 | "Layer does not contain this parameter", /*NCS_LAYER_INVALID_PARAMETER*/ /**[18]**/ |
||
404 | |||
405 | "Failed to create pipe", /*NCS_PIPE_CREATE_FAILED*/ /**[19]**/ |
||
406 | |||
407 | /* Directory creation errors */
|
||
408 | "Directory already exists", /*[20] NCS_FILE_MKDIR_EXISTS, Directory already exists */ |
||
409 | "The path was not found", /*[20] NCS_FILE_MKDIR_PATH_NOT_FOUND, The path for the location of the new dir does not exist */ |
||
410 | |||
411 | "The read was cancelled",
|
||
412 | "Error reading georeferencing data from JPEG 2000 file", /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
||
413 | "Error writing georeferencing data to JPEG 2000 file", /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
||
414 | "JPEG 2000 file is not or should not be georeferenced", /*[21] NCS_JP2_GEODATA_NOT_GEOREFERENCED*/ |
||
415 | // Insert new errors before here!
|
||
416 | "Max NCSError enum value!", /* NCS_MAX_ERROR_NUMBER */ /**[08]**/ |
||
417 | ""};
|
||
418 | |||
419 | static char *NCSErrorTextArrayEx[] = { |
||
420 | "No error", /* NCS_SUCCESS */ |
||
421 | /* NCS Raster Errors */
|
||
422 | "Queue node creation failed", /* NCS_QUEUE_NODE_CREATE_FAILED */ |
||
423 | "Could not open file \"%s\" %s", /* NCS_FILE_OPEN_FAILED */ |
||
424 | "The Image Web Server's licensed file limit has been reached %s", /* NCS_FILE_LIMIT_REACHED (license name eg office) */ |
||
425 | "The requested file is larger than is permitted by the license on this Image Web Server %s",/* NCS_FILE_SIZE_LIMIT_REACHED (license name eg office) */ |
||
426 | "Not enough memory for new file", /* NCS_FILE_NO_MEMORY */ |
||
427 | "The Image Web Server's licensed client limit has been reached %s", /* NCS_CLIENT_LIMIT_REACHED (license name eg enterprise) */ |
||
428 | "Detected duplicate open from net layer", /* NCS_DUPLICATE_OPEN */ |
||
429 | "Packet request type not yet implemented %d", /* NCS_PACKET_REQUEST_NYI (packet type num) */ |
||
430 | "Packet type is illegal %d", /* NCS_PACKET_TYPE_ILLEGAL (packet type num) */ |
||
431 | "Client closed while requests outstanding", /* NCS_DESTROY_CLIENT_DANGLING_REQUESTS */ |
||
432 | |||
433 | /* NCS Network Errors */
|
||
434 | "Client UID unknown", /* NCS_UNKNOWN_CLIENT_UID */ |
||
435 | "Could not create new client %s", /* NCS_COULDNT_CREATE_CLIENT (reason) */ |
||
436 | "Could not resolve address of Image Web Server %s", /* NCS_NET_COULDNT_RESOLVE_HOST (ip or hostname) */ |
||
437 | "Could not connect to host %s", /* NCS_NET_COULDNT_CONNECT (reason) */ |
||
438 | "Receive timeout", /* NCS_NET_RECV_TIMEOUT */ |
||
439 | "Error sending header %s", /* NCS_NET_HEADER_SEND_FAILURE (reason) */ |
||
440 | "Error receiving header %s", /* NCS_NET_HEADER_RECV_FAILURE (reason) */ |
||
441 | "Error sending packet", /* NCS_NET_PACKET_SEND_FAILURE */ |
||
442 | "Error receiving packet", /* NCS_NET_PACKET_RECV_FAILURE */ |
||
443 | "401 Unauthorised", /* NCS_NET_401_UNAUTHORISED */ |
||
444 | "403 Forbidden", /* NCS_NET_403_FORBIDDEN */ |
||
445 | "Is the host an Image Web Server?", /* NCS_NET_404_NOT_FOUND */ |
||
446 | "Your HTTP proxy requires authentication,\nthis is presently unsupported by the Image Web Server control", /* NCS_NET_407_PROXYAUTH */ |
||
447 | "Unexpected HTTP response %s", /* NCS_NET_UNEXPECTED_RESPONSE (resonse # or string)*/ |
||
448 | "Bad HTTP response %s", /* NCS_NET_BAD_RESPONSE (resonse # or string) */ |
||
449 | "Already connected", /* NCS_NET_ALREADY_CONNECTED */ |
||
450 | "The connection is invalid", /* NCS_INVALID_CONNECTION */ |
||
451 | "Windows sockets failure %s", /* NCS_WINSOCK_FAILURE (reason (GetLastError()) or wininet version) */ |
||
452 | |||
453 | /* NCS Symbol Errors */
|
||
454 | "Symbology error", /* NCS_SYMBOL_ERROR */ |
||
455 | "Could not open database", /* NCS_OPEN_DB_ERROR */ |
||
456 | "Could not execute the requested query on database", /* NCS_DB_QUERY_FAILED */ |
||
457 | "SQL statement could not be executed", /* NCS_DB_SQL_ERROR */ |
||
458 | "Open symbol layer failed", /* NCS_GET_LAYER_FAILED */ |
||
459 | "The database is not open", /* NCS_DB_NOT_OPEN */ |
||
460 | "This type of quad tree is not supported", /* NCS_QT_TYPE_UNSUPPORTED */ |
||
461 | |||
462 | /* Preference errors */
|
||
463 | "Invalid local user key name specified %s", /* NCS_PREF_INVALID_USER_KEY (key name) */ |
||
464 | "Invalid local machine key name specified %s", /* NCS_PREF_INVALID_MACHINE_KEY (local machine key) */ |
||
465 | "Failed to open registry key %s", /* NCS_REGKEY_OPENEX_FAILED (key name) */ |
||
466 | "Registry query failed %s", /* NCS_REGQUERY_VALUE_FAILED (reason) */ |
||
467 | "Type mismatch in registry variable", /* NCS_INVALID_REG_TYPE */ |
||
468 | |||
469 | /* Misc errors */
|
||
470 | "Invalid arguments passed to function %s", /* NCS_INVALID_ARGUMENTS (function name) */ |
||
471 | "ECW error %s", /* NCS_ECW_ERROR (reason) */ |
||
472 | "Server error %s", /* NCS_SERVER_ERROR (reason) */ |
||
473 | "Unknown error %s", /* NCS_UNKNOWN_ERROR (reason) */ |
||
474 | "Extent conversion failed", /* NCS_EXTENT_ERROR */ |
||
475 | "Could not allocate enough memory %s", /* NCS_COULDNT_ALLOC_MEMORY (what trying to malloc) [12]*/ |
||
476 | "An invalid parameter was used %s", /* NCS_INVALID_PARAMETER (reason) */ |
||
477 | |||
478 | /* Compress errors */
|
||
479 | "Could not perform Read/Write on file %s", /* NCS_FILEIO_ERROR (filename) */ |
||
480 | "Could not open compression task %s", /* NCS_COULDNT_OPEN_COMPRESSION (reason) */ |
||
481 | "Could not perform compression %s", /* NCS_COULDNT_PERFORM_COMPRESSION (reason) */ |
||
482 | "Trying to generate too many output lines", /* NCS_GENERATED_TOO_MANY_OUTPUT_LINES */ |
||
483 | "User cancelled compression", /* NCS_USER_CANCELLED_COMPRESSION */ |
||
484 | "Could not read line from input image file", /* NCS_COULDNT_READ_INPUT_LINE */ |
||
485 | "Input image size exceeded for this version", /* NCS_INPUT_SIZE_EXCEEDED */ |
||
486 | |||
487 | /* Decompression Errors */
|
||
488 | "Specified image region is outside image area", /* NCS_REGION_OUTSIDE_FILE */ |
||
489 | "Supersampling not supported", /* NCS_NO_SUPERSAMPLE */ |
||
490 | "Specified image region has a zero width or height", /* NCS_ZERO_SIZE */ |
||
491 | "More bands specified than exist (%d) in this file (%d)",/* NCS_TOO_MANY_BANDS (bands passed, bands in file) */ |
||
492 | "An invalid band number has been specified %s", /* NCS_INVALID_BAND_NR (bandnr) */ |
||
493 | |||
494 | /* New Compression Error */
|
||
495 | "Input image size is too small to compress", /* NCS_INPUT_SIZE_TOO_SMALL */ |
||
496 | /* NEW Network error */
|
||
497 | "The ECWP client version (%s) is incompatible with this server (%s)", /* NCS_INCOMPATIBLE_PROTOCOL_VERSION (clientver, server ver) */ |
||
498 | "Windows Internet Client error %s", /* NCS_WININET_FAILURE (reason) */ |
||
499 | "Could not load wininet.dll %s", /* NCS_COULDNT_LOAD_WININET (reason) */ |
||
500 | |||
501 | /* NCSFile && NCSRenderer class errors */
|
||
502 | "Invalid SetView parameters or SetView not called.", /* NCS_FILE_INVALID_SETVIEW */ |
||
503 | "There is no open ECW file.", /* NCS_FILE_NOT_OPEN */ |
||
504 | |||
505 | /* NEW JNI Java Errors */
|
||
506 | "Class does not implement ECWProgressiveDisplay interface.",/* NCS_JNI_REFRESH_NOT_IMPLEMENTED */ |
||
507 | |||
508 | /* NEW Coordinate Errors */
|
||
509 | "Incompatible coordinate systems", /* NCS_INCOMPATIBLE_COORDINATE_SYSTEMS */ |
||
510 | "Incompatible coordinate datum types", /* NCS_INCOMPATIBLE_COORDINATE_DATUM */ |
||
511 | "Incompatible coordinate projection types", /* NCS_INCOMPATIBLE_COORDINATE_PROJECTION */ |
||
512 | "Incompatible coordinate units types", /* NCS_INCOMPATIBLE_COORDINATE_UNITS */ |
||
513 | "Non-linear coordinate systems not supported", /* NCS_COORDINATE_CANNOT_BE_TRANSFORMED */ |
||
514 | "GDT Error : %s", /* NCS_GDT_ERROR (reason) */ |
||
515 | "Zero length packet : %s", /* NCS_NET_PACKET_RECV_ZERO_LENGTH (reason) */ /**[01]**/ |
||
516 | "Must use Japanese version of the ECW SDK", /* NCS_UNSUPPORTEDLANGUAGE */ /**[02]**/ |
||
517 | "Lost of connection to server : %s", /* NCS_CONNECTION_LOST */ /**[03]**/ |
||
518 | "NCSGdt coordinate conversion failed : %s", /* NCS_COORD_CONVERT_ERROR */ |
||
519 | "Failed to open metabase : %s", /* NCS_METABASE_OPEN_FAILED*/ /**[04]**/ |
||
520 | "Failed to get value from metabase : %s", /* NCS_METABASE_GET_FAILED*/ /**[04]**/ |
||
521 | "Timeout sending header : %s", /* NCS_NET_HEADER_SEND_TIMEOUT*/ /**[05]**/ |
||
522 | "Java JNI error : %s", /* NCS_JNI_ERROR */ /**[06]**/ |
||
523 | "No data source passed", /* NCS_DB_INVALID_NAME */ |
||
524 | "Could not resolve address of Image Web Server Symbol Server Extension", /* NCS_SYMBOL_COULDNT_RESOLVE_HOST */ |
||
525 | "Invalid NCSError value!", /* NCS_INVALID_ERROR_ENUM */ /**[08]**/ |
||
526 | /* NCSFileIO errors [10] */
|
||
527 | "End Of File reached : %s", /* NCS_FILE_EOF [10] */ |
||
528 | "File not found : %s", /* NCS_FILE_NOT_FOUND [10] */ |
||
529 | "File is invalid or corrupt : %s", /* NCS_FILE_INVALID [10] */ |
||
530 | "Attempted to read, write or seek past file limits : %s", /* NCS_FILE_SEEK_ERROR [10] */ |
||
531 | "Permissions not available to access file : %s", /* NCS_FILE_NO_PERMISSIONS [10] */ |
||
532 | "File open error : %s", /* NCS_FILE_OPEN_ERROR [10] */ |
||
533 | "File close error : %s", /* NCS_FILE_CLOSE_ERROR [10] */ |
||
534 | "File IO error : %s", /* NCS_FILE_IO_ERROR [10] */ |
||
535 | |||
536 | "Illegal World Coordinates : %s", /* NCS_SET_EXTENTS_ERROR [13] */ |
||
537 | |||
538 | "Image projection doesn't match controlling layer : %s", /* NCS_FILE_PROJECTION_MISMATCH [14] */ |
||
539 | |||
540 | /** 1.65 gdt errors [15]**/
|
||
541 | "Unknown map projection: %s", /*NCS_GDT_UNKNOWN_PROJECTION,*/ |
||
542 | "Unknown datum: %s", /*NCS_GDT_UNKNOWN_DATUM,*/ |
||
543 | "User specified Geographic Projection Database data server failed while loading %s. Please check your network connection and if the problem persists contact the website administrator.", /*NCS_GDT_USER_SERVER_FAILED*/ |
||
544 | "Remote Geographic Projection Database file downloading has been disable and no Geographic Projection Database data is locally available", /*NCS_GDT_REMOTE_PATH_DISABLED*/ |
||
545 | "Invalid transform mode: %s", /*NCS_GDT_BAD_TRANSFORM_MODE, [17]**/ |
||
546 | |||
547 | "coordinate to be transformed is out of bounds: %s", /*NCS_GDT_TRANSFORM_OUT_OF_BOUNDS*/ |
||
548 | |||
549 | "Layer already exists with this name : %s", /*NCS_LAYER_DUPLICATE_LAYER_NAME*/ /**[17]**/ |
||
550 | "Layer does not contain this parameter : %s", /*NCS_LAYER_INVALID_PARAMETER*/ /**[18]**/ |
||
551 | |||
552 | "Failed to create pipe : %s", /*NCS_PIPE_CREATE_FAILED*/ /**[19]**/ |
||
553 | |||
554 | /* Directory creation errors */
|
||
555 | "Directory already exists : %s", /*[20] NCS_FILE_MKDIR_EXISTS, Directory already exists */ |
||
556 | "The path was not found : %s", /*[20] NCS_FILE_MKDIR_PATH_NOT_FOUND, The path for the location of the new dir does not exist */ |
||
557 | |||
558 | "The read was cancelled",
|
||
559 | "Error reading georeferencing data from JPEG 2000 file: %s", /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
||
560 | "Error writing georeferencing data to JPEG 2000 file: %s", /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
||
561 | "JPEG 2000 file is not or should not be georeferenced: %s", /*[21] NCS_JP2_GEODATA_NOT_GEOREFERENCED*/ |
||
562 | |||
563 | // Insert new errors before here!
|
||
564 | "Max NCSError enum value!", /* NCS_MAX_ERROR_NUMBER */ /**[08]**/ |
||
565 | ""};
|
||
566 | |||
567 | #endif /* NCSERROR_DEFINE_GLOBALS */ |
||
568 | |||
569 | /**
|
||
570 | * @def Macro for checking success status on error return values
|
||
571 | */
|
||
572 | #define NCS_SUCCEEDED(nError) (nError == NCS_SUCCESS)
|
||
573 | /**
|
||
574 | * @def Macro for checking fail status on error return values
|
||
575 | */
|
||
576 | #define NCS_FAILED(nError) (nError != NCS_SUCCESS)
|
||
577 | |||
578 | void NCSErrorInit(void); |
||
579 | void NCSErrorFini(void); |
||
580 | |||
581 | /**
|
||
582 | * Construct a message box displaying the error test for the last reported error
|
||
583 | * @param nError The error
|
||
584 | * @param pWindow The parent window of the message box
|
||
585 | */
|
||
586 | void NCSGetLastErrorTextMsgBox(NCSError nError, void *pWindow); |
||
587 | /**
|
||
588 | * Return formatted error text for a series of errors
|
||
589 | * @param nError Variable length list of error arguments
|
||
590 | * @return (char *) value, formatted error text
|
||
591 | */
|
||
592 | const char * NCSFormatErrorText(NCSError nError, ...); |
||
593 | /**
|
||
594 | * Return error text for the last error
|
||
595 | * @param nError Error number
|
||
596 | * @return (char *) value, error text
|
||
597 | */
|
||
598 | const char * NCSGetLastErrorText(NCSError nError); |
||
599 | /**
|
||
600 | * Get the error number of the last error that has occurred
|
||
601 | * @return NCSError value, the last error number
|
||
602 | */
|
||
603 | NCSError NCSGetLastErrorNum(void);
|
||
604 | |||
605 | #ifdef WIN32 // [11] |
||
606 | |||
607 | DWORD NCSDbgGetExceptionInfoMsg(EXCEPTION_POINTERS *pExceptionPtr, char *pMessage);
|
||
608 | |||
609 | #endif /* MACINTOSH */ |
||
610 | |||
611 | // Deprecated
|
||
612 | extern const char * NCSGetErrorText(NCSError eError); |
||
613 | |||
614 | #ifdef WIN32
|
||
615 | #ifdef _WIN32_WCE
|
||
616 | #define MSGBOX_WARNING_FLAGS (MB_OK|MB_ICONINFORMATION)
|
||
617 | #define MSGBOX_ERROR_FLAGS (MB_OK|MB_ICONERROR)
|
||
618 | #else
|
||
619 | #define MSGBOX_WARNING_FLAGS (MB_OK|MB_ICONINFORMATION|MB_TASKMODAL)
|
||
620 | #define MSGBOX_ERROR_FLAGS (MB_OK|MB_ICONERROR|MB_TASKMODAL)
|
||
621 | #endif
|
||
622 | #elif defined PALM
|
||
623 | NCSError NCSPalmGetNCSError(Err eErr); |
||
624 | #endif
|
||
625 | |||
626 | #ifdef __cplusplus
|
||
627 | } |
||
628 | #endif
|
||
629 | |||
630 | #endif /* NCSERRORS_H */ |