예제 #1
0
LD110AnalyzerSettings::LD110AnalyzerSettings() : m_oGlobalClockChannel(UNDEFINED_CHANNEL)
  {
  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oBCDChannelInterfaceVector[nIndex].reset(new AnalyzerSettingInterfaceChannel());
    m_oBCDChannelVector.push_back(Channel(UNDEFINED_CHANNEL));

    m_oDigitChannelInterfaceVector[nIndex].reset(new AnalyzerSettingInterfaceChannel());
    m_oDigitChannelVector.push_back(Channel(UNDEFINED_CHANNEL));
    }

  m_oGlobalClockChannelInterface.reset(new AnalyzerSettingInterfaceChannel());

  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oTitle.str("BCD Bit ");
    m_oTitle << (nIndex + 1);

    m_oTooltip.str("BCD Bit ");
    m_oTooltip << nIndex + 1 << " (Pin " << 16 - nIndex << ")";

    m_oBCDChannelInterfaceVector[nIndex]->SetTitleAndTooltip(m_oTitle.str().c_str(), m_oTooltip.str().c_str());
    m_oBCDChannelInterfaceVector[nIndex]->SetChannel(m_oBCDChannelVector[nIndex]);

    AddInterface(m_oBCDChannelInterfaceVector[nIndex].get());
    }

  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oTitle.str("Digit ");
    m_oTitle << nIndex + 1 << " clock";

    m_oTooltip.str("The clock for digit ");
    m_oTooltip << nIndex + 1 << " (Pin " << 1 + nIndex << ")";

    m_oDigitChannelInterfaceVector[nIndex]->SetTitleAndTooltip(m_oTitle.str().c_str(), m_oTooltip.str().c_str());
    m_oDigitChannelInterfaceVector[nIndex]->SetChannel(m_oDigitChannelVector[nIndex]);

    AddInterface(m_oDigitChannelInterfaceVector[nIndex].get());
    }

  m_oGlobalClockChannelInterface.reset(new AnalyzerSettingInterfaceChannel());
  m_oGlobalClockChannelInterface->SetTitleAndTooltip("Global clock", "The clock for LD110 IC");
  m_oGlobalClockChannelInterface->SetChannel(m_oGlobalClockChannel);

  AddInterface(m_oGlobalClockChannelInterface.get());

	AddExportOption( 0, "Export as text/csv file" );
	AddExportExtension( 0, "text", "txt" );
	AddExportExtension( 0, "csv", "csv" );

	ClearChannels();
  AddChannels();
  }
예제 #2
0
bool LD110AnalyzerSettings::SetSettingsFromInterfaces()
  {
  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oBCDChannelVector[nIndex]   = m_oBCDChannelInterfaceVector[nIndex]->GetChannel();
    m_oDigitChannelVector[nIndex] = m_oDigitChannelInterfaceVector[nIndex]->GetChannel();
    }

  m_oGlobalClockChannel = m_oGlobalClockChannelInterface->GetChannel();

	ClearChannels();
  AddChannels();

	return true;
  }
예제 #3
0
void LD110AnalyzerSettings::LoadSettings( const char* settings )
  {
	m_oArchive.SetString( settings );

  for(int nIndex = 0; nIndex < m_nBCDAndDigitChannelCount; nIndex++)
    {
    m_oArchive >> m_oBCDChannelVector[nIndex];
    m_oArchive >> m_oDigitChannelVector[nIndex];
    }

  m_oArchive >> m_oGlobalClockChannel;

	ClearChannels();
  AddChannels();

  UpdateInterfacesFromSettings();
  }
예제 #4
0
void DABlinGTK::InitWidgets() {
	// init widgets
	frame_combo_channels.set_label("Channel");
	frame_combo_channels.set_size_request(75, -1);
	frame_combo_channels.add(combo_channels);

	combo_channels_liststore = Gtk::ListStore::create(combo_channels_cols);
	combo_channels_liststore->set_sort_column(combo_channels_cols.col_freq, Gtk::SORT_ASCENDING);

	combo_channels.signal_changed().connect(sigc::mem_fun(*this, &DABlinGTK::on_combo_channels));
	combo_channels.set_model(combo_channels_liststore);
	combo_channels.pack_start(combo_channels_cols.col_string);

	if(!options.dab2eti_binary.empty())
		AddChannels();
	else
		frame_combo_channels.set_sensitive(false);

	frame_label_ensemble.set_label("Ensemble");
	frame_label_ensemble.set_size_request(150, -1);
	frame_label_ensemble.add(label_ensemble);
	label_ensemble.set_halign(Gtk::ALIGN_START);
	label_ensemble.set_padding(WIDGET_SPACE, WIDGET_SPACE);


	frame_combo_services.set_label("Service");
	frame_combo_services.set_size_request(170, -1);
	frame_combo_services.add(combo_services);

	combo_services_liststore = Gtk::ListStore::create(combo_services_cols);
	combo_services_liststore->set_sort_column(combo_services_cols.col_sort, Gtk::SORT_ASCENDING);

	combo_services.signal_changed().connect(sigc::mem_fun(*this, &DABlinGTK::on_combo_services));
	combo_services.set_model(combo_services_liststore);
	combo_services.pack_start(combo_services_cols.col_string);


	frame_label_format.set_label("Format");
	frame_label_format.set_size_request(250, -1);
	frame_label_format.add(label_format);
	label_format.set_halign(Gtk::ALIGN_START);
	label_format.set_padding(WIDGET_SPACE, WIDGET_SPACE);

	tglbtn_mute.set_label("Mute");
	tglbtn_mute.signal_clicked().connect(sigc::mem_fun(*this, &DABlinGTK::on_tglbtn_mute));

	frame_label_dl.set_label("Dynamic Label");
	frame_label_dl.set_size_request(750, 50);
	frame_label_dl.set_sensitive(false);
	frame_label_dl.add(label_dl);
	label_dl.set_halign(Gtk::ALIGN_START);
	label_dl.set_padding(WIDGET_SPACE, WIDGET_SPACE);


	top_grid.set_column_spacing(WIDGET_SPACE);
	top_grid.set_row_spacing(WIDGET_SPACE);


	// add widgets
	add(top_grid);

	top_grid.attach(frame_combo_channels, 0, 0, 1, 1);
	top_grid.attach_next_to(frame_label_ensemble, frame_combo_channels, Gtk::POS_RIGHT, 1, 1);
	top_grid.attach_next_to(frame_combo_services, frame_label_ensemble, Gtk::POS_RIGHT, 1, 1);
	top_grid.attach_next_to(frame_label_format, frame_combo_services, Gtk::POS_RIGHT, 1, 1);
	top_grid.attach_next_to(tglbtn_mute, frame_label_format, Gtk::POS_RIGHT, 1, 1);
	top_grid.attach(frame_label_dl, 0, 1, 5, 1);
}