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
6fab618d
Commit
6fab618d
authored
Feb 28, 2017
by
yannick legoc
Browse files
reorganized command box accessor with command zone accessor.
parent
d396f402
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
6fab618d
...
...
@@ -315,9 +315,9 @@
<arg
line=
"${protoFlags} ${protoDir}/ConditionManagerRequests.proto"
/>
</exec>
<echo
message=
"Generating Command
Box
Requests.java"
/>
<echo
message=
"Generating Command
Zone
Requests.java"
/>
<exec
executable=
"protoc"
>
<arg
line=
"${protoFlags} ${protoDir}/
c
ommand
z
one
/CommandBox
Requests.proto"
/>
<arg
line=
"${protoFlags} ${protoDir}/
C
ommand
Z
oneRequests.proto"
/>
</exec>
</target>
...
...
src/main/java/fr/ill/ics/core/property/BooleanProperty.java
View file @
6fab618d
...
...
@@ -18,7 +18,7 @@
package
fr.ill.ics.core.property
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor
;
import
fr.ill.ics.nscclient.dataprovider.DataAccessor
;
public
class
BooleanProperty
extends
Property
{
...
...
@@ -33,7 +33,7 @@ public class BooleanProperty extends Property {
public
String
getServerValue
()
{
// Don't use format for the moment. The value can only be "true" or "false"
if
(
isCommandBox
)
{
return
Boolean
.
toString
(
Command
Box
Accessor
.
getInstance
(
serverId
).
getBooleanValue
(
containerId
,
id
));
return
Boolean
.
toString
(
Command
Zone
Accessor
.
getInstance
(
serverId
).
getBooleanValue
(
containerId
,
id
));
}
else
{
return
Boolean
.
toString
(
DataAccessor
.
getInstance
(
serverId
).
getBooleanValue
(
containerId
,
id
));
}
...
...
@@ -44,7 +44,7 @@ public class BooleanProperty extends Property {
//try {
boolean
ok
=
true
;
if
(
isCommandBox
)
{
ok
=
Command
Box
Accessor
.
getInstance
(
serverId
).
setBooleanValue
(
containerId
,
id
,
Boolean
.
valueOf
(
value
).
booleanValue
());
ok
=
Command
Zone
Accessor
.
getInstance
(
serverId
).
setBooleanValue
(
containerId
,
id
,
Boolean
.
valueOf
(
value
).
booleanValue
());
}
else
{
ok
=
DataAccessor
.
getInstance
(
serverId
).
setBooleanValue
(
containerId
,
id
,
Boolean
.
valueOf
(
value
).
booleanValue
());
if
(!
ok
)
{
...
...
src/main/java/fr/ill/ics/core/property/Float64Property.java
View file @
6fab618d
...
...
@@ -18,7 +18,7 @@
package
fr.ill.ics.core.property
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor
;
import
fr.ill.ics.nscclient.dataprovider.DataAccessor
;
import
fr.ill.ics.util.ConfigManager
;
...
...
@@ -31,7 +31,7 @@ public class Float64Property extends FloatProperty {
public
String
getServerValue
()
{
try
{
if
(
isCommandBox
)
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
Command
Box
Accessor
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
Command
Zone
Accessor
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
}
else
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Double
(
DataAccessor
.
getInstance
(
serverId
).
getFloat64Value
(
containerId
,
id
)).
toString
());
}
...
...
@@ -48,7 +48,7 @@ public class Float64Property extends FloatProperty {
boolean
ok
=
isOk
(
serverValue
);
if
(
ok
)
{
if
(
isCommandBox
)
{
ok
=
Command
Box
Accessor
.
getInstance
(
serverId
).
setFloat64Value
(
containerId
,
id
,
new
Double
(
serverValue
).
doubleValue
());
ok
=
Command
Zone
Accessor
.
getInstance
(
serverId
).
setFloat64Value
(
containerId
,
id
,
new
Double
(
serverValue
).
doubleValue
());
}
else
{
ok
=
DataAccessor
.
getInstance
(
serverId
).
setFloat64Value
(
containerId
,
id
,
new
Double
(
serverValue
).
doubleValue
());
if
(!
ok
)
{
...
...
src/main/java/fr/ill/ics/core/property/Int32Property.java
View file @
6fab618d
...
...
@@ -18,7 +18,7 @@
package
fr.ill.ics.core.property
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor
;
import
fr.ill.ics.nscclient.dataprovider.DataAccessor
;
import
fr.ill.ics.util.ConfigManager
;
...
...
@@ -30,7 +30,7 @@ public class Int32Property extends IntegerProperty {
public
String
getServerValue
()
{
if
(
isCommandBox
)
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Integer
(
Command
Box
Accessor
.
getInstance
(
serverId
).
getInt32Value
(
containerId
,
id
)).
toString
());
return
this
.
propertyFormat
.
formatForDisplay
(
new
Integer
(
Command
Zone
Accessor
.
getInstance
(
serverId
).
getInt32Value
(
containerId
,
id
)).
toString
());
}
else
{
return
this
.
propertyFormat
.
formatForDisplay
(
new
Integer
(
DataAccessor
.
getInstance
(
serverId
).
getInt32Value
(
containerId
,
id
)).
toString
());
}
...
...
@@ -43,7 +43,7 @@ public class Int32Property extends IntegerProperty {
boolean
ok
=
isOk
(
serverValue
);
if
(
ok
)
{
if
(
isCommandBox
)
{
ok
=
Command
Box
Accessor
.
getInstance
(
serverId
).
setInt32Value
(
containerId
,
id
,
new
Integer
(
serverValue
).
intValue
());
ok
=
Command
Zone
Accessor
.
getInstance
(
serverId
).
setInt32Value
(
containerId
,
id
,
new
Integer
(
serverValue
).
intValue
());
}
else
{
ok
=
DataAccessor
.
getInstance
(
serverId
).
setInt32Value
(
containerId
,
id
,
new
Integer
(
serverValue
).
intValue
());
if
(!
ok
)
{
...
...
src/main/java/fr/ill/ics/core/property/StringProperty.java
View file @
6fab618d
...
...
@@ -18,7 +18,7 @@
package
fr.ill.ics.core.property
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor
;
import
fr.ill.ics.nscclient.dataprovider.DataAccessor
;
public
class
StringProperty
extends
Property
{
...
...
@@ -29,7 +29,7 @@ public class StringProperty extends Property {
public
String
getServerValue
()
{
if
(
isCommandBox
)
{
return
this
.
propertyFormat
.
formatForDisplay
(
Command
Box
Accessor
.
getInstance
(
serverId
).
getStringValue
(
containerId
,
id
));
return
this
.
propertyFormat
.
formatForDisplay
(
Command
Zone
Accessor
.
getInstance
(
serverId
).
getStringValue
(
containerId
,
id
));
}
else
{
return
this
.
propertyFormat
.
formatForDisplay
(
DataAccessor
.
getInstance
(
serverId
).
getStringValue
(
containerId
,
id
));
}
...
...
@@ -41,7 +41,7 @@ public class StringProperty extends Property {
if
(
ok
)
{
// try {
if
(
isCommandBox
)
{
ok
=
Command
Box
Accessor
.
getInstance
(
serverId
).
setStringValue
(
containerId
,
id
,
serverValue
);
ok
=
Command
Zone
Accessor
.
getInstance
(
serverId
).
setStringValue
(
containerId
,
id
,
serverValue
);
}
else
{
ok
=
DataAccessor
.
getInstance
(
serverId
).
setStringValue
(
containerId
,
id
,
serverValue
);
if
(!
ok
)
{
...
...
src/main/java/fr/ill/ics/nscclient/command/Command
Box
Accessor.java
→
src/main/java/fr/ill/ics/nscclient/command/Command
Zone
Accessor.java
View file @
6fab618d
This diff is collapsed.
Click to expand it.
src/main/java/fr/ill/ics/nscclient/command/ServerAtomicCommandBox.java
View file @
6fab618d
...
...
@@ -27,19 +27,19 @@ public class ServerAtomicCommandBox extends ServerCommandBox {
}
public
int
getCommandID
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getCommandID
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getCommandID
(
commandBoxId
);
}
public
boolean
isSettings
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
isSettings
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
isSettings
(
commandBoxId
);
}
public
void
setSettingsFileName
(
String
filename
)
{
Command
Box
Accessor
.
getInstance
(
serverId
).
setSettingsFileName
(
commandBoxId
,
filename
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
setSettingsFileName
(
commandBoxId
,
filename
);
}
public
String
getSettingsFileName
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getSettingsFileName
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getSettingsFileName
(
commandBoxId
);
}
public
int
getNumberOfCommandBoxes
()
{
...
...
src/main/java/fr/ill/ics/nscclient/command/ServerCommandBox.java
View file @
6fab618d
...
...
@@ -18,7 +18,7 @@
package
fr.ill.ics.nscclient.command
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor.ExecutionPhaseState
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor.ExecutionPhaseState
;
public
abstract
class
ServerCommandBox
{
...
...
@@ -53,23 +53,23 @@ public abstract class ServerCommandBox {
}
public
void
toggleBackground
()
{
Command
Box
Accessor
.
getInstance
(
serverId
).
toggleBackground
(
commandBoxId
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
toggleBackground
(
commandBoxId
);
}
public
void
toggleParallel
()
{
Command
Box
Accessor
.
getInstance
(
serverId
).
toggleParallel
(
commandBoxId
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
toggleParallel
(
commandBoxId
);
}
public
boolean
isBackground
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
isBackground
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
isBackground
(
commandBoxId
);
}
public
boolean
isParallel
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
isParallel
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
isParallel
(
commandBoxId
);
}
public
ExecutionPhaseState
getExecutionState
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getExecutionState
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getExecutionState
(
commandBoxId
);
}
public
boolean
isRunning
()
{
...
...
@@ -85,19 +85,19 @@ public abstract class ServerCommandBox {
}
public
void
setModifiable
(
boolean
isModifiable
)
{
Command
Box
Accessor
.
getInstance
(
serverId
).
setModifiable
(
commandBoxId
,
isModifiable
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
setModifiable
(
commandBoxId
,
isModifiable
);
}
public
boolean
isModifiable
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
isModifiable
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
isModifiable
(
commandBoxId
);
}
public
void
stop
()
{
Command
Box
Accessor
.
getInstance
(
serverId
).
stop
(
commandBoxId
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
stop
(
commandBoxId
);
}
public
int
getProgression
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getProgression
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getProgression
(
commandBoxId
);
}
public
abstract
int
getNumberOfCommandBoxes
();
...
...
src/main/java/fr/ill/ics/nscclient/command/ServerGenericCommandBox.java
View file @
6fab618d
...
...
@@ -27,31 +27,31 @@ public class ServerGenericCommandBox extends ServerCommandBox {
}
public
void
setControllerName
(
String
controllerName
)
{
Command
Box
Accessor
.
getInstance
(
serverId
).
setControllerName
(
commandBoxId
,
controllerName
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
setControllerName
(
commandBoxId
,
controllerName
);
}
public
String
getControllerName
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getControllerName
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getControllerName
(
commandBoxId
);
}
public
void
setPropertyName
(
String
propertyName
)
{
Command
Box
Accessor
.
getInstance
(
serverId
).
setPropertyName
(
commandBoxId
,
propertyName
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
setPropertyName
(
commandBoxId
,
propertyName
);
}
public
String
getPropertyName
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getPropertyName
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getPropertyName
(
commandBoxId
);
}
public
int
getBoxType
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getBoxType
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getBoxType
(
commandBoxId
);
}
public
void
setValue
(
String
value
)
{
Command
Box
Accessor
.
getInstance
(
serverId
).
setValue
(
commandBoxId
,
value
);
Command
Zone
Accessor
.
getInstance
(
serverId
).
setValue
(
commandBoxId
,
value
);
}
public
String
getValue
()
{
return
Command
Box
Accessor
.
getInstance
(
serverId
).
getValue
(
commandBoxId
);
return
Command
Zone
Accessor
.
getInstance
(
serverId
).
getValue
(
commandBoxId
);
}
public
int
getNumberOfCommandBoxes
()
{
...
...
src/main/java/fr/ill/ics/nscclient/sessionmanagement/ServerSessionManager.java
View file @
6fab618d
...
...
@@ -25,7 +25,7 @@ import java.util.Map;
import
fr.ill.ics.bridge.ControllerManager
;
import
fr.ill.ics.bridge.DriverManager
;
import
fr.ill.ics.bridge.ResourceManager
;
import
fr.ill.ics.nscclient.command.Command
Box
Accessor
;
import
fr.ill.ics.nscclient.command.Command
Zone
Accessor
;
import
fr.ill.ics.nscclient.command.CommandZoneAccessorProxy
;
import
fr.ill.ics.nscclient.command.ControlCommandBoxAccessorProxy
;
import
fr.ill.ics.nscclient.command.ForLoopCommandBoxAccessorProxy
;
...
...
@@ -72,7 +72,7 @@ public class ServerSessionManager {
ServantManagerAccessor
.
getInstance
(
serverId
).
init
();
CommandZoneAccessorProxy
.
getInstance
(
serverId
).
init
();
Command
Box
Accessor
.
getInstance
(
serverId
).
init
();
Command
Zone
Accessor
.
getInstance
(
serverId
).
init
();
ScanCommandBoxAccessorProxy
.
getInstance
(
serverId
).
init
();
ForLoopCommandBoxAccessorProxy
.
getInstance
(
serverId
).
init
();
ControlCommandBoxAccessorProxy
.
getInstance
(
serverId
).
init
();
...
...
@@ -158,7 +158,7 @@ public class ServerSessionManager {
ConditionManagerAccessor
.
getInstance
(
serverId
).
reset
();
Command
Box
Accessor
.
getInstance
(
serverId
).
reset
();
Command
Zone
Accessor
.
getInstance
(
serverId
).
reset
();
currentSession
.
logout
();
currentSession
=
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