PageRenderTime 57ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/ATF2/control-software/epics-3.14.8/base/src/gdd/dbMapper.cc

http://atf2flightsim.googlecode.com/
C++ | 1805 lines | 1462 code | 240 blank | 103 comment | 159 complexity | 48658eb99272f2e68d5c5bea7835f05c MD5 | raw file
Possible License(s): BSD-2-Clause, LGPL-2.0, IPL-1.0, BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. /*************************************************************************\
  2. * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
  3. * National Laboratory.
  4. * Copyright (c) 2002 The Regents of the University of California, as
  5. * Operator of Los Alamos National Laboratory.
  6. * EPICS BASE Versions 3.13.7
  7. * and higher are distributed subject to a Software License Agreement found
  8. * in file LICENSE that is included with this distribution.
  9. \*************************************************************************/
  10. // Author: Jim Kowalkowski
  11. // Date: 2/96
  12. //
  13. // dbMapper.cc,v 1.39.2.4 2009/07/09 17:06:45 anj Exp
  14. //
  15. #define DB_MAPPER_SOURCE 1
  16. #include <stdio.h>
  17. #include <epicsAlgorithm.h>
  18. #define epicsExportSharedSymbols
  19. #include "gddApps.h"
  20. #include "gddAppTable.h"
  21. #include "dbMapper.h"
  22. // #include "templates/dbMapperTempl.h"
  23. // hardcoded in same order as aitConvert.h
  24. // no way to detect a string type!!!!!!!
  25. extern epicsShareDef const int gddAitToDbr[aitConvertLast+1] = {
  26. DBR_STRING,
  27. DBR_CHAR,
  28. DBR_CHAR,
  29. DBR_SHORT,
  30. DBR_SHORT,
  31. DBR_ENUM,
  32. DBR_LONG,
  33. DBR_LONG,
  34. DBR_FLOAT,
  35. DBR_DOUBLE,
  36. DBR_STRING,
  37. DBR_STRING
  38. };
  39. extern epicsShareDef const unsigned gddDbrToAitNElem =
  40. sizeof(gddAitToDbr)/sizeof(gddAitToDbr[0]);
  41. /*
  42. * application type ("app" field) is initialized
  43. * at run tim using the "app_name" field.
  44. */
  45. epicsShareDef gddDbrToAitTable gddDbrToAit[DBM_N_DBR_TYPES] = {
  46. // Atomic
  47. { aitEnumFixedString, 0, "value" }, // DBR_STRING
  48. { aitEnumInt16, 0, "value" }, // DBR_SHORT
  49. { aitEnumFloat32, 0, "value" }, // DBR_FLOAT
  50. { aitEnumEnum16, 0, "value" }, // DBR_ENUM
  51. { aitEnumInt8, 0, "value" }, // DBR_CHAR
  52. { aitEnumInt32, 0, "value" }, // DBR_LONG
  53. { aitEnumFloat64, 0, "value" }, // DBR_DOUBLE
  54. // Status
  55. { aitEnumFixedString, 0, "value" }, // DBR_STS_STRING
  56. { aitEnumInt16, 0, "value" }, // DBR_STS_SHORT
  57. { aitEnumFloat32, 0, "value" }, // DBR_STS_FLOAT
  58. { aitEnumEnum16, 0, "value" }, // DBR_STS_ENUM
  59. { aitEnumInt8, 0, "value" }, // DBR_STS_CHAR
  60. { aitEnumInt32, 0, "value" }, // DBR_STS_LONG
  61. { aitEnumFloat64, 0, "value" }, // DBR_STS_DOUBLE
  62. // Time
  63. { aitEnumFixedString, 0, "value" }, // DBR_TIME_STRING
  64. { aitEnumInt16, 0, "value" }, // DBR_TIME_SHORT
  65. { aitEnumFloat32, 0, "value" }, // DBR_TIME_FLOAT
  66. { aitEnumEnum16, 0, "value" }, // DBR_TIME_ENUM
  67. { aitEnumInt8, 0, "value" }, // DBR_TIME_CHAR
  68. { aitEnumInt32, 0, "value" }, // DBR_TIME_LONG
  69. { aitEnumFloat64, 0, "value" }, // DBR_TIME_DOUBLE
  70. // Graphic
  71. { aitEnumFixedString, 0, "value" }, // DBR_GR_STRING
  72. { aitEnumInt16, 0, "dbr_gr_short" }, // DBR_GR_SHORT
  73. { aitEnumFloat32, 0, "dbr_gr_float" }, // DBR_GR_FLOAT
  74. { aitEnumEnum16, 0, "dbr_gr_enum" }, // DBR_GR_ENUM
  75. { aitEnumInt8, 0, "dbr_gr_char" }, // DBR_GR_CHAR
  76. { aitEnumInt32, 0, "dbr_gr_long" }, // DBR_GR_LONG
  77. { aitEnumFloat64, 0, "dbr_gr_double" }, // DBR_GR_DOUBLE
  78. // Control
  79. { aitEnumFixedString, 0, "value" }, // DBR_CTRL_STRING
  80. { aitEnumInt16, 0, "dbr_ctrl_short" }, // DBR_CTRL_SHORT
  81. { aitEnumFloat32, 0, "dbr_ctrl_float" }, // DBR_CTRL_FLOAT
  82. { aitEnumEnum16, 0, "dbr_ctrl_enum" }, // DBR_CTRL_ENUM
  83. { aitEnumInt8, 0, "dbr_ctrl_char" }, // DBR_CTRL_CHAR
  84. { aitEnumInt32, 0, "dbr_ctrl_long" }, // DBR_CTRL_LONG
  85. { aitEnumFloat64, 0, "dbr_ctrl_double" }, // DBR_CTRL_DOUBLE
  86. // Ack
  87. { aitEnumUint16, 0, "ackt" }, // DBR_PUT_ACKT
  88. { aitEnumUint16, 0, "acks" }, // DBR_PUT_ACKS
  89. { aitEnumFixedString, 0, "dbr_stsack_string" }, // DBR_STSACK_STRING
  90. // Class
  91. { aitEnumFixedString, 0, "class" } // DBR_CLASS_NAME
  92. };
  93. #if DBM_N_DBR_TYPES != (LAST_BUFFER_TYPE+1)
  94. #error db mapper is out of sync with db_access.h
  95. #endif
  96. static gddApplicationTypeTable* type_table = NULL;
  97. static aitDataFormat local_data_format=aitLocalDataFormat;
  98. extern epicsShareDef const unsigned gddAitToDbrNElem =
  99. sizeof(gddDbrToAit)/sizeof(gddDbrToAit[0]);
  100. //
  101. // special gddDestructor guarantees same form of new and delete
  102. //
  103. class dbMapperFixedStringDestructor: public gddDestructor {
  104. virtual void run (void *);
  105. };
  106. // I generated a container for each of the important DBR types. This
  107. // includes all the control and graphic structures. The others are
  108. // not needed become you can get time stamp and status in each gdd.
  109. // Currently the containers are built here with c++ code.
  110. // string type needs to be written special and not use template
  111. // maybe create a template for the string type
  112. // the problem is that the value of a string structure is an array,
  113. // not just a single element
  114. static smartGDDPointer mapStringToGdd(void* v,aitIndex count) {
  115. aitFixedString* db = (aitFixedString*)v;
  116. aitEnum to_type = gddDbrToAit[DBR_STRING].type;
  117. aitUint16 to_app = gddDbrToAit[DBR_STRING].app;
  118. if(count<=1)
  119. {
  120. smartGDDPointer dd = new gddScalar(to_app,to_type);
  121. dd->unreference();
  122. dd->put(*db);
  123. return dd;
  124. }
  125. else
  126. {
  127. smartGDDPointer dd=new gddAtomic(to_app,to_type,1,count);
  128. dd->unreference();
  129. aitFixedString* pCopy = new aitFixedString [count];
  130. memcpy (pCopy,db,sizeof(aitFixedString)*count);
  131. dd->putRef(db,new dbMapperFixedStringDestructor);
  132. return dd;
  133. }
  134. }
  135. static int mapGddToString(void* vd, aitIndex count,
  136. const gdd & dd, const gddEnumStringTable &enumStringTable) {
  137. aitFixedString* db = (aitFixedString*)vd;
  138. aitIndex sz = dd.getDataSizeElements();
  139. const void* v = dd.dataVoid();
  140. int status;
  141. if (count>sz) {
  142. memset (db+sz, '\0', sizeof(*db)*(count-sz));
  143. count = sz;
  144. }
  145. if(local_data_format==aitLocalDataFormat) {
  146. if((aitFixedString*)v!=db) {
  147. status = aitConvert(aitEnumFixedString,db,
  148. dd.primitiveType(),v,count, &enumStringTable);
  149. }
  150. else {
  151. status = sz*sizeof(aitFixedString);
  152. }
  153. }
  154. else {
  155. status = aitConvertToNet(aitEnumFixedString,
  156. db,dd.primitiveType(),v,count, &enumStringTable);
  157. }
  158. return status;
  159. }
  160. static smartGDDPointer mapShortToGdd(void* v,aitIndex count) {
  161. dbr_short_t* sv = (dbr_short_t*)v;
  162. if(count>1) {
  163. smartGDDPointer dd=new gddAtomic(gddDbrToAit[DBR_SHORT].app,
  164. gddDbrToAit[DBR_SHORT].type,1,count);
  165. dd->unreference();
  166. dbr_short_t* pCopy = (dbr_short_t*) new char [sizeof(dbr_short_t)*count];
  167. memcpy (pCopy,sv,sizeof(dbr_short_t)*count);
  168. dd->putRef(pCopy, new gddDestructor);
  169. return dd;
  170. } else {
  171. smartGDDPointer dd=new gddScalar(gddDbrToAit[DBR_SHORT].app);
  172. dd->unreference();
  173. *dd=*sv;
  174. return dd;
  175. }
  176. }
  177. static int mapGddToShort(void* vd, aitIndex count, const gdd &dd,
  178. const gddEnumStringTable &enumStringTable) {
  179. dbr_short_t* sv = (dbr_short_t*)vd;
  180. aitIndex sz = dd.getDataSizeElements();
  181. const void * v=dd.dataVoid();
  182. int status;
  183. if (count>sz) {
  184. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  185. count = sz;
  186. }
  187. if (local_data_format==aitLocalDataFormat) {
  188. if((dbr_short_t*)v!=sv) {
  189. status = aitConvert(aitEnumInt16,sv,
  190. dd.primitiveType(),v,count, &enumStringTable);
  191. }
  192. else {
  193. status = count*sizeof(dbr_short_t);
  194. }
  195. }
  196. else {
  197. status = aitConvertToNet(aitEnumInt16,sv,
  198. dd.primitiveType(),v,count, &enumStringTable);
  199. }
  200. return status;
  201. }
  202. static smartGDDPointer mapFloatToGdd(void* v,aitIndex count) {
  203. dbr_float_t* sv = (dbr_float_t*)v;
  204. if(count>1) {
  205. smartGDDPointer dd=new gddAtomic(gddDbrToAit[DBR_FLOAT].app,
  206. gddDbrToAit[DBR_FLOAT].type,1,count);
  207. dd->unreference();
  208. dbr_float_t* pCopy = (dbr_float_t*) new char [sizeof(dbr_float_t)*count];
  209. memcpy (pCopy,sv,sizeof(dbr_float_t)*count);
  210. dd->putRef(pCopy, new gddDestructor);
  211. return dd;
  212. } else {
  213. smartGDDPointer dd=new gddScalar(gddDbrToAit[DBR_FLOAT].app);
  214. dd->unreference();
  215. *dd=*sv;
  216. return dd;
  217. }
  218. }
  219. static int mapGddToFloat(void* vd, aitIndex count,
  220. const gdd & dd, const gddEnumStringTable &enumStringTable) {
  221. dbr_float_t* sv = (dbr_float_t*)vd;
  222. aitIndex sz=dd.getDataSizeElements();
  223. const void * v = dd.dataVoid();
  224. int status;
  225. if (count>sz) {
  226. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  227. count = sz;
  228. }
  229. if(local_data_format==aitLocalDataFormat) {
  230. if((dbr_float_t*)v!=sv) {
  231. status = aitConvert(aitEnumFloat32,sv,
  232. dd.primitiveType(),v,count, &enumStringTable);
  233. }
  234. else {
  235. status = sz*sizeof(dbr_float_t);
  236. }
  237. }
  238. else {
  239. status = aitConvertToNet(aitEnumFloat32,sv,
  240. dd.primitiveType(),v,count, &enumStringTable);
  241. }
  242. return status;
  243. }
  244. static smartGDDPointer mapEnumToGdd(void* v,aitIndex count) {
  245. dbr_enum_t* sv = (dbr_enum_t*)v;
  246. smartGDDPointer dd;
  247. if(count>1) {
  248. dd=new gddAtomic(gddDbrToAit[DBR_ENUM].app,
  249. gddDbrToAit[DBR_ENUM].type,1,count);
  250. dd->unreference();
  251. dbr_enum_t* pCopy = (dbr_enum_t *) new char [sizeof(dbr_enum_t)*count];
  252. memcpy (pCopy,sv,sizeof(dbr_enum_t)*count);
  253. dd->putRef(pCopy, new gddDestructor);
  254. } else {
  255. dd=new gddScalar(gddDbrToAit[DBR_ENUM].app);
  256. dd->unreference();
  257. *dd=*sv;
  258. }
  259. return dd;
  260. }
  261. static int mapGddToEnum(void* vd, aitIndex count, const gdd & dd,
  262. const gddEnumStringTable &enumStringTable) {
  263. dbr_enum_t* sv = (dbr_enum_t*)vd;
  264. aitIndex sz=dd.getDataSizeElements();
  265. const void* v = dd.dataVoid();
  266. int status;
  267. if (count>sz) {
  268. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  269. count = sz;
  270. }
  271. if(local_data_format==aitLocalDataFormat) {
  272. if((dbr_enum_t*)v!=sv) {
  273. status = aitConvert(aitEnumEnum16,sv,
  274. dd.primitiveType(),v,count, &enumStringTable);
  275. }
  276. else {
  277. status = sizeof(dbr_enum_t)*count;
  278. }
  279. }
  280. else {
  281. status = aitConvertToNet(aitEnumEnum16,sv,
  282. dd.primitiveType(),v,count, &enumStringTable);
  283. }
  284. return status;
  285. }
  286. static smartGDDPointer mapCharToGdd(void* v,aitIndex count) {
  287. dbr_char_t* sv = (dbr_char_t*)v;
  288. smartGDDPointer dd;
  289. if(count>1) {
  290. dd=new gddAtomic(gddDbrToAit[DBR_CHAR].app,
  291. gddDbrToAit[DBR_CHAR].type,1,count);
  292. dd->unreference();
  293. dbr_char_t* pCopy = (dbr_char_t *) new char [sizeof(dbr_char_t)*count];
  294. memcpy (pCopy,sv,sizeof(dbr_char_t)*count);
  295. dd->putRef(pCopy, new gddDestructor);
  296. } else {
  297. dd=new gddScalar(gddDbrToAit[DBR_CHAR].app);
  298. dd->unreference();
  299. *dd=*sv;
  300. }
  301. return dd;
  302. }
  303. static int mapGddToChar(void* vd, aitIndex count,
  304. const gdd & dd, const gddEnumStringTable &enumStringTable) {
  305. dbr_char_t* sv = (dbr_char_t*)vd;
  306. aitIndex sz=dd.getDataSizeElements();
  307. const void* v = dd.dataVoid();
  308. int status;
  309. if (count>sz) {
  310. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  311. count = sz;
  312. }
  313. if (local_data_format==aitLocalDataFormat) {
  314. if((dbr_char_t*)v!=sv) {
  315. status = aitConvert(aitEnumInt8,sv,
  316. dd.primitiveType(),v,count, &enumStringTable);
  317. }
  318. else {
  319. status = sz*sizeof(dbr_char_t);
  320. }
  321. }
  322. else {
  323. status = aitConvertToNet(aitEnumInt8,sv,
  324. dd.primitiveType(),v,count, &enumStringTable);
  325. }
  326. return status;
  327. }
  328. static smartGDDPointer mapLongToGdd(void* v,aitIndex count) {
  329. dbr_long_t* sv = (dbr_long_t*)v;
  330. smartGDDPointer dd;
  331. if(count>1) {
  332. dd=new gddAtomic(gddDbrToAit[DBR_LONG].app,
  333. gddDbrToAit[DBR_LONG].type,1,count);
  334. dd->unreference();
  335. dbr_long_t* pCopy = (dbr_long_t*) new char [sizeof(dbr_long_t)*count];
  336. memcpy (pCopy,sv,sizeof(dbr_long_t)*count);
  337. dd->putRef(pCopy, new gddDestructor);
  338. } else {
  339. dd=new gddScalar(gddDbrToAit[DBR_LONG].app);
  340. dd->unreference();
  341. *dd=*sv;
  342. }
  343. return dd;
  344. }
  345. static int mapGddToLong(void* vd, aitIndex count, const gdd & dd,
  346. const gddEnumStringTable &enumStringTable) {
  347. dbr_long_t* sv = (dbr_long_t*)vd;
  348. aitIndex sz=dd.getDataSizeElements();
  349. const void* v = dd.dataVoid();
  350. int status;
  351. if (count>sz) {
  352. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  353. count = sz;
  354. }
  355. if (local_data_format==aitLocalDataFormat) {
  356. if ((dbr_long_t*)v!=sv) {
  357. status = aitConvert(aitEnumInt32,sv,
  358. dd.primitiveType(),v,count, &enumStringTable);
  359. }
  360. else {
  361. status = count*sizeof(dbr_long_t);
  362. }
  363. }
  364. else {
  365. status = aitConvertToNet(aitEnumInt32,sv,
  366. dd.primitiveType(),v,count, &enumStringTable);
  367. }
  368. return status;
  369. }
  370. static smartGDDPointer mapDoubleToGdd(void* v,aitIndex count) {
  371. dbr_double_t* sv = (dbr_double_t*)v;
  372. smartGDDPointer dd;
  373. if(count>1) {
  374. dd=new gddAtomic(gddDbrToAit[DBR_DOUBLE].app,
  375. gddDbrToAit[DBR_DOUBLE].type,1,count);
  376. dd->unreference();
  377. dbr_double_t* pCopy = (dbr_double_t *) new char [sizeof(dbr_double_t)*count];
  378. memcpy (pCopy,sv,sizeof(dbr_double_t)*count);
  379. dd->putRef(pCopy, new gddDestructor);
  380. } else {
  381. dd=new gddScalar(gddDbrToAit[DBR_DOUBLE].app);
  382. dd->unreference();
  383. *dd=*sv;
  384. }
  385. return dd;
  386. }
  387. static int mapGddToDouble(void* vd, aitIndex count, const gdd & dd,
  388. const gddEnumStringTable &enumStringTable) {
  389. dbr_double_t* sv = (dbr_double_t*)vd;
  390. aitIndex sz=dd.getDataSizeElements();
  391. const void* v = dd.dataVoid();
  392. int status;
  393. if (count>sz) {
  394. memset (sv+sz, '\0', sizeof(*sv)*(count-sz));
  395. count = sz;
  396. }
  397. if (local_data_format==aitLocalDataFormat) {
  398. if ((dbr_double_t*)v!=sv) {
  399. status = aitConvert(aitEnumFloat64,sv,
  400. dd.primitiveType(),v,count, &enumStringTable);
  401. }
  402. else {
  403. status = count*sizeof(dbr_double_t);
  404. }
  405. }
  406. else {
  407. status = aitConvertToNet(aitEnumFloat64,sv,
  408. dd.primitiveType(),v,count, &enumStringTable);
  409. }
  410. return status;
  411. }
  412. // ********************************************************************
  413. // sts structure mappings
  414. // ********************************************************************
  415. static smartGDDPointer mapStsStringToGdd(void* v,aitIndex count)
  416. {
  417. dbr_sts_string* db = (dbr_sts_string*)v;
  418. aitFixedString* dbv = (aitFixedString*)db->value;
  419. aitEnum to_type = gddDbrToAit[DBR_STS_STRING].type;
  420. aitUint16 to_app = gddDbrToAit[DBR_STS_STRING].app;
  421. smartGDDPointer dd;
  422. if(count<=1)
  423. {
  424. dd=new gddScalar(to_app,to_type);
  425. dd->unreference();
  426. dd->put(*dbv);
  427. }
  428. else
  429. {
  430. dd=new gddAtomic(to_app,to_type,1,count);
  431. dd->unreference();
  432. aitFixedString* pCopy = (aitFixedString*) new char [sizeof(aitFixedString)*count];
  433. memcpy (pCopy,dbv,sizeof(aitFixedString)*count);
  434. dd->putRef(pCopy, new gddDestructor);
  435. }
  436. dd->setStatSevr(db->status,db->severity);
  437. return dd;
  438. }
  439. static int mapStsGddToString(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  440. {
  441. dbr_sts_string* db = (dbr_sts_string*)v;
  442. aitFixedString* dbv = (aitFixedString*)db->value;
  443. dd.getStatSevr(db->status,db->severity);
  444. return mapGddToString(dbv, count, dd, enumStringTable);
  445. }
  446. static smartGDDPointer mapStsShortToGdd(void* v,aitIndex count)
  447. {
  448. dbr_sts_short* dbv = (dbr_sts_short*)v;
  449. smartGDDPointer dd=mapShortToGdd(&dbv->value,count);
  450. dd->setStatSevr(dbv->status,dbv->severity);
  451. return dd;
  452. }
  453. static int mapStsGddToShort(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  454. {
  455. dbr_sts_short* dbv = (dbr_sts_short*)v;
  456. dd.getStatSevr(dbv->status,dbv->severity);
  457. return mapGddToShort(&dbv->value, count, dd, enumStringTable);
  458. }
  459. static smartGDDPointer mapStsFloatToGdd(void* v,aitIndex count)
  460. {
  461. dbr_sts_float* dbv = (dbr_sts_float*)v;
  462. smartGDDPointer dd=mapFloatToGdd(&dbv->value,count);
  463. dd->setStatSevr(dbv->status,dbv->severity);
  464. return dd;
  465. }
  466. static int mapStsGddToFloat(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  467. {
  468. dbr_sts_float* dbv = (dbr_sts_float*)v;
  469. dd.getStatSevr(dbv->status,dbv->severity);
  470. return mapGddToFloat(&dbv->value,count,dd, enumStringTable);
  471. }
  472. static smartGDDPointer mapStsEnumToGdd(void* v,aitIndex count)
  473. {
  474. dbr_sts_enum* dbv = (dbr_sts_enum*)v;
  475. smartGDDPointer dd=mapEnumToGdd(&dbv->value,count);
  476. dd->setStatSevr(dbv->status,dbv->severity);
  477. return dd;
  478. }
  479. static int mapStsGddToEnum(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  480. {
  481. dbr_sts_enum* dbv = (dbr_sts_enum*)v;
  482. dd.getStatSevr(dbv->status,dbv->severity);
  483. return mapGddToEnum(&dbv->value,count,dd, enumStringTable);
  484. }
  485. static smartGDDPointer mapStsCharToGdd(void* v,aitIndex count)
  486. {
  487. dbr_sts_char* dbv = (dbr_sts_char*)v;
  488. smartGDDPointer dd=mapCharToGdd(&dbv->value,count);
  489. dd->setStatSevr(dbv->status,dbv->severity);
  490. return dd;
  491. }
  492. static int mapStsGddToChar(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  493. {
  494. dbr_sts_char* dbv = (dbr_sts_char*)v;
  495. dd.getStatSevr(dbv->status,dbv->severity);
  496. dbv->RISC_pad = '\0'; // shut up purify
  497. return mapGddToChar(&dbv->value,count,dd, enumStringTable);
  498. }
  499. static smartGDDPointer mapStsLongToGdd(void* v,aitIndex count)
  500. {
  501. dbr_sts_long* dbv = (dbr_sts_long*)v;
  502. smartGDDPointer dd=mapLongToGdd(&dbv->value,count);
  503. dd->setStatSevr(dbv->status,dbv->severity);
  504. return dd;
  505. }
  506. static int mapStsGddToLong(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  507. {
  508. dbr_sts_long* dbv = (dbr_sts_long*)v;
  509. dd.getStatSevr(dbv->status,dbv->severity);
  510. return mapGddToLong(&dbv->value,count,dd, enumStringTable);
  511. }
  512. static smartGDDPointer mapStsDoubleToGdd(void* v,aitIndex count)
  513. {
  514. dbr_sts_double* dbv = (dbr_sts_double*)v;
  515. smartGDDPointer dd=mapDoubleToGdd(&dbv->value,count);
  516. dd->setStatSevr(dbv->status,dbv->severity);
  517. return dd;
  518. }
  519. static int mapStsGddToDouble(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  520. {
  521. dbr_sts_double* dbv = (dbr_sts_double*)v;
  522. dd.getStatSevr(dbv->status,dbv->severity);
  523. dbv->RISC_pad = 0; // shut up purify
  524. return mapGddToDouble(&dbv->value,count,dd, enumStringTable);
  525. }
  526. // ********************************************************************
  527. // time structure mappings
  528. // ********************************************************************
  529. static smartGDDPointer mapTimeStringToGdd(void* v,aitIndex count)
  530. {
  531. dbr_time_string* db = (dbr_time_string*)v;
  532. aitFixedString* dbv = (aitFixedString*)db->value;
  533. aitEnum to_type = gddDbrToAit[DBR_TIME_STRING].type;
  534. aitUint16 to_app = gddDbrToAit[DBR_TIME_STRING].app;
  535. smartGDDPointer dd;
  536. if(count<=1)
  537. {
  538. dd=new gddScalar(to_app,to_type);
  539. dd->unreference();
  540. dd->put(*dbv);
  541. }
  542. else
  543. {
  544. dd=new gddAtomic(to_app,to_type,1,count);
  545. dd->unreference();
  546. aitFixedString* pCopy = (aitFixedString*) new char [sizeof(aitFixedString)*count];
  547. memcpy (pCopy,dbv,sizeof(aitFixedString)*count);
  548. dd->putRef(pCopy, new gddDestructor);
  549. }
  550. dd->setStatSevr(db->status,db->severity);
  551. dd->setTimeStamp(&db->stamp);
  552. return dd;
  553. }
  554. static int mapTimeGddToString(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  555. {
  556. dbr_time_string* db = (dbr_time_string*)v;
  557. aitFixedString* dbv = (aitFixedString*)db->value;
  558. dd.getStatSevr(db->status,db->severity);
  559. dd.getTimeStamp(&db->stamp);
  560. return mapGddToString(dbv, count, dd, enumStringTable);
  561. }
  562. static smartGDDPointer mapTimeShortToGdd(void* v,aitIndex count)
  563. {
  564. dbr_time_short* dbv = (dbr_time_short*)v;
  565. smartGDDPointer dd=mapShortToGdd(&dbv->value,count);
  566. dd->setStatSevr(dbv->status,dbv->severity);
  567. dd->setTimeStamp(&dbv->stamp);
  568. return dd;
  569. }
  570. static int mapTimeGddToShort(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  571. {
  572. dbr_time_short* dbv = (dbr_time_short*)v;
  573. dd.getStatSevr(dbv->status,dbv->severity);
  574. dd.getTimeStamp(&dbv->stamp);
  575. dbv->RISC_pad = 0; // shut up purify
  576. return mapGddToShort(&dbv->value,count,dd, enumStringTable);
  577. }
  578. static smartGDDPointer mapTimeFloatToGdd(void* v,aitIndex count)
  579. {
  580. dbr_time_float* dbv = (dbr_time_float*)v;
  581. smartGDDPointer dd=mapFloatToGdd(&dbv->value,count);
  582. dd->setStatSevr(dbv->status,dbv->severity);
  583. dd->setTimeStamp(&dbv->stamp);
  584. return dd;
  585. }
  586. static int mapTimeGddToFloat(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  587. {
  588. dbr_time_float* dbv = (dbr_time_float*)v;
  589. dd.getStatSevr(dbv->status,dbv->severity);
  590. dd.getTimeStamp(&dbv->stamp);
  591. return mapGddToFloat(&dbv->value,count,dd, enumStringTable);
  592. }
  593. static smartGDDPointer mapTimeEnumToGdd(void* v,aitIndex count)
  594. {
  595. dbr_time_enum* dbv = (dbr_time_enum*)v;
  596. smartGDDPointer dd=mapEnumToGdd(&dbv->value,count);
  597. dd->setStatSevr(dbv->status,dbv->severity);
  598. dd->setTimeStamp(&dbv->stamp);
  599. return dd;
  600. }
  601. static int mapTimeGddToEnum(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  602. {
  603. dbr_time_enum* dbv = (dbr_time_enum*)v;
  604. dd.getStatSevr(dbv->status,dbv->severity);
  605. dd.getTimeStamp(&dbv->stamp);
  606. dbv->RISC_pad = 0; // shut up purify
  607. return mapGddToEnum(&dbv->value,count,dd, enumStringTable);
  608. }
  609. static smartGDDPointer mapTimeCharToGdd(void* v,aitIndex count)
  610. {
  611. dbr_time_char* dbv = (dbr_time_char*)v;
  612. smartGDDPointer dd=mapCharToGdd(&dbv->value,count);
  613. dd->setStatSevr(dbv->status,dbv->severity);
  614. dd->setTimeStamp(&dbv->stamp);
  615. return dd;
  616. }
  617. static int mapTimeGddToChar(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  618. {
  619. dbr_time_char* dbv = (dbr_time_char*)v;
  620. dd.getStatSevr(dbv->status,dbv->severity);
  621. dd.getTimeStamp(&dbv->stamp);
  622. dbv->RISC_pad0 = 0; // shut up purify
  623. dbv->RISC_pad1 = '\0'; // shut up purify
  624. return mapGddToChar(&dbv->value,count,dd, enumStringTable);
  625. }
  626. static smartGDDPointer mapTimeLongToGdd(void* v,aitIndex count)
  627. {
  628. dbr_time_long* dbv = (dbr_time_long*)v;
  629. smartGDDPointer dd=mapLongToGdd(&dbv->value,count);
  630. dd->setStatSevr(dbv->status,dbv->severity);
  631. dd->setTimeStamp(&dbv->stamp);
  632. return dd;
  633. }
  634. static int mapTimeGddToLong(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  635. {
  636. dbr_time_long* dbv = (dbr_time_long*)v;
  637. dd.getStatSevr(dbv->status,dbv->severity);
  638. dd.getTimeStamp(&dbv->stamp);
  639. return mapGddToLong(&dbv->value,count,dd, enumStringTable);
  640. }
  641. static smartGDDPointer mapTimeDoubleToGdd(void* v,aitIndex count)
  642. {
  643. dbr_time_double* dbv = (dbr_time_double*)v;
  644. smartGDDPointer dd=mapDoubleToGdd(&dbv->value,count);
  645. dd->setStatSevr(dbv->status,dbv->severity);
  646. dd->setTimeStamp(&dbv->stamp);
  647. return dd;
  648. }
  649. static int mapTimeGddToDouble(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  650. {
  651. dbr_time_double* dbv = (dbr_time_double*)v;
  652. dd.getStatSevr(dbv->status,dbv->severity);
  653. dd.getTimeStamp(&dbv->stamp);
  654. dbv->RISC_pad = 0; // shut up purify
  655. return mapGddToDouble(&dbv->value,count,dd, enumStringTable);
  656. }
  657. // ********************************************************************
  658. // graphic structure mappings
  659. // ********************************************************************
  660. // -------------map the short structures----------------
  661. static smartGDDPointer mapGraphicShortToGdd(void* v, aitIndex count)
  662. {
  663. // must be a container
  664. dbr_gr_short* db = (dbr_gr_short*)v;
  665. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_SHORT].app);
  666. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_short_value];
  667. aitString* str=NULL;
  668. (*dd)[gddAppTypeIndex_dbr_gr_short_units].getRef(str);
  669. str->copy(db->units);
  670. (*dd)[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit;
  671. (*dd)[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit;
  672. (*dd)[gddAppTypeIndex_dbr_gr_short_alarmLow]=db->lower_alarm_limit;
  673. (*dd)[gddAppTypeIndex_dbr_gr_short_alarmHigh]=db->upper_alarm_limit;
  674. (*dd)[gddAppTypeIndex_dbr_gr_short_alarmLowWarning]=db->lower_warning_limit;
  675. (*dd)[gddAppTypeIndex_dbr_gr_short_alarmHighWarning]=db->upper_warning_limit;
  676. vdd.setStatSevr(db->status,db->severity);
  677. if(count==1) {
  678. if(vdd.dimension()) vdd.clear();
  679. vdd=db->value;
  680. } else {
  681. if(vdd.dimension()!=1) vdd.reset(aitEnumInt16,1,&count);
  682. else vdd.setPrimType(aitEnumInt16);
  683. vdd.setBound(0,0,count);
  684. dbr_short_t* pCopy = (dbr_short_t*) new char [sizeof(dbr_short_t)*count];
  685. memcpy (pCopy,&db->value,sizeof(dbr_short_t)*count);
  686. vdd.putRef(pCopy, new gddDestructor);
  687. }
  688. return dd;
  689. }
  690. static smartGDDPointer mapControlShortToGdd(void* v, aitIndex count)
  691. {
  692. // must be a container
  693. dbr_ctrl_short* db = (dbr_ctrl_short*)v;
  694. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_SHORT].app);
  695. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_short_value];
  696. aitString* str = NULL;
  697. (*dd)[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str);
  698. str->copy(db->units);
  699. (*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit;
  700. (*dd)[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit;
  701. (*dd)[gddAppTypeIndex_dbr_ctrl_short_controlLow]=db->lower_ctrl_limit;
  702. (*dd)[gddAppTypeIndex_dbr_ctrl_short_controlHigh]=db->upper_ctrl_limit;
  703. (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLow]=db->lower_alarm_limit;
  704. (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHigh]=db->upper_alarm_limit;
  705. (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning]=db->lower_warning_limit;
  706. (*dd)[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning]=db->upper_warning_limit;
  707. vdd.setStatSevr(db->status,db->severity);
  708. if(count==1) {
  709. if(vdd.dimension()) vdd.clear();
  710. vdd=db->value;
  711. } else {
  712. if(vdd.dimension()!=1) vdd.reset(aitEnumInt16,1,&count);
  713. else vdd.setPrimType(aitEnumInt16);
  714. vdd.setBound(0,0,count);
  715. dbr_short_t* pCopy = (dbr_short_t*) new char [sizeof(dbr_short_t)*count];
  716. memcpy (pCopy,&db->value,sizeof(dbr_short_t)*count);
  717. vdd.putRef(pCopy, new gddDestructor);
  718. }
  719. return dd;
  720. }
  721. static int mapGraphicGddToShort(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  722. {
  723. const aitString* str;
  724. dbr_gr_short* db = (dbr_gr_short*)v;
  725. const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value];
  726. dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str);
  727. if(str->string()) {
  728. strncpy(db->units,str->string(), sizeof(db->units));
  729. db->units[sizeof(db->units)-1u] = '\0';
  730. }
  731. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicLow];
  732. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicHigh];
  733. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLow];
  734. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmHigh];
  735. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLowWarning];
  736. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmHighWarning];
  737. vdd.getStatSevr(db->status,db->severity);
  738. return mapGddToShort(&db->value,count,vdd, enumStringTable);
  739. }
  740. static int mapControlGddToShort(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  741. {
  742. const aitString* str;
  743. dbr_ctrl_short* db = (dbr_ctrl_short*)v;
  744. const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value];
  745. dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str);
  746. if(str->string()) {
  747. strncpy(db->units,str->string(), sizeof(db->units));
  748. db->units[sizeof(db->units)-1u] = '\0';
  749. }
  750. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow];
  751. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh];
  752. db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlLow];
  753. db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlHigh];
  754. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmLow];
  755. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmHigh];
  756. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmLowWarning];
  757. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_short_alarmHighWarning];
  758. vdd.getStatSevr(db->status,db->severity);
  759. return mapGddToShort(&db->value,count,vdd, enumStringTable);
  760. }
  761. // -------------map the float structures----------------
  762. static smartGDDPointer mapGraphicFloatToGdd(void* v, aitIndex count)
  763. {
  764. // must be a container
  765. dbr_gr_float* db = (dbr_gr_float*)v;
  766. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_FLOAT].app);
  767. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_float_value];
  768. aitString* str = NULL;
  769. (*dd)[gddAppTypeIndex_dbr_gr_float_units].getRef(str);
  770. str->copy(db->units);
  771. (*dd)[gddAppTypeIndex_dbr_gr_float_precision]=db->precision;
  772. (*dd)[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit;
  773. (*dd)[gddAppTypeIndex_dbr_gr_float_graphicHigh]=db->upper_disp_limit;
  774. (*dd)[gddAppTypeIndex_dbr_gr_float_alarmLow]=db->lower_alarm_limit;
  775. (*dd)[gddAppTypeIndex_dbr_gr_float_alarmHigh]=db->upper_alarm_limit;
  776. (*dd)[gddAppTypeIndex_dbr_gr_float_alarmLowWarning]=db->lower_warning_limit;
  777. (*dd)[gddAppTypeIndex_dbr_gr_float_alarmHighWarning]=db->upper_warning_limit;
  778. vdd.setStatSevr(db->status,db->severity);
  779. if(count==1) {
  780. if(vdd.dimension()) vdd.clear();
  781. vdd=db->value;
  782. } else {
  783. if(vdd.dimension()!=1) vdd.reset(aitEnumFloat32,1,&count);
  784. else vdd.setPrimType(aitEnumFloat32);
  785. vdd.setBound(0,0,count);
  786. dbr_float_t* pCopy = (dbr_float_t*) new char [sizeof(dbr_float_t)*count];
  787. memcpy (pCopy,&db->value,sizeof(dbr_float_t)*count);
  788. vdd.putRef(pCopy, new gddDestructor);
  789. }
  790. return dd;
  791. }
  792. static smartGDDPointer mapControlFloatToGdd(void* v, aitIndex count)
  793. {
  794. // must be a container
  795. dbr_ctrl_float* db = (dbr_ctrl_float*)v;
  796. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_FLOAT].app);
  797. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_float_value];
  798. aitString* str = NULL;
  799. (*dd)[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str);
  800. str->copy(db->units);
  801. (*dd)[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision;
  802. (*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit;
  803. (*dd)[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]=db->upper_disp_limit;
  804. (*dd)[gddAppTypeIndex_dbr_ctrl_float_controlLow]=db->lower_ctrl_limit;
  805. (*dd)[gddAppTypeIndex_dbr_ctrl_float_controlHigh]=db->upper_ctrl_limit;
  806. (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLow]=db->lower_alarm_limit;
  807. (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHigh]=db->upper_alarm_limit;
  808. (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning]=db->lower_warning_limit;
  809. (*dd)[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning]=db->upper_warning_limit;
  810. vdd.setStatSevr(db->status,db->severity);
  811. if(count==1) {
  812. if(vdd.dimension()) vdd.clear();
  813. vdd=db->value;
  814. } else {
  815. if(vdd.dimension()!=1) vdd.reset(aitEnumFloat32,1,&count);
  816. else vdd.setPrimType(aitEnumFloat32);
  817. vdd.setBound(0,0,count);
  818. dbr_float_t* pCopy = (dbr_float_t*) new char [sizeof(dbr_float_t)*count];
  819. memcpy (pCopy,&db->value,sizeof(dbr_float_t)*count);
  820. vdd.putRef(pCopy, new gddDestructor);
  821. }
  822. return dd;
  823. }
  824. static int mapGraphicGddToFloat(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  825. {
  826. const aitString* str;
  827. dbr_gr_float* db = (dbr_gr_float*)v;
  828. const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value];
  829. dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str);
  830. if(str->string()) {
  831. strncpy(db->units,str->string(), sizeof(db->units));
  832. db->units[sizeof(db->units)-1u] = '\0';
  833. }
  834. db->precision=dd[gddAppTypeIndex_dbr_gr_float_precision];
  835. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicLow];
  836. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicHigh];
  837. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmLow];
  838. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmHigh];
  839. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmLowWarning];
  840. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_float_alarmHighWarning];
  841. db->RISC_pad0 = 0; // shut up purify
  842. vdd.getStatSevr(db->status,db->severity);
  843. return mapGddToFloat(&db->value,count,vdd, enumStringTable);
  844. }
  845. static int mapControlGddToFloat(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  846. {
  847. const aitString* str;
  848. dbr_ctrl_float* db = (dbr_ctrl_float*)v;
  849. const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value];
  850. dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str);
  851. if(str->string()) {
  852. strncpy(db->units,str->string(), sizeof(db->units));
  853. db->units[sizeof(db->units)-1u] = '\0';
  854. }
  855. db->precision=dd[gddAppTypeIndex_dbr_ctrl_float_precision];
  856. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow];
  857. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh];
  858. db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_float_controlLow];
  859. db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_float_controlHigh];
  860. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmLow];
  861. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmHigh];
  862. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmLowWarning];
  863. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_float_alarmHighWarning];
  864. db->RISC_pad = 0; // shut up purify
  865. vdd.getStatSevr(db->status,db->severity);
  866. return mapGddToFloat(&db->value,count,vdd, enumStringTable);
  867. }
  868. // -------------map the enum structures----------------
  869. static smartGDDPointer mapGraphicEnumToGdd(void* v, aitIndex /*count*/)
  870. {
  871. dbr_gr_enum* db = (dbr_gr_enum*)v;
  872. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_ENUM].app);
  873. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_enum_value];
  874. gdd& menu = (*dd)[gddAppTypeIndex_dbr_gr_enum_enums];
  875. aitFixedString* str = menu;
  876. //aitFixedString* f = (aitFixedString*)db->strs;
  877. aitIndex sz,i;
  878. // int i;
  879. // old way using aitString menu
  880. // for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
  881. if(menu.dataPointer()==NULL || !menu.isAtomic())
  882. {
  883. // need to copy the menu chunk from dbr to aitFixedString chunk
  884. menu.setDimension(1);
  885. sz=db->no_str;
  886. str=new aitFixedString[db->no_str];
  887. menu.putRef(str,new dbMapperFixedStringDestructor);
  888. }
  889. else
  890. {
  891. if((sz=menu.getDataSizeElements())>(aitIndex)db->no_str)
  892. sz=db->no_str;
  893. }
  894. unsigned minl = epicsMin(sizeof(aitFixedString),sizeof(str[0].fixed_string)) - 1;
  895. for (i=0;i<sz;i++) {
  896. strncpy (str[i].fixed_string, &(db->strs[i][0]), minl);
  897. memset(&str[i].fixed_string[minl], '\0', sizeof(aitFixedString)-minl);
  898. }
  899. menu.setBound(0,0,sz);
  900. // should always be a scaler
  901. if(vdd.dimension()) vdd.clear();
  902. vdd=db->value;
  903. vdd.setStatSevr(db->status,db->severity);
  904. return dd;
  905. }
  906. static smartGDDPointer mapControlEnumToGdd(void* v, aitIndex /*count*/)
  907. {
  908. dbr_ctrl_enum* db = (dbr_ctrl_enum*)v;
  909. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_ENUM].app);
  910. gdd& menu = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_enums];
  911. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_enum_value];
  912. aitFixedString* str = menu;
  913. //aitFixedString* f = (aitFixedString*)db->strs;
  914. aitIndex sz,i;
  915. // int i;
  916. // old way using aitString menu
  917. // for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
  918. if(menu.dataPointer()==NULL || !menu.isAtomic())
  919. {
  920. // need to copy the menu chunk from dbr to aitFixedString chunk
  921. menu.setDimension(1);
  922. sz=db->no_str;
  923. str=new aitFixedString[db->no_str];
  924. menu.putRef(str,new dbMapperFixedStringDestructor);
  925. }
  926. else
  927. {
  928. if((sz=menu.getDataSizeElements())>(aitIndex)db->no_str)
  929. sz=db->no_str;
  930. }
  931. unsigned minl = epicsMin(sizeof(aitFixedString),(size_t)MAX_ENUM_STRING_SIZE) - 1;
  932. for (i=0;i<sz;i++) {
  933. strncpy(str[i].fixed_string,&(db->strs[i][0]), minl);
  934. memset(&str[i].fixed_string[minl], '\0', sizeof(aitFixedString)-minl);
  935. }
  936. menu.setBound(0,0,sz);
  937. // should always be a scaler
  938. if(vdd.dimension()) vdd.clear();
  939. vdd=db->value;
  940. vdd.setStatSevr(db->status,db->severity);
  941. return dd;
  942. }
  943. static int mapGraphicGddToEnum (
  944. void * v, aitIndex count, const gdd & dd,
  945. const gddEnumStringTable & enumStringTable )
  946. {
  947. dbr_gr_enum * db = ( dbr_gr_enum * ) v;
  948. const gdd & vdd = dd[gddAppTypeIndex_dbr_gr_enum_value];
  949. vdd.getStatSevr ( db->status, db->severity );
  950. unsigned noStr = enumStringTable.numberOfStrings ();
  951. if ( noStr < MAX_ENUM_STATES ) {
  952. db->no_str = static_cast < dbr_short_t > ( noStr );
  953. }
  954. else {
  955. db->no_str = MAX_ENUM_STATES;
  956. }
  957. for ( int i=0; i < db->no_str; i++ ) {
  958. enumStringTable.getString ( i,
  959. &(db->strs[i][0]), MAX_ENUM_STRING_SIZE );
  960. }
  961. for ( int j = db->no_str; j < MAX_ENUM_STATES; j++ ) {
  962. db->strs[j][0] = '\0';
  963. }
  964. return mapGddToEnum ( &db->value,
  965. count, vdd, enumStringTable );
  966. }
  967. static int mapControlGddToEnum (
  968. void * v, aitIndex count, const gdd & dd,
  969. const gddEnumStringTable & enumStringTable )
  970. {
  971. dbr_ctrl_enum* db = ( dbr_ctrl_enum * ) v;
  972. const gdd & vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value];
  973. vdd.getStatSevr ( db->status, db->severity );
  974. unsigned noStr = enumStringTable.numberOfStrings ();
  975. if ( noStr < MAX_ENUM_STATES ) {
  976. db->no_str = static_cast < dbr_short_t > ( noStr );
  977. }
  978. else {
  979. db->no_str = MAX_ENUM_STATES;
  980. }
  981. for ( int i=0; i < db->no_str; i++ ) {
  982. enumStringTable.getString ( i,
  983. &(db->strs[i][0]), MAX_ENUM_STRING_SIZE );
  984. }
  985. for ( int j = db->no_str; j < MAX_ENUM_STATES; j++ ) {
  986. db->strs[j][0] = '\0';
  987. }
  988. return mapGddToEnum ( &db->value,
  989. count, vdd, enumStringTable );
  990. }
  991. // -------------map the char structures----------------
  992. static smartGDDPointer mapGraphicCharToGdd(void* v, aitIndex count)
  993. {
  994. // must be a container
  995. dbr_gr_char* db = (dbr_gr_char*)v;
  996. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_CHAR].app);
  997. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_char_value];
  998. aitString* str = NULL;
  999. (*dd)[gddAppTypeIndex_dbr_gr_char_units].getRef(str);
  1000. str->copy(db->units);
  1001. (*dd)[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit;
  1002. (*dd)[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit;
  1003. (*dd)[gddAppTypeIndex_dbr_gr_char_alarmLow]=db->lower_alarm_limit;
  1004. (*dd)[gddAppTypeIndex_dbr_gr_char_alarmHigh]=db->upper_alarm_limit;
  1005. (*dd)[gddAppTypeIndex_dbr_gr_char_alarmLowWarning]=db->lower_warning_limit;
  1006. (*dd)[gddAppTypeIndex_dbr_gr_char_alarmHighWarning]=db->upper_warning_limit;
  1007. vdd.setStatSevr(db->status,db->severity);
  1008. if(count==1) {
  1009. if(vdd.dimension()) vdd.clear();
  1010. vdd=db->value;
  1011. } else {
  1012. if(vdd.dimension()!=1) vdd.reset(aitEnumInt8,1,&count);
  1013. else vdd.setPrimType(aitEnumInt8);
  1014. vdd.setBound(0,0,count);
  1015. dbr_char_t* pCopy = (dbr_char_t *) new char [sizeof(dbr_char_t)*count];
  1016. memcpy (pCopy,&db->value,sizeof(dbr_char_t)*count);
  1017. vdd.putRef(pCopy, new gddDestructor);
  1018. }
  1019. return dd;
  1020. }
  1021. static smartGDDPointer mapControlCharToGdd(void* v, aitIndex count)
  1022. {
  1023. // must be a container
  1024. dbr_ctrl_char* db = (dbr_ctrl_char*)v;
  1025. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_CHAR].app);
  1026. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_char_value];
  1027. aitString* str = NULL;
  1028. (*dd)[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str);
  1029. str->copy(db->units);
  1030. (*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit;
  1031. (*dd)[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit;
  1032. (*dd)[gddAppTypeIndex_dbr_ctrl_char_controlLow]=db->lower_ctrl_limit;
  1033. (*dd)[gddAppTypeIndex_dbr_ctrl_char_controlHigh]=db->upper_ctrl_limit;
  1034. (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLow]=db->lower_alarm_limit;
  1035. (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHigh]=db->upper_alarm_limit;
  1036. (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning]=db->lower_warning_limit;
  1037. (*dd)[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning]=db->upper_warning_limit;
  1038. vdd.setStatSevr(db->status,db->severity);
  1039. if(count==1) {
  1040. if(vdd.dimension()) vdd.clear();
  1041. vdd=db->value;
  1042. } else {
  1043. if(vdd.dimension()!=1) vdd.reset(aitEnumInt8,1,&count);
  1044. else vdd.setPrimType(aitEnumInt8);
  1045. vdd.setBound(0,0,count);
  1046. dbr_char_t* pCopy = (dbr_char_t*) new char [sizeof(dbr_char_t)*count];
  1047. memcpy (pCopy,&db->value,sizeof(dbr_char_t)*count);
  1048. vdd.putRef(pCopy, new gddDestructor);
  1049. }
  1050. return dd;
  1051. }
  1052. static int mapGraphicGddToChar(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  1053. {
  1054. const aitString* str;
  1055. dbr_gr_char* db = (dbr_gr_char*)v;
  1056. const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value];
  1057. dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str);
  1058. if(str->string()) {
  1059. strncpy(db->units,str->string(), sizeof(db->units));
  1060. db->units[sizeof(db->units)-1u] = '\0';
  1061. }
  1062. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicLow];
  1063. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicHigh];
  1064. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLow];
  1065. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmHigh];
  1066. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLowWarning];
  1067. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmHighWarning];
  1068. db->RISC_pad = 0;
  1069. vdd.getStatSevr(db->status,db->severity);
  1070. return mapGddToChar(&db->value,count,vdd, enumStringTable);
  1071. }
  1072. static int mapControlGddToChar(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  1073. {
  1074. const aitString* str;
  1075. dbr_ctrl_char* db = (dbr_ctrl_char*)v;
  1076. const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value];
  1077. dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str);
  1078. if(str->string()) {
  1079. strncpy(db->units,str->string(), sizeof(db->units));
  1080. db->units[sizeof(db->units)-1u] = '\0';
  1081. }
  1082. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow];
  1083. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh];
  1084. db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlLow];
  1085. db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlHigh];
  1086. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmLow];
  1087. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmHigh];
  1088. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmLowWarning];
  1089. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_char_alarmHighWarning];
  1090. db->RISC_pad = '\0'; // shut up purify
  1091. vdd.getStatSevr(db->status,db->severity);
  1092. return mapGddToChar(&db->value,count,vdd, enumStringTable);
  1093. }
  1094. // -------------map the long structures----------------
  1095. static smartGDDPointer mapGraphicLongToGdd(void* v, aitIndex count)
  1096. {
  1097. // must be a container
  1098. dbr_gr_long* db = (dbr_gr_long*)v;
  1099. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_LONG].app);
  1100. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_long_value];
  1101. aitString* str = NULL;
  1102. (*dd)[gddAppTypeIndex_dbr_gr_long_units].getRef(str);
  1103. str->copy(db->units);
  1104. (*dd)[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit;
  1105. (*dd)[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit;
  1106. (*dd)[gddAppTypeIndex_dbr_gr_long_alarmLow]=db->lower_alarm_limit;
  1107. (*dd)[gddAppTypeIndex_dbr_gr_long_alarmHigh]=db->upper_alarm_limit;
  1108. (*dd)[gddAppTypeIndex_dbr_gr_long_alarmLowWarning]=db->lower_warning_limit;
  1109. (*dd)[gddAppTypeIndex_dbr_gr_long_alarmHighWarning]=db->upper_warning_limit;
  1110. vdd.setStatSevr(db->status,db->severity);
  1111. if(count==1) {
  1112. if(vdd.dimension()) vdd.clear();
  1113. vdd=db->value;
  1114. } else {
  1115. if(vdd.dimension()!=1) vdd.reset(aitEnumInt32,1,&count);
  1116. else vdd.setPrimType(aitEnumInt32);
  1117. vdd.setBound(0,0,count);
  1118. dbr_long_t* pCopy = (dbr_long_t*) new char [sizeof(dbr_long_t)*count];
  1119. memcpy (pCopy,&db->value,sizeof(dbr_long_t)*count);
  1120. vdd.putRef(pCopy, new gddDestructor);
  1121. }
  1122. return dd;
  1123. }
  1124. static smartGDDPointer mapControlLongToGdd(void* v, aitIndex count)
  1125. {
  1126. // must be a container
  1127. dbr_ctrl_long* db = (dbr_ctrl_long*)v;
  1128. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_LONG].app);
  1129. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_long_value];
  1130. aitString* str = NULL;
  1131. (*dd)[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str);
  1132. str->copy(db->units);
  1133. (*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit;
  1134. (*dd)[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit;
  1135. (*dd)[gddAppTypeIndex_dbr_ctrl_long_controlLow]=db->lower_ctrl_limit;
  1136. (*dd)[gddAppTypeIndex_dbr_ctrl_long_controlHigh]=db->upper_ctrl_limit;
  1137. (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLow]=db->lower_alarm_limit;
  1138. (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHigh]=db->upper_alarm_limit;
  1139. (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning]=db->lower_warning_limit;
  1140. (*dd)[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning]=db->upper_warning_limit;
  1141. vdd.setStatSevr(db->status,db->severity);
  1142. if(count==1) {
  1143. if(vdd.dimension()) vdd.clear();
  1144. vdd=db->value;
  1145. } else {
  1146. if(vdd.dimension()!=1) vdd.reset(aitEnumInt32,1,&count);
  1147. else vdd.setPrimType(aitEnumInt32);
  1148. vdd.setBound(0,0,count);
  1149. dbr_long_t* pCopy = (dbr_long_t *)new char [sizeof(dbr_long_t)*count];
  1150. memcpy (pCopy,&db->value,sizeof(dbr_long_t)*count);
  1151. vdd.putRef(pCopy, new gddDestructor);
  1152. }
  1153. return dd;
  1154. }
  1155. static int mapGraphicGddToLong(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  1156. {
  1157. const aitString* str;
  1158. dbr_gr_long* db = (dbr_gr_long*)v;
  1159. const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value];
  1160. dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str);
  1161. if(str->string()) {
  1162. strncpy(db->units,str->string(), sizeof(db->units));
  1163. db->units[sizeof(db->units)-1u] = '\0';
  1164. }
  1165. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicLow];
  1166. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicHigh];
  1167. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLow];
  1168. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmHigh];
  1169. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLowWarning];
  1170. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmHighWarning];
  1171. vdd.getStatSevr(db->status,db->severity);
  1172. return mapGddToLong(&db->value,count,vdd, enumStringTable);
  1173. }
  1174. static int mapControlGddToLong(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  1175. {
  1176. const aitString* str;
  1177. dbr_ctrl_long* db = (dbr_ctrl_long*)v;
  1178. const gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value];
  1179. dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str);
  1180. if(str->string()) {
  1181. strncpy(db->units,str->string(), sizeof(db->units));
  1182. db->units[sizeof(db->units)-1u] = '\0';
  1183. }
  1184. db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow];
  1185. db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh];
  1186. db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlLow];
  1187. db->upper_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlHigh];
  1188. db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmLow];
  1189. db->upper_alarm_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmHigh];
  1190. db->lower_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmLowWarning];
  1191. db->upper_warning_limit=dd[gddAppTypeIndex_dbr_ctrl_long_alarmHighWarning];
  1192. vdd.getStatSevr(db->status,db->severity);
  1193. return mapGddToLong(&db->value,count,vdd, enumStringTable);
  1194. }
  1195. // -------------map the double structures----------------
  1196. static smartGDDPointer mapGraphicDoubleToGdd(void* v, aitIndex count)
  1197. {
  1198. // must be a container
  1199. dbr_gr_double* db = (dbr_gr_double*)v;
  1200. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_GR_DOUBLE].app);
  1201. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_gr_double_value];
  1202. aitString* str = NULL;
  1203. (*dd)[gddAppTypeIndex_dbr_gr_double_units].getRef(str);
  1204. str->copy(db->units);
  1205. (*dd)[gddAppTypeIndex_dbr_gr_double_precision]=db->precision;
  1206. (*dd)[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit;
  1207. (*dd)[gddAppTypeIndex_dbr_gr_double_graphicHigh]=db->upper_disp_limit;
  1208. (*dd)[gddAppTypeIndex_dbr_gr_double_alarmLow]=db->lower_alarm_limit;
  1209. (*dd)[gddAppTypeIndex_dbr_gr_double_alarmHigh]=db->upper_alarm_limit;
  1210. (*dd)[gddAppTypeIndex_dbr_gr_double_alarmLowWarning]=db->lower_warning_limit;
  1211. (*dd)[gddAppTypeIndex_dbr_gr_double_alarmHighWarning]=db->upper_warning_limit;
  1212. vdd.setStatSevr(db->status,db->severity);
  1213. if(count==1) {
  1214. if(vdd.dimension()) vdd.clear();
  1215. vdd=db->value;
  1216. } else {
  1217. if(vdd.dimension()!=1) vdd.reset(aitEnumFloat64,1,&count);
  1218. else vdd.setPrimType(aitEnumFloat64);
  1219. vdd.setBound(0,0,count);
  1220. dbr_double_t* pCopy = (dbr_double_t *) new char [sizeof(dbr_double_t)*count];
  1221. memcpy (pCopy,&db->value,sizeof(dbr_double_t)*count);
  1222. vdd.putRef(pCopy, new gddDestructor);
  1223. }
  1224. return dd;
  1225. }
  1226. static smartGDDPointer mapControlDoubleToGdd(void* v, aitIndex count)
  1227. {
  1228. // must be a container
  1229. dbr_ctrl_double* db = (dbr_ctrl_double*)v;
  1230. smartGDDPointer dd = type_table->getDD(gddDbrToAit[DBR_CTRL_DOUBLE].app);
  1231. gdd& vdd = (*dd)[gddAppTypeIndex_dbr_ctrl_double_value];
  1232. aitString* str = NULL;
  1233. (*dd)[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str);
  1234. str->copy(db->units);
  1235. (*dd)[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision;
  1236. (*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit;
  1237. (*dd)[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]=db->upper_disp_limit;
  1238. (*dd)[gddAppTypeIndex_dbr_ctrl_double_controlLow]=db->lower_ctrl_limit;
  1239. (*dd)[gddAppTypeIndex_dbr_ctrl_double_controlHigh]=db->upper_ctrl_limit;
  1240. (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLow]=db->lower_alarm_limit;
  1241. (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHigh]=db->upper_alarm_limit;
  1242. (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmLowWarning]=db->lower_warning_limit;
  1243. (*dd)[gddAppTypeIndex_dbr_ctrl_double_alarmHighWarning]=db->upper_warning_limit;
  1244. vdd.setStatSevr(db->status,db->severity);
  1245. if(count==1) {
  1246. if(vdd.dimension()) vdd.clear();
  1247. vdd=db->value;
  1248. } else {
  1249. if(vdd.dimension()!=1) vdd.reset(aitEnumFloat64,1,&count);
  1250. else vdd.setPrimType(aitEnumFloat64);
  1251. vdd.setBound(0,0,count);
  1252. dbr_double_t* pCopy = (dbr_double_t *) new char [sizeof(dbr_double_t)*count];
  1253. memcpy (pCopy,&db->value,sizeof(dbr_double_t)*count);
  1254. vdd.putRef(pCopy, new gddDestructor);
  1255. }
  1256. return dd;
  1257. }
  1258. static int mapGraphicGddToDouble(void* v, aitIndex count, const gdd & dd, const gddEnumStringTable &enumStringTable)
  1259. {
  1260. const aitString* str;
  1261. dbr_gr_double* db = (dbr_gr_double*)v;
  1262. const gdd& vdd = dd[gddAppTypeIndex_dbr_gr_doub

Large files files are truncated, but you can click here to view the full file