public class SimpleProcessImage extends Object implements ProcessImageImplementation
The image has a simple linear address space for, analog, digital and file objects. Holes may be created by adding a object with a reference after the last object reference of that type.
DIG_FALSE, DIG_INVALID, DIG_TRUE| Constructor and Description |
|---|
SimpleProcessImage()
Constructs a new SimpleProcessImage instance.
|
SimpleProcessImage(int unit)
Constructs a new SimpleProcessImage instance having a
(potentially) non-zero unit ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDigitalIn(DigitalIn di)
Adds a new DigitalIn instance.
|
void |
addDigitalIn(int ref,
DigitalIn d1)
Adds a new DigitalIn instance at the given reference, possibly
creating a hole between the last existing reference and the new object.
|
void |
addDigitalOut(DigitalOut out)
Adds a new DigitalOut instance.
|
void |
addDigitalOut(int ref,
DigitalOut dout)
Adds a new DigitalOut instance at the given reference.
|
void |
addFIFO(FIFO fifo)
Adds a new FIFO instance.
|
void |
addFIFO(int ref,
FIFO newFIFO)
Adds a new FIFO instance, possibly
creating a hole between the last existing reference and the new object.
|
void |
addFile(File newFile)
Adds a new File instance.
|
void |
addFile(int ref,
File newFile)
Adds a new File instance, possibly
creating a hole between the last existing reference and the new object.
|
void |
addInputRegister(InputRegister reg)
Adds a new InputRegister instance.
|
void |
addInputRegister(int ref,
InputRegister inReg)
Adds a new InputRegister instance, possibly
creating a hole between the last existing reference and the new object.
|
void |
addRegister(int ref,
Register reg)
Adds a new Register instance, possibly
creating a hole between the last existing reference and the new object.
|
void |
addRegister(Register reg)
Adds a new Register instance.
|
DigitalIn |
getDigitalIn(int ref)
Returns the DigitalIn instance at the given reference.
|
int |
getDigitalInCount()
Returns the number of DigitalIn instances in this
ProcessImage.
|
DigitalIn[] |
getDigitalInRange(int ref,
int count)
Returns a range of DigitalIn instances.
|
DigitalOut |
getDigitalOut(int ref)
Returns the DigitalOut instance at the given reference.
|
int |
getDigitalOutCount()
Returns the number of DigitalOut instances in this
ProcessImage.
|
DigitalOut[] |
getDigitalOutRange(int ref,
int count)
Returns a range of DigitalOut instances.
|
FIFO |
getFIFO(int fifoNumber)
Returns the FIFO instance in the list of all FIFO objects
in this ProcessImage.
|
FIFO |
getFIFOByAddress(int ref)
Returns the FIFO instance having the specified base address.
|
int |
getFIFOCount()
Returns the number of File instances in this
ProcessImage.
|
File |
getFile(int fileNumber)
Returns the File instance at the given reference.
|
File |
getFileByNumber(int ref)
Returns the File instance having the specified file number.
|
int |
getFileCount()
Returns the number of File instances in this
ProcessImage.
|
InputRegister |
getInputRegister(int ref)
Returns the InputRegister instance at the given reference.
|
int |
getInputRegisterCount()
Returns the number of InputRegister instances in this
ProcessImage.
|
InputRegister[] |
getInputRegisterRange(int ref,
int count)
Returns a range of InputRegister instances.
|
Register |
getRegister(int ref)
Returns the Register instance at the given reference.
|
int |
getRegisterCount()
Returns the number of Register instances in this
ProcessImage.
|
Register[] |
getRegisterRange(int ref,
int count)
Returns a range of Register instances.
|
int |
getUnitID() |
boolean |
isLocked()
The process image is locked to prevent changes.
|
void |
removeDigitalIn(DigitalIn di)
Removes a given DigitalIn instance.
|
void |
removeDigitalOut(DigitalOut out)
Removes a given DigitalOut instance.
|
void |
removeFIFO(FIFO oldFIFO)
Removes a given FIFO instance.
|
void |
removeFile(File oldFile)
Removes a given File instance.
|
void |
removeInputRegister(InputRegister reg)
Removes a given InputRegister instance.
|
void |
removeRegister(Register reg)
Removes a given Register instance.
|
void |
setDigitalIn(int ref,
DigitalIn di)
Sets a new DigitalIn instance at the given reference.
|
void |
setDigitalOut(int ref,
DigitalOut out)
Sets a new DigitalOut instance at the given reference.
|
void |
setFIFO(int fifoNumber,
FIFO fifo)
Sets a new FIFO instance at the given reference.
|
void |
setFile(int fileNumber,
File file)
Sets a new File instance at the given reference.
|
void |
setInputRegister(int ref,
InputRegister reg)
Sets a new InputRegister instance at the given reference.
|
boolean |
setLocked(boolean locked)
setLocked -- lock or unlock the process image.
|
void |
setRegister(int ref,
Register reg)
Sets a new Register instance at the given reference.
|
public SimpleProcessImage()
public SimpleProcessImage(int unit)
unit - Unit ID of this imagepublic boolean isLocked()
public boolean setLocked(boolean locked)
Compatability Note: jamod did not enforce this restriction, so it is being handled in a way which is backwards compatible. If you wish to determine if you acquired the lock, check the return value. If your code is still based on the jamod paradigm, you will ignore the return value and your code will function as before.
locked - True if the image is to be lockedpublic int getUnitID()
public DigitalOut[] getDigitalOutRange(int ref, int count)
ProcessImagegetDigitalOutRange in interface ProcessImageref - the start offset.count - the amount of DigitalOut from the offset.public DigitalOut getDigitalOut(int ref) throws IllegalAddressException
ProcessImagegetDigitalOut in interface ProcessImageref - the reference.IllegalAddressException - if the reference is invalid.public int getDigitalOutCount()
ProcessImagegetDigitalOutCount in interface ProcessImagepublic DigitalIn[] getDigitalInRange(int ref, int count)
ProcessImagegetDigitalInRange in interface ProcessImageref - the start offset.count - the amount of DigitalIn from the offset.public DigitalIn getDigitalIn(int ref) throws IllegalAddressException
ProcessImagegetDigitalIn in interface ProcessImageref - the reference.IllegalAddressException - if the reference is invalid.public int getDigitalInCount()
ProcessImagegetDigitalInCount in interface ProcessImagepublic InputRegister[] getInputRegisterRange(int ref, int count)
ProcessImagegetInputRegisterRange in interface ProcessImageref - the start offset.count - the amount of InputRegister from the offset.public InputRegister getInputRegister(int ref) throws IllegalAddressException
ProcessImagegetInputRegister in interface ProcessImageref - the reference.IllegalAddressException - if the reference is invalid.public int getInputRegisterCount()
ProcessImageThis is not the same as the value of the highest addressable register.
getInputRegisterCount in interface ProcessImagepublic Register[] getRegisterRange(int ref, int count)
ProcessImagegetRegisterRange in interface ProcessImageref - the start offset.count - the amount of Register from the offset.public Register getRegister(int ref) throws IllegalAddressException
ProcessImagegetRegister in interface ProcessImageref - the reference.IllegalAddressException - if the reference is invalid.public int getRegisterCount()
ProcessImageThis is not the same as the value of the highest addressable register.
getRegisterCount in interface ProcessImagepublic File getFile(int fileNumber)
ProcessImagegetFile in interface ProcessImagefileNumber - the reference.public File getFileByNumber(int ref)
ProcessImagegetFileByNumber in interface ProcessImageref - The file number for the File object to be returned.public int getFileCount()
ProcessImageThis is not the same as the value of the highest addressable register.
getFileCount in interface ProcessImagepublic FIFO getFIFO(int fifoNumber)
ProcessImagegetFIFO in interface ProcessImagefifoNumber - the reference.public FIFO getFIFOByAddress(int ref)
ProcessImagegetFIFOByAddress in interface ProcessImageref - The address for the FIFO object to be returned.public int getFIFOCount()
ProcessImageThis is not the same as the value of the highest addressable register.
getFIFOCount in interface ProcessImagepublic void setDigitalOut(int ref,
DigitalOut out)
throws IllegalAddressException
ProcessImageImplementationsetDigitalOut in interface ProcessImageImplementationref - the reference as int.out - the new DigitalOut instance to be set.IllegalAddressException - if the reference is invalid.public void addDigitalOut(DigitalOut out)
ProcessImageImplementationaddDigitalOut in interface ProcessImageImplementationout - the DigitalOut instance to be added.public void addDigitalOut(int ref,
DigitalOut dout)
ProcessImageImplementationaddDigitalOut in interface ProcessImageImplementationref - - the reference for the instance.dout - - the DigitalOut instance to be added.public void removeDigitalOut(DigitalOut out)
ProcessImageImplementationremoveDigitalOut in interface ProcessImageImplementationout - the DigitalOut instance to be removed.public void setDigitalIn(int ref,
DigitalIn di)
throws IllegalAddressException
ProcessImageImplementationsetDigitalIn in interface ProcessImageImplementationref - the reference as int.di - the new DigitalIn instance to be set.IllegalAddressException - if the reference is invalid.public void addDigitalIn(DigitalIn di)
ProcessImageImplementationaddDigitalIn in interface ProcessImageImplementationdi - the DigitalIn instance to be added.public void addDigitalIn(int ref,
DigitalIn d1)
ProcessImageImplementationaddDigitalIn in interface ProcessImageImplementationref - - the reference for the new instance.d1 - the DigitalIn instance to be added.public void removeDigitalIn(DigitalIn di)
ProcessImageImplementationremoveDigitalIn in interface ProcessImageImplementationdi - the DigitalIn instance to be removed.public void setInputRegister(int ref,
InputRegister reg)
throws IllegalAddressException
ProcessImageImplementationsetInputRegister in interface ProcessImageImplementationref - the reference as int.reg - the new InputRegister instance to be set.IllegalAddressException - if the reference is invalid.public void addInputRegister(InputRegister reg)
ProcessImageImplementationaddInputRegister in interface ProcessImageImplementationreg - the InputRegister instance to be added.public void addInputRegister(int ref,
InputRegister inReg)
ProcessImageImplementationaddInputRegister in interface ProcessImageImplementationref - - The reference for the new instance.inReg - the InputRegister instance to be added.public void removeInputRegister(InputRegister reg)
ProcessImageImplementationremoveInputRegister in interface ProcessImageImplementationreg - the InputRegister instance to be removed.public void setRegister(int ref,
Register reg)
throws IllegalAddressException
ProcessImageImplementationsetRegister in interface ProcessImageImplementationref - the reference as int.reg - the new Register instance to be set.IllegalAddressException - if the reference is invalid.public void addRegister(Register reg)
ProcessImageImplementationaddRegister in interface ProcessImageImplementationreg - the Register instance to be added.public void addRegister(int ref,
Register reg)
ProcessImageImplementationaddRegister in interface ProcessImageImplementationref - - the reference for the new instance.reg - the Register instance to be added.public void removeRegister(Register reg)
ProcessImageImplementationremoveRegister in interface ProcessImageImplementationreg - the Register instance to be removed.public void setFile(int fileNumber,
File file)
ProcessImageImplementationsetFile in interface ProcessImageImplementationfileNumber - the reference as int.file - the new File instance to be set.public void addFile(File newFile)
ProcessImageImplementationaddFile in interface ProcessImageImplementationnewFile - the File instance to be added.public void addFile(int ref,
File newFile)
ProcessImageImplementationaddFile in interface ProcessImageImplementationref - - the reference for the new isntance.newFile - the File instance to be added.public void removeFile(File oldFile)
ProcessImageImplementationremoveFile in interface ProcessImageImplementationoldFile - the File instance to be removed.public void setFIFO(int fifoNumber,
FIFO fifo)
ProcessImageImplementationsetFIFO in interface ProcessImageImplementationfifoNumber - the reference as int.fifo - the new FIFO instance to be set.public void addFIFO(FIFO fifo)
ProcessImageImplementationaddFIFO in interface ProcessImageImplementationfifo - the FIFO instance to be added.public void addFIFO(int ref,
FIFO newFIFO)
ProcessImageImplementationaddFIFO in interface ProcessImageImplementationref - - the reference for the new instance.newFIFO - the FIFO instance to be added.public void removeFIFO(FIFO oldFIFO)
ProcessImageImplementationremoveFIFO in interface ProcessImageImplementationoldFIFO - the FIFO instance to be removed.Copyright © 2025. All Rights Reserved.