Changeset 19 for trunk/tmdmcreator
- Timestamp:
- 02/22/13 14:37:37 (12 years ago)
- Location:
- trunk/tmdmcreator
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tmdmcreator/docs/uml/tmdmcreator/128033.diagram
r17 r19 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 34 74.420005 xyz 34.4 74.1 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. 3 184.920009 xyz 400.9 184.2 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 196. 5 408200013 xyz 196.3 408.1 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. 2 588.3200017 xyz 363.9 588.5 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 1 8.9 694.5200021 xyz 17.9 693.8 2000 22 22 end 23 23 relationcanvas 128673 relation_ref 128033 // <generalisation> -
trunk/tmdmcreator/docs/uml/tmdmcreator/33.session
r17 r19 5 5 end 6 6 show_stereotypes 7 selected operation_ref 1 36097 // TmDmProcessorSimple7 selected operation_ref 144161 // _ProcessAttributesValues 8 8 open 9 9 class_ref 128161 // TmDmCopier 10 10 operation_ref 136481 // ProcessBlock 11 11 class_ref 141345 // TmDmProcessorSimple 12 class_ref 141473 // TmDmProcessorAttributs12 operation_ref 136609 // ProcessBlock 13 13 deploymentview_ref 128033 // tmdmdeploy 14 14 end -
trunk/tmdmcreator/docs/uml/tmdmcreator/tmdmcreator.prj
r17 r19 1 1 format 75 2 2 "tmdmcreator" 3 revision 53 revision 6 4 4 modified_by 33 "lucien" 5 5 … … 525 525 end 526 526 527 operation 144033 "_ProcessAttributesName" 528 private explicit_return_type "bool" 529 nparams 1 530 param in name "blockstart" explicit_type "int" 531 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}${abstract}; 532 " 533 cpp_def "${comment}${inline}${type} ${class}::${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}${staticnl}{ 534 ${body}} 535 " 536 537 538 539 540 end 541 542 operation 144161 "_ProcessAttributesValues" 543 private explicit_return_type "bool" 544 nparams 1 545 param in name "blockstart" explicit_type "int" 546 cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}${abstract}; 547 " 548 cpp_def "${comment}${inline}${type} ${class}::${name}${(}${t0} ${p0}${)}${const}${volatile}${throw}${staticnl}{ 549 ${body}} 550 " 551 552 553 554 555 end 556 527 557 operation 135841 "TmDmProcessorAttributs" 528 558 public explicit_return_type "" -
trunk/tmdmcreator/src/tmdmcreator.cpp
r18 r19 108 108 109 109 // Process layers 110 TmDmProcessorSimple my LayerProc(m_FileNameUserContent, m_FileNameOutSQL);111 int myThematicLayersStart = my LayerProc.FindBlock(_T("thematic_layers"));110 TmDmProcessorSimple myProc(m_FileNameUserContent, m_FileNameOutSQL); 111 int myThematicLayersStart = myProc.FindBlock(_T("thematic_layers")); 112 112 if (myThematicLayersStart == wxNOT_FOUND) { 113 113 errorsmsg.Add(wxString::Format(_("'thematic_layers' field not found in %s"), m_FileNameUserContent.GetFullPath())); 114 114 return false; 115 115 } 116 if (my LayerProc.ProcessBlock(myThematicLayersStart, _T("thematic_layers"))==false) {116 if (myProc.ProcessBlock(myThematicLayersStart, _T("thematic_layers"))==false) { 117 117 errorsmsg.Add(wxString::Format(_("Processing 'thematic_layers' failed in %s"), m_FileNameUserContent.GetFullPath())); 118 118 return false; 119 119 } 120 121 // Process objects 122 int myObjectStart = myProc.FindBlock(_T("dmn_layer_object")); 123 if (myObjectStart == wxNOT_FOUND) { 124 errorsmsg.Add(wxString::Format(_("'dmn_layer_object' field not found in %s"), m_FileNameUserContent.GetFullPath())); 125 return false; 126 } 127 if (myProc.ProcessBlock(myObjectStart, _T("dmn_layer_object"))==false) { 128 errorsmsg.Add(wxString::Format(_("Processing 'dmn_layer_object' failed in %s"), m_FileNameUserContent.GetFullPath())); 129 return false; 130 } 131 132 // Process attributs 133 TmDmProcessorAttributs myProcAttributs (m_FileNameUserContent, m_FileNameOutSQL); 134 int myAttributStart = myProcAttributs.FindBlock(_T("attributs")); 135 if (myAttributStart == wxNOT_FOUND) { 136 errorsmsg.Add(wxString::Format(_("'attributs' field not found in %s"), m_FileNameUserContent.GetFullPath())); 137 return false; 138 } 139 if (myProcAttributs.ProcessBlock(myAttributStart, wxEmptyString)==false) { 140 errorsmsg.Add(wxString::Format(_("Processing 'attributs' failed in %s"), m_FileNameUserContent.GetFullPath())); 141 return false; 142 } 143 144 120 145 return true; 121 146 } -
trunk/tmdmcreator/src/tmdmprocessor.cpp
r18 r19 64 64 wxArrayString mySQLCols; 65 65 TmDmCopier myCopier(m_FileDst); 66 myCopier.CopyFrom(wxString::Format(_T("\n-- %s --\n"), tablename)); 67 66 68 67 69 wxFileInputStream input(m_FileSrc.GetFullPath()); … … 123 125 } 124 126 127 128 125 129 TmDmProcessorAttributs::~TmDmProcessorAttributs() { 126 130 } 127 131 132 133 134 bool TmDmProcessorAttributs::_ProcessAttributesName(int blockstart) { 135 wxArrayString mySQLCols; 136 TmDmCopier myCopier(m_FileDst); 137 myCopier.CopyFrom(wxString::Format(_T("\n-- %s --\n"), _T("dmn_layer_attribut"))); 138 int NUM_COLS = 3; 139 wxArrayString myPreviousRow; 140 141 wxFileInputStream input(m_FileSrc.GetFullPath()); 142 wxTextInputStream text(input); 143 long myLineIndex = 0; 144 while(input.IsOk() && !input.Eof() ){ 145 wxString myRow = text.ReadLine(); 146 if (myLineIndex <= blockstart) { 147 myLineIndex++; 148 continue; 149 } 150 151 if (myLineIndex == blockstart+1) { 152 mySQLCols = wxStringTokenize(myRow, _T("\t"), wxTOKEN_RET_EMPTY); 153 myLineIndex++; 154 continue; 155 } 156 157 wxArrayString myValues = wxStringTokenize(myRow, _T("\t"), wxTOKEN_RET_EMPTY_ALL); 158 bool bEmpty = true; 159 for (unsigned int i = 0; i< myValues.GetCount(); i++) { 160 if (myValues[i] != wxEmptyString) { 161 bEmpty = false; 162 break; 163 } 164 } 165 if (bEmpty == true) { 166 // ok empty line found 167 return true; 168 } 169 170 // check that this row differs from previous 171 wxArrayString myAttributRow; 172 for (unsigned int i = 0; i< NUM_COLS; i++) { 173 myAttributRow.Add(myValues.Item(i)); 174 } 175 if (myAttributRow == myPreviousRow) { 176 continue; 177 } 178 myPreviousRow = myAttributRow; 179 180 181 wxString myInsert = _T("INSERT INTO `dmn_layer_attribut` VALUES ("); 182 for (unsigned int i = 0; i< myAttributRow.GetCount(); i++) { 183 myInsert.Append(wxString::Format(_T("\"%s\","), myAttributRow.Item(i))); 184 } 185 myInsert.RemoveLast(); 186 myInsert.Append(_T(");\n")); 187 myCopier.CopyFrom(myInsert); 188 myLineIndex++; 189 } 190 return true; 191 } 192 193 194 195 bool TmDmProcessorAttributs::_ProcessAttributesValues(int blockstart) { 196 wxArrayString mySQLCols; 197 TmDmCopier myCopier(m_FileDst); 198 myCopier.CopyFrom(wxString::Format(_T("\n-- %s --\n"), _T("attribut values"))); 199 int START_COL = 3; 200 201 wxFileInputStream input(m_FileSrc.GetFullPath()); 202 wxTextInputStream text(input); 203 long myLineIndex = 0; 204 while(input.IsOk() && !input.Eof() ){ 205 wxString myRow = text.ReadLine(); 206 if (myLineIndex <= blockstart) { 207 myLineIndex++; 208 continue; 209 } 210 211 if (myLineIndex == blockstart+1) { 212 mySQLCols = wxStringTokenize(myRow, _T("\t"), wxTOKEN_RET_EMPTY); 213 myLineIndex++; 214 continue; 215 } 216 217 218 wxArrayString myValues = wxStringTokenize(myRow, _T("\t"), wxTOKEN_RET_EMPTY_ALL); 219 bool bEmpty = true; 220 for (unsigned int i = 0; i< myValues.GetCount(); i++) { 221 if (myValues[i] != wxEmptyString) { 222 bEmpty = false; 223 break; 224 } 225 } 226 if (bEmpty == true) { 227 // ok empty line found 228 return true; 229 } 230 231 // query to dmn_catalog 232 wxString myInsert = _T("INSERT INTO `dmn_catalog` VALUES ("); 233 for (unsigned int i = START_COL; i< mySQLCols.GetCount(); i++) { 234 myInsert.Append(wxString::Format(_T("\"%s\","), myValues.Item(i))); 235 } 236 myInsert.RemoveLast(); 237 myInsert.Append(_T(");\n")); 238 239 240 // query to dmn_attribut_value 241 myInsert.Append(wxString::Format(_T("INSERT INTO `dmn_attribut_value` VALUES (%s, %s);\n"), 242 myValues.Item(0), myValues.Item(START_COL))); 243 244 myCopier.CopyFrom(myInsert); 245 myLineIndex++; 246 } 247 return true; 248 } 249 250 251 128 252 bool TmDmProcessorAttributs::ProcessBlock(int blockstart, const wxString & tablename) { 129 return false; 130 } 131 253 if (_ProcessAttributesName(blockstart) == false) { 254 return false; 255 } 256 257 if (_ProcessAttributesValues(blockstart) == false) { 258 return false; 259 } 260 return true; 261 } 262 263 264 -
trunk/tmdmcreator/src/tmdmprocessor.h
r18 r19 62 62 63 63 class TmDmProcessorAttributs : public TmDmProcessor { 64 private: 65 bool _ProcessAttributesName(int blockstart); 66 bool _ProcessAttributesValues(int blockstart); 67 64 68 public: 65 69 TmDmProcessorAttributs(const wxFileName & src, const wxFileName & dest);
Note: See TracChangeset
for help on using the changeset viewer.