Esempio n. 1
0
void LED::dataChanged()
{
	QColor color = dataColor("0-color");
	r = color.red() / (double)0x100;
	g = color.green() / (double)0x100;
	b = color.blue() / (double)0x100;
}
Esempio n. 2
0
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();
}
Esempio n. 3
0
void MatrixDisplay::dataChanged() {
    QColor color = dataColor("color");
    m_r = double(color.red())   / 0x100;
    m_g = double(color.green()) / 0x100;
    m_b = double(color.blue())  / 0x100;

    int numRows = dataInt("0-rows");
    int numCols = dataInt("1-cols");

    bool ledsChanged = (numRows != int(m_numRows)) || (numCols != int(m_numCols));

    if (ledsChanged) { 
        for (unsigned i = 0; i < m_numCols; i++)
            for (unsigned j = 0; j < m_numRows; j++)  // must remove elements before re-organizing storage. 
                removeElement(&(m_LEDs[i][j].m_pDiode), (i == (m_numCols - 1)) && (j == (m_numRows - 1))); 

        initPins(numRows, numCols);
        }

    bool rowCathode = dataString("diode-configuration") == "Row Cathode";

    if ((rowCathode != m_bRowCathode) || ledsChanged) {
        m_bRowCathode = rowCathode;

        for (unsigned i = 0; i < m_numCols; i++) {
            for (unsigned j = 0; j < m_numRows; j++) {

                if (rowCathode) {
                    setup2pinElement(m_LEDs[i][j].m_pDiode, m_pColNodes[i]->pin(), m_pRowNodes[j]->pin());
                } else setup2pinElement(m_LEDs[i][j].m_pDiode, m_pRowNodes[j]->pin(), m_pColNodes[i]->pin());
            }
        }
    }
}
Esempio n. 4
0
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();
}
Esempio n. 5
0
void Probe::dataChanged() {
	m_color = dataColor("color");

	if (p_probeData)
		p_probeData->setColor(m_color);

	setChanged();
}
Esempio n. 6
0
void BiDirLED::dataChanged() {
	QString colors[] = { "0-color1", "0-color2" };

	for (unsigned i = 0; i < 2; i++) {
		QColor color = dataColor(colors[i]);
		r[i] = color.red() / 0x100;
		g[i] = color.green() / 0x100;
		b[i] = color.blue() / 0x100;
	}
}
Esempio n. 7
0
void DPLine::dataChanged()
{
	setPen( QPen( dataColor("line-color"),
			unsigned( dataInt("line-width") ),
			getDataPenStyle("line-style"),
			getDataPenCapStyle("cap-style"),
			Qt::MiterJoin ) );
	
	postResize(); // in case the pen width has changed
	update();
}
Esempio n. 8
0
void LEDBarGraphDisplay::dataChanged() {
	DiodeSettings ds;
	QColor color = dataColor("color");

	ds.I_S = dataDouble("I_S");
	ds.V_B = dataDouble("V_B");
	ds.N = dataDouble("N");

	initPins();

	// Update each diode in array with new diode setting as they are acting individually.

	for (unsigned i = 0; i < m_numRows; i++) {
		m_LEDParts[i]->setDiodeSettings(ds);
		m_LEDParts[i]->setColor(color);
	}
}
Esempio n. 9
0
QColor FChart3d::GetColorData(double z)
{

    RGBA rgba = (*dataColor())(Triple(0, 0, z));
    return QColor::fromRgbF(rgba.r, rgba.g, rgba.b, rgba.a);
}