public final class FcsUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.lsst.ccs.utilities.logging.Logger |
FCSLOG |
static int |
MAX_NODE_ID
The maximum number of CANopen devices which can be on a CANbus.
|
static int |
MAX_VALUE_2BYTES
The maximum value which a number coded on 2 bytes can reach.
|
static int |
TICKMILLIS
A value for all fcs Modules tickmillis.
|
| Constructor and Description |
|---|
FcsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildRsdoCommand(int nodeID,
int index,
int subindex)
build a Can Open rsdo Command that can understand the C wrapper.
|
static String |
buildWsdoCommand(int nodeID,
int index,
int subindex,
int size,
int data)
build a Can Open wsdo Command that can understand the C wrapper.
|
static void |
checkCommand(String command) |
static void |
checkPositive(int arg) |
static void |
checkSocketName(String name) |
static int |
computeNewCurrentValue(int stepHeight,
int currentValue,
int finalValue) |
static short |
convertInteger16(long integer16)
Convert a number coded on 16 bits which represents a signed number (INTEGER16) to a short.
|
static int |
convertInteger32(long integer32)
Convert a number coded on 32 bits which represents a signed number (INTEGER32) to an int.
|
static byte |
convertInteger8(long integer8)
Convert a number coded on 8 bits which represents a signed number (INTEGER8) to a byte.
|
static String |
displayListParameters()
Displays the list of parameters.
|
static String |
displayListParameters(String modeInString)
Displays the list of parameters that we have to define for a given mode.
|
static boolean |
finalValueReached(int stepHeight,
int newCurrentValue,
int finalValue)
Returns true if the final value is reached.
|
static int |
force2one(int val,
int bit)
Return a new value where the digit (bit number given as argument) has been replaced by 1.
|
static int |
force2zero(int val,
int bit)
Computes a new value given as argument in replacing bit which is at position
given as argument by 0.
|
static int |
forceBit(int val,
int bit,
int zeroOne)
Sets the nth bit
|
static int |
getSignedStepHeight(int initialValue,
int finalValue,
int increment)
For online clamps.
|
static boolean |
isValidCommandWord(String command)
returns true if the command given as argument is an available CANopen command.
|
static void |
main(String[] args) |
static void |
sleep(int duration,
String itemName) |
protected static final org.lsst.ccs.utilities.logging.Logger FCSLOG
public static final int MAX_VALUE_2BYTES
public static final int MAX_NODE_ID
public static final int TICKMILLIS
public static void checkSocketName(String name)
name - public static int force2zero(int val,
int bit)
val - value to transformbit - bit numero to be replacedIllegalArgumentException - if bit <0 or bit >15public static int force2one(int val,
int bit)
val - bit - public static int forceBit(int val,
int bit,
int zeroOne)
val - the value to modifiybit - the bit number to setzeroOne - if zero forces to zero. Forces to one otherwisepublic static String buildWsdoCommand(int nodeID, int index, int subindex, int size, int data)
nodeID - index - subindex - size - data - public static String buildRsdoCommand(int nodeID, int index, int subindex)
nodeID - index - subindex - public static boolean isValidCommandWord(String command)
command - public static void checkCommand(String command)
command - IllegalArgumentException - if command is not a valid command.public static byte convertInteger8(long integer8)
integer8 - public static short convertInteger16(long integer16)
integer16 - a long because readSDO command returns a long.public static int convertInteger32(long integer32)
integer32 - public static String displayListParameters(String modeInString)
modeInString - public static String displayListParameters()
public static int getSignedStepHeight(int initialValue,
int finalValue,
int increment)
initialValue - finalValue - increment - public static void main(String[] args)
args - the command line argumentspublic static boolean finalValueReached(int stepHeight,
int newCurrentValue,
int finalValue)
stepHeight - newCurrentValue - finalValue - public static int computeNewCurrentValue(int stepHeight,
int currentValue,
int finalValue)
public static void sleep(int duration,
String itemName)
public static void checkPositive(int arg)
Copyright © 2018 LSST. All rights reserved.