示例#1
0
control::control(std::unique_ptr<property_widget::idata_proxy> Data) :
	base(std::move(Data)),
	m_image(new Gtk::Image())
{
	set_name("k3d-property-button");
	set_tooltip_text(_("LMB-Click to make connections with other properties. RMB-Click for context menu."));

	add(*manage(m_image));

	data_changed();
	m_data->document().document().pipeline().dependency_signal().connect(sigc::mem_fun(*this, &control::on_dependencies_changed));

	signal_button_press_event().connect(sigc::mem_fun(*this, &base::button_press_event));
	signal_button_release_event().connect(sigc::mem_fun(*this, &base::button_release_event));
}
示例#2
0
void control::on_dependencies_changed(const k3d::ipipeline::dependencies_t& Dependencies)
{
	if(Dependencies.count(&m_data->property()))
		data_changed();
}
FormEfficiencyCalibration::FormEfficiencyCalibration(QSettings &settings, XMLableDB<Qpx::Detector>& newDetDB, QWidget *parent) :
  QWidget(parent),
  ui(new Ui::FormEfficiencyCalibration),
  detectors_(newDetDB),
  settings_(settings)
{
  ui->setupUi(this);
  this->setWindowTitle("Efficiency calib");

  loadSettings();

  style_fit.default_pen = QPen(Qt::blue, 0);
  style_pts.themes["selected"] = QPen(Qt::black, 7);

  ui->PlotCalib->setLabels("channel", "energy");

  ui->tablePeaks->verticalHeader()->hide();
  ui->tablePeaks->setColumnCount(4);
  ui->tablePeaks->setHorizontalHeaderLabels({"chan", "energy", "cps", QString(QChar(0x03B5)) + "-rel"});
  ui->tablePeaks->setSelectionBehavior(QAbstractItemView::SelectRows);
  ui->tablePeaks->setSelectionMode(QAbstractItemView::ExtendedSelection);
  ui->tablePeaks->setEditTriggers(QAbstractItemView::NoEditTriggers);
  ui->tablePeaks->horizontalHeader()->setStretchLastSection(true);
  ui->tablePeaks->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
  ui->tablePeaks->show();
  connect(ui->tablePeaks, SIGNAL(itemSelectionChanged()), this, SLOT(selection_changed_in_table()));

  connect(ui->PlotCalib, SIGNAL(selection_changed()), this, SLOT(selection_changed_in_calib_plot()));
  ui->PlotCalib->set_scale_type_x("Logarithmic");
  ui->PlotCalib->set_scale_type_y("Logarithmic");

  ui->isotopes->show();
  connect(ui->isotopes, SIGNAL(isotopeSelected()), this, SLOT(isotope_chosen()));

  QShortcut* shortcut = new QShortcut(QKeySequence(QKeySequence::Delete), ui->tablePeaks);
  connect(shortcut, SIGNAL(activated()), this, SLOT(on_pushMarkerRemove_clicked()));



  ui->isotopes->set_editable(false);



  //file formats for opening mca spectra
  std::vector<std::string> spectypes = Qpx::Spectrum::Factory::getInstance().types();
  QStringList filetypes;
  for (auto &q : spectypes) {
    Qpx::Spectrum::Template* type_template = Qpx::Spectrum::Factory::getInstance().create_template("1D");
    if (!type_template->input_types.empty())
      filetypes.push_back("Spectrum " + QString::fromStdString(q) + "(" + catExtensions(type_template->input_types) + ")");
    delete type_template;
  }
  mca_load_formats_ = catFileTypes(filetypes);

  ui->plotSpectrum->setFit(&fit_data_);


  connect(ui->plotSpectrum, SIGNAL(selection_changed(std::set<double>)), this, SLOT(update_selection(std::set<double>)));
  connect(ui->plotSpectrum, SIGNAL(data_changed()), this, SLOT(update_data()));

  connect(ui->spectrumSelector, SIGNAL(itemSelected(SelectorItem)), this, SLOT(spectrumDetails(SelectorItem)));
  connect(ui->spectrumSelector, SIGNAL(itemToggled(SelectorItem)), this, SLOT(spectrumLooksChanged(SelectorItem)));
}