public 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.
|
| Constructor and Description |
|---|
FcsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
binaryToHex(String bin) |
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 |
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 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 deconfigonfigimal 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 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 - Copyright © 2016 LSST. All rights reserved.