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
0df91acf
Commit
0df91acf
authored
Jan 05, 2016
by
Jerome Locatelli
Browse files
Merge of branch Instrument_RC_174
parent
aef132ea
Changes
28
Show whitespace changes
Inline
Side-by-side
build.xml
View file @
0df91acf
...
...
@@ -235,7 +235,7 @@
</exec>
</target>
<target
name=
"jar"
>
<target
name=
"jar"
depends=
"idl,proto"
>
<echo
message=
"Creating nomadCommandSystem.jar"
/>
<jar
destfile=
"nomadCommandSystem.jar"
basedir=
"${classes}"
>
...
...
@@ -247,7 +247,7 @@
</target>
<target
name=
"jar 64bits"
>
<target
name=
"jar 64bits"
depends=
"idl,proto"
>
<echo
message=
"Creating nomadCommandSystem.jar for 64bits system"
/>
<jar
destfile=
"nomadCommandSystem.jar"
basedir=
"${classes}"
>
...
...
lib64/jeromq-0.3.5.jar
0 → 100644
View file @
0df91acf
File added
lib64/nappli-java-api.jar
0 → 100644
View file @
0df91acf
File added
src/fr/ill/ics/bridge/Controller.java
View file @
0df91acf
...
...
@@ -49,4 +49,6 @@ public interface Controller {
public
Controller
getLinkedController
();
public
void
updateDynamicProperties
();
public
int
getDatabaseId
();
}
\ No newline at end of file
src/fr/ill/ics/bridge/ControllerManager.java
View file @
0df91acf
...
...
@@ -57,6 +57,9 @@ public abstract class ControllerManager {
public
abstract
Map
getInstalledCommands
();
public
abstract
Map
<
String
,
Map
<
String
,
List
<
String
>>>
getInstalledControllers
();
public
abstract
Set
<
String
>
getControllerTypes
();
//public abstract Map getInstalledControllers();
public
abstract
Set
<
String
>
getControllersOfType
(
String
type
,
boolean
onlyVisibleOnes
);
...
...
src/fr/ill/ics/bridge/command/AtomicCommandWrapper.java
View file @
0df91acf
...
...
@@ -30,10 +30,16 @@ import fr.ill.ics.nscclient.dataprovider.ServantDatabase;
public
class
AtomicCommandWrapper
extends
CommandWrapper
implements
Controller
{
private
ServerAtomicCommandBox
serverAtomicCommandBox
;
private
int
servantId
;
private
String
type
;
private
String
name
;
public
AtomicCommandWrapper
(
ServerAtomicCommandBox
serverAtomicCommandBox
)
{
super
(
serverAtomicCommandBox
);
this
.
serverAtomicCommandBox
=
serverAtomicCommandBox
;
servantId
=
CommandDatabase
.
getInstance
().
getServantIdForCommand
(
serverAtomicCommandBox
.
getCommandID
());
type
=
ServantDatabase
.
getInstance
().
getServantType
(
servantId
);
name
=
ServantDatabase
.
getInstance
().
getServantName
(
servantId
);
}
public
void
unregister
()
{
...
...
@@ -44,13 +50,11 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
}
public
String
getName
()
{
int
servantId
=
CommandDatabase
.
getInstance
().
getServantIdForCommand
(
serverAtomicCommandBox
.
getCommandID
());
return
ServantDatabase
.
getInstance
().
getServantName
(
servantId
);
return
name
;
}
public
String
getType
()
{
int
servantId
=
CommandDatabase
.
getInstance
().
getServantIdForCommand
(
serverAtomicCommandBox
.
getCommandID
());
return
ServantDatabase
.
getInstance
().
getServantType
(
servantId
);
return
type
;
}
public
Set
getCommandNames
()
{
...
...
@@ -77,7 +81,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
}
public
int
getServantId
()
{
return
CommandDatabase
.
getInstance
().
getServantIdForCommand
(
serverAtomicCommandBox
.
getCommandID
())
;
return
servantId
;
}
public
boolean
isSettings
()
{
...
...
@@ -108,7 +112,7 @@ public class AtomicCommandWrapper extends CommandWrapper implements Controller {
return
serverAtomicCommandBox
.
getSettingsFileName
();
}
public
int
getDatabaseI
D
()
{
public
int
getDatabaseI
d
()
{
return
serverAtomicCommandBox
.
getDatabaseID
();
}
...
...
src/fr/ill/ics/bridge/command/ControlCommandWrapper.java
View file @
0df91acf
...
...
@@ -116,7 +116,7 @@ public class ControlCommandWrapper extends CommandWrapper {
return
new
CommandZoneIteratorWrapper
(
serverControlCommandBox
.
getContent
(
thenBlock
));
}
public
int
getDatabaseI
D
()
{
public
int
getDatabaseI
d
()
{
return
serverControlCommandBox
.
getDatabaseID
();
}
...
...
src/fr/ill/ics/bridge/command/ForLoopCommandWrapper.java
View file @
0df91acf
...
...
@@ -199,7 +199,7 @@ public class ForLoopCommandWrapper extends CommandWrapper implements IForLoopEve
return
getCommandBoxID
();
}
public
int
getDatabaseI
D
()
{
public
int
getDatabaseI
d
()
{
return
serverForLoopCommandBox
.
getDatabaseID
();
}
...
...
src/fr/ill/ics/bridge/command/GenericCommandWrapper.java
View file @
0df91acf
...
...
@@ -86,7 +86,7 @@ public class GenericCommandWrapper extends CommandWrapper {
return
"generic"
;
}
public
int
getDatabaseI
D
()
{
public
int
getDatabaseI
d
()
{
return
serverGenericCommandBox
.
getDatabaseID
();
}
...
...
src/fr/ill/ics/bridge/command/ICommandBoxEventListener.java
View file @
0df91acf
...
...
@@ -25,7 +25,7 @@ public interface ICommandBoxEventListener {
void
commandTerminated
();
void
progressChanged
(
double
progress
);
int
getDatabaseI
D
();
int
getDatabaseI
d
();
int
getCommandBoxID
();
void
onReset
();
void
onExpressionChanged
();
...
...
src/fr/ill/ics/bridge/command/IForLoopEventListener.java
View file @
0df91acf
...
...
@@ -22,7 +22,7 @@ public interface IForLoopEventListener {
void
currentValueChanged
(
double
value
,
int
lineIndex
);
int
getDatabaseI
D
();
int
getDatabaseI
d
();
int
getForLoopCommandBoxID
();
}
\ No newline at end of file
src/fr/ill/ics/bridge/command/ScanCommandWrapper.java
View file @
0df91acf
...
...
@@ -80,7 +80,7 @@ public class ScanCommandWrapper extends CommandWrapper {
return
commandId
;
}
public
int
getDatabaseI
D
()
{
public
int
getDatabaseI
d
()
{
return
serverScanCommandBox
.
getDatabaseID
();
}
}
\ No newline at end of file
src/fr/ill/ics/core/command/Command.java
View file @
0df91acf
...
...
@@ -33,6 +33,7 @@ public class Command extends CommandAction implements ServerCommandStateChangeLi
private
int
id
;
private
int
databaseId
;
private
String
serverId
;
// package protected constructor (have to be created by CommandManager)
Command
(
int
databaseId
,
int
id
,
String
commandName
)
{
...
...
@@ -41,12 +42,13 @@ public class Command extends CommandAction implements ServerCommandStateChangeLi
this
.
databaseId
=
databaseId
;
DataNotificationClient
.
getInstance
().
addCommandStateChangeListener
(
this
);
DataNotificationClient
.
getInstance
().
addCommandProgressionChangeListener
(
this
);
this
.
isRunning
=
(
DataAccessor
.
getInstance
(
"real"
).
getCommandState
(
databaseId
,
id
)
==
ClientCommandState
.
ACTIVE
);
serverId
=
DataAccessor
.
getServerId
(
databaseId
);
this
.
isRunning
=
(
DataAccessor
.
getInstance
(
serverId
).
getCommandState
(
0
,
id
)
==
ClientCommandState
.
ACTIVE
);
}
public
ClientCommandState
getCommandState
()
{
return
DataAccessor
.
getInstance
(
"real"
).
getCommandState
(
databaseId
,
id
);
return
DataAccessor
.
getInstance
(
serverId
).
getCommandState
(
0
,
id
);
}
/**
...
...
@@ -60,7 +62,7 @@ public class Command extends CommandAction implements ServerCommandStateChangeLi
this
.
isRunning
=
false
;
try
{
DataAccessor
.
getInstance
(
"real"
).
execute
(
databaseId
,
id
);
DataAccessor
.
getInstance
(
serverId
).
execute
(
databaseId
,
id
);
showStartingCommandMessage
();
}
catch
(
UnknownCommandException
e
)
{
LOGGER
.
logp
(
Level
.
SEVERE
,
this
.
getClass
().
getName
(),
"execute"
,
"Unknown command: "
+
this
.
id
);
...
...
@@ -72,7 +74,7 @@ public class Command extends CommandAction implements ServerCommandStateChangeLi
*
*/
public
void
stop
()
{
DataAccessor
.
getInstance
(
"real"
).
stop
(
databaseId
,
id
);
DataAccessor
.
getInstance
(
serverId
).
stop
(
databaseId
,
id
);
showStoppingCommandMessage
();
}
...
...
src/fr/ill/ics/core/command/CommandManager.java
View file @
0df91acf
...
...
@@ -69,7 +69,7 @@ public class CommandManager {
}
else
{
int
id
=
CommandDatabase
.
getInstance
().
getCommandId
(
servantId
,
commandName
);
if
(
id
!=
-
1
)
{
command
=
new
Command
(
((
CorbaServant
)
controller
)
.
getDatabaseId
(),
id
,
commandName
);
command
=
new
Command
(
controller
.
getDatabaseId
(),
id
,
commandName
);
allCommands
.
put
(
commandName
,
command
);
}
}
...
...
src/fr/ill/ics/core/property/Property.java
View file @
0df91acf
...
...
@@ -73,6 +73,8 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
protected
boolean
showSettingPropertyMessage
=
true
;
private
String
name
;
/**
*
* @param id
...
...
@@ -83,6 +85,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
this
.
containerId
=
containerId
;
this
.
isCommandBox
=
isCommandBox
;
this
.
name
=
PropertyDatabase
.
getInstance
().
getPropertyName
(
id
);
maxLength
=
getDefaultMaxLength
();
...
...
@@ -206,7 +209,7 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
}
public
String
getName
()
{
return
PropertyDatabase
.
getInstance
().
getPropertyName
(
id
)
;
return
name
;
}
/**
...
...
src/fr/ill/ics/core/property/PropertyManager.java
View file @
0df91acf
...
...
@@ -507,7 +507,7 @@ public class PropertyManager {
List
<
Integer
>
ids
=
dynamicPropertyDescriptor
.
getIds
();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
Property
childProperty
=
PropertyFactory
.
getInstance
().
createProperty
(
command
.
getId
(),
(
Integer
)
ids
.
get
(
i
),
xmlDynamicPropertyDescriptor
,
true
);
Property
childProperty
=
PropertyFactory
.
getInstance
().
createProperty
(
command
.
getId
(),
ids
.
get
(
i
),
xmlDynamicPropertyDescriptor
,
true
);
childProperty
.
setServerId
(
command
.
getServerId
());
childProperties
.
put
(
childProperty
.
getName
(),
childProperty
);
...
...
@@ -698,18 +698,21 @@ public class PropertyManager {
if
(
setOfDescriptors
!=
null
&&
setOfDescriptors
.
size
()
>
0
)
{
if
(
setOfDescriptors
.
size
()
==
1
)
{
// Verify the only property loaded is not a commandStatus property
Iterator
<
SpyPropertyDescriptor
>
it
=
setOfDescriptors
.
iterator
();
SpyPropertyDescriptor
spyDescriptor
=
it
.
next
();
int
actualPropertyID
=
spyDescriptor
.
getActualID
();
String
actualPropertyName
=
PropertyDatabase
.
getInstance
().
getPropertyName
(
actualPropertyID
);
if
(
actualPropertyName
.
equals
(
"commandStatus"
))
{
if
(
setOfDescriptors
.
size
()
<=
2
)
{
return
false
;
}
return
true
;
//can this case happen? (that is: only one property & property != commandStatus)
}
// if (setOfDescriptors.size() == 1) {
// // Verify the only property loaded is not a commandStatus property
// 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; //can this case happen? (that is: only one property & property != commandStatus)
// }
return
true
;
}
return
false
;
...
...
src/fr/ill/ics/core/property/array/Float32Array.java
View file @
0df91acf
...
...
@@ -114,6 +114,9 @@ public class Float32Array extends Array {
}
public
boolean
onlyContainsNegativeValues
()
{
if
(
array
==
null
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
array
[
i
]
>
0
)
{
return
false
;
...
...
src/fr/ill/ics/core/property/array/Float64Array.java
View file @
0df91acf
...
...
@@ -113,6 +113,9 @@ public class Float64Array extends Array {
}
public
boolean
onlyContainsNegativeValues
()
{
if
(
array
==
null
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
array
[
i
]
>
0
)
{
return
false
;
...
...
src/fr/ill/ics/core/property/array/Int16Array.java
View file @
0df91acf
...
...
@@ -122,6 +122,9 @@ public class Int16Array extends Array {
}
public
boolean
onlyContainsNegativeValues
()
{
if
(
array
==
null
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
array
[
i
]
>
0
)
{
return
false
;
...
...
src/fr/ill/ics/core/property/array/Int32Array.java
View file @
0df91acf
...
...
@@ -121,6 +121,9 @@ public class Int32Array extends Array {
}
public
boolean
onlyContainsNegativeValues
()
{
if
(
array
==
null
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
array
[
i
]
>
0
)
{
return
false
;
...
...
Prev
1
2
Next
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