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
82374a32
Commit
82374a32
authored
Feb 15, 2017
by
yannick legoc
Browse files
Renamed IServant into IController.
parent
157a12aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/bridge/ControllerManager.java
View file @
82374a32
...
...
@@ -296,7 +296,7 @@ public class ControllerManager implements ServerConfigurationChangeListener {
}
public
void
updateDynamicProperties
(
I
Servant
servant
)
{
public
void
updateDynamicProperties
(
I
Controller
servant
)
{
Controller
controller
=
(
Controller
)
servant
;
ServantManagerAccessor
.
getInstance
(
serverId
).
updateDynamicProperties
(
controller
.
getId
());
}
...
...
@@ -314,7 +314,7 @@ public class ControllerManager implements ServerConfigurationChangeListener {
reset
();
}
public
String
getControllerNameWithRole
(
I
Servant
servant
,
String
role
)
{
public
String
getControllerNameWithRole
(
I
Controller
servant
,
String
role
)
{
Controller
controller
=
(
Controller
)
servant
;
return
ServantManagerAccessor
.
getInstance
(
serverId
).
getControllerNameWithRole
(
controller
.
getId
(),
role
);
}
...
...
src/main/java/fr/ill/ics/bridge/I
Servant
.java
→
src/main/java/fr/ill/ics/bridge/I
Controller
.java
View file @
82374a32
...
...
@@ -26,7 +26,7 @@ import fr.ill.ics.bridge.listeners.ServerProgressChangeListener;
import
fr.ill.ics.bridge.listeners.ServerPropertyChangeListener
;
import
fr.ill.ics.bridge.listeners.ServerResetCommandListener
;
public
interface
I
Servant
{
public
interface
I
Controller
{
public
String
getName
();
public
String
getType
();
...
...
@@ -47,7 +47,7 @@ public interface IServant {
public
void
addServerResetCommandListener
(
ServerResetCommandListener
listener
);
public
void
removeServerResetCommandListener
(
ServerResetCommandListener
listener
);
public
I
Servant
getLinkedController
();
public
I
Controller
getLinkedController
();
public
void
updateDynamicProperties
();
public
int
getDatabaseId
();
...
...
src/main/java/fr/ill/ics/bridge/command/AtomicCommandWrapper.java
View file @
82374a32
...
...
@@ -21,13 +21,13 @@ package fr.ill.ics.bridge.command;
import
java.util.Map
;
import
java.util.Set
;
import
fr.ill.ics.bridge.I
Servant
;
import
fr.ill.ics.bridge.I
Controller
;
import
fr.ill.ics.bridge.listeners.ServerPropertyChangeListener
;
import
fr.ill.ics.nscclient.command.ServerAtomicCommandBox
;
import
fr.ill.ics.nscclient.dataprovider.CommandDatabase
;
import
fr.ill.ics.nscclient.dataprovider.ServantDatabase
;
public
class
AtomicCommandWrapper
extends
CommandWrapper
implements
I
Servant
{
public
class
AtomicCommandWrapper
extends
CommandWrapper
implements
I
Controller
{
private
ServerAtomicCommandBox
serverAtomicCommandBox
;
private
int
servantId
;
...
...
@@ -96,7 +96,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements IServant {
// do nothing
}
public
I
Servant
getLinkedController
()
{
public
I
Controller
getLinkedController
()
{
return
null
;
}
...
...
src/main/java/fr/ill/ics/core/command/CommandManager.java
View file @
82374a32
...
...
@@ -21,7 +21,7 @@ package fr.ill.ics.core.command;
import
java.util.HashMap
;
import
java.util.Map
;
import
fr.ill.ics.bridge.I
Servant
;
import
fr.ill.ics.bridge.I
Controller
;
import
fr.ill.ics.bridge.command.AtomicCommandWrapper
;
import
fr.ill.ics.nscclient.dataprovider.CommandDatabase
;
import
fr.ill.ics.nscclient.servant.Servant
;
...
...
@@ -44,7 +44,7 @@ public class CommandManager {
return
instance
;
}
public
Command
getCommand
(
I
Servant
controller
,
String
commandName
,
boolean
createExceptionIfNotFound
,
PluginType
pluginType
)
throws
CommandNotFoundException
{
public
Command
getCommand
(
I
Controller
controller
,
String
commandName
,
boolean
createExceptionIfNotFound
,
PluginType
pluginType
)
throws
CommandNotFoundException
{
// Create a new Map of commandName:Command instance if it doesn't exist for the abstract controller
if
(
controllerCommands
==
null
)
{
...
...
src/main/java/fr/ill/ics/core/property/PropertyManager.java
View file @
82374a32
...
...
@@ -33,7 +33,7 @@ import java.util.TreeSet;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
fr.ill.ics.bridge.I
Servant
;
import
fr.ill.ics.bridge.I
Controller
;
import
fr.ill.ics.bridge.ControllerManager
;
import
fr.ill.ics.bridge.DriverManager
;
import
fr.ill.ics.bridge.ResourceManager
;
...
...
@@ -126,7 +126,7 @@ public class PropertyManager {
boolean
clientFilesExist
=
readPropertiesClientFilesFor
(
descriptor
.
getType
());
if
(
clientFilesExist
)
{
I
Servant
controller
=
DriverManager
.
getInstance
().
getDriver
(
descriptor
.
getName
());
I
Controller
controller
=
DriverManager
.
getInstance
().
getDriver
(
descriptor
.
getName
());
createPropertiesForController
((
Servant
)
controller
);
if
(
dynamicPropertiesByControllerType
!=
null
&&
dynamicPropertiesByControllerType
.
containsKey
(((
Servant
)
controller
).
getType
()))
{
createDynamicPropertiesForController
((
Servant
)
controller
);
...
...
@@ -140,7 +140,7 @@ public class PropertyManager {
ClientServantDescriptor
descriptor
=
it
.
next
();
boolean
clientFilesExist
=
readPropertiesClientFilesFor
(
descriptor
.
getType
());
if
(
clientFilesExist
)
{
I
Servant
controller
=
ControllerManager
.
getInstance
().
getController
(
descriptor
.
getName
());
I
Controller
controller
=
ControllerManager
.
getInstance
().
getController
(
descriptor
.
getName
());
createPropertiesForController
((
Servant
)
controller
);
if
(
dynamicPropertiesByControllerType
!=
null
&&
dynamicPropertiesByControllerType
.
containsKey
(((
Servant
)
controller
).
getType
()))
{
createDynamicPropertiesForController
((
Servant
)
controller
);
...
...
@@ -166,7 +166,7 @@ public class PropertyManager {
Set
<
String
>
drivers
=
ServantDatabase
.
getInstance
().
getDriversOfType
(
type
,
false
);
if
(
drivers
!=
null
&&
!
drivers
.
isEmpty
())
{
for
(
String
driverName
:
drivers
)
{
I
Servant
controller
=
DriverManager
.
getInstance
().
getDriver
(
driverName
);
I
Controller
controller
=
DriverManager
.
getInstance
().
getDriver
(
driverName
);
createPropertiesForController
((
Servant
)
controller
);
if
(
dynamicPropertiesByControllerType
!=
null
&&
dynamicPropertiesByControllerType
.
containsKey
(((
Servant
)
controller
).
getType
()))
{
createDynamicPropertiesForController
((
Servant
)
controller
);
...
...
@@ -176,7 +176,7 @@ public class PropertyManager {
Set
<
String
>
controllers
=
ControllerManager
.
getInstance
().
getControllersOfType
(
type
,
false
);
if
(
controllers
!=
null
&&
!
controllers
.
isEmpty
())
{
for
(
String
controllerName
:
controllers
)
{
I
Servant
controller
=
ControllerManager
.
getInstance
().
getController
(
controllerName
);
I
Controller
controller
=
ControllerManager
.
getInstance
().
getController
(
controllerName
);
createPropertiesForController
((
Servant
)
controller
);
if
(
dynamicPropertiesByControllerType
!=
null
&&
dynamicPropertiesByControllerType
.
containsKey
(((
Servant
)
controller
).
getType
()))
{
createDynamicPropertiesForController
((
Servant
)
controller
);
...
...
@@ -304,7 +304,7 @@ public class PropertyManager {
* @return
* @throws PropertyNotFoundException
*/
public
Property
getProperty
(
I
Servant
controller
,
String
propertyName
,
PluginType
pluginType
)
throws
PropertyNotFoundException
{
public
Property
getProperty
(
I
Controller
controller
,
String
propertyName
,
PluginType
pluginType
)
throws
PropertyNotFoundException
{
Property
property
;
if
(
controller
instanceof
Servant
)
{
property
=
getPropertyForServant
((
Servant
)
controller
,
propertyName
);
...
...
@@ -641,7 +641,7 @@ public class PropertyManager {
* @param propertyName
* @return
*/
public
Property
getDynamicPropertyChild
(
I
Servant
controller
,
String
realPropertyName
,
PluginType
pluginType
)
throws
PropertyNotFoundException
{
public
Property
getDynamicPropertyChild
(
I
Controller
controller
,
String
realPropertyName
,
PluginType
pluginType
)
throws
PropertyNotFoundException
{
String
parentPropertyName
=
realPropertyName
.
substring
(
0
,
realPropertyName
.
lastIndexOf
(
"."
));
int
index
=
Integer
.
parseInt
(
realPropertyName
.
substring
(
realPropertyName
.
lastIndexOf
(
"."
)+
1
));
Property
property
=
null
;
...
...
@@ -674,7 +674,7 @@ public class PropertyManager {
/**
* Search dynamic property
*/
public
Property
getDynamicProperty
(
I
Servant
controller
,
String
propertyName
)
throws
PropertyNotFoundException
{
public
Property
getDynamicProperty
(
I
Controller
controller
,
String
propertyName
)
throws
PropertyNotFoundException
{
String
parentPropertyName
=
propertyName
.
substring
(
0
,
propertyName
.
lastIndexOf
(
"."
));
int
index
=
Integer
.
parseInt
(
propertyName
.
substring
(
propertyName
.
lastIndexOf
(
"."
)+
1
));
...
...
@@ -882,7 +882,7 @@ public class PropertyManager {
* @param property
* @param isTrueString
*/
public
void
changeToString
(
I
Servant
controller
,
Property
property
,
boolean
isTrueString
)
{
public
void
changeToString
(
I
Controller
controller
,
Property
property
,
boolean
isTrueString
)
{
if
(
controller
instanceof
AtomicCommandWrapper
)
{
AtomicCommandWrapper
command
=
(
AtomicCommandWrapper
)
controller
;
CommandBoxKey
key
=
new
CommandBoxKey
(
command
.
getServerId
(),
command
.
getId
());
...
...
@@ -900,7 +900,7 @@ public class PropertyManager {
* @param property
* @param isTrueString
*/
public
void
changeDynamicToString
(
I
Servant
controller
,
Property
property
,
boolean
isTrueString
)
{
public
void
changeDynamicToString
(
I
Controller
controller
,
Property
property
,
boolean
isTrueString
)
{
if
(
controller
instanceof
AtomicCommandWrapper
)
{
AtomicCommandWrapper
command
=
(
AtomicCommandWrapper
)
controller
;
CommandBoxKey
key
=
new
CommandBoxKey
(
command
.
getServerId
(),
command
.
getId
());
...
...
@@ -970,7 +970,7 @@ public class PropertyManager {
*
* @param controller
*/
public
void
removeController
(
I
Servant
controller
)
{
public
void
removeController
(
I
Controller
controller
)
{
if
(
controller
instanceof
AtomicCommandWrapper
)
{
AtomicCommandWrapper
command
=
(
AtomicCommandWrapper
)
controller
;
CommandBoxKey
key
=
new
CommandBoxKey
(
command
.
getServerId
(),
command
.
getId
());
...
...
@@ -993,13 +993,13 @@ public class PropertyManager {
* @param dynamicPropertyName
* @return
*/
public
int
getNumberOfChildrenForDynamicProperty
(
I
Servant
controller
,
String
dynamicPropertyName
)
{
public
int
getNumberOfChildrenForDynamicProperty
(
I
Controller
controller
,
String
dynamicPropertyName
)
{
int
propertyId
=
PropertyDatabase
.
getInstance
().
getDynamicPropertyIdForServant
(((
Servant
)
controller
).
getId
(),
dynamicPropertyName
);
return
PropertyDatabase
.
getInstance
().
getNumberOfChildProperties
(
propertyId
);
}
public
int
getNumberOfDecimalPlaces
(
I
Servant
controller
,
String
propertyName
)
{
public
int
getNumberOfDecimalPlaces
(
I
Controller
controller
,
String
propertyName
)
{
try
{
Property
property
=
getProperty
(
controller
,
propertyName
,
PluginType
.
GENERAL
);
if
(
property
!=
null
)
{
...
...
@@ -1023,7 +1023,7 @@ public class PropertyManager {
* @param propertyName
* @return
*/
public
boolean
isDynamic
(
I
Servant
controller
,
String
propertyName
)
{
public
boolean
isDynamic
(
I
Controller
controller
,
String
propertyName
)
{
if
(
propertyMap
.
containsKey
(((
Servant
)
controller
).
getId
()))
{
Map
map
=
propertyMap
.
get
(((
Servant
)
controller
).
getId
());
if
(
map
.
containsKey
(
propertyName
))
{
...
...
src/main/java/fr/ill/ics/nscclient/servant/Servant.java
View file @
82374a32
...
...
@@ -21,7 +21,7 @@ package fr.ill.ics.nscclient.servant;
import
java.util.Map
;
import
java.util.Set
;
import
fr.ill.ics.bridge.I
Servant
;
import
fr.ill.ics.bridge.I
Controller
;
import
fr.ill.ics.bridge.ControllerManager
;
import
fr.ill.ics.bridge.listeners.ServerCommandStateChangeListener
;
import
fr.ill.ics.bridge.listeners.ServerProgressChangeListener
;
...
...
@@ -35,7 +35,7 @@ import fr.ill.ics.nscclient.dataprovider.PropertyDatabase;
import
fr.ill.ics.nscclient.notification.DataNotificationClient
;
public
class
Servant
implements
I
Servant
{
public
class
Servant
implements
I
Controller
{
public
class
UnknownPropertyException
extends
Exception
{};
public
class
UnknownCommandException
extends
Exception
{};
...
...
@@ -145,7 +145,7 @@ public class Servant implements IServant {
return
servantDescriptor
.
getName
();
}
public
I
Servant
getLinkedController
()
{
public
I
Controller
getLinkedController
()
{
return
this
;
}
...
...
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