|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject charly.server.devices.ChGpibDeviceImpl
This class is the bridge between the functionality of the GPIB-bus, that
is concentrated in ChGpib
, and the network. Its methods are mostly
called by the client via RMI.
If synchronization on the GPIB-bus is necessary, it is synchronized
on gpib
.
Nested Class Summary | |
(package private) static class |
ChGpibDeviceImpl.ChClientGpibInfo
|
(package private) static class |
ChGpibDeviceImpl.ChSrqInitiator
|
(package private) class |
ChGpibDeviceImpl.ChSrqService
|
Field Summary | |
(package private) ChGpib |
gpib
|
(package private) ChRsrcManagerImpl |
rsrcMgr
|
(package private) ChGpibDeviceImpl.ChSrqService |
srqService
|
static java.lang.String |
srqSuffix
|
Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
Fields inherited from class java.rmi.server.RemoteServer |
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Fields inherited from interface charly.server.devices.ChGpibDevice |
NAME |
Constructor Summary | |
ChGpibDeviceImpl()
|
Method Summary | |
void |
checkSrq(java.lang.String taskID,
int dvcAddr,
ChClientGpib clientGpib)
This method asks the server to notify the specified client, when an SRQ on the specified device occured. |
byte[] |
enter(java.lang.String taskID,
int dvcAddr)
receives from a given device on the gpib-bus. |
byte[] |
enter(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix)
receives from a given device on the gpib-bus. |
java.lang.String |
getName()
|
protected java.lang.String |
getRsrcName(int dvcAddr)
returns a string-description for a specified device on the GPIB-Bus. |
protected java.lang.String |
getRsrcName(int dvcAddr,
java.lang.String suffix)
returns a string-description for a specified device on the GPIB-Bus. |
void |
initialize(java.lang.String taskID,
int addr,
int level)
usually does not need to be called. |
int |
isGpibBoardPresent()
tests if gpibboard is present. |
int |
isListenerPresent(java.lang.String taskID,
int dvcAddr)
tests if listener with specified address is present. |
int |
isListenerPresent(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix)
tests if listener with specified address is present. |
int |
ppoll(java.lang.String taskID)
This function will be replaced by an event-listener-model. |
byte[] |
rarray(java.lang.String taskID)
receives binary and non-binary data from the gpib-bus. |
byte[] |
rarray(java.lang.String taskID,
int dvcAddr)
receives binary and non-binary data from a given device of the gpib-bus. |
byte[] |
rarray(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix)
receives binary and non-binary data from a given device of the gpib-bus. |
byte[] |
receive(java.lang.String taskID)
receives non-binary data from the gpib-bus. |
byte[] |
receive(java.lang.String taskID,
int dvcAddr)
receives non-binary data from a device of the gpib-bus. |
byte[] |
receive(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix)
receives non-binary data from a device of the gpib-bus. |
void |
send(java.lang.String taskID,
int dvcAddr,
byte[] data,
int length)
sends a specified string to a given device on the gpib-bus. |
void |
send(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix,
byte[] data,
int length)
sends a specified string to a given device on the gpib-bus. |
byte[] |
sendAndEnter(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix,
byte[] data,
int length)
sends a specified string to a device on the gpib-bus and enters the result from this device. |
void |
setRsrcMgr(ChRsrcManagerImpl rsrcMgr)
is called immediately after the constructor |
void |
setTimeOut(java.lang.String taskID,
int msec)
sets timeout-time of the GPIB-Bus in msec. |
int |
spoll(java.lang.String taskID,
int dvcAddr)
This function will be replaced by an event-listener-model. |
int |
srq(java.lang.String taskID)
This function will be replaced by an event-listener-model. |
void |
tarray(java.lang.String taskID,
byte[] data,
int length,
byte eoi)
sends data to the gpib-bus. |
void |
tarray(java.lang.String taskID,
int dvcAddr,
byte[] data,
int length,
byte eoi)
sends data to a given device of the gpib-bus. |
void |
tarray(java.lang.String taskID,
int dvcAddr,
java.lang.String suffix,
byte[] data,
int length,
byte eoi)
sends data to a given device of the gpib-bus. |
void |
transmit(java.lang.String taskID,
byte[] data,
int length)
sends data to a the gpib-bus. |
void |
uncheckSrq(java.lang.String taskID,
int dvcAddr,
ChClientGpib clientGpib)
This method tells the server to stop notifying the specified client, when an SRQ on the specified device occured. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
ChGpib gpib
ChRsrcManagerImpl rsrcMgr
ChGpibDeviceImpl.ChSrqService srqService
public static final java.lang.String srqSuffix
Constructor Detail |
public ChGpibDeviceImpl() throws java.rmi.RemoteException
Method Detail |
public void setRsrcMgr(ChRsrcManagerImpl rsrcMgr)
ChDevice
setRsrcMgr
in interface ChDevice
public java.lang.String getName()
getName
in interface ChDevice
ChGpibDevice.NAME
protected java.lang.String getRsrcName(int dvcAddr)
getName()
+ slash + dvcAddr
, e.g.
"GPIB/7"protected java.lang.String getRsrcName(int dvcAddr, java.lang.String suffix)
dvcAddr
- (0-31)suffix
- - e.g. "CHANNEL2"; can be null
getName()
+ slash + dvcAddr
+slash+ suffix
, e.g.
"GPIB/7/CHANNEL2"public void initialize(java.lang.String taskID, int addr, int level) throws ChTaskNotStartedException, ChAccessDeniedException
ChGpib
.
initialize
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
addr
- the device-nr, the present GPIB-Board should have as GPIB-address
(0-32)level
- 0 means the GPIB-board is controller of the GPIB-bus
ChAccessDeniedException
- if access to resource "GPIB" is denied
ChTaskNotStartedException
public void send(java.lang.String taskID, int dvcAddr, java.lang.String suffix, byte[] data, int length) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
send
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)suffix
- - e.g. "CHANNEL2"; can be null
data
- the bytes to be sentlength
- amount of bytes to be sent
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public void send(java.lang.String taskID, int dvcAddr, byte[] data, int length) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
send
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)data
- the bytes to be sentlength
- amount of bytes to be sent
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] sendAndEnter(java.lang.String taskID, int dvcAddr, java.lang.String suffix, byte[] data, int length) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
send(String, int, String, byte[], int)
and
enter(String, int, String)
. This method synchronizes on
gpib
.
sendAndEnter
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the
gpib-bus (0-32)suffix
- - e.g. "CHANNEL2"; can be null
data
- the bytes to be sentlength
- amount of bytes to be sent
java.rmi.RemoteException
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] enter(java.lang.String taskID, int dvcAddr, java.lang.String suffix) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
enter
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)suffix
- - e.g. "CHANNEL2"; can be null
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] enter(java.lang.String taskID, int dvcAddr) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
enter
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public void checkSrq(java.lang.String taskID, int dvcAddr, ChClientGpib clientGpib) throws ChTaskNotStartedException, ChAccessDeniedException
checkSrq
in interface ChGpibDevice
ChTaskNotStartedException
ChAccessDeniedException
public void uncheckSrq(java.lang.String taskID, int dvcAddr, ChClientGpib clientGpib) throws ChTaskNotStartedException, ChAccessDeniedException
uncheckSrq
in interface ChGpibDevice
ChTaskNotStartedException
ChAccessDeniedException
public int spoll(java.lang.String taskID, int dvcAddr) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
spoll
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
srq(String)
public int ppoll(java.lang.String taskID) throws ChTaskNotStartedException, ChAccessDeniedException
ppoll
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
ChAccessDeniedException
- if access to resource "GPIB" is denied
ChTaskNotStartedException
srq(String)
public void transmit(java.lang.String taskID, byte[] data, int length) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
transmit
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
data
- the bytes to be sentlength
- amount of bytes to be sent
ChAccessDeniedException
- if access to resource "GPIB" is denied
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public byte[] receive(java.lang.String taskID) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
receive
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
ChAccessDeniedException
- if access to resource "GPIB" is denied.
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public byte[] receive(java.lang.String taskID, int dvcAddr, java.lang.String suffix) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MLA TALK "+dvcAddr
and
then calls ChGpib.receive()
receive
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)suffix
- - e.g. "CHANNEL2"; can be null
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public byte[] receive(java.lang.String taskID, int dvcAddr) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MLA TALK "+dvcAddr
and
then calls ChGpib.receive()
receive
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
ChTaskNotStartedException
ChAccessDeniedException
ChGpibTimeOutException
ChGpibStateException
public void tarray(java.lang.String taskID, byte[] data, int length, byte eoi) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
tarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
ChAccessDeniedException
- if access to resource "GPIB" is denied.
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public void tarray(java.lang.String taskID, int dvcAddr, java.lang.String suffix, byte[] data, int length, byte eoi) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MTA LISTEN "+dvcAddr
and
then calls ChGpib.tarray(byte[], int, byte)
.
tarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)suffix
- - e.g. "CHANNEL2"; can be null
data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
ChAccessDeniedException
- if access to the receiving
device is denied.
java.rmi.RemoteException
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public void tarray(java.lang.String taskID, int dvcAddr, byte[] data, int length, byte eoi) throws java.rmi.RemoteException, ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MTA LISTEN "+dvcAddr
and
then calls ChGpib.tarray(byte[], int, byte)
.
tarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)data
- the bytes to be sentlength
- amount of bytes to be senteoi
- EOI-Byte
ChAccessDeniedException
- if access to the receiving
device is denied.
java.rmi.RemoteException
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public byte[] rarray(java.lang.String taskID) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
rarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
ChAccessDeniedException
- if access to resource "GPIB" is denied.
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public byte[] rarray(java.lang.String taskID, int dvcAddr, java.lang.String suffix) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MLA TALK "+dvcAddr
and
then calls ChGpib.rarray()
rarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- (0-31)suffix
- - e.g. "CHANNEL2"; can be null
ChAccessDeniedException
- if access to the gpib device is denied.
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public byte[] rarray(java.lang.String taskID, int dvcAddr) throws ChTaskNotStartedException, ChAccessDeniedException, ChGpibTimeOutException, ChGpibStateException
"UNL UNT MLA TALK "+dvcAddr
and
then calls ChGpib.rarray()
rarray
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the receiving device on the gpib-bus (0-32)
ChAccessDeniedException
- if access to the gpib device is denied.
ChTaskNotStartedException
ChGpibTimeOutException
ChGpibStateException
public int srq(java.lang.String taskID) throws ChTaskNotStartedException, ChAccessDeniedException
srq
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
ChAccessDeniedException
- if access to resource "GPIB" is denied
ChTaskNotStartedException
spoll(String,int)
,
ppoll(String)
public void setTimeOut(java.lang.String taskID, int msec) throws ChTaskNotStartedException, ChAccessDeniedException
setTimeOut
in interface ChGpibDevice
taskID
- is the string returned by
ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
ChAccessDeniedException
- if access to resource
"GPIB" is denied
ChTaskNotStartedException
public int isListenerPresent(java.lang.String taskID, int dvcAddr, java.lang.String suffix) throws ChTaskNotStartedException, ChAccessDeniedException
isListenerPresent
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the checked device on the gpib-bus
(0-32)suffix
- - e.g. "CHANNEL2"; can be null
ChTaskNotStartedException
ChAccessDeniedException
public int isListenerPresent(java.lang.String taskID, int dvcAddr) throws ChTaskNotStartedException, ChAccessDeniedException
isListenerPresent
in interface ChGpibDevice
taskID
- is the string returned by ChRsrcManager.startTask(
ChClientTask, String, java.util.Set)
dvcAddr
- the device-nr of the checked device on the gpib-bus (0-32)
ChTaskNotStartedException
ChAccessDeniedException
public int isGpibBoardPresent()
isGpibBoardPresent
in interface ChGpibDevice
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |