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

BaseFilename_config.xml saving outdated parameters #556

Open
jamesobutler opened this issue May 24, 2019 · 2 comments
Open

BaseFilename_config.xml saving outdated parameters #556

jamesobutler opened this issue May 24, 2019 · 2 comments

Comments

@jamesobutler
Copy link
Contributor

It appears that the BaseFilename_config.xml that gets saved with a recording is writing a configuration with outdated attributes if they were changed with commands after the server was started.

Can someone confirm if these attributes should reflect the current state at time of start recording instead of always being the attributes from when the server was started? Is this a bug across devices or maybe the device class I'm using just isn't handling the update correctly to then be written?

@dzenanz
Copy link
Contributor

dzenanz commented May 29, 2019

Here is a code snippet which demonstrates the usage James is wondering about:

vtkXMLDataElement* configRootElement =
    vtkXMLUtilities::ReadElementFromFile(configFilePath.c_str());
vtkPlusConfig::GetInstance()->SetDeviceSetConfigurationData(configRootElement);
vtkSmartPointer<vtkPlusDataCollector> dataCollector =
    vtkSmartPointer<vtkPlusDataCollector>::New();
dataCollector->ReadConfiguration(configRootElement);
vtkSmartPointer<vtkIGSIOTransformRepository> transformRepository =
    vtkSmartPointer<vtkIGSIOTransformRepository>::New();
transformRepository->ReadConfiguration(configRootElement);

dataCollector->Connect();
dataCollector->Start();

// change some options at run time
dataCollector->GetDevice(aDevice, "VideoDeviceWP");
winprobeDevice = dynamic_cast<vtkPlusWinProbeVideoSource*>(aDevice);
winprobeDevice->SetTransmitFrequencyMHz(txFrequency_float);
winprobeDevice->SetScanDepthMm(ssDepth_float);
if (runtimeCondition)
  winprobeDevice->SetBRFEnabled(true); // RF mode
else
  winprobeDevice->SetMModeEnabled(true); // M-mode

// finally record stream to file
dataCollector->GetDevice(aDevice, "CaptureDeviceWP");
pVirtualDiscCapture = vtkPlusVirtualCapture::SafeDownCast(aDevice);
pVirtualDiscCapture->OpenFile(temp.c_str());
pVirtualDiscCapture->SetEnableCapturing(true);
Sleep(5000); // record for 5 seconds
pVirtualDiscCapture->SetEnableCapturing(false);
pVirtualDiscCapture->CloseFile();

What is written to BaseFilename_config.xml? The same file from configFilePath or is a new configuration file constructed at the time of pVirtualDiscCapture->SetEnableCapturing(true);?

@Sunderlandkyl
Copy link
Contributor

As you say, I would think that the correct behaviour would be to save the updated config file.

I'll take a look at it to see why that isn't the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants