public final class FcsUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
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 int |
addAngle(int angle1,
int angle2)
Add 2 angles : an angle is a int which value is between -360 and +360
|
static String |
binaryToHex(String bin) |
static String |
buildRsdoCommand(String nodeID,
String index,
String subindex)
build a Can Open rsdo Command that can understand the C wrapper.
|
static String |
buildWsdoCommand(String nodeID,
String index,
String subindex,
String size,
String data)
build a Can Open wsdo Command that can understand the C wrapper.
|
static void |
checkCommand(String command) |
static void |
checkSocketName(String name) |
static int |
computeRotationShortestWay(int angle)
This method computes the shortest way for a rotation angle given as argument and returns it.
|
static int |
convertToInteger16(int unsigned16)
Change an int represented by an UNSIGNED16 to an INTEGER16.
|
static StatusDataPublishedByEPOSController |
createStatusDataPublishedByEPOSController(EPOSController ctlr)
Creates an object to be published on the STATUS bus by an EPOSController.
|
static StatusDataPublishedByHardware |
createStatusDataPublishedByHardware(PieceOfHardware device)
Creates an object to be published on the STATUS bus by a PieceOfHardware.
|
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 String |
force2one(String hexaVal,
int pos)
Transforms a numericonfigonfig value given in hexa to binary and
replaconfigonfige the digit in position pos given as argument by 1.
|
static String |
force2zero(String hexaVal,
int pos)
Transforms a numericonfigonfig value given in hexa to binary and
replaconfigonfige the digit in position pos given as argument by 0.
|
static String |
hexToBinary(String Hex)
The String argument represents an integer in hexa.
|
static boolean |
isValidCommandWord(String command)
returns true if the command given as argument is an available CANopen command.
|
static void |
main(String[] args) |
static String |
replaceDigit(String twoBytesInHexa,
int bitPosition,
String digit)
Takes an integer represented by 2 bytes in hexa as argument, transforms
is its binary representation, replaconfigonfiges the bit at position
bitPosition by digit given as argument.
|
static int[] |
toReverseBinary(int decimal)
Transform an integer given in its decimal format to its binary
format, reverse it and returns the reversed binary at an array of int.
|
static String |
twoBytesInHexaToBinary(String twoBytesInHexa)
The String argument represents an integer in hexa.
|
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 StatusDataPublishedByHardware createStatusDataPublishedByHardware(PieceOfHardware device)
device - public static StatusDataPublishedByEPOSController createStatusDataPublishedByEPOSController(EPOSController ctlr)
ctlr - public static String hexToBinary(String Hex)
Hex - public static String twoBytesInHexaToBinary(String twoBytesInHexa)
twoBytesInHexa - public static String replaceDigit(String twoBytesInHexa, int bitPosition, String digit)
twoBytesInHexa - bitPosition - digit - public static String force2zero(String hexaVal, int pos)
hexaVal - pos - public static String force2one(String hexaVal, int pos)
hexaVal - pos - public static int[] toReverseBinary(int decimal)
decimal - public static String buildWsdoCommand(String nodeID, String index, String subindex, String size, String data)
nodeID - index - subindex - size - data - public static String buildRsdoCommand(String nodeID, String index, String 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 int convertToInteger16(int unsigned16)
unsigned16 - public static String displayListParameters(String modeInString)
modeInString - public static String displayListParameters()
public static int addAngle(int angle1,
int angle2)
angle1 - angle2 - public static int computeRotationShortestWay(int angle)
angle - public static void main(String[] args)
args - the command line argumentsCopyright © 2016 LSST. All rights reserved.