Class LVarHelper
public class LVarHelper
extends java.lang.Object
This class implements a helper to manipulate LVars using FSUIPC. LVars are gauge variables. This class allows you to read, write and create LVars.
Manipulating LVars via FSUIPC requires 3 data requests, because it works with 3 offsets. Many functions in this class
return all of them in an instance of LVarHelper.LVarResult
. The main offset in use is 0D70, in which you write a string
telling FSUIPC what to do with what LVar. I call it here a "control request" and it is the LVarHelper.LVarResult.getControlRequest()
. The next offset is 0D6C and I reference it as "parameter request" here. Because it is the parameter for requested
LVar operation, telling FSUIPC at which offset and in what format to place the result of LVar read operation, or
where it will find the value for write/create operation. You will find this request in the result object as LVarHelper.LVarResult.getParamRequest()
. The last data request is the result request (even thought that for write and create it is actually kind of source
data request). It is the data request that will hold the result of the LVar read operation, or will hold the value to
write or init new LVar with (create operation). This is the LVarHelper.LVarResult.getResultRequest()
in the result
object.
There are various functions for writing, creating LVar, which mostly differ just by the value type they accept.
Some functions also accepts an instance of FSUIPC
class and a boolean parameter. These functions will also
register the generated requests with given FSUIPC instance for one-time or continual processing (based on that
boolean parameter)
Reading an LVar example
Here is an example how you would read an LVar value without this helper class. It first creates a "parameter request", which tells FSUIPC that we want to store the value of LVar being read at offset 0x66C0 as double value. Than we create "control request", which will tell FSUIPC to read the LVar. The third request is the one that Lvar value will be store in. Than we register all 3 request for one-time processing, process all the requests and print the result.
// Construct the control param request. We will be reading the LVar, this param means:
// Store an LVar value at offset 0x66C0 as 64-bit float value (It is the 0x00000 + 0x66C0. More about this in FSUIPC documentation)
IntRequest paramReq = new IntRequest(0x0D6C);
paramReq.setValue(0x066C0);
paramReq.setType(IDataRequest.RequestType.WRITE);
fsuipc.addOneTimeRequest(paramReq);
//Construct the control request. The ":" tells FSUIPC to read the LVar, whose name follows
StringRequest controlReq = new StringRequest(0x0D70, ":FSDT_GSX_DEBOARDING_STATE");
fsuipc.addOneTimeRequest(controlReq);
//The result request where the resulting 64-bit float (double) will be
DoubleRequest resultReq = new DoubleRequest(0x66C0);
fsuipc.addOneTimeRequest(resultReq);
//Read the LVar value
if (fsuipc.processRequestsOnce() == FSUIPC.PROCESS_RESULT_OK) {
System.out.println("Read Okay");
System.out.println("The value of lvar: FSDT_GSX_DEBOARDING_STATE is: " + resultReq.getValue());
}
The same done using this helper class. You can see it si much simpler, as all of the code is hidden in the function.
The function that takes an FSUIPC
instance is used here, so not even needed to register the requests. Just
call the helper function and process the requests.
//Let the helper function construct all 3 requests and register them with FSUIPC for one-time processing
LVarHelper.LVarResult lvarreq = lvarHelper.readLVar("FSDT_GSX_DEBOARDING_STATE", 0x66C0,LVarHelper.LVarValueFormat.DOUBLE , fsuipc, false);
//Read the LVar value
if (fsuipc.processRequestsOnce() == FSUIPC.PROCESS_RESULT_OK) {
System.out.println("Read Okay");
System.out.println("The value of lvar: FSDT_GSX_DEBOARDING_STATE is: " + lvarreq.getResultRequest().getValue());
}
Writing an LVar or creating an LVar follows the same logic. Only in these cases, all generated requests will be write only. If you use the function that that registers the requests with FSUIPC, you may not need the resulting object at all. Unless you registered them for continual processing and need to remove them from processing later on.
If you will be registering the requests yourself, make sure that in the case of reading LVar you register them in the order:
- 1. Parameter request (
LVarHelper.LVarResult.getParamRequest()
) - 2. Control request (
LVarHelper.LVarResult.getControlRequest()
) - 3. Result request (
LVarHelper.LVarResult.getResultRequest()
)
and in the case of write/create:
- 1. Parameter request (
LVarHelper.LVarResult.getParamRequest()
) - 2. Result request (
LVarHelper.LVarResult.getResultRequest()
) - 3. Control request (
LVarHelper.LVarResult.getControlRequest()
)
So in the case of write/read, the control request needs to be registered last! So it has all required data when it comes to it.
You can also just use the request and other supporting classes defined in this helper class and write the "functions" by yourself.
- Author:
- Mouseviator
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LVarHelper.ByteLVarReadRequest
This class implements LVar read (read-only) request.static class
LVarHelper.ByteLVarWriteRequest
This class implements LVar write (write-only) request.static class
LVarHelper.DoubleLVarReadRequest
This class implements LVar read (read-only) request.static class
LVarHelper.DoubleLVarWriteRequest
This class implements LVar write (write-only) request.static class
LVarHelper.FloatLVarReadRequest
This class implements LVar read (read-only) request.static class
LVarHelper.FloatLVarWriteRequest
This class implements LVar write (write-only) request.static class
LVarHelper.IntegerLVarReadRequest
This class implements LVar read (read-only) request.static class
LVarHelper.IntegerLVarWriteRequest
This class implements LVar write (write-only) request.static class
LVarHelper.LVarControlRequest
This class implements Lvar control offset.static class
LVarHelper.LVarControlRequestCommand
An enumeration representing a command forLVarHelper.LVarControlRequest
.static class
LVarHelper.LVarParamRequest
This class implements Lvar parameter request.static class
LVarHelper.LVarResult
A class representing a result fo many Lvar helper functions in the classLVarHelper
.static class
LVarHelper.LVarValueFormat
An enumeration specifying a value format for LVar read and write functions.static class
LVarHelper.ShortLVarReadRequest
This class implements LVar read (read-only) request.static class
LVarHelper.ShortLVarWriteRequest
This class implements LVar write (write-only) request. -
Field Summary
Fields Modifier and Type Field Description static int
CONTROL_OFFSET
Offset to tell FSUIPC what to do with lua script, LVar or Macrostatic int
PARAMETER_OFFSET
Offset for parameter passing for the control offset below -
Constructor Summary
Constructors Constructor Description LVarHelper()
-
Method Summary
Modifier and Type Method Description LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, byte lvarValue)
This is helper function to create Lvar.LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, double lvarValue)
This is helper function to create Lvar.LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, float lvarValue)
This is helper function to create Lvar.LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, int lvarValue)
This is helper function to create Lvar.LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, short lvarValue)
This is helper function to create Lvar.LVarHelper.LVarResult
createLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat)
This is helper function to create Lvar.boolean
createLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc)
This is helper function to create Lvar.LVarHelper.LVarResult
readLVar(java.lang.String lvar, int targetOffset, LVarHelper.LVarValueFormat lvarValueFormat)
This is helper function to read Lvar.LVarHelper.LVarResult
readLVar(java.lang.String lvar, int targetOffset, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc, boolean continual)
This is helper function to read Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, byte lvarValue)
This is helper function to write Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, double lvarValue)
This is helper function to write Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, float lvarValue)
This is helper function to write Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, int lvarValue)
This is helper function to write Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, short lvarValue)
This is helper function to write Lvar.LVarHelper.LVarResult
writeLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat)
This is helper function to write Lvar.boolean
writeLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc, boolean continual)
This is helper function to write Lvar.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
PARAMETER_OFFSET
public static final int PARAMETER_OFFSETOffset for parameter passing for the control offset below- See Also:
- Constant Field Values
-
CONTROL_OFFSET
public static final int CONTROL_OFFSETOffset to tell FSUIPC what to do with lua script, LVar or Macro- See Also:
- Constant Field Values
-
-
Constructor Details
-
LVarHelper
public LVarHelper()
-
-
Method Details
-
readLVar
public LVarHelper.LVarResult readLVar(java.lang.String lvar, int targetOffset, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc, boolean continual)This is helper function to read Lvar. Reading an Lvar value actually requires 3 requests. One to tell FSUIPC what Lvar to read, one to tell FSUIPC where to store the result and one to read the result - the Lvar value. This function will construct all of them, but return only the one to read the resulting (Lvar) value. It will also register all of the request for one-time or continual processing with given FSUIPC instance. The returned request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
.- Parameters:
lvar
- Name of the Lvar to read.targetOffset
- An offset at which to store the value of the Lvar.lvarValueFormat
- The format of the value to be stored at the specified offset.fsuipc
- AnFSUIPC
instance to register requests with.continual
- Whether to register created requests for continual or one-time processing. True for continual processing.- Returns:
- Null if
fsuipc
is null. An instance ofLVarHelper.LVarResult
class with all 3 requests required to read an Lvar. Do not register the request for processing by FSUIPC, as it will be done by this function.
-
readLVar
public LVarHelper.LVarResult readLVar(java.lang.String lvar, int targetOffset, LVarHelper.LVarValueFormat lvarValueFormat)This is helper function to read Lvar. Reading an Lvar value actually requires 3 requests. One to tell FSUIPC what Lvar to read, one to tell FSUIPC where to store the result and one to read the result - the Lvar value. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getParamRequest()
first,LVarHelper.LVarResult.getControlRequest()
second, andLVarHelper.LVarResult.getResultRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
.- Parameters:
lvar
- Name of the Lvar to read.targetOffset
- An offset at which to store the value of the Lvar.lvarValueFormat
- The format of the value to be stored at the specified offset.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to read an Lvar.
-
writeLVar
public LVarHelper.LVarResult writeLVar(java.lang.String lvar, int lvarValueOffset, double lvarValue)This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
public LVarHelper.LVarResult writeLVar(java.lang.String lvar, int lvarValueOffset, float lvarValue)This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
public LVarHelper.LVarResult writeLVar(java.lang.String lvar, int lvarValueOffset, short lvarValue)This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
public LVarHelper.LVarResult writeLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat)This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the value to be written.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.lvarValueFormat
- The format (data type) of the value to be written to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
writeLVar
public boolean writeLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc, boolean continual)This is helper function to write Lvar. Writing a value an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to write to, one to tell FSUIPC at which offset to find the value to be written and one with the value itself. This function will construct all of them and will register them with given FSUIPC instance for one-time or continual processing based on thecontinual
parameter.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.lvarValueFormat
- The format (data type) of the value to be written to Lvar.fsuipc
- AnFSUIPC
instance to register requests with.continual
- Whether to register created requests for continual or one-time processing. True for continual processing.- Returns:
- True if requests were created and registered for processing. False if
fsuipc
is null. Note that the True does not mean that the Lvar was actually written to. There is no way to detect if the write succeeded. First, it happens after call to process the requests, and this function only registers the requests. Than there is still no other way to tell if the write succeeded other than reading back the value of the Lvar.
-
createLVar
public LVarHelper.LVarResult createLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.lvarValueFormat
- The format (data type) of the value to be written to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
public LVarHelper.LVarResult createLVar(java.lang.String lvar, int lvarValueOffset, double lvarValue)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
public LVarHelper.LVarResult createLVar(java.lang.String lvar, int lvarValueOffset, float lvarValue)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
public LVarHelper.LVarResult createLVar(java.lang.String lvar, int lvarValueOffset, short lvarValue)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
public LVarHelper.LVarResult createLVar(java.lang.String lvar, int lvarValueOffset, byte lvarValue)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize the Lvar with and one with the value itself. This function will construct all of them and return them in an instance ofLVarHelper.LVarResult
class. You can then register them for continual or one-time processing as you are used to. Note that the requests should be registered in the order:LVarHelper.LVarResult.getResultRequest()
first,LVarHelper.LVarResult.getParamRequest()
second,LVarHelper.LVarResult.getControlRequest()
last. The result request will be an instance ofLVarHelper.DoubleLVarReadRequest
,LVarHelper.FloatLVarReadRequest
,LVarHelper.IntegerLVarReadRequest
,LVarHelper.ShortLVarReadRequest
orLVarHelper.ByteLVarReadRequest
depending on the value oflvarValueFormat
. The result request in this case is the request containing the initial value of the Lvar.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.- Returns:
- An instance of
LVarHelper.LVarResult
class with all 3 requests required to write an Lvar.
-
createLVar
public boolean createLVar(java.lang.String lvar, int lvarValueOffset, java.lang.Object lvarValue, LVarHelper.LVarValueFormat lvarValueFormat, FSUIPC fsuipc)This is helper function to create Lvar. Creating an Lvar actually requires 3 requests. One to tell FSUIPC what Lvar to create, one to tell FSUIPC at which offset to find the value to initialize Lvar with and one with the value itself. This function will construct all of them and will register them with given FSUIPC instance for one-time processing.- Parameters:
lvar
- An Lvar to write to.lvarValueOffset
- Offset at which FSUIPC will find the value to write to the Lvar.lvarValue
- Value to write to Lvar.lvarValueFormat
- The format (data type) of the value to be written to Lvar.fsuipc
- AnFSUIPC
instance to register requests with.- Returns:
- True if requests were created and registered for one-time processing. False if
fsuipc
is null. Note that the True does not mean that the Lvar was actually created. There is no way to detect if the create succeeded. First, it happens after call to process the requests, and this function only registers the requests. Than there is still no other way to tell if the create succeeded other than reading back the value of the Lvar.
-