public class Command extends Object implements Serializable
| 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.
|
| 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,
String comment,
IrSignal irSignal) |
Command(String name,
String comment,
IrSignal irSignal,
boolean generateCcf,
boolean decode)
Construct a Command from an IrSignal, i.e.
|
Command(String name,
String comment,
String ccf,
boolean generateRaw,
boolean decode)
Construct a Command from CCF form.
|
Command(String name,
String comment,
String protocol,
HashMap<String,Long> parameters)
Construct a Command from protocol and parameters.
|
Command(String name,
String comment,
String protocol,
HashMap<String,Long> parameters,
IrpMaster irpMaster,
boolean generateRaw,
boolean generateCcf)
Construct a Command from protocol and parameters.
|
Command(String name,
String comment,
String protocol,
HashMap<String,Long> parameters,
String protocolIniPath,
boolean generateRaw,
boolean generateCcf)
Convenience version of the constructor with IrpMaster.
|
| 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) |
static ModulatedIrSequence |
appendAsSequence(Collection<Command> commands) |
void |
checkForCcf() |
void |
checkForParameters()
Tries to decode the signals, unless parameters already are present.
|
void |
checkForRaw() |
String |
getCcf() |
String |
getComment() |
double |
getDutyCycle() |
String |
getEnding() |
String |
getFormat(String name)
Returns an "other" format, identified by its name.
|
int |
getFrequency() |
String |
getIntro() |
Command.MasterType |
getMasterType() |
String |
getName() |
String |
getNotes() |
Collection<String> |
getOtherFormats() |
HashMap<String,Long> |
getParameters() |
String |
getProtocol() |
String |
getRepeat() |
static void |
main(String[] args)
Just for testing, not for deployment.
|
String |
nameProtocolParameterString() |
String |
prettyValueString() |
static void |
setIrpMaster(IrpMaster newIrpMaster)
Sets an IrpMaster instance, which will be used in subsequent transformations from parameter format.
|
static HashMap<String,Command> |
toHashMap(Command command) |
IrSignal |
toIrSignal()
Returns the IrSignal of the Command.
|
ModulatedIrSequence |
toModulatedIrSequence(int noRepetitions) |
String |
toPrintString() |
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 - ParseExceptionIrpMasterExceptionpublic Command(String name, String comment, IrSignal irSignal, boolean generateCcf, boolean decode)
name - Name of commandcomment - textual commentirSignal - IrSignalgenerateCcf - generate the CCF form, if not already present.decode - invoke decoding.public Command(String name, String comment, String protocol, HashMap<String,Long> parameters) throws IrpMasterException
name - comment - protocol - parameters - IrpMasterExceptionpublic Command(String name, String comment, String protocol, HashMap<String,Long> parameters, IrpMaster irpMaster, boolean generateRaw, boolean generateCcf) throws IrpMasterException
name - comment - protocol - parameters - irpMaster - generateRaw - generateCcf - IrpMasterExceptionpublic Command(String name, String comment, String protocol, HashMap<String,Long> parameters, String protocolIniPath, boolean generateRaw, boolean generateCcf) throws FileNotFoundException, IrpMasterException
name - comment - protocol - parameters - protocolIniPath - generateRaw - generateCcf - FileNotFoundExceptionIrpMasterExceptionpublic Command(String name, String comment, String ccf, boolean generateRaw, boolean decode) throws IrpMasterException
name - comment - ccf - generateRaw - decode - IrpMasterExceptionpublic static void setIrpMaster(IrpMaster newIrpMaster)
newIrpMaster - public double getDutyCycle()
public String getComment()
public String getNotes()
public Command.MasterType getMasterType()
public String getName()
public String getProtocol()
public int getFrequency()
public String getIntro()
public String getRepeat()
public String getEnding()
public String getCcf()
public Collection<String> getOtherFormats()
public String getFormat(String name)
name - public IrSignal toIrSignal() throws IrpMasterException
IrpMasterExceptionpublic ModulatedIrSequence toModulatedIrSequence(int noRepetitions) throws IrpMasterException
IrpMasterExceptionpublic static ModulatedIrSequence appendAsSequence(Collection<Command> commands) throws IrpMasterException
IrpMasterExceptionpublic String nameProtocolParameterString()
public String prettyValueString()
public String toPrintString() throws IrpMasterException
IrpMasterExceptionpublic void checkForParameters()
throws IrpMasterException
IrpMasterExceptionpublic void checkForRaw()
throws IrpMasterException
IrpMasterExceptionpublic void checkForCcf()
throws IrpMasterException
IrpMasterExceptionpublic void addFormat(Command.CommandTextFormat format, int repeatCount) throws IrpMasterException
format - repeatCount - IrpMasterExceptionpublic Element xmlExport(Document doc, String title, boolean fatRaw, boolean generateRaw, boolean generateCcf, boolean generateParameters) throws IrpMasterException
doc - title - fatRaw - generateRaw - generateCcf - generateParameters - IrpMasterExceptionpublic static void main(String[] args)
args - Copyright © 2015. All rights reserved.