inp.camac
Class Module

java.lang.Object
  |
  +--inp.camac.Module

public class Module
extends java.lang.Object

Basic CAMAC module class to be extended by actual modules implementations, this class represent basics common methods required for CAMAC module


Constructor Summary
Module()
           
 
Method Summary
 void addLAMlistener(LAMlistener listener)
          Method to add listener interested in LAMs from this module Besides adding listener logicaly it enables LAM from this position executing enableLAM on this module.
 void AF(int A, int F)
          Execute A,F on this module without data transfer.
 void AF(int A, int F, int[] data)
          execute A,F on this module with data as many times as length of data[] is. if data[] is null, NAF without data transfer will be executed once.
 int dataBits()
          Public method query Module for number of significant bits.
protected  void fireLAM()
          Method called by CamacDriver when LAM from station at N occures.
 Crate getCrate()
          setCrate reference for this module
 java.lang.String getModuleName()
          Get name for this module
 int getN()
          get position number of this module in Crate.
 boolean isF24F26supported()
          public method to check is LAM enable/disable with F26/F24 commands supported by this module.Default implementation always return false; Modules implementations must override this methods if this command is supported.
 boolean isF8supported()
          public method to check is LAM by Q with F8 supported.
 boolean mustHaveQ(int F)
          By default module must return Q for any supported F if module is ready to execute it.
 boolean mustHaveX(int F)
          By default module must return X for any supported F.
 void removeLAMlistener(LAMlistener listener)
          Method to remove listener interested in LAMs from this module When last listener removed implementation disables LAM from this position.
protected  void setCrate(Crate c)
          setCrate reference for this module
 void setModuleName(java.lang.String name)
          Set module name
protected  void setN(int N)
          set position number of this module in Crate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Module

public Module()
Method Detail

addLAMlistener

public void addLAMlistener(LAMlistener listener)
                    throws java.io.IOException
Method to add listener interested in LAMs from this module Besides adding listener logicaly it enables LAM from this position executing enableLAM on this module. Do it once when first listener added.
Parameters:
listener - LAMlistener interested in LAMs from this module

removeLAMlistener

public void removeLAMlistener(LAMlistener listener)
                       throws java.io.IOException
Method to remove listener interested in LAMs from this module When last listener removed implementation disables LAM from this position.
Parameters:
listener - one to remove

fireLAM

protected void fireLAM()
Method called by CamacDriver when LAM from station at N occures. Deafualt implenetation dispatch LAMevent to all LAMListeners added to this module.

setN

protected void setN(int N)
set position number of this module in Crate.

getN

public int getN()
get position number of this module in Crate.

setCrate

protected void setCrate(Crate c)
setCrate reference for this module

getCrate

public Crate getCrate()
setCrate reference for this module

AF

public void AF(int A,
               int F,
               int[] data)
        throws java.io.IOException
execute A,F on this module with data as many times as length of data[] is. if data[] is null, NAF without data transfer will be executed once. Default implementation delegate this method to crate
Parameters:
A - CAMAC subaddress
F - CAMAC function to execute
data - data array to transfer. NAF will be executed as many times as data.length is. In case data is null NAF without data transfer will be executed once. For write operations data will be transfered from array to module. For read operations data read from CAMAC will be placed in this array. For CAMAC functions without data transfer, no transfer will be done.

AF

public void AF(int A,
               int F)
        throws java.io.IOException
Execute A,F on this module without data transfer. Default implementation delegate this method to crate
Parameters:
A - CAMAC subaddress
F - CAMAC function to execute

isF8supported

public boolean isF8supported()
public method to check is LAM by Q with F8 supported. Default implementation always return false. Actual modules implementations must override this methods if this command is supported.

isF24F26supported

public boolean isF24F26supported()
public method to check is LAM enable/disable with F26/F24 commands supported by this module.Default implementation always return false; Modules implementations must override this methods if this command is supported.

dataBits

public int dataBits()
Public method query Module for number of significant bits. This number can be used by CamacDriver implementations in order to optimize transfers. Default implementation suppose all 24 bits are required.

getModuleName

public java.lang.String getModuleName()
Get name for this module

setModuleName

public void setModuleName(java.lang.String name)
Set module name
Returns:
Module name

mustHaveQ

public boolean mustHaveQ(int F)
By default module must return Q for any supported F if module is ready to execute it. But some hardware can ignore this requirement, so if particular module do not return Q, returning false by this method for some F will suppress throwing exceptions when there is no Q for this function.

mustHaveX

public boolean mustHaveX(int F)
By default module must return X for any supported F. But some hardware can ignore this requirement, so if particular module do not return X , returning false by this method for some F will suppress throwing exceptions when there is no Q for this function.