MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / ReInitFromTableInt

Method ReInitFromTableInt

DataViewer/VarOrderPtree.cpp:314–349  ·  view source on GitHub ↗

Update VarOrderPtree based on meta-data from TableInterface */

Source from the content-addressed store, hash-verified

312/** Update VarOrderPtree based on meta-data from TableInterface
313 */
314void VarOrderPtree::ReInitFromTableInt(TableInterface* table)
315{
316 if (!table) return;
317
318 var_grps.clear();
319 time_ids.clear();
320
321 std::vector<wxString> tm_strs;
322 table->GetTimeStrings(tm_strs);
323 int times = table->GetTimeSteps();
324 int cols = table->GetNumberCols();
325 this->time_ids.resize(times);
326 for (int t=0; t<times; ++t) {
327 this->time_ids[t] = tm_strs[t].ToStdString();
328 }
329 std::vector<int> col_map;
330 table->FillColIdMap(col_map);
331 for (int i=0; i<cols; ++i) {
332 int col = col_map[i];
333 VarGroup e;
334 e.name = table->GetColName(col);
335 if (table->IsColTimeVariant(col)) {
336 e.vars.resize(times);
337 for (int t=0; t<times; ++t) {
338 if (table->GetColType(col, t) == GdaConst::placeholder_type) {
339 e.vars[t] = "";
340 } else {
341 e.vars[t] = table->GetColName(col, t);
342 }
343 }
344 }
345 e.displayed_decimals = table->GetColDispDecimals(col);
346 e.meta_data = table->GetMetaData(col);
347 this->var_grps.push_back(e);
348 }
349}
350
351wxString VarOrderPtree::VarOrderToStr() const
352{

Callers 2

UpdateProjectConfMethod · 0.80
OnOkClickMethod · 0.80

Calls 10

GetTimeStringsMethod · 0.80
GetColTypeMethod · 0.80
GetColDispDecimalsMethod · 0.80
clearMethod · 0.45
GetTimeStepsMethod · 0.45
GetNumberColsMethod · 0.45
FillColIdMapMethod · 0.45
GetColNameMethod · 0.45
IsColTimeVariantMethod · 0.45
GetMetaDataMethod · 0.45

Tested by

no test coverage detected