User Tools

Site Tools


code:new_target_type

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
code:new_target_type [2009/01/26 22:39]
pkubanek created
code:new_target_type [2009/01/26 00:00] (current)
Line 4: Line 4:
 If you would like to introduce a new target type, you must: If you would like to introduce a new target type, you must:
  
- - introduce its type identifier among types listed in //types// table. This table contains character identifiing type and short type description. +  ​- introduce its type identifier among types listed in //types// table. This table contains character identifiing type and short type description. 
- +  - add its description to src/​utils/​rts2target.h file. Find defines starting with TYPE_, and add your own type, together with characted which represents it. This define is of course not required, but it is highly recommended. 
- - add its description to src/​utils/​rts2target.h file. Find defines starting with TYPE_, and add your own type, together with characted which represents it. This define is of course not required, but it is highly recommended. +  - create table which will hold target extended parameters. This table must include reference to tar_id from targets as primary key. 
- +  - create its class as subclass of Target class in src/utils directory. You might choose to create a new file with this subclass, or add its definition to existing file. It is recommended to start a new file. You must add this file to src/​utilsdb/​Makefile.am - please look at this file for rts2targetgrb string to see where it must be added. 
- - create table which will hold target extended parameters. This table must include reference to tar_id from targets as primary key. +  - in subclass load method, you can add any additional select statements which will load from database additional fields. For an example, look to rts2targetgrb.ec for ::load method implementation. You can of course use any ECPG statements. Please consult ECPG documentation for details. 
- +  - add this target type to //Target *createTarget (int _tar_id, struct ln_lnlat_posn *_obs)// in //​src/​utilsdb/​target.ec//​.
- - create its class as subclass of Target class in src/utils directory. You might choose to create a new file with this subclass, or add its definition to existing file. It is recommended to start a new file. You must add this file to src/​utilsdb/​Makefile.am - please look at this file for rts2targetgrb string to see where it must be added. +
- +
- - in subclass load method, you can add any additional select statements which will load from database additional fields. For an example, look to rts2targetgrb.ec for ::load method implementation. You can of course use any ECPG statements. Please consult ECPG documentation for details. +
- +
- - add this target type to //Target *createTarget (int _tar_id, struct ln_lnlat_posn *_obs)// in //​src/​utilsdb/​target.ec//​.+
  
 There is an example. Lets suppose we would like to add target for observing There is an example. Lets suppose we would like to add target for observing
Line 198: Line 193:
 } }
 </​code>​ </​code>​
- 
code/new_target_type.1233005974.txt.gz · Last modified: 2009/01/26 00:00 (external edit)