Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
c855ab0c
Commit
c855ab0c
authored
Feb 12, 2015
by
Cristina Cocho
Browse files
added function to check if an spy is autogenerated
parent
b5e261c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fr/ill/ics/core/property/PropertyManager.java
View file @
c855ab0c
...
...
@@ -655,11 +655,34 @@ public class PropertyManager {
return
dynamicChildNames
;
}
public
Set
<
SpyPropertyDescriptor
>
getSpyListOfPropertyDescriptor
(
String
controllerName
)
{
/**
* New spy: retrieve data about the properties that need to be displayed
* @param controllerName
* @return
*/
public
Set
<
SpyPropertyDescriptor
>
getListOfpropertyDescriptorForSpy
(
String
controllerName
)
{
int
servantId
=
ServantDatabase
.
getInstance
().
getServantId
(
controllerName
);
return
PropertyDatabase
.
getInstance
().
getSpyPropertyDescriptors
(
servantId
);
}
public
boolean
isAnAutogeneratedSpy
(
String
controllerName
)
{
Set
<
SpyPropertyDescriptor
>
setOfDescriptors
=
getListOfpropertyDescriptorForSpy
(
controllerName
);
if
(
setOfDescriptors
!=
null
&&
setOfDescriptors
.
size
()
==
1
)
{
// Verify the only property loaded is not a commandStatus property (maybe this situation never takes place)
Iterator
<
SpyPropertyDescriptor
>
it
=
setOfDescriptors
.
iterator
();
SpyPropertyDescriptor
spyDescriptor
=
it
.
next
();
int
actualPropertyID
=
spyDescriptor
.
getActualID
();
String
actualPropertyName
=
PropertyDatabase
.
getInstance
().
getPropertyName
(
actualPropertyID
);
if
(
actualPropertyName
.
equals
(
"commandStatus"
))
{
return
false
;
}
return
true
;
}
return
false
;
}
/**
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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