void
CModule_ControlSwitch::Setup(
	void)
{
	touchMode = gConfig.GetVal(eConfigVar_TouchMode);

	LoadDataFromEEPROM(controlSwitchArray, eepromOffset, sizeof(controlSwitchArray));
	LoadDataFromEEPROM(controlSwitchToTurnoutMapArray, eepromOffset + sizeof(controlSwitchArray), sizeof(controlSwitchToTurnoutMapArray));

	SMsg_Table	dummy;
	TableUpdate(0, dummy);

	if(touchMode == eTouchMode_BuiltIn)
	{
		uint32_t	touchBV = 0;

		for(int i = 0; i < eMaxControlSwitchCount; ++i)
		{
			if(controlSwitchArray[i].touchID != 0xFF)
			{
				touchBV |= 1 << controlSwitchArray[i].touchID;
			}
		}

		TeensyRegisterTouchSensor(touchBV, this);
	}
	else if(touchMode == eTouchMode_MPR121)
	{
		MPRRegisterTouchSensor(0, this);
	}
}
Exemple #2
0
static void update_fonttool_cb(OptionStructure *opt, int value, void *data)
{
    fonttool_ui *ui = (fonttool_ui *) data;
    int cwidth, cheight;

    if (ui->font_id != value) {
        ui->font_id = value;
        ui->new_font = TRUE;
    }

    TableGetCellDimentions(ui->font_table, &cwidth, &cheight);

    /* 6 = 2*cellShadowThickness + 2 */
    ui->csize = MIN2(cwidth, cheight) - 6;

    TableUpdate(ui->font_table);
}
Exemple #3
0
ERR_Code
aCatalogue::Update()
{
	ERR_Code err = aObject::Update();
	if ( !err )
	{

		aLog::print(aLog::Debug, tr("aCatalogue update"));
		err = TableUpdate( md_group );
		if(err)
		{
			aLog::print(aLog::Error, tr("aCatalogue update groups error %1").arg(err));
		}
		else
		{
			aLog::print(aLog::Debug, tr("aCatalogue update groups"));
		}
	}
	else
	{
		aLog::print(aLog::Error, tr("aCatalogue update elements error %1").arg(err));
	}
	return err;
}
Exemple #4
0
ERR_Code
aCatalogue::GroupUpdate()
{
	aLog::print(aLog::Debug, tr("aCatalogue update group"));
	return TableUpdate( md_group );
}