MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / SetValue

Method SetValue

src/variablegrid.cpp:469–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467}
468
469void VariableGridData::SetValue(int row, int col, const wxString& value)
470{
471 if (col == 0)
472 return; // no updating of variable name allowed here!
473 else if (col == 1)
474 return; // no updating of variable label allowed here!
475 else if ((col > 1) && (col < (int)(m_cases.size() + 2))) {
476 int lookup_row = row;
477 if (m_sorted) lookup_row = m_sorted_index[row];
478 Case* c = GetCase(row, col);
479 wxString var_name;
480 size_t ndx_hybrid;
481 if (UpdateVarNameNdxHybrid(c, m_var_names[lookup_row], &var_name, &ndx_hybrid)) {
482 if (m_var_table_vec[col - 2][ndx_hybrid]->Get(var_name)) {
483 VarValue* vv = m_var_table_vec[col - 2][ndx_hybrid]->Get(var_name);
484 if (vv) {
485 VarValue::Parse(vv->Type(), value, *vv);
486 // updates ui from grid
487 m_cases[col - 2]->VariableChanged(var_name, ndx_hybrid);
488 }
489 }
490 }
491 }
492}
493
494
495

Callers

nothing calls this directly

Calls 5

UpdateVarNameNdxHybridFunction · 0.85
sizeMethod · 0.80
TypeMethod · 0.80
VariableChangedMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected