Esempio n. 1
0
//#include "freeems/fetable2ddata.h"
TableView2D::TableView2D(QWidget *parent)
{
	Q_UNUSED(parent)
	//m_isSignedData = isSigned;
	m_isFlashOnly = false;
	ui.setupUi(this);
	metaDataValid = false;
	tableData=0;
	//ui.tableWidget->setColumnCount(1);
	ui.tableWidget->setRowCount(2);
	ui.tableWidget->horizontalHeader()->hide();
	ui.tableWidget->verticalHeader()->hide();
	//ui.tableWidget->setColumnWidth(0,100);
	connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
	connect(ui.loadFlashPushButton,SIGNAL(clicked()),this,SLOT(loadFlashClicked()));
	connect(ui.loadRamPushButton,SIGNAL(clicked()),this,SLOT(loadRamClicked()));
	connect(ui.tableWidget,SIGNAL(cellChanged(int,int)),this,SLOT(tableCellChanged(int,int)));
	connect(ui.tableWidget,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(tableCurrentCellChanged(int,int,int,int)));
	connect(ui.exportPushButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	connect(ui.importPushButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	connect(ui.tableWidget,SIGNAL(hotKeyPressed(int,Qt::KeyboardModifiers)),this,SLOT(hotKeyPressed(int,Qt::KeyboardModifiers)));
	ui.tableWidget->addHotkey(Qt::Key_Plus,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Minus,Qt::NoModifier);
	ui.tableWidget->addHotkey(Qt::Key_Underscore,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Equal,Qt::NoModifier);
	ui.tableWidget->setItemDelegate(new TableWidgetDelegate());

	QPalette pal = ui.plot->palette();
	pal.setColor(QPalette::Background,QColor::fromRgb(0,0,0));
	ui.plot->setPalette(pal);
	curve = new QwtPlotCurve("Test");
	curve->attach(ui.plot);
	curve->setPen(QPen(QColor::fromRgb(255,0,0),3));
	QwtPlotGrid *grid = new QwtPlotGrid();
	grid->setPen(QPen(QColor::fromRgb(100,100,100)));
	grid->attach(ui.plot);


	//curve->setData()
	//QwtSeriesData<QwtIntervalSample> series;
	/*if (!isram)
	{
		//Is only flash
		ui.loadRamPushButton->setVisible(false);
	}
	else if (!isflash)
	{
		//Is only ram
		ui.loadFlashPushButton->setVisible(false);
		ui.savePushButton->setVisible(false);
	}
	else
	{
		//Is both ram and flash
	}*/
	connect(ui.tracingCheckBox,SIGNAL(stateChanged(int)),this,SLOT(tracingCheckBoxStateChanged(int)));
}
Esempio n. 2
0
TableView3D::TableView3D(QWidget *parent)
{
	Q_UNUSED(parent)
	m_isFlashOnly = false;
	m_tableMap=0;
	ui.setupUi(this);
	tableData=0;
	m_tracingEnabled = false;
	connect(ui.savePushButton,SIGNAL(clicked()),this,SLOT(saveClicked()));
	connect(ui.loadFlashPushButton,SIGNAL(clicked()),this,SLOT(loadClicked()));
	connect(ui.loadRamPushButton,SIGNAL(clicked()),this,SLOT(loadRamClicked()));
	connect(ui.exportPushButton,SIGNAL(clicked()),this,SLOT(exportClicked()));
	connect(ui.importPushButton,SIGNAL(clicked()),this,SLOT(importClicked()));
	connect(ui.tableWidget,SIGNAL(hotKeyPressed(int,Qt::KeyboardModifier)),this,SLOT(hotKeyPressed(int,Qt::KeyboardModifier)));
	connect(ui.tracingCheckBox,SIGNAL(stateChanged(int)),this,SLOT(tracingCheckBoxStateChanged(int)));
	ui.tableWidget->addHotkey(Qt::Key_Plus,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Minus,Qt::NoModifier);
	ui.tableWidget->addHotkey(Qt::Key_Underscore,Qt::ShiftModifier);
	ui.tableWidget->addHotkey(Qt::Key_Equal,Qt::NoModifier);
	connect(ui.tableWidget,SIGNAL(itemChangeRequest(int,int,int,int,QString)),this,SLOT(itemChangeRequest(int,int,int,int,QString)));
	//ui.tableWidget->setItemDelegate(new TableWidgetDelegate());

	setContextMenuPolicy(Qt::DefaultContextMenu);
	//QAction* fooAction = new QAction("foo",this);
	//QAction* barAction = new QAction("bar",this);
	//connect(fooAction, SIGNAL(triggered()), this, SLOT(doSomethingFoo()));
	//connect(barAction, SIGNAL(triggered()), this, SLOT(doSomethingBar()));
	//addAction(fooAction);
	//addAction(barAction);
	metaDataValid = true;
	/*if (!isram)
	{
		//Is only flash
		ui.loadRamPushButton->setVisible(false);
	}
	else if (!isflash)
	{
		//Is only ram
		ui.savePushButton->setVisible(false);
		ui.loadFlashPushButton->setVisible(false);
	}
	else
	{
		//Is both ram and flash
	}*/
	//ui.importPushButton->setVisible(false);
	//ui.tracingCheckBox->setVisible(false);
	//ui.tracingCheckBox->setEnabled(false);
	connect(ui.showMapPushButton,SIGNAL(clicked()),this,SLOT(showMapClicked()));
	m_inputTimer = new QTimer(this);
	connect(m_inputTimer,SIGNAL(timeout()),this,SLOT(inputTimerTimeout()));
}