AM3DNormalizationABEditor::AM3DNormalizationABEditor(AM3DNormalizationAB *analysisBlock, QWidget *parent)
	: QWidget(parent)
{
	analysisBlock_ = analysisBlock;

	dataNames_ = new QComboBox;
	normalizationNames_ = new QComboBox;
	populateComboBox();

	connect(dataNames_, SIGNAL(currentIndexChanged(int)), this, SLOT(onDataNameChoiceChanged(int)));
	connect(normalizationNames_, SIGNAL(currentIndexChanged(int)), this, SLOT(onNormalizationNameChoiceChanged(int)));
	connect(analysisBlock_, SIGNAL(inputSourcesChanged()), this, SLOT(populateComboBox()));

	if (analysisBlock_->inputDataSourceCount() > 0){

		dataNames_->setCurrentIndex(dataNames_->findData(analysisBlock_->dataName()));
		normalizationNames_->setCurrentIndex(normalizationNames_->findData(analysisBlock_->normalizationName()));
	}

	QFormLayout *layout = new QFormLayout;
	layout->addRow("Data:", dataNames_);
	layout->addRow("Normalization:", normalizationNames_);

	setLayout(layout);
}
Ejemplo n.º 2
0
LayersSettings::LayersSettings(QWidget *parent, FANN::neural_net *net, bool isNewNet, Qt::WindowFlags flags) :
    QWidget(parent, flags), Ui::LayersSettings(), net(net)
{
    assert(net && "Illegal program state, net uninitialized");
    setupUi(this);
    populateComboBox(networkTypeCombo, FANN::NET_TYPES, "NetworkTypes",  2);
    if (isNewNet == 0)
    {
        loadData();
        disableControls();
    }

    std::auto_ptr<StrictIntValidator> 
       i1(new StrictIntValidator(1, 999, neuronCountEdit)),
       i2(new StrictIntValidator(1, 999, inputNeuronsEdit)),
       i3(new StrictIntValidator(1, 999, outputNeuronsEdit));
    connect(hiddenLayersSpin, SIGNAL(valueChanged(int)),
            this, SLOT(layersNumberChanged(const int)));
    connect(networkTypeCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(networkTypeChanged(int)));
    connect(neuronCountEdit, SIGNAL(textChanged(const QString&)),
            this, SLOT(neuronsNumberChanged(const QString&)));
    connect(layerNumberCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(layersChoiceChanged(const int)));
    
    neuronCountEdit->setValidator(i1.release());
    inputNeuronsEdit->setValidator(i2.release());
    outputNeuronsEdit->setValidator(i3.release());
}
Ejemplo n.º 3
0
EntityPropertyEditor::EntityPropertyEditor (Entity* entity, const std::string& name)
{
	_widget = gtk_vbox_new(FALSE, 6);

	GtkWidget* editBox = gtk_hbox_new(FALSE, 3);
	gtk_container_set_border_width(GTK_CONTAINER(editBox), 3);

	// Set up the combobox TreeModel
	_comboBox = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(gtk_list_store_new(1, G_TYPE_STRING)), 0); // number of the "text" column
	populateComboBox();

	// Add completion functionality to the combobox entry
	GtkEntryCompletion* completion = gtk_entry_completion_new();
	gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(gtk_combo_box_get_model(GTK_COMBO_BOX(_comboBox)))
	);
	gtk_entry_completion_set_text_column(completion, 0);
	gtk_entry_set_completion(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(_comboBox))), completion);

	std::string caption = name + ": ";
	gtk_box_pack_start(GTK_BOX(editBox), gtk_label_new(caption.c_str()), FALSE, FALSE, 0);
	gtk_box_pack_end(GTK_BOX(editBox), _comboBox, TRUE, TRUE, 0);

	GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), editBox, TRUE, FALSE, 0);

	gtk_box_pack_start(GTK_BOX(_widget), vbox, TRUE, TRUE, 0);
}
Ejemplo n.º 4
0
AM1DBasicIntegralABEditor::AM1DBasicIntegralABEditor(AM1DIntegralAB *analysisBlock, QWidget *parent)
    : QWidget(parent)
{
    analysisBlock_ = analysisBlock;

    names_ = new QComboBox;
    populateComboBox();

    connect(names_, SIGNAL(currentIndexChanged(int)), this, SLOT(onNameChoiceChanged(int)));
    connect(analysisBlock_, SIGNAL(inputSourcesChanged()), this, SLOT(populateComboBox()));

    if (analysisBlock_->inputDataSourceCount() > 0)
        onNameChoiceChanged(0);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(new QLabel("Input:"), 0, Qt::AlignRight);
    layout->addWidget(names_, 0, Qt::AlignLeft);

    setLayout(layout);
}
Ejemplo n.º 5
0
AMOrderReductionABEditor::AMOrderReductionABEditor(AMOrderReductionAB *analysisBlock, QWidget *parent)
	: QWidget(parent)
{
	analysisBlock_ = analysisBlock;

	sourceNames_ = new QComboBox;
	reducedAxisOptions_ = new QComboBox;
	populateComboBox();

	connect(sourceNames_, SIGNAL(currentIndexChanged(int)), this, SLOT(onDataSourceChanged(int)));
	connect(reducedAxisOptions_, SIGNAL(currentIndexChanged(int)), this, SLOT(onReducedAxisChanged(int)));

	if (analysisBlock_->inputDataSourceCount() > 0){

		sourceNames_->setCurrentIndex(sourceNames_->findData(analysisBlock_->selectedName()));
		reducedAxisOptions_->setCurrentIndex(reducedAxisOptions_->findData(analysisBlock_->reducedAxis()));
	}

	QFormLayout *layout = new QFormLayout;
	layout->addRow("Source:", sourceNames_);
	layout->addRow("Reduced Axis:", reducedAxisOptions_);

	setLayout(layout);
}
Ejemplo n.º 6
0
MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) :
	WindowQt(machine, parent)
{
	QPoint parentPos = parent->pos();
	setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400);
	setWindowTitle("Debug: Memory View");

	//
	// The main frame and its input and log widgets
	//
	QFrame* mainWindowFrame = new QFrame(this);

	// The top frame & groupbox that contains the input widgets
	QFrame* topSubFrame = new QFrame(mainWindowFrame);

	// The input edit
	m_inputEdit = new QLineEdit(topSubFrame);
	connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted()));

	// The memory space combo box
	m_memoryComboBox = new QComboBox(topSubFrame);
	m_memoryComboBox->setMinimumWidth(300);
	connect(m_memoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(memoryRegionChanged(int)));

	// The main memory window
	m_memTable = new DebuggerView(DVT_MEMORY,
									m_machine,
									this);

	// Populate the combo box
	populateComboBox();


	// Layout
	QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame);
	subLayout->addWidget(m_inputEdit);
	subLayout->addWidget(m_memoryComboBox);
	subLayout->setSpacing(3);
	subLayout->setContentsMargins(2,2,2,2);

	QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
	vLayout->setSpacing(3);
	vLayout->setContentsMargins(2,2,2,2);
	vLayout->addWidget(topSubFrame);
	vLayout->addWidget(m_memTable);

	setCentralWidget(mainWindowFrame);

	//
	// Menu bars
	//
	// Create a byte-chunk group
	QActionGroup* chunkGroup = new QActionGroup(this);
	QAction* chunkActOne  = new QAction("1-byte chunks", this);
	QAction* chunkActTwo  = new QAction("2-byte chunks", this);
	QAction* chunkActFour = new QAction("4-byte chunks", this);
	chunkActOne->setCheckable(true);
	chunkActTwo->setCheckable(true);
	chunkActFour->setCheckable(true);
	chunkActOne->setActionGroup(chunkGroup);
	chunkActTwo->setActionGroup(chunkGroup);
	chunkActFour->setActionGroup(chunkGroup);
	chunkActOne->setShortcut(QKeySequence("Ctrl+1"));
	chunkActTwo->setShortcut(QKeySequence("Ctrl+2"));
	chunkActFour->setShortcut(QKeySequence("Ctrl+4"));
	chunkActOne->setChecked(true);
	connect(chunkGroup, SIGNAL(triggered(QAction*)), this, SLOT(chunkChanged(QAction*)));

	// Create a address display group
	QActionGroup* addressGroup = new QActionGroup(this);
	QAction* addressActLogical = new QAction("Logical Addresses", this);
	QAction* addressActPhysical = new QAction("Physical Addresses", this);
	addressActLogical->setCheckable(true);
	addressActPhysical->setCheckable(true);
	addressActLogical->setActionGroup(addressGroup);
	addressActPhysical->setActionGroup(addressGroup);
	addressActLogical->setShortcut(QKeySequence("Ctrl+G"));
	addressActPhysical->setShortcut(QKeySequence("Ctrl+Y"));
	addressActLogical->setChecked(true);
	connect(addressGroup, SIGNAL(triggered(QAction*)), this, SLOT(addressChanged(QAction*)));

	// Create a reverse view radio
	QAction* reverseAct = new QAction("Reverse View", this);
	reverseAct->setCheckable(true);
	reverseAct->setShortcut(QKeySequence("Ctrl+R"));
	connect(reverseAct, SIGNAL(toggled(bool)), this, SLOT(reverseChanged(bool)));

	// Create increase and decrease bytes-per-line actions
	QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this);
	QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this);
	increaseBplAct->setShortcut(QKeySequence("Ctrl+P"));
	decreaseBplAct->setShortcut(QKeySequence("Ctrl+O"));
	connect(increaseBplAct, SIGNAL(triggered(bool)), this, SLOT(increaseBytesPerLine(bool)));
	connect(decreaseBplAct, SIGNAL(triggered(bool)), this, SLOT(decreaseBytesPerLine(bool)));

	// Assemble the options menu
	QMenu* optionsMenu = menuBar()->addMenu("&Options");
	optionsMenu->addActions(chunkGroup->actions());
	optionsMenu->addSeparator();
	optionsMenu->addActions(addressGroup->actions());
	optionsMenu->addSeparator();
	optionsMenu->addAction(reverseAct);
	optionsMenu->addSeparator();
	optionsMenu->addAction(increaseBplAct);
	optionsMenu->addAction(decreaseBplAct);
}
Ejemplo n.º 7
0
MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) :
	WindowQt(machine, nullptr)
{
	setWindowTitle("Debug: Memory View");

	if (parent != nullptr)
	{
		QPoint parentPos = parent->pos();
		setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400);
	}

	//
	// The main frame and its input and log widgets
	//
	QFrame* mainWindowFrame = new QFrame(this);

	// The top frame & groupbox that contains the input widgets
	QFrame* topSubFrame = new QFrame(mainWindowFrame);

	// The input edit
	m_inputEdit = new QLineEdit(topSubFrame);
	connect(m_inputEdit, &QLineEdit::returnPressed, this, &MemoryWindow::expressionSubmitted);

	// The memory space combo box
	m_memoryComboBox = new QComboBox(topSubFrame);
	m_memoryComboBox->setObjectName("memoryregion");
	m_memoryComboBox->setMinimumWidth(300);
	connect(m_memoryComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &MemoryWindow::memoryRegionChanged);

	// The main memory window
	m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this);

	// Layout
	QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame);
	subLayout->addWidget(m_inputEdit);
	subLayout->addWidget(m_memoryComboBox);
	subLayout->setSpacing(3);
	subLayout->setContentsMargins(2,2,2,2);

	QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
	vLayout->setSpacing(3);
	vLayout->setContentsMargins(2,2,2,2);
	vLayout->addWidget(topSubFrame);
	vLayout->addWidget(m_memTable);

	setCentralWidget(mainWindowFrame);

	//
	// Menu bars
	//

	// Create a data format group
	QActionGroup* dataFormat = new QActionGroup(this);
	dataFormat->setObjectName("dataformat");
	QAction* formatActOne  = new QAction("1-byte chunks", this);
	QAction* formatActTwo  = new QAction("2-byte chunks", this);
	QAction* formatActFour = new QAction("4-byte chunks", this);
	QAction* formatActEight = new QAction("8-byte chunks", this);
	QAction* formatAct32bitFloat = new QAction("32 bit floating point", this);
	QAction* formatAct64bitFloat = new QAction("64 bit floating point", this);
	QAction* formatAct80bitFloat = new QAction("80 bit floating point", this);
	formatActOne->setObjectName("formatActOne");
	formatActTwo->setObjectName("formatActTwo");
	formatActFour->setObjectName("formatActFour");
	formatActEight->setObjectName("formatActEight");
	formatAct32bitFloat->setObjectName("formatAct32bitFloat");
	formatAct64bitFloat->setObjectName("formatAct64bitFloat");
	formatAct80bitFloat->setObjectName("formatAct80bitFloat");
	formatActOne->setCheckable(true);
	formatActTwo->setCheckable(true);
	formatActFour->setCheckable(true);
	formatActEight->setCheckable(true);
	formatAct32bitFloat->setCheckable(true);
	formatAct64bitFloat->setCheckable(true);
	formatAct80bitFloat->setCheckable(true);
	formatActOne->setActionGroup(dataFormat);
	formatActTwo->setActionGroup(dataFormat);
	formatActFour->setActionGroup(dataFormat);
	formatActEight->setActionGroup(dataFormat);
	formatAct32bitFloat->setActionGroup(dataFormat);
	formatAct64bitFloat->setActionGroup(dataFormat);
	formatAct80bitFloat->setActionGroup(dataFormat);
	formatActOne->setShortcut(QKeySequence("Ctrl+1"));
	formatActTwo->setShortcut(QKeySequence("Ctrl+2"));
	formatActFour->setShortcut(QKeySequence("Ctrl+4"));
	formatActEight->setShortcut(QKeySequence("Ctrl+8"));
	formatAct32bitFloat->setShortcut(QKeySequence("Ctrl+9"));
	formatActOne->setChecked(true);
	connect(dataFormat, &QActionGroup::triggered, this, &MemoryWindow::formatChanged);
	// Create a address display group
	QActionGroup* addressGroup = new QActionGroup(this);
	addressGroup->setObjectName("addressgroup");
	QAction* addressActLogical = new QAction("Logical Addresses", this);
	QAction* addressActPhysical = new QAction("Physical Addresses", this);
	addressActLogical->setCheckable(true);
	addressActPhysical->setCheckable(true);
	addressActLogical->setActionGroup(addressGroup);
	addressActPhysical->setActionGroup(addressGroup);
	addressActLogical->setShortcut(QKeySequence("Ctrl+G"));
	addressActPhysical->setShortcut(QKeySequence("Ctrl+Y"));
	addressActLogical->setChecked(true);
	connect(addressGroup, &QActionGroup::triggered, this, &MemoryWindow::addressChanged);

	// Create a reverse view radio
	QAction* reverseAct = new QAction("Reverse View", this);
	reverseAct->setObjectName("reverse");
	reverseAct->setCheckable(true);
	reverseAct->setShortcut(QKeySequence("Ctrl+R"));
	connect(reverseAct, &QAction::toggled, this, &MemoryWindow::reverseChanged);

	// Create increase and decrease bytes-per-line actions
	QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this);
	QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this);
	increaseBplAct->setShortcut(QKeySequence("Ctrl+P"));
	decreaseBplAct->setShortcut(QKeySequence("Ctrl+O"));
	connect(increaseBplAct, &QAction::triggered, this, &MemoryWindow::increaseBytesPerLine);
	connect(decreaseBplAct, &QAction::triggered, this, &MemoryWindow::decreaseBytesPerLine);

	// Assemble the options menu
	QMenu* optionsMenu = menuBar()->addMenu("&Options");
	optionsMenu->addActions(dataFormat->actions());
	optionsMenu->addSeparator();
	optionsMenu->addActions(addressGroup->actions());
	optionsMenu->addSeparator();
	optionsMenu->addAction(reverseAct);
	optionsMenu->addSeparator();
	optionsMenu->addAction(increaseBplAct);
	optionsMenu->addAction(decreaseBplAct);


	//
	// Initialize
	//
	populateComboBox();

	// Set to the current CPU's memory view
	setToCurrentCpu();
}
Ejemplo n.º 8
0
AM4DBinningABEditor::AM4DBinningABEditor(AM4DBinningAB *analysisBlock, QWidget *parent)
	: QWidget(parent)
{
	analysisBlock_ = analysisBlock;

	names_ = new QComboBox;
	populateComboBox();

	connect(names_, SIGNAL(currentIndexChanged(int)), this, SLOT(onNameChoiceChanged(int)));
	connect(analysisBlock_, SIGNAL(inputSourcesChanged()), this, SLOT(populateComboBox()));

	axisSelector_ = new QComboBox();
	axisSelector_->addItem("Horizontal");
	axisSelector_->addItem("Vertical");
	axisSelector_->addItem("Depth");

	rangeMinControl_ = new QSpinBox();
	rangeMinControl_->setSingleStep(1);
	rangeMinControl_->setMinimum(0);
	rangeMaxControl_ = new QSpinBox();
	rangeMaxControl_->setSingleStep(1);
	rangeMaxControl_->setMinimum(0);

	plot_ = new MPlot();
	plotWidget_ = new MPlotWidget();
	plotWidget_->setPlot(plot_);

	plot_->plotArea()->setBrush(QBrush(QColor(Qt::white)));
	plot_->axisRight()->setTicks(0);
	plot_->axisBottom()->setTicks(4);
	plot_->axisLeft()->showGrid(false);
	plot_->axisBottom()->showAxisName(false);
	plot_->axisLeft()->showAxisName(false);
	plot_->axisScaleBottom()->setPadding(0);
	plot_->axisScaleLeft()->setPadding(0);
	seriesData_ = new MPlotVectorSeriesData();
	series_ = new MPlotSeriesBasic();
	series_->setMarker(MPlotMarkerShape::None);
	series_->setModel(seriesData_, true);
	plot_->addItem(series_);

	QColor white(Qt::white);
	QPen pen(white, 1, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin);
	white.setAlphaF(0.6);
	rangeRectangle1_ = new MPlotRectangle(QRectF(0,0,10,10), Qt::NoPen, QBrush(white));
	rangeRectangle1_->setSelectable(false);
	rangeRectangle1_->setIgnoreWhenAutoScaling(true);
	rangeRectangle1_->setZValue(3000);
	plot_->addItem(rangeRectangle1_);
	rangeRectangle1_->setVisible(false);
	rangeRectangle2_ = new MPlotRectangle(QRectF(0,0,10,10), Qt::NoPen, QBrush(white));
	rangeRectangle2_->setSelectable(false);
	rangeRectangle2_->setIgnoreWhenAutoScaling(true);
	rangeRectangle2_->setZValue(3000);
	plot_->addItem(rangeRectangle2_);
	rangeRectangle2_->setVisible(false);
	plot_->legend()->enableDefaultLegend(false);

	plot_->addTool(new MPlotDragZoomerTool());
	plot_->addTool(new MPlotWheelZoomerTool());

	QVBoxLayout* vl = new QVBoxLayout();
	QFormLayout* fl = new QFormLayout();
	fl->addRow("Input:", names_);
	fl->addRow("Sum", axisSelector_);
	QHBoxLayout* hl = new QHBoxLayout();
	hl->addWidget(rangeMinControl_);
	hl->addWidget(new QLabel("To"));
	hl->addWidget(rangeMaxControl_);
	fl->addRow("From (index)", hl);
	vl->addLayout(fl);
	vl->addWidget(plotWidget_);
	setLayout(vl);

	onAnalysisBlockInputDataSourcesChanged();

	// This needs to be called last because it requires all of the pointers to be valid.  All of dem.
	if (analysisBlock_->inputDataSourceCount() > 0)
		onNameChoiceChanged(0);

	// make connections
	connect(analysisBlock_, SIGNAL(inputSourcesChanged()), this, SLOT(onAnalysisBlockInputDataSourcesChanged()));

	connect(axisSelector_, SIGNAL(currentIndexChanged(int)), this, SLOT(onSumAxisControlChanged(int)));
	connect(rangeMinControl_, SIGNAL(valueChanged(int)), this, SLOT(onRangeMinControlChanged(int)));
	connect(rangeMaxControl_, SIGNAL(valueChanged(int)), this, SLOT(onRangeMaxControlChanged(int)));
}
Ejemplo n.º 9
0
DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) :
	WindowQt(machine, nullptr)
{
	setWindowTitle("Debug: Disassembly View");

	if (parent != nullptr)
	{
		QPoint parentPos = parent->pos();
		setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400);
	}

	//
	// The main frame and its input and log widgets
	//
	QFrame* mainWindowFrame = new QFrame(this);

	// The top frame & groupbox that contains the input widgets
	QFrame* topSubFrame = new QFrame(mainWindowFrame);

	// The input edit
	m_inputEdit = new QLineEdit(topSubFrame);
	connect(m_inputEdit, &QLineEdit::returnPressed, this, &DasmWindow::expressionSubmitted);

	// The cpu combo box
	m_cpuComboBox = new QComboBox(topSubFrame);
	m_cpuComboBox->setObjectName("cpu");
	m_cpuComboBox->setMinimumWidth(300);
	connect(m_cpuComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &DasmWindow::cpuChanged);

	// The main disasm window
	m_dasmView = new DebuggerView(DVT_DISASSEMBLY, m_machine, this);
	connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated);

	// Force a recompute of the disassembly region
	downcast<debug_view_disasm*>(m_dasmView->view())->set_expression("curpc");

	// Populate the combo box & set the proper cpu
	populateComboBox();
	//const debug_view_source *source = mem->views[0]->view->source_for_device(curcpu);
	//gtk_combo_box_set_active(zone_w, mem->views[0]->view->source_list().indexof(*source));
	//mem->views[0]->view->set_source(*source);


	// Layout
	QHBoxLayout* subLayout = new QHBoxLayout(topSubFrame);
	subLayout->addWidget(m_inputEdit);
	subLayout->addWidget(m_cpuComboBox);
	subLayout->setSpacing(3);
	subLayout->setContentsMargins(2,2,2,2);

	QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
	vLayout->setSpacing(3);
	vLayout->setContentsMargins(2,2,2,2);
	vLayout->addWidget(topSubFrame);
	vLayout->addWidget(m_dasmView);

	setCentralWidget(mainWindowFrame);

	//
	// Menu bars
	//
	// Create three commands
	m_breakpointToggleAct = new QAction("Toggle Breakpoint at Cursor", this);
	m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this);
	m_runToCursorAct = new QAction("Run to Cursor", this);
	m_breakpointToggleAct->setShortcut(Qt::Key_F9);
	m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
	m_runToCursorAct->setShortcut(Qt::Key_F4);
	connect(m_breakpointToggleAct, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor);
	connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor);
	connect(m_runToCursorAct, &QAction::triggered, this, &DasmWindow::runToCursor);

	// Right bar options
	QActionGroup* rightBarGroup = new QActionGroup(this);
	rightBarGroup->setObjectName("rightbargroup");
	QAction* rightActRaw = new QAction("Raw Opcodes", this);
	QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this);
	QAction* rightActComments = new QAction("Comments", this);
	rightActRaw->setCheckable(true);
	rightActEncrypted->setCheckable(true);
	rightActComments->setCheckable(true);
	rightActRaw->setActionGroup(rightBarGroup);
	rightActEncrypted->setActionGroup(rightBarGroup);
	rightActComments->setActionGroup(rightBarGroup);
	rightActRaw->setShortcut(QKeySequence("Ctrl+R"));
	rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
	rightActComments->setShortcut(QKeySequence("Ctrl+N"));
	rightActRaw->setChecked(true);
	connect(rightBarGroup, &QActionGroup::triggered, this, &DasmWindow::rightBarChanged);

	// Assemble the options menu
	QMenu* optionsMenu = menuBar()->addMenu("&Options");
	optionsMenu->addAction(m_breakpointToggleAct);
	optionsMenu->addAction(m_breakpointEnableAct);
	optionsMenu->addAction(m_runToCursorAct);
	optionsMenu->addSeparator();
	optionsMenu->addActions(rightBarGroup->actions());
}
Ejemplo n.º 10
0
void SysSettingsForm::populate()
{
	QString msg;
	int idx;
	
	// Select the Audio category
    categoryListBox->setCurrentRow(idxCatGeneral);
    settingsWidgetStack->setCurrentWidget(pageGeneral);
	
	// Set focus on first field
	categoryListBox->setFocus();
	
	// Audio settings
	list_audio_playback_dev = sys_config->get_audio_devices(true);
	list_audio_capture_dev = sys_config->get_audio_devices(false);
	ringtoneComboBox->clear();
	speakerComboBox->clear();
	micComboBox->clear();
	bool devRingtoneFound = false;
	bool devSpeakerFound = false;
	bool devMicFound = false;
	
	// Playback devices
	idx = 0;
	for (list<t_audio_device>::iterator i = list_audio_playback_dev.begin(); 
	i != list_audio_playback_dev.end(); i++, idx++) {
		string item = i->get_description();
        ringtoneComboBox->addItem(QString(item.c_str()));
        speakerComboBox->addItem(QString(item.c_str()));
		
		// Select audio device
		if (sys_config->get_dev_ringtone().device == i->device) {
            ringtoneComboBox->setCurrentIndex(idx);
			otherRingtoneLineEdit->clear();
			devRingtoneFound = true;
		}
		if (sys_config->get_dev_speaker().device == i->device) {
            speakerComboBox->setCurrentIndex(idx);
			otherSpeakerLineEdit->clear();
			devSpeakerFound = true;
		}
		
		// Determine index for other non-standard device
		if (i->device == DEV_OTHER) {
			if (i->type == t_audio_device::ALSA) {
				idxOtherPlaybackDevAlsa = idx;
			} else {
				idxOtherPlaybackDevOss = idx;
			}
		}
	}
	
	// Check for non-standard audio devices
	if (!devRingtoneFound) {
		t_audio_device dev = sys_config->get_dev_ringtone();
		otherRingtoneLineEdit->setText(dev.device.c_str());
        ringtoneComboBox->setCurrentIndex(
			(dev.type == t_audio_device::ALSA ? idxOtherPlaybackDevAlsa : idxOtherPlaybackDevOss));
	}
	if (!devSpeakerFound) {
		t_audio_device dev = sys_config->get_dev_speaker();
		otherSpeakerLineEdit->setText(dev.device.c_str());
        speakerComboBox->setCurrentIndex(
			(dev.type == t_audio_device::ALSA ? idxOtherPlaybackDevAlsa : idxOtherPlaybackDevOss));
	}
	
	// Capture device
	idx = 0;
	for (list<t_audio_device>::iterator i = list_audio_capture_dev.begin(); 
	i != list_audio_capture_dev.end(); i++, idx++) {
		string item = i->get_description();
        micComboBox->addItem(QString(item.c_str()));
		
		// Select audio device
		if (sys_config->get_dev_mic().device == i->device) {
            micComboBox->setCurrentIndex(idx);
			otherMicLineEdit->clear();
			devMicFound = true;
		}
		
		// Determine index for other non-standard device
		if (i->device == DEV_OTHER) {
			if (i->type == t_audio_device::ALSA) {
				idxOtherCaptureDevAlsa = idx;
			} else {
				idxOtherCaptureDevOss = idx;
			}
		}
	}
	
	// Check for non-standard audio devices
	if (!devMicFound) {
		t_audio_device dev = sys_config->get_dev_mic();
		otherMicLineEdit->setText(dev.device.c_str());
        micComboBox->setCurrentIndex(
			(dev.type == t_audio_device::ALSA ? idxOtherCaptureDevAlsa : idxOtherCaptureDevOss));
	}
	
	// Enable/disable line edit for non-standard device
    devRingtoneSelected(ringtoneComboBox->currentIndex());
    devSpeakerSelected(speakerComboBox->currentIndex());
    devMicSelected(micComboBox->currentIndex());
	
	validateAudioCheckBox->setChecked(sys_config->get_validate_audio_dev());
	
	populateComboBox(ossFragmentComboBox, 
			 QString::number(sys_config->get_oss_fragment_size()));
	populateComboBox(alsaPlayPeriodComboBox,
			 QString::number(sys_config->get_alsa_play_period_size()));
	populateComboBox(alsaCapturePeriodComboBox,
			QString::number(sys_config->get_alsa_capture_period_size()));
	
	// Log settings
	logMaxSizeSpinBox->setValue(sys_config->get_log_max_size());
	logDebugCheckBox->setChecked(sys_config->get_log_show_debug());
	logSipCheckBox->setChecked(sys_config->get_log_show_sip());
	logStunCheckBox->setChecked(sys_config->get_log_show_stun());
	logMemoryCheckBox->setChecked(sys_config->get_log_show_memory());
	
	// General settings
	guiUseSystrayCheckBox->setChecked(sys_config->get_gui_use_systray());
	guiHideCheckBox->setChecked(sys_config->get_gui_hide_on_close());
	guiHideCheckBox->setEnabled(sys_config->get_gui_use_systray());
	
	// Call history
	histSizeSpinBox->setValue(sys_config->get_ch_max_size());
	
	// Auto show on incoming call
	autoShowCheckBox->setChecked(sys_config->get_gui_auto_show_incoming());
	autoShowTimeoutSpinBox->setValue(sys_config->get_gui_auto_show_timeout());
	
	// Services
	callWaitingCheckBox->setChecked(sys_config->get_call_waiting());
	hangupBothCheckBox->setChecked(sys_config->get_hangup_both_3way());
	
	// Startup settings
	startHiddenCheckBox->setChecked(sys_config->get_start_hidden());

	osdCheckBox->setChecked(sys_config->get_gui_show_call_osd());
	
	QStringList profiles;
	if (!SelectProfileForm::getUserProfiles(profiles, msg)) {
        ((t_gui *)ui)->cb_show_msg(this, msg.toStdString(), MSG_CRITICAL);
	}
	profileListView->clear();
	for (QStringList::Iterator i = profiles.begin(); i != profiles.end(); i++) {
		// Strip off the .cfg suffix
		QString profile = *i;
		profile.truncate(profile.length() - 4);
        QListWidgetItem* item = new QListWidgetItem(profile, profileListView);
        item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
        item->setCheckState(Qt::Unchecked);
        item->setData(Qt::DecorationRole, QPixmap(":/icons/images/penguin-small.png"));
		
		list<string> l = sys_config->get_start_user_profiles();
        if (std::find(l.begin(), l.end(), profile.toStdString()) != l.end())
		{
            item->setCheckState(Qt::Checked);
		}
	}
	
	// Web browser command
	browserLineEdit->setText(sys_config->get_gui_browser_cmd().c_str());
	
	// Network settings
	sipUdpPortSpinBox->setValue(sys_config->get_config_sip_port());
	rtpPortSpinBox->setValue(sys_config->get_rtp_port());
	
	maxUdpSizeLineEdit->setText(QString::number(sys_config->get_sip_max_udp_size()));
	maxTcpSizeLineEdit->setText(QString::number(sys_config->get_sip_max_tcp_size()));
	
	// Ring tone settings
	playRingtoneCheckBox->setChecked(sys_config->get_play_ringtone());
	defaultRingtoneRadioButton->setChecked(sys_config->get_ringtone_file().empty());
	customRingtoneRadioButton->setChecked(!sys_config->get_ringtone_file().empty());
	ringtoneLineEdit->setText(sys_config->get_ringtone_file().c_str());
	defaultRingtoneRadioButton->setEnabled(sys_config->get_play_ringtone());
	customRingtoneRadioButton->setEnabled(sys_config->get_play_ringtone());
	ringtoneLineEdit->setEnabled(!sys_config->get_ringtone_file().empty());
	openRingtoneToolButton->setEnabled(!sys_config->get_ringtone_file().empty());
	
	playRingbackCheckBox->setChecked(sys_config->get_play_ringback());
	defaultRingbackRadioButton->setChecked(sys_config->get_ringback_file().empty());
	customRingbackRadioButton->setChecked(!sys_config->get_ringback_file().empty());
	ringbackLineEdit->setText(sys_config->get_ringback_file().c_str());
	defaultRingbackRadioButton->setEnabled(sys_config->get_play_ringback());
	customRingbackRadioButton->setEnabled(sys_config->get_play_ringback());
	ringbackLineEdit->setEnabled(!sys_config->get_ringback_file().empty());
	openRingbackToolButton->setEnabled(!sys_config->get_ringback_file().empty());
	
	// Address book settings
	abLookupNameCheckBox->setChecked(sys_config->get_ab_lookup_name());
	abOverrideDisplayCheckBox->setChecked(sys_config->get_ab_override_display());
	abOverrideDisplayCheckBox->setEnabled(sys_config->get_ab_lookup_name());
	abLookupPhotoCheckBox->setChecked(sys_config->get_ab_lookup_photo());
}
Ejemplo n.º 11
0
AM1DCalibrationABEditor::AM1DCalibrationABEditor(AM1DCalibrationAB *analysisBlock, QWidget *parent)
	: QWidget(parent)
{
	analysisBlock_ = analysisBlock;
	chooseScanDialog_ = 0;
	dataNames_ = new QComboBox;
	normalizationNames_ = new QComboBox;
	populateComboBox();

	/// Spinners for Energy calibration
	energyCalibrationOffsetBox_ = new QDoubleSpinBox;
	energyCalibrationOffsetBox_->setSingleStep(0.1);
	energyCalibrationOffsetBox_->setRange(-1000,1000);
	energyCalibrationOffsetBox_->setValue(analysisBlock_->energyCalibrationOffset());
	energyCalibrationReferenceBox_ = new QDoubleSpinBox;
	energyCalibrationReferenceBox_->setSingleStep(0.1);
	energyCalibrationReferenceBox_->setRange(-1000,20000);
	energyCalibrationReferenceBox_->setValue(analysisBlock_->energyCalibrationReference());
	energyCalibrationScalingBox_ = new QDoubleSpinBox;
	energyCalibrationScalingBox_->setSingleStep(0.01);
	energyCalibrationScalingBox_->setRange(0.01,5);
	energyCalibrationScalingBox_->setValue(analysisBlock_->energyCalibrationScaling());

	isTransmissionCheckbox_ = new QCheckBox;
	isTransmissionCheckbox_->setChecked(analysisBlock_->isTransmission());
	toEdgeJumpCheckbox_ = new QCheckBox;
	toEdgeJumpCheckbox_->setChecked(analysisBlock_->toEdgeJump());
	preEdgePointSlider_ = new QSlider(Qt::Horizontal);
	preEdgePointSlider_->setValue(analysisBlock_->preEdgePoint());
	preEdgePointSlider_->setRange(-1,analysisBlock_->size(0)-1);
	preEdgePointSlider_->setEnabled(analysisBlock_->toEdgeJump());
	postEdgePointSlider_ = new QSlider(Qt::Horizontal);
	postEdgePointSlider_->setValue(analysisBlock_->postEdgePoint());
	postEdgePointSlider_->setRange(-1,analysisBlock_->size(0)-1);
	postEdgePointSlider_->setEnabled(analysisBlock_->toEdgeJump());




		/// Apply to sources/scans button
	applyToAllSourcesButton_ = new QPushButton("Apply to All Sources");
	applyToScansButton_ = new QPushButton("Apply to Scans...");


	connect(dataNames_, SIGNAL(currentIndexChanged(int)), this, SLOT(onDataNameChoiceChanged(int)));
	connect(normalizationNames_, SIGNAL(currentIndexChanged(int)), this, SLOT(onNormalizationNameChoiceChanged(int)));
	connect(analysisBlock_, SIGNAL(inputSourcesChanged()), this, SLOT(populateComboBox()));
	connect(energyCalibrationOffsetBox_, SIGNAL(valueChanged(double)), this, SLOT(onEnergyCalibrationOffsetChanged(double)));
	connect(energyCalibrationScalingBox_, SIGNAL(valueChanged(double)), this, SLOT(onEnergyCalibrationScalingChanged(double)));
	connect(energyCalibrationReferenceBox_, SIGNAL(valueChanged(double)), this, SLOT(onEnergyCalibrationReferenceChanged(double)));
	connect(applyToScansButton_, SIGNAL(clicked()), this, SLOT(onApplyToScansButtonClicked()));

	connect(isTransmissionCheckbox_, SIGNAL(clicked(bool)), this, SLOT(onIsTransmissionChanged(bool)));
	connect(toEdgeJumpCheckbox_, SIGNAL(clicked(bool)), this, SLOT(onToEdgeJumpChanged(bool)));
	connect(preEdgePointSlider_, SIGNAL(valueChanged(int)), this, SLOT(onPreEdgePointChanged(int)));
	connect(postEdgePointSlider_, SIGNAL(valueChanged(int)), this, SLOT(onPostEdgePointChanged(int)));

	preEdgePointLabel_ = new QLabel("Set to zero at:");
	postEdgePointLabel_ = new QLabel("Set to one at");

	if (analysisBlock_->inputDataSourceCount() > 0){

		dataNames_->setCurrentIndex(dataNames_->findData(analysisBlock_->dataName()));
		normalizationNames_->setCurrentIndex(normalizationNames_->findData(analysisBlock_->normalizationName()));
	}

	onPreEdgePointChanged(analysisBlock->preEdgePoint());  //to set widget labels
	onPostEdgePointChanged(analysisBlock->postEdgePoint());

	QFormLayout *layout = new QFormLayout;
	layout->addRow("Data:", dataNames_);
	layout->addRow("Normalization:", normalizationNames_);
	layout->addRow("Transmisssion Spectra:", isTransmissionCheckbox_);
	layout->addRow("Normalize to Edge:", toEdgeJumpCheckbox_);
	layout->addRow(preEdgePointLabel_, preEdgePointSlider_);
	layout->addRow(postEdgePointLabel_, postEdgePointSlider_);
	layout->addRow("Offset:", energyCalibrationOffsetBox_);
	layout->addRow("Scaling:",energyCalibrationScalingBox_);
	layout->addRow("Reference:",energyCalibrationReferenceBox_);
	layout->addRow("", applyToScansButton_);

	setLayout(layout);

}