Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 - multiple device sets do not load correctly #2061

Closed
srcejon opened this issue Apr 8, 2024 · 3 comments
Closed

Qt6 - multiple device sets do not load correctly #2061

srcejon opened this issue Apr 8, 2024 · 3 comments
Labels

Comments

@srcejon
Copy link
Collaborator

srcejon commented Apr 8, 2024

When built with Qt6, if the default configuration has multiple device sets, one of the devices may not be correctly restored, when SDRangel is started (On Windows and Mac, haven't tried Linux yet).

  • Create a workspace with two Test Sources
  • Restart SDRangel
  • Sometimes it creates one Test Source and one File Input, occasionally just one Test Source.
@srcejon
Copy link
Collaborator Author

srcejon commented Apr 8, 2024

2024-04-08 17:32:15.410 (D) MainWindow::MainWindow: load current configuration...
2024-04-08 17:32:15.411 (D) MainWindow::loadConfiguration: configuration [default | no name] 1 workspace(s) - 2 device set(s) - 0 feature(s)
2024-04-08 17:32:15.416 (D) MainWindow::loadConfiguration: Unknown preset type: 7602297
2024-04-08 17:32:15.416 (D) DeviceEnumerator::getBestSamplingDeviceIndex: serial matched (exact): id: sdrangel.samplesource.testsource ser:
2024-04-08 17:32:15.417 (D) MainWindow::loadConfiguration: add source sdrangel.samplesource.testsource in workspace 0 spectrum in 0

Unknown preset type is perhaps the problem.

@srcejon srcejon added the bug label Apr 8, 2024
@srcejon
Copy link
Collaborator Author

srcejon commented Apr 8, 2024

The problem is in the Preset copy constructor:

Preset::Preset(const Preset& other) :
    m_group(other.m_group),
    m_description(other.m_description),
    m_centerFrequency(other.m_centerFrequency),
    m_spectrumConfig(other.m_spectrumConfig),
    m_dcOffsetCorrection(other.m_dcOffsetCorrection),
    m_iqImbalanceCorrection(other.m_iqImbalanceCorrection),
    m_channelConfigs(other.m_channelConfigs),
    m_deviceConfigs(other.m_deviceConfigs),
    m_showSpectrum(other.m_showSpectrum),
    m_layout(other.m_layout)

It doesn't copy all of the members. It's missing some of:

m_presetType(other.m_presetType),
m_spectrumGeometry(other.m_spectrumGeometry),
m_spectrumWorkspaceIndex(other.m_spectrumWorkspaceIndex),
m_deviceGeometry(other.m_deviceGeometry),
m_deviceWorkspaceIndex(other.m_deviceWorkspaceIndex),
m_selectedDevice(other.m_selectedDevice),

Are some of them not meant to be copied? m_presetType and m_selectedDevice are what's causing this problem, I think.

Also, the resetToDefaults method doesn't reset everything.

@f4exb
Copy link
Owner

f4exb commented Apr 8, 2024

It does not seem to me there is a specific reason behind these missing parts.

srcejon added a commit to srcejon/sdrangel that referenced this issue Apr 10, 2024
@srcejon srcejon mentioned this issue Apr 10, 2024
@srcejon srcejon closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants