Création des brokers fonctionnelle
This commit is contained in:
@@ -11,6 +11,10 @@ CSystemConfig::~CSystemConfig()
|
||||
{
|
||||
delete mCANDeviceConfigList.takeAt(0);
|
||||
}
|
||||
while(mCloudLoggingParamsList.size() != 0)
|
||||
{
|
||||
delete mCloudLoggingParamsList.takeAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
int CSystemConfig::LoadConfig()
|
||||
@@ -70,7 +74,15 @@ int CSystemConfig::LoadConfig()
|
||||
}
|
||||
|
||||
//Load Cloud logging settings
|
||||
*InputStream >> mCloudLoggingParams;
|
||||
//TODO: load list size
|
||||
int NbCloudParams = 1;
|
||||
*InputStream >> NbCloudParams;
|
||||
for(int i = 0; i < NbCloudParams; i++)
|
||||
{
|
||||
CCloudParams *NewBrokerParams = new CCloudParams;
|
||||
*InputStream >> *NewBrokerParams;
|
||||
mCloudLoggingParamsList.append(NewBrokerParams);
|
||||
}
|
||||
|
||||
//Load general program settings
|
||||
*InputStream >> mGeneralSystemParams;
|
||||
@@ -137,7 +149,11 @@ int CSystemConfig::SaveConfig()
|
||||
}
|
||||
|
||||
//Save the Cloud logging settings
|
||||
*OutputStream << mCloudLoggingParams;
|
||||
*OutputStream << mCloudLoggingParamsList.size();
|
||||
for(int i = 0; i < mCloudLoggingParamsList.size(); i++)
|
||||
{
|
||||
*OutputStream << *mCloudLoggingParamsList.at(i);
|
||||
}
|
||||
|
||||
//Save the general system parameters
|
||||
*OutputStream << mGeneralSystemParams;
|
||||
@@ -193,9 +209,9 @@ int CSystemConfig::SetCANDevicesConfigList(QList<CCANDeviceConfig *> *DevicesCon
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
CCloudParams *CSystemConfig::GetCloudParams()
|
||||
QList<CCloudParams *> *CSystemConfig::GetCloudParams()
|
||||
{
|
||||
return &mCloudLoggingParams;
|
||||
return &mCloudLoggingParamsList;
|
||||
}
|
||||
|
||||
CCANWatchdogConfig *CSystemConfig::GetCANWatchdogConfig()
|
||||
@@ -221,12 +237,22 @@ int CSystemConfig::SetCANWatchdogConfig(CCANWatchdogConfig *Config)
|
||||
mCANWatchdogParams = *Config;
|
||||
}
|
||||
|
||||
int CSystemConfig::SetCloudParams(CCloudParams *CloudParams)
|
||||
int CSystemConfig::SetCloudParamsList(QList<CCloudParams *> *CloudParams)
|
||||
{
|
||||
if(CloudParams == 0)
|
||||
return RET_GENERAL_ERROR;
|
||||
|
||||
mCloudLoggingParams = *CloudParams;
|
||||
while(mCloudLoggingParamsList.size() != 0)
|
||||
{
|
||||
delete mCloudLoggingParamsList.takeAt(0);
|
||||
}
|
||||
|
||||
for(int i = 0; i < CloudParams->size(); i++)
|
||||
{
|
||||
CCloudParams *NewBrokerParams = new CCloudParams(*CloudParams->at(i));
|
||||
mCloudLoggingParamsList.append(NewBrokerParams);
|
||||
}
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user