void ECKeyPad::dataChanged() { initPins(dataInt("numCols")); bool useToggle = dataBool("useToggles"); bool bounce = dataBool("bounce"); int bouncePeriod_ms = int(dataDouble("bounce_period") * 1e3); for (unsigned i = 0; i < 4; i++) { for (unsigned j = 0; j < m_numCols; j++) { button(buttonID(i, j))->setToggle(useToggle); m_switch[i][j]->setBounce(bounce, bouncePeriod_ms); } } }
void ECMOSFET::dataChanged() { bool haveBodyPin = dataBool( "bodyPin" ); if ( haveBodyPin != m_bHaveBodyPin ) { m_bHaveBodyPin = haveBodyPin; if ( m_bHaveBodyPin ) { // Creating a body pin ECNode * NodeB = createPin( 16, 0, 180, "b" ); removeElement( m_pMOSFET, false ); m_pMOSFET = createMOSFET( ecNodeWithID( "d" ), ecNodeWithID( "g" ), ecNodeWithID( "s" ), NodeB, m_MOSFET_type ); } else { // Removing a body pin removeNode( "b" ); removeElement( m_pMOSFET, false ); m_pMOSFET = createMOSFET( ecNodeWithID( "d" ), ecNodeWithID( "g" ), ecNodeWithID( "s" ), ecNodeWithID( "s" ), m_MOSFET_type ); } } #if 0 MOSFETSettings s; s.I_S = dataDouble( "I_S" ); s.N_F = dataDouble( "N_F" ); s.N_R = dataDouble( "N_R" ); s.B_F = dataDouble( "B_F" ); s.B_R = dataDouble( "B_R" ); m_pMOSFET->setMOSFETSettings( s ); #endif }
/* ERROR FUNCTION NUMBER - 6 */ Bool conInitData(Connector *c, u_char dir) { if(!c) return setError(E_WRONG_ARG, 1.06, NULL); c->elt.pointer = True; switch(c->ticket->dat) { case DAT_ANYTYPE: /* does it realy need? */ *(c->elt.data) = dataFree(0, 1, 0); break; case DAT_SIGNAL: *(c->elt.data) = dataBool(True); break; case DAT_STRING: *(c->elt.data) = regDataText(NULL); break; default: if(dir == C_OUT) /* array with given size */ return dataInitArray(c->elt.data, c->ticket->dat); else *(c->elt.data) = dataArrayNull(); } return True; }
void DPText::dataChanged() { b_displayBackground = dataBool("background"); m_backgroundColor = dataColor("background-color"); m_frameColor = dataColor("frame-color"); m_text = dataString("text"); if ( !Qt::mightBeRichText( m_text ) ) { // Format the text to be HTML m_text.replace( '\n', "<br>" ); } update(); }
void DPRectangle::dataChanged() { bool displayBackground = dataBool("background"); QColor line_color = dataColor("line-color"); unsigned width = unsigned( dataInt("line-width") ); Qt::PenStyle style = getDataPenStyle("line-style"); setPen( QPen( line_color, width, style ) ); if (displayBackground) setBrush( dataColor("background-color") ); else setBrush( Qt::NoBrush ); postResize(); update(); }
void ECLogicInput::dataChanged() { button("button")->setToggle( dataBool("useToggle") ); }