Commit 032400e3 authored by vlad_burin's avatar vlad_burin
Browse files

Initial branch commit. XML saving changed to save all params separately.

--HG--
branch : MockCompsTest
parent b376091ec89a
......@@ -450,7 +450,7 @@ bool URuntimeLibrary::AddNewClass(const std::string &new_class_name, const std::
CurrentComponentStruct.Destroy();
// XML RTname
if(!cont->SaveComponent(&CurrentComponentStruct, true, ptPubParameter))
if(!cont->SaveComponent(&CurrentComponentStruct, true, ptAny|pgPublic))
return false;
CurrentComponentStruct.SelectNode(cont->GetName());
......@@ -513,6 +513,7 @@ bool URuntimeLibrary::DelClass(const std::string &class_name)
return true;
}
///
bool URuntimeLibrary::DeleteOwnDirectory(void)
{
return (!RDK::DeleteDirectory(LibPath.c_str()));
......
......@@ -640,6 +640,24 @@ bool UNet::SaveComponent(RDK::USerStorageXML *serstorage, bool links, unsigned i
serstorage->AddNode(GetName());
if(Storage)
serstorage->SetNodeAttribute("Class",/*RDK::sntoa(cont->GetClass())*/Storage->FindClassName(GetClass()));
unsigned int prop_type = 0x1;
unsigned int prop_group = params_type_mask & 0xFFFF00;
for(int i = 0; i < 5; i++)
{
prop_type = params_type_mask & (0x1 << i);
if(prop_type)
{
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(prop_type));
if(!GetComponentProperties(serstorage, prop_type | prop_group))
{
serstorage->SelectUp();
return false;
}
serstorage->SelectUp();
}
}
/*
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(ptParameter));
if(!GetComponentProperties(serstorage,params_type_mask))
{
......@@ -647,7 +665,7 @@ bool UNet::SaveComponent(RDK::USerStorageXML *serstorage, bool links, unsigned i
return false;
}
serstorage->SelectUp();
*/
if(links)
{
serstorage->AddNode("Links");
......@@ -685,6 +703,24 @@ bool UNet::SaveComponentStructure(RDK::USerStorageXML *serstorage, bool links, u
if(Storage)
serstorage->SetNodeAttribute("Class",/*RDK::sntoa(cont->GetClass())*/Storage->FindClassName(GetClass()));
unsigned int prop_type = 0x1;
unsigned int prop_group = type_mask & 0xFFFF00;
for(int i = 0; i < 5; i++)
{
prop_type = type_mask & (0x1 << i);
if(prop_type)
{
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(prop_type));
if(!GetComponentProperties(serstorage, prop_type | prop_group))
{
serstorage->SelectUp();
return false;
}
serstorage->SelectUp();
}
}
/*
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(type_mask)); // ptParameter
if(!GetComponentProperties(serstorage,type_mask))
{
......@@ -692,7 +728,7 @@ bool UNet::SaveComponentStructure(RDK::USerStorageXML *serstorage, bool links, u
return false;
}
serstorage->SelectUp();
*/
if(links)
{
serstorage->AddNode("Links");
......@@ -825,10 +861,26 @@ bool UNet::SaveComponentProperties(RDK::USerStorageXML *serstorage, unsigned int
serstorage->AddNode(GetName());
serstorage->SetNodeAttribute("Class",Storage->FindClassName(GetClass()));
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(type_mask));
if(!GetComponentProperties(serstorage,type_mask))
return false;
serstorage->SelectUp();
unsigned int prop_type = 0x1;
unsigned int prop_group = type_mask & 0xFFFF00;
for(int i = 0; i < 5; i++)
{
prop_type = type_mask & (0x1 << i);
if(prop_type)
{
serstorage->AddNode(UVariable::GetPropertyTypeNameByType(prop_type));
if(!GetComponentProperties(serstorage, prop_type | prop_group))
{
serstorage->SelectUp();
return false;
}
serstorage->SelectUp();
}
}
// serstorage->AddNode(UVariable::GetPropertyTypeNameByType(type_mask));
// if(!GetComponentProperties(serstorage,type_mask))
// return false;
// serstorage->SelectUp();
serstorage->AddNode("Components");
for(int i=0;i<GetNumComponents();i++)
......
......@@ -2556,7 +2556,7 @@ int RDK_CALL Model_LoadComponentPropertiesFromFile(const char *stringid, const c
const char * RDK_CALL Model_SaveComponentParameters(const char *stringid, unsigned int type_mask)
{
return RdkCoreManager.GetEngineLock()->Model_SaveComponentProperties(stringid, type_mask & 0xFFFFFF01);
return RdkCoreManager.GetEngineLock()->Model_SaveComponentProperties(stringid, type_mask & 0xFFFFFFFF);
}
// xml
......@@ -2565,7 +2565,7 @@ const char * RDK_CALL MModel_SaveComponentParameters(int channel_index, const ch
if(channel_index<0 || channel_index>=Core_GetNumChannels())
return 0;
return RdkCoreManager.GetEngineLock(channel_index)->Model_SaveComponentProperties(stringid, type_mask & 0xFFFFFF01);
return RdkCoreManager.GetEngineLock(channel_index)->Model_SaveComponentProperties(stringid, type_mask & 0xFFFFFFFF);
}
// xml
......
......@@ -1048,8 +1048,8 @@ RDK_LIB_TYPE unsigned char* RDK_CALL Model_GetComponentOutputData(const char *st
// , ,
// xml
RDK_LIB_TYPE const char * RDK_CALL Model_SaveComponent(const char *stringid, unsigned int params_type_mask=ptParameter | pgPublic);
RDK_LIB_TYPE const char * RDK_CALL MModel_SaveComponent(int channel_index, const char *stringid, unsigned int params_type_mask=ptParameter | pgPublic);
RDK_LIB_TYPE const char * RDK_CALL Model_SaveComponent(const char *stringid, unsigned int params_type_mask=ptAny | pgPublic);
RDK_LIB_TYPE const char * RDK_CALL MModel_SaveComponent(int channel_index, const char *stringid, unsigned int params_type_mask=ptAny | pgPublic);
// , ,
// xml
......
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