public class Command extends Object implements Serializable
Some protocols have toggles, a persistant variable that changes between invocations. If a such a protocol is used, there are two cases
The member functions of class may throw IrpMasterExceptions when they encounter erroneous data. The other classes in the package may not; they should just ignore individual unparseable commands.
Modifier and Type | Class and Description |
---|---|
static interface |
Command.CommandTextFormat
An implementation of this interface describes a way to format an IrSignal to a text string.
|
static class |
Command.MasterType
This describes which representation of a Command constitutes the master,
from which the other representations are derived.
|
Constructor and Description |
---|
Command(Element element,
String inheritProtocol,
HashMap<String,Long> inheritParameters)
This constructor is for importing from the Element as first argument.
|
Command(String name) |
Command(String name,
String comment,
IrSignal irSignal)
Construct a Command from an IrSignal, i.e. timing data.
|
Command(String name,
String comment,
String ccf)
Construct a Command from CCF form.
|
Command(String name,
String comment,
String protocolName,
HashMap<String,Long> parameters)
Construct a Command from protocolName and parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addFormat(Command.CommandTextFormat format,
int repeatCount)
Add an extra format to the Command.
|
void |
addFormat(String name,
String value) |
String |
getCcf()
Returns the CCF (Pronto Hex) version of the first signal.
|
String |
getCcf(int T) |
String |
getComment() |
double |
getDutyCycle() |
String |
getEnding()
Returns the first ending sequence.
|
String |
getEnding(int T) |
String |
getFormat(String name)
Returns an "other" format, identified by its name.
|
double |
getFrequency() |
String |
getIntro()
Returns the first intro sequence.
|
String |
getIntro(int T) |
Command.MasterType |
getMasterType() |
String |
getName() |
String |
getNotes() |
Collection<String> |
getOtherFormats() |
HashMap<String,Long> |
getParameters() |
String |
getProtocolName() |
String |
getRepeat()
Returns the first repeat sequence.
|
String |
getRepeat(int T) |
String |
nameProtocolParameterString() |
int |
numberOfToggleValues()
Returns the number of possible values of the toggle variable.
|
String |
prettyValueString() |
static void |
setIrpMaster(IrpMaster newIrpMaster)
Sets an global IrpMaster instance, which will be used in subsequent transformations from parameter format.
|
static void |
setIrpMaster(String irpProtocolsIniPath)
Creates and sets an global IrpMaster instance, which will be used in subsequent transformations from parameter format.
|
IrSignal |
toIrSignal()
Returns the IrSignal of the Command.
|
IrSignal |
toIrSignal(int T)
Returns the IrSignal of the Command.
|
String |
toPrintString() |
String |
toString() |
Element |
xmlExport(Document doc,
String title,
boolean fatRaw,
boolean generateRaw,
boolean generateCcf,
boolean generateParameters)
XMLExport of the Command.
|
public Command(Element element, String inheritProtocol, HashMap<String,Long> inheritParameters) throws ParseException, IrpMasterException
element
- inheritProtocol
- inheritParameters
- ParseException
IrpMasterException
public Command(String name, String comment, IrSignal irSignal)
name
- Name of commandcomment
- textual commentirSignal
- IrSignalpublic Command(String name, String comment, String protocolName, HashMap<String,Long> parameters) throws IrpMasterException
name
- comment
- protocolName
- parameters
- IrpMasterException
public Command(String name, String comment, String ccf) throws IrpMasterException
name
- comment
- ccf
- IrpMasterException
public Command(String name)
public static void setIrpMaster(IrpMaster newIrpMaster)
newIrpMaster
- IrpMaster instancepublic static void setIrpMaster(String irpProtocolsIniPath) throws IOException, IncompatibleArgumentException
irpProtocolsIniPath
- IOException
IncompatibleArgumentException
public double getDutyCycle()
public String getComment()
public String getNotes()
public Command.MasterType getMasterType()
public String getName()
public String getProtocolName() throws IrpMasterException
IrpMasterException
public HashMap<String,Long> getParameters() throws IrpMasterException
IrpMasterException
public double getFrequency()
public String getIntro() throws IrpMasterException
IrpMasterException
public String getIntro(int T) throws IrpMasterException
T
- toggle valueIrpMasterException
public String getRepeat() throws IrpMasterException
IrpMasterException
public String getRepeat(int T) throws IrpMasterException
T
- toggle valueIrpMasterException
public String getEnding() throws IrpMasterException
IrpMasterException
public String getEnding(int T) throws IrpMasterException
T
- toggle valueIrpMasterException
public String getCcf() throws IrpMasterException
IrpMasterException
public String getCcf(int T) throws IrpMasterException
T
- toggle valueIrpMasterException
public Collection<String> getOtherFormats()
public String getFormat(String name)
name
- format namepublic IrSignal toIrSignal() throws IrpMasterException
IrpMasterException
public IrSignal toIrSignal(int T) throws IrpMasterException
T
- toggle valueIrpMasterException
public String nameProtocolParameterString()
public String prettyValueString()
public String toPrintString() throws IrpMasterException
IrpMasterException
public int numberOfToggleValues()
public void addFormat(Command.CommandTextFormat format, int repeatCount) throws IrpMasterException
format
- repeatCount
- IrpMasterException
public Element xmlExport(Document doc, String title, boolean fatRaw, boolean generateRaw, boolean generateCcf, boolean generateParameters)
doc
- title
- fatRaw
- generateRaw
- generateCcf
- generateParameters
- Copyright © 2016. All rights reserved.