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
da77cf86
Commit
da77cf86
authored
Jan 16, 2015
by
yannick legoc
Browse files
Added the enumerated values/labels functionality for properties
parent
0db707d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/fr/ill/ics/nscclient/servant/ClientPropertyDescriptor.java
View file @
da77cf86
...
...
@@ -21,14 +21,24 @@ package fr.ill.ics.nscclient.servant;
public
class
ClientPropertyDescriptor
{
private
int
id
;
private
String
name
;
private
String
type
;
private
int
enumeratedValuesId
;
private
int
enumeratedLabelsId
;
public
ClientPropertyDescriptor
(
String
name
,
String
type
)
{
public
ClientPropertyDescriptor
(
int
id
,
String
name
,
String
type
,
int
enumeratedValuesId
,
int
enumeratedLabelsId
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
type
=
type
;
this
.
enumeratedValuesId
=
enumeratedValuesId
;
this
.
enumeratedLabelsId
=
enumeratedLabelsId
;
}
public
int
getId
()
{
return
id
;
}
public
String
getName
()
{
return
name
;
}
...
...
@@ -36,4 +46,13 @@ public class ClientPropertyDescriptor {
public
String
getType
()
{
return
type
;
}
public
int
getEnumeratedValuesId
()
{
return
enumeratedValuesId
;
}
public
int
getEnumeratedLabelsId
()
{
return
enumeratedLabelsId
;
}
}
\ No newline at end of file
src/fr/ill/ics/nscclient/servant/CorbaServantManager.java
View file @
da77cf86
...
...
@@ -278,11 +278,23 @@ public class CorbaServantManager {
ids
.
add
(
i
.
next
());
}
int
enumeratedValuesId
=
0
;
int
enumeratedLabelsId
=
0
;
if
(
pbProperty
.
hasEnumeratedValuesID
())
{
enumeratedValuesId
=
pbProperty
.
getEnumeratedValuesID
();
}
if
(
pbProperty
.
hasEnumeratedLabelsID
())
{
enumeratedLabelsId
=
pbProperty
.
getEnumeratedLabelsID
();
}
if
(
pbProperty
.
getDynamic
())
{
PropertyDatabase
.
getInstance
().
addDynamicPropertyDescriptor
(
descriptor
.
getId
(),
new
DynamicPropertyDescriptor
(
propertyId
,
ids
,
pbProperty
.
getName
(),
pbProperty
.
getType
()));
PropertyDatabase
.
getInstance
().
addDynamicPropertyDescriptor
(
descriptor
.
getId
(),
new
DynamicPropertyDescriptor
(
propertyId
,
ids
,
pbProperty
.
getName
(),
pbProperty
.
getType
()
,
enumeratedValuesId
,
enumeratedLabelsId
));
}
else
{
PropertyDatabase
.
getInstance
().
addStandardPropertyDescriptor
(
descriptor
.
getId
(),
new
StandardPropertyDescriptor
(
propertyId
,
pbProperty
.
getName
(),
pbProperty
.
getType
()));
PropertyDatabase
.
getInstance
().
addStandardPropertyDescriptor
(
descriptor
.
getId
(),
new
StandardPropertyDescriptor
(
propertyId
,
pbProperty
.
getName
(),
pbProperty
.
getType
()
,
enumeratedValuesId
,
enumeratedLabelsId
));
}
}
Iterator
<
ServantDataConfiguration
.
CommandDescriptor
>
d
=
pbServant
.
getCommandsList
().
iterator
();
...
...
@@ -395,8 +407,19 @@ public class CorbaServantManager {
ids
.
add
(
i
.
next
());
}
int
enumeratedValuesId
=
0
;
int
enumeratedLabelsId
=
0
;
if
(
pbProperty
.
hasEnumeratedValuesID
())
{
enumeratedValuesId
=
pbProperty
.
getEnumeratedValuesID
();
}
if
(
pbProperty
.
hasEnumeratedLabelsID
())
{
enumeratedLabelsId
=
pbProperty
.
getEnumeratedLabelsID
();
}
if
(
pbProperty
.
getDynamic
())
{
PropertyDatabase
.
getInstance
().
addDynamicPropertyDescriptor
(
servantID
,
new
DynamicPropertyDescriptor
(
propertyId
,
ids
,
pbProperty
.
getName
(),
pbProperty
.
getType
()));
PropertyDatabase
.
getInstance
().
addDynamicPropertyDescriptor
(
servantID
,
new
DynamicPropertyDescriptor
(
propertyId
,
ids
,
pbProperty
.
getName
(),
pbProperty
.
getType
()
,
enumeratedValuesId
,
enumeratedLabelsId
));
}
else
{
System
.
err
.
println
(
"properties should be dynamic in updateDynamicProperties"
);
}
...
...
src/fr/ill/ics/nscclient/servant/DynamicPropertyDescriptor.java
View file @
da77cf86
...
...
@@ -23,12 +23,10 @@ import java.util.List;
public
class
DynamicPropertyDescriptor
extends
ClientPropertyDescriptor
{
private
int
id
;
private
List
<
Integer
>
ids
;
public
DynamicPropertyDescriptor
(
int
id
,
List
<
Integer
>
ids
,
String
name
,
String
type
)
{
super
(
name
,
type
);
this
.
id
=
id
;
public
DynamicPropertyDescriptor
(
int
id
,
List
<
Integer
>
ids
,
String
name
,
String
type
,
int
enumeratedValuesId
,
int
enumeratedLabelsId
)
{
super
(
id
,
name
,
type
,
enumeratedValuesId
,
enumeratedLabelsId
);
this
.
ids
=
new
ArrayList
<
Integer
>(
ids
);
}
...
...
@@ -36,14 +34,8 @@ public class DynamicPropertyDescriptor extends ClientPropertyDescriptor {
return
ids
.
size
();
}
public
int
getId
()
{
return
id
;
}
public
List
<
Integer
>
getIds
()
{
return
ids
;
}
}
\ No newline at end of file
src/fr/ill/ics/nscclient/servant/StandardPropertyDescriptor.java
View file @
da77cf86
...
...
@@ -20,15 +20,8 @@ package fr.ill.ics.nscclient.servant;
public
class
StandardPropertyDescriptor
extends
ClientPropertyDescriptor
{
private
int
id
;
public
StandardPropertyDescriptor
(
int
id
,
String
name
,
String
type
)
{
super
(
name
,
type
);
this
.
id
=
id
;
}
public
int
getId
()
{
return
id
;
public
StandardPropertyDescriptor
(
int
id
,
String
name
,
String
type
,
int
enumeratedValuesId
,
int
enumeratedLabelsId
)
{
super
(
id
,
name
,
type
,
enumeratedValuesId
,
enumeratedLabelsId
);
}
}
\ No newline at end of file
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