|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.ftcontroller.FtController
public class FtController
Class to handle a fischertechnik ROBO interface connected directly to the USB port or using the wireless RF Data Link. A FtController instance communicates with the umFish40.dll using the Java API Wrapper (JAW) framework based on the Java Native Interface (JNI). Any changes on input ports are considered as events. A high performance native thread polls the interface and reports changes to a Java thread that fires listener callback methods that conform to the Java event model. All listener callbacks run in the Event Dispatch Thread EDT, so it is safe to use Swing methods directly.
Field Summary | |
---|---|
AnalogIn |
analogIn1
A reference to the analogIn 1 instance. |
AnalogIn |
analogIn2
A reference to the analogIn 2 instance. |
AnalogIn[] |
analogInAry
Array of all analogIn instances. |
Counter |
counter1
A reference to the counter 1 instance. |
Counter |
counter2
A reference to the counter 2 instance. |
Counter |
counter3
A reference to the counter 3 instance. |
Counter |
counter4
A reference to the counter 4 instance. |
Counter |
counter5
A reference to the counter 5 instance. |
Counter |
counter6
A reference to the counter 6 instance. |
Counter |
counter7
A reference to the counter 7 instance. |
Counter |
counter8
A reference to the counter 8 instance. |
Counter[] |
counterAry
Array of all counter instances. |
DigitalIn |
digitalIn
A reference to the digitalIn instance. |
DistanceIn |
distanceIn1
A reference to the distanceIn 1 instance. |
DistanceIn |
distanceIn2
A reference to the distanceIn 2 instance. |
DistanceIn[] |
distanceInAry
Array of all distanceIn instances. |
InfraredIn |
infraredIn
A reference to the infraredIn instance. |
Lamp |
lamp1
A reference to the lamp 1 instance. |
Lamp |
lamp2
A reference to the lamp 2 instance. |
Lamp |
lamp3
A reference to the lamp 3 instance. |
Lamp |
lamp4
A reference to the lamp 4 instance. |
Lamp |
lamp5
A reference to the lamp 5 instance. |
Lamp |
lamp6
A reference to the lamp 6 instance. |
Lamp |
lamp7
A reference to the lamp 7 instance. |
Lamp |
lamp8
A reference to the lamp 8 instance. |
Lamp[] |
lampAry
Array of all lamp instances. |
Motor |
motor1
A reference to the motor 1 instance. |
Motor |
motor2
A reference to the motor 2 instance. |
Motor |
motor3
A reference to the motor 3 instance. |
Motor |
motor4
A reference to the motor 4 instance. |
Motor[] |
motorAry
Array of all motors instances. |
ResistorIn |
resistorIn1
A reference to the resistorIn 1 instance. |
ResistorIn |
resistorIn2
A reference to the resistorIn 2 instance. |
ResistorIn[] |
resistorInAry
Array of all resistorIn instances. |
Constructor Summary | |
---|---|
FtController()
Same as FtController("ftcontroller", true, 20, 20) |
|
FtController(boolean doConnect)
Same as FtController("ftcontroller", doConnect, 20, 20) |
|
FtController(java.lang.String dll)
Same as FtController(dll, true, 20, 20) |
|
FtController(java.lang.String dll,
boolean doConnect)
Same as FtController(dll, doConnect, 20, 20) |
|
FtController(java.lang.String dll,
boolean doConnect,
int controllerPollPeriod,
int queuePollPeriod)
Creates a FtController instance using the given Windows dll. |
Method Summary | |
---|---|
void |
addAnalogListener(AnalogListener analogListener,
int portNb)
Same as addAnalogListener(analogListener, portNb, 0). |
void |
addAnalogListener(AnalogListener analogListener,
int portNb,
int jitter)
Registers the given AnalogListener. |
void |
addConnectionListener(ConnectionListener connectionListener)
Registers the given ConnectionListener. |
void |
addCounterListener(CounterListener counterListener,
int counterNb)
Registers the given CounterListener. |
void |
addDigitalListener(DigitalListener digitalListener)
Registers the given DigitalListener. |
void |
addDistanceListener(DistanceListener distanceListener,
int portNb)
Registers the given DistanceListener. |
void |
addInfraredListener(InfraredListener infraredListener)
Registers the given InfraredListener. |
void |
addMotorListener(MotorListener motorListener,
int motorNb)
Registers the given MotorListener for the given motor. |
void |
addMotorListener(MotorListener motorListener,
Motor motor)
Same as addMotorListener(MotorListener motorListener, int motorNb) for given motor. |
void |
addResistorListener(ResistorListener resistorListener,
int portNb)
Same as addResistorListener(resistorListener, portNb, 0). |
void |
addResistorListener(ResistorListener resistorListener,
int portNb,
int jitter)
Registers the given ResitorListener. |
void |
clearAllCounters()
Set all counters to zero. |
boolean |
connect()
Establishes a connection to the controller with USB or RF Data Link by calling the native function rbOpenInterfaceUSBdis(0, 0, ftiDisUltra) (ports D1/D2 used for ultrasonic distance sensors). |
static void |
delay(int ms)
Delay the execution for the given time. |
void |
dispose()
Releases all resources. |
void |
exit()
Releases all resources and call System.exit(0). |
java.lang.String |
getDeviceName()
Returns the device name. |
int |
getDeviceType()
Returns the device type. |
java.lang.String |
getFirmwareInfo()
Returns the firmware information. |
int |
getFirmwareNumber()
Returns the firmware number. |
int |
getMotorsStatus()
Returns status of all motors as a bit mask. |
int |
getSerialNumber()
Returns the device serial number. |
static java.lang.String |
getVersion()
Returns the version information. |
boolean |
isConnected()
Returns true, if connected; otherwise false. |
void |
waitCount(int counterNb,
int count)
Set the count of the specified counter to zero and blocks until the specified counter reaches the given count. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Motor motor1
public Motor motor2
public Motor motor3
public Motor motor4
public Motor[] motorAry
public Counter counter1
public Counter counter2
public Counter counter3
public Counter counter4
public Counter counter5
public Counter counter6
public Counter counter7
public Counter counter8
public Counter[] counterAry
public DigitalIn digitalIn
public AnalogIn analogIn1
public AnalogIn analogIn2
public AnalogIn[] analogInAry
public ResistorIn resistorIn1
public ResistorIn resistorIn2
public ResistorIn[] resistorInAry
public DistanceIn distanceIn1
public DistanceIn distanceIn2
public DistanceIn[] distanceInAry
public InfraredIn infraredIn
public Lamp lamp1
public Lamp lamp2
public Lamp lamp3
public Lamp lamp4
public Lamp lamp5
public Lamp lamp6
public Lamp lamp7
public Lamp lamp8
public Lamp[] lampAry
Constructor Detail |
---|
public FtController()
FtController(String dll, boolean doConnect, int controllerPollPeriod, int queuePollPeriod)
public FtController(boolean doConnect)
FtController(String dll, boolean doConnect, int controllerPollPeriod, int queuePollPeriod)
public FtController(java.lang.String dll)
FtController(String dll, boolean doConnect, int controllerPollPeriod, int queuePollPeriod)
public FtController(java.lang.String dll, boolean doConnect)
FtController(String dll, boolean doConnect, int controllerPollPeriod, int queuePollPeriod)
public FtController(java.lang.String dll, boolean doConnect, int controllerPollPeriod, int queuePollPeriod)
dll
- either the fully qualified filename to the Windows DLL or simply
the name of the DLL without extension. In this case the DLL must be found
in the operating system's path.doConnect
- if true, tries to establish a connectioncontrollerPollPeriod
- the period in ms for the native polling threadqueuePollPeriod
- the period in ms for the Java polling threadconnect()
Method Detail |
---|
public boolean connect()
public void dispose()
public void exit()
public static void delay(int ms)
ms
- the wait time in millisecondspublic void clearAllCounters()
public int getDeviceType()
public int getSerialNumber()
public int getFirmwareNumber()
public java.lang.String getFirmwareInfo()
public java.lang.String getDeviceName()
public int getMotorsStatus()
public void addDigitalListener(DigitalListener digitalListener)
digitalListener
- the DigitalListener to registerpublic void addAnalogListener(AnalogListener analogListener, int portNb, int jitter)
analogListener
- the AnalogListener to registerportNb
- the port number to monitor (1, 2)jitter
- the dead zone around the current value that must be exceeded to report an eventpublic void addAnalogListener(AnalogListener analogListener, int portNb)
public void addResistorListener(ResistorListener resistorListener, int portNb, int jitter)
resistorListener
- the ResistorListener to registerportNb
- the port number to monitor (1, 2)jitter
- the dead zone around the current value that must be exceeded to report an eventpublic void addResistorListener(ResistorListener resistorListener, int portNb)
public void addDistanceListener(DistanceListener distanceListener, int portNb)
distanceListener
- the DistanceListener to registerportNb
- the port number to monitor (1, 2)public void addInfraredListener(InfraredListener infraredListener)
infraredListener
- the InfraredListener to registerpublic void addCounterListener(CounterListener counterListener, int counterNb)
counterListener
- the CounterListener to registercounterNb
- the counter number to monitor (1..8)public void addMotorListener(MotorListener motorListener, Motor motor)
public void addMotorListener(MotorListener motorListener, int motorNb)
motorListener
- the MotorListener to registermotorNb
- the number of the motorMotor
public void addConnectionListener(ConnectionListener connectionListener)
connectionListener
- the ConnectionListener to registerpublic boolean isConnected()
public void waitCount(int counterNb, int count)
counterNb
- the counter number to wait for (1..8)count
- the minimum count until the method returnspublic static java.lang.String getVersion()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |