Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
3af3ef9d
Commit
3af3ef9d
authored
Apr 05, 2016
by
helene ortiz
Browse files
No commit message
No commit message
parent
da3be72d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/core/property/PropertyManager.java
View file @
3af3ef9d
...
...
@@ -593,31 +593,35 @@ public class PropertyManager {
Map
<
String
,
Property
>
childProperties
=
new
HashMap
<
String
,
Property
>();
XMLDynamicPropertyDescriptor
xmlDynamicPropertyDescriptor
=
getDynamicPropertyDescriptor
(
command
.
getType
(),
parentPropertyName
);
DynamicPropertyDescriptor
dynamicPropertyDescriptor
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyDescriptor
(
command
.
getServantId
(),
xmlDynamicPropertyDescriptor
.
getPropertyName
());
if
(
dynamicPropertyDescriptor
==
null
)
{
// trying with parent name (in case of double dynamic properties)
dynamicPropertyDescriptor
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyDescriptor
(
command
.
getServantId
(),
parentPropertyName
);
}
if
(
dynamicPropertyDescriptor
!=
null
)
{
int
propertyId
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyIdForServant
(
command
.
getServantId
(),
parentPropertyName
);
if
(
propertyId
<
0
)
{
System
.
err
.
println
(
"Cannot get dynamic property "
+
parentPropertyName
);
return
null
;
if
(
xmlDynamicPropertyDescriptor
==
null
)
{
// This can occur when using a settings file containing property names which have been changed (renamed properties)
PropertyNotFoundException
e
=
new
PropertyNotFoundException
(
parentPropertyName
,
command
.
getType
(),
command
.
getName
(),
getClass
().
getCanonicalName
(),
"createDynamicPropertiesForCommand"
,
PluginType
.
COMMAND
);
}
else
{
DynamicPropertyDescriptor
dynamicPropertyDescriptor
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyDescriptor
(
command
.
getServantId
(),
xmlDynamicPropertyDescriptor
.
getPropertyName
());
if
(
dynamicPropertyDescriptor
==
null
)
{
// trying with parent name (in case of double dynamic properties)
dynamicPropertyDescriptor
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyDescriptor
(
command
.
getServantId
(),
parentPropertyName
);
}
List
<
Integer
>
ids
=
dynamicPropertyDescriptor
.
getIds
();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
Property
childProperty
=
PropertyFactory
.
getInstance
().
createProperty
(
command
.
getId
(),
ids
.
get
(
i
),
xmlDynamicPropertyDescriptor
,
true
);
childProperty
.
setServerId
(
command
.
getServerId
());
childProperties
.
put
(
childProperty
.
getName
(),
childProperty
);
if
(
dynamicPropertyDescriptor
!=
null
)
{
int
propertyId
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyIdForServant
(
command
.
getServantId
(),
parentPropertyName
);
if
(
propertyId
<
0
)
{
System
.
err
.
println
(
"Cannot get dynamic property "
+
parentPropertyName
);
return
null
;
}
List
<
Integer
>
ids
=
dynamicPropertyDescriptor
.
getIds
();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
Property
childProperty
=
PropertyFactory
.
getInstance
().
createProperty
(
command
.
getId
(),
ids
.
get
(
i
),
xmlDynamicPropertyDescriptor
,
true
);
childProperty
.
setServerId
(
command
.
getServerId
());
childProperties
.
put
(
childProperty
.
getName
(),
childProperty
);
}
return
childProperties
;
}
return
childProperties
;
LOGGER
.
log
(
Level
.
SEVERE
,
"Unable to find description of dynamic property "
+
parentPropertyName
+
" for atomic command "
+
command
.
getType
());
}
LOGGER
.
log
(
Level
.
SEVERE
,
"Unable to find description of dynamic property "
+
parentPropertyName
+
" for atomic command "
+
command
.
getType
());
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment