Changeset 21
- Timestamp:
- 02/25/13 11:47:25 (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tmdmcreator/docs/uml/tmdmcreator/128033.diagram
r19 r21 3 3 classcanvas 128033 class_ref 128033 // TmDmCreator 4 4 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 5 xyz 3 4.4 74.120005 xyz 32.3 74.3 2000 6 6 end 7 7 classcanvas 128161 class_ref 128161 // TmDmCopier 8 8 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 9 xyz 400.9 184.220009 xyz 528.3 153.4 2000 10 10 end 11 11 classcanvas 128417 class_ref 141217 // TmDmProcessor 12 12 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 13 xyz 1 96.3 408.1200013 xyz 103.9 345.5 2000 14 14 end 15 15 classcanvas 128545 class_ref 141345 // TmDmProcessorSimple 16 16 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 17 xyz 363. 9 588.5200017 xyz 363.7 588.3 2000 18 18 end 19 19 classcanvas 128801 class_ref 141473 // TmDmProcessorAttributs 20 20 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 21 xyz 17.9 693. 8200021 xyz 17.9 693.2 2000 22 22 end 23 23 relationcanvas 128673 relation_ref 128033 // <generalisation> -
trunk/tmdmcreator/docs/uml/tmdmcreator/33.session
r19 r21 1 window_sizes 959 1031 253 700 8381361 window_sizes 1440 852 253 1181 659 136 2 2 diagrams 3 3 active classdiagram_ref 128033 // tmdmcreator 4 1 573 819 90 4 0 04 1177 639 90 4 0 0 5 5 end 6 6 show_stereotypes 7 selected operation_ref 1 44161 // _ProcessAttributesValues7 selected operation_ref 150689 // SwitchCols 8 8 open 9 class_ref 128033 // TmDmCreator 9 10 class_ref 128161 // TmDmCopier 10 11 operation_ref 136481 // ProcessBlock -
trunk/tmdmcreator/docs/uml/tmdmcreator/tmdmcreator.prj
r19 r21 1 1 format 75 2 2 "tmdmcreator" 3 revision 63 revision 7 4 4 modified_by 33 "lucien" 5 5 … … 251 251 operation 137505 "ProcessFiles" 252 252 public explicit_return_type "bool" 253 nparams 1253 nparams 2 254 254 param out name "errorsmsg" explicit_type "wxArrayString" 255 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} & ${p0}${v0}${)}${const}${volatile}${throw}${abstract}; 256 " 257 cpp_def "${comment}${inline}${type} ${class}::${name}${(}${t0} & ${p0}${)}${const}${volatile}${throw}${staticnl}{ 255 param in name "languagecolumn" explicit_type "int" 256 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} & ${p0}${v0}, ${t1} ${p1}${)}${const}${volatile}${throw}${abstract}; 257 " 258 cpp_def "${comment}${inline}${type} ${class}::${name}${(}${t0} & ${p0}, ${t1} ${p1}${)}${const}${volatile}${throw}${staticnl}{ 258 259 ${body}} 259 260 " … … 379 380 end 380 381 382 attribute 155169 "m_LanguageCol" 383 protected explicit_type "int" 384 init_value "0" 385 cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value}; 386 " 387 java_decl "" 388 php_decl "" 389 python_decl "" 390 idl_decl "" 391 set_oper operation_ref 150817 // SetLanguageColumn 392 end 393 394 operation 150689 "SwitchCols" 395 protected explicit_return_type "wxString" 396 nparams 2 397 param in name "cols" explicit_type "wxArrayString" 398 param in name "values" explicit_type "wxArrayString" 399 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} * ${p0}, ${t1} * ${p1}${)}${const}${volatile}${throw}${abstract}; 400 " 401 cpp_def "${comment}${inline}${type} ${class}::${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${const}${volatile}${throw}${staticnl}{ 402 ${body}} 403 " 404 405 406 407 408 end 409 381 410 operation 135585 "TmDmProcessor" 382 411 public explicit_return_type "" … … 435 464 436 465 466 end 467 468 operation 150817 "SetLanguageColumn" 469 force_body_gen public explicit_return_type "void" 470 nparams 1 471 param in name "value" explicit_type "int" 472 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}; 473 " 474 cpp_def "${comment}${inline}${type} ${class}::${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}${staticnl}{ 475 m_LanguageCol = ${p0}; 476 } 477 " 478 cpp_name_spec "SetLanguageColumn" 479 480 java_name_spec "set${Name}" 481 482 php_name_spec "set${Name}" 483 484 python_name_spec "set${Name}" 485 486 idl_name_spec "set_${name}" 487 set_of_attribute attribute_ref 155169 // m_LanguageCol 437 488 end 438 489 end -
trunk/tmdmcreator/src/main.cpp
r18 r21 35 35 wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, 36 36 { wxCMD_LINE_SWITCH, "v", "verbose", "Be more verbose" }, 37 { wxCMD_LINE_SWITCH, "t", "toolmap", "toolmap output" }, 38 { wxCMD_LINE_SWITCH, "o", "overwrite", "overwrite output" }, 37 { wxCMD_LINE_SWITCH, "t", "toolmap", "toolmap output (default is SQL)" }, 38 { wxCMD_LINE_SWITCH, "o", "overwrite", "overwrite output" }, 39 { wxCMD_LINE_OPTION, "l", "language", "language column (default is 0)", wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_PARAM_OPTIONAL}, 39 40 { wxCMD_LINE_PARAM, NULL, NULL, "[base structure sql file]"}, 40 41 { wxCMD_LINE_PARAM, NULL, NULL, "[user structure sql file]"}, … … 83 84 bool bVerbose = parser.Found("verbose"); 84 85 bool bToolMap = parser.Found("toolmap"); 86 long myLanguage = 0; 87 if(parser.Found("language", &myLanguage) == true) { 88 wxPrintf(_("Using language column: %ld\n"), myLanguage); 89 } 85 90 if (parser.Found("overwrite") && wxFileExists(parser.GetParam(3))) { 86 91 wxRemoveFile(parser.GetParam(3)); … … 108 113 } 109 114 110 if (myCreator.ProcessFiles(myErrors ) == false) {115 if (myCreator.ProcessFiles(myErrors, myLanguage) == false) { 111 116 if (bVerbose == true) { 112 117 PrintArray(myErrors); -
trunk/tmdmcreator/src/tmdmcreator.cpp
r19 r21 91 91 92 92 93 bool TmDmCreator::ProcessFiles(wxArrayString & errorsmsg ) {93 bool TmDmCreator::ProcessFiles(wxArrayString & errorsmsg, int languagecolumn) { 94 94 errorsmsg.Clear(); 95 95 // Copy structure … … 109 109 // Process layers 110 110 TmDmProcessorSimple myProc(m_FileNameUserContent, m_FileNameOutSQL); 111 myProc.SetLanguageColumn(languagecolumn); 111 112 int myThematicLayersStart = myProc.FindBlock(_T("thematic_layers")); 112 113 if (myThematicLayersStart == wxNOT_FOUND) { … … 132 133 // Process attributs 133 134 TmDmProcessorAttributs myProcAttributs (m_FileNameUserContent, m_FileNameOutSQL); 135 myProcAttributs.SetLanguageColumn(languagecolumn); 134 136 int myAttributStart = myProcAttributs.FindBlock(_T("attributs")); 135 137 if (myAttributStart == wxNOT_FOUND) { -
trunk/tmdmcreator/src/tmdmcreator.h
r16 r21 42 42 43 43 bool CheckFiles(wxArrayString & errormsg); 44 bool ProcessFiles(wxArrayString & errorsmsg );44 bool ProcessFiles(wxArrayString & errorsmsg, int languagecolumn); 45 45 }; 46 46 #endif -
trunk/tmdmcreator/src/tmdmprocessor.cpp
r19 r21 21 21 m_FileSrc = src; 22 22 m_FileDst = dest; 23 m_LanguageCol = 0; 23 24 } 24 25 … … 42 43 } 43 44 return wxNOT_FOUND; 45 } 46 47 48 49 wxString TmDmProcessor::SwitchCols(wxArrayString * cols, wxArrayString * values, int item) { 50 if (m_LanguageCol == 0) { 51 return values->Item(item); 52 } 53 54 55 if(cols->Item(item).Contains(_T("_0")) == true) { 56 return values->Item(item + m_LanguageCol); 57 } 58 59 wxString myColName = wxString::Format(_T("_%d"), m_LanguageCol); 60 if (cols->Item(item).Contains(myColName) == true) { 61 return values->Item(item - m_LanguageCol); 62 } 63 return values->Item(item); 64 } 65 66 67 68 void TmDmProcessor::SetLanguageColumn(int value) { 69 m_LanguageCol = value; 44 70 } 45 71 … … 104 130 myInsert.Append(_T(") VALUES (")); 105 131 for (unsigned int i = 0; i< mySQLCols.GetCount(); i++) { 106 myInsert.Append(wxString::Format(_T("\"%s\","), myValues.Item(i)));132 myInsert.Append(wxString::Format(_T("\"%s\","), SwitchCols(&mySQLCols, &myValues, i))); 107 133 } 108 134 myInsert.RemoveLast(); … … 232 258 wxString myInsert = _T("INSERT INTO `dmn_catalog` VALUES ("); 233 259 for (unsigned int i = START_COL; i< mySQLCols.GetCount(); i++) { 234 myInsert.Append(wxString::Format(_T("\"%s\","), myValues.Item(i)));260 myInsert.Append(wxString::Format(_T("\"%s\","), SwitchCols(&mySQLCols, &myValues, i))); 235 261 } 236 262 myInsert.RemoveLast(); -
trunk/tmdmcreator/src/tmdmprocessor.h
r19 r21 33 33 wxFileName m_FileDst; 34 34 35 int m_LanguageCol; 36 wxString SwitchCols(wxArrayString * cols, wxArrayString * values, int item); 37 35 38 public: 36 39 TmDmProcessor(const wxFileName & src, const wxFileName & dest); … … 39 42 int FindBlock(const wxString & blockname); 40 43 virtual bool ProcessBlock(int blockstart, const wxString & tablename) = 0; 44 45 void SetLanguageColumn(int value); 41 46 }; 42 47 -
trunk/tutorial/model_tutorial.tex
r14 r21 115 115 PRIMARY KEY (`OBJECT_ID`), 116 116 KEY `LAYER_ATX_FKIndex1` (`OBJECT_ID`) 117 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 117 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 118 118 \end{lstlisting} 119 119 This code is the basic template for creating an attribute table. The number after layer\_at (see line 2) indicates the layer index and refers to the LAYER\_INDEX column in user\_content.txt. In our example layer\_at1 describe the attributes for the layer Boreholes\_PT. User attributes can then be added on line 4 of this template.
Note: See TracChangeset
for help on using the changeset viewer.