Skip to content
Snippets Groups Projects
Commit b838d139 authored by Alexander Mueller's avatar Alexander Mueller
Browse files

BugID: 136

Made the g_navigatorID dependent on the manager ID of the Navigator UI manager. Not deleted instances are reused on starting a Navigator UI manager with the same number.
(And changed the file type).
parent c24b88e2
Branches
Tags
No related merge requests found
...@@ -149,7 +149,7 @@ int navConfigGetNavigatorID() ...@@ -149,7 +149,7 @@ int navConfigGetNavigatorID()
void navConfigSetNavigatorID(int newID) void navConfigSetNavigatorID(int newID)
{ {
bool createConfiguration = false; bool createConfiguration = false;
if(newID != 0) if(newID > 256)
{ {
g_navigatorID = newID; g_navigatorID = newID;
if(!dpAccessable(DPNAME_NAVIGATOR + g_navigatorID)) if(!dpAccessable(DPNAME_NAVIGATOR + g_navigatorID))
...@@ -159,29 +159,17 @@ void navConfigSetNavigatorID(int newID) ...@@ -159,29 +159,17 @@ void navConfigSetNavigatorID(int newID)
} }
else else
{ {
int id=1; g_navigatorID = myManNum();
while(id<20 && !createConfiguration) // if no free config found, use config #20 if(!dpAccessable(DPNAME_NAVIGATOR + g_navigatorID))
{
if(!dpAccessable(DPNAME_NAVIGATOR + id))
{ {
g_navigatorID = id;
createConfiguration = true; createConfiguration = true;
} }
else
{
id++;
}
}
} }
if (createConfiguration) if (createConfiguration)
{ {
dpCreate(DPNAME_NAVIGATOR + g_navigatorID, DPTYPENAME_NAVIGATOR_INSTANCE); dpCreate(DPNAME_NAVIGATOR + g_navigatorID, DPTYPENAME_NAVIGATOR_INSTANCE);
} }
else if(!createConfiguration) // if no free config found, use config #20 dpSet(DPNAME_NAVIGATOR + g_navigatorID + "." + ELNAME_USECOUNT, 0);
{
g_navigatorID = 20;
dpCreate(DPNAME_NAVIGATOR + g_navigatorID, DPTYPENAME_NAVIGATOR_INSTANCE);
}
LOG_DEBUG("Using Navigator ID:", g_navigatorID); LOG_DEBUG("Using Navigator ID:", g_navigatorID);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment