320 wxColour color_ok( 122, 166, 194 );
321 wxColour color_text( 0, 0, 0 );
331 if( entryA.m_symbol.size() > 0 )
333 label = entryA.m_symbol;
337 label = entryA.m_name;
342 if( entryA.m_name.size() > 0 )
344 label = entryA.m_name;
348 label = entryA.m_symbol;
352 m_table->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
353 m_table->SetRowLabelValue( i, label );
354 m_table->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
355 m_table->SetColLabelValue( i, label );
356 m_table->SetCellAlignment( i, j, wxALIGN_CENTER, wxALIGN_CENTER );
360 double diff = entryA.m_potential - entryB.m_potential;
361 int diff_temp =
KiROUND( abs( diff * 99 ) );
363 value = wxString::Format(
"%.0f", diff * 1000 );
364 m_table->SetCellValue( i, j, value );
368 if( abs( diff ) == 0 )
370 aBg = wxColour( 193, 231, 255 );
376 aBg = wxColour( 226 - diff_temp, 226 - diff_temp, 246 - diff_temp );
380 aBg = wxColour( 255 - diff_temp, 222 - diff_temp, 199 - diff_temp );
388 m_table->SetCellBackgroundColour( i, j, aBg );
390 m_table->SetCellAlignment( i, j, wxALIGN_CENTER, wxALIGN_CENTER );
391 m_table->SetReadOnly( i, j,
true );
398 m_table->SetColLabelTextOrientation( wxVERTICAL );
400 m_table->SetColLabelSize( wxGRID_AUTOSIZE );
401 m_table->SetRowLabelSize( wxGRID_AUTOSIZE );
wxString m_symbol
Chemical symbol (Cu), not translatable.
wxString m_name
Translatable name ( Copper )
double m_potential
potential in volts, relative to copper
CORROSION_TABLE_ENTRY(const wxString &aName, const wxString &aSymbol, double aPotential)
PANEL_GALVANIC_CORROSION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(509, 245), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
PANEL_GALVANIC_CORROSION(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)