Commit f9dc7ce0 authored by Jussi Lindgren's avatar Jussi Lindgren

Applications: Minor fixes to Acquisition Server

- Doesn't nag if user closes the driver config window
- Fixed compiler wreorder nag
- No longer saves the old global impedance check setting
parent a7f9a5d3
......@@ -286,7 +286,6 @@ CAcquisitionServerGUI::~CAcquisitionServerGUI(void)
::fprintf(l_pFile, "AcquisitionServer_JitterEstimationCountForDrift = %llu\n", m_pAcquisitionServer->getJitterEstimationCountForDrift());
::fprintf(l_pFile, "AcquisitionServer_DriftToleranceDuration = %llu\n", m_pAcquisitionServer->getDriftToleranceDuration());
::fprintf(l_pFile, "AcquisitionServer_OverSamplingFactor = %llu\n", m_pAcquisitionServer->getOversamplingFactor());
::fprintf(l_pFile, "AcquisitionServer_CheckImpedance = %s\n", (m_pAcquisitionServer->isImpedanceCheckRequested() ? "True" : "False"));
::fprintf(l_pFile, "AcquisitionServer_ChannelSelection = %s\n", (m_pAcquisitionServer->isChannelSelectionRequested() ? "True" : "False"));
::fprintf(l_pFile, "AcquisitionServer_NaNReplacementPolicy = %s\n", m_pAcquisitionServer->getNaNReplacementPolicyStr().toASCIIString());
......
......@@ -119,9 +119,13 @@ boolean CConfigurationBuilder::configure(IHeader& rHeader)
}
// Only run if preConfig succeeded
if(m_bApplyConfiguration && !this->doConfigure())
EErrorCode l_oErrorCode;
if(m_bApplyConfiguration && !this->doConfigure(l_oErrorCode))
{
std::cout << "Note: Driver doConfigure failed (or user cancelled)\n";
if(l_oErrorCode != Error_UserCancelled)
{
std::cout << "Note: Driver doConfigure failed with code " << l_oErrorCode << "\n";
}
m_bApplyConfiguration = false;
}
......@@ -292,14 +296,28 @@ boolean CConfigurationBuilder::preConfigure(void)
return true;
}
boolean CConfigurationBuilder::doConfigure(void)
boolean CConfigurationBuilder::doConfigure(EErrorCode& errorCode)
{
if(!m_pDialog)
{
errorCode = Error_Unknown;
return false;
}
return gtk_dialog_run(GTK_DIALOG(m_pDialog))==GTK_RESPONSE_APPLY;
const gint l_oResponse = gtk_dialog_run(GTK_DIALOG(m_pDialog));
switch(l_oResponse)
{
case GTK_RESPONSE_APPLY:
errorCode = Error_NoError;
return true;
case GTK_RESPONSE_CANCEL:
errorCode = Error_UserCancelled;
return false;
default:
errorCode = Error_Unknown;
return false;
}
}
boolean CConfigurationBuilder::postConfigure(void)
......
......@@ -15,6 +15,11 @@ namespace OpenViBEAcquisitionServer
class CConfigurationBuilder
{
public:
typedef enum {
Error_NoError = 0,
Error_UserCancelled = 1,
Error_Unknown = 2
} EErrorCode;
CConfigurationBuilder(const char* sGtkBuilderFileName);
virtual ~CConfigurationBuilder(void);
......@@ -30,7 +35,7 @@ namespace OpenViBEAcquisitionServer
protected:
virtual OpenViBE::boolean preConfigure(void);
virtual OpenViBE::boolean doConfigure(void);
virtual OpenViBE::boolean doConfigure(EErrorCode& result);
virtual OpenViBE::boolean postConfigure(void);
private:
......
......@@ -95,9 +95,9 @@ CHeaderImpl::CHeaderImpl(void)
:m_ui32ExperimentIdentifier(_NoValueI_)
,m_ui32SubjectAge(18)
,m_ui32SubjectGender(OVTK_Value_Gender_NotSpecified)
,m_bIsImpedanceCheckRequested(false)
,m_ui32ChannelCount(_NoValueI_)
,m_ui32SamplingFrequency(_NoValueI_)
,m_bIsImpedanceCheckRequested(false)
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment