public class Protocol extends IrpObject implements AggregateLister
NamedProtocol.
There are too many public functions in the API...
| Modifier and Type | Class and Description |
|---|---|
static class |
Protocol.ProtocolNotDecodableException
This exception is thrown when trying to decode with a Protocol that is not decodeable.
|
static class |
Protocol.ProtocolNotRenderableException
This exception is thrown when trying to render with a Protocol that is not renderable.
|
| Constructor and Description |
|---|
Protocol() |
Protocol(GeneralSpec generalSpec,
BitspecIrstream bitspecIrstream,
NameEngine definitions,
ParameterSpecs parameterSpecs) |
Protocol(GeneralSpec generalSpec,
BitspecIrstream bitspecIrstream,
NameEngine definitions,
ParameterSpecs parameterSpecs,
IrpParser.ProtocolContext parseTree) |
Protocol(GeneralSpec generalSpec,
BitspecIrstream bitspecIrstream,
NameEngine definitions,
ParameterSpecs parameterSpecs,
IrpParser.ProtocolContext parseTree,
Class<? extends AbstractDecoder> decoderClass) |
Protocol(IrpParser.ProtocolContext parseTree) |
Protocol(String irpString)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TreeSet<Double> |
allDurationsInMicros() |
protected void |
checkFrequency(Double frequency,
Decoder.DecoderParameters params) |
String |
classificationString() |
boolean |
constantNonEmptySequence(IrSignal.Pass pass) |
boolean |
constantSequence(IrSignal.Pass pass) |
boolean |
equals(Object obj) |
BitDirection |
getBitDirection() |
BitspecIrstream |
getBitspecIrstream() |
String |
getDecoderName() |
NameEngine |
getDefinitions() |
Double |
getDutyCycle() |
Double |
getFrequency() |
protected double |
getFrequencyWithDefault() |
GeneralSpec |
getGeneralSpec() |
String |
getIrp() |
(package private) long |
getMemoryVariable(String name) |
Expression |
getParameterDefault(String parameterName) |
long |
getParameterMax(String parameterName) |
long |
getParameterMin(String parameterName) |
protected ParameterSpecs |
getParameterSpecs() |
double |
getUnit() |
Integer |
guessParameterLength(String name) |
boolean |
hasExtent() |
int |
hashCode() |
(package private) boolean |
hasMemoryVariable(String name) |
boolean |
hasNonStandardParameters() |
boolean |
hasParameter(String name) |
boolean |
hasParameterDefault(String name) |
boolean |
hasParameterMemory(String parameterName) |
boolean |
hasVariation() |
boolean |
interleavingFlashOk() |
boolean |
interleavingGapOk() |
boolean |
interleavingOk() |
boolean |
isBiphase() |
boolean |
isEmpty(IrSignal.Pass pass) |
(package private) boolean |
isPWM16() |
boolean |
isPWM2() |
boolean |
isPWM4() |
boolean |
isRPlus() |
boolean |
isSonyType()
A protocol is Sonytype if it is PWM2 with different flashes, and has interleaving flashes.
|
boolean |
isTrivial() |
boolean |
isTrivial(boolean inverted) |
double |
minDurationDiff() |
boolean |
nonConstantBitFieldLength() |
BareIrStream |
normalBareIrStream(IrSignal.Pass pass) |
Protocol |
normalForm(IrSignal.Pass pass) |
Element |
normalFormElement(Document document) |
String |
normalFormIrpString(int radix) |
Protocol |
normalFormProtocol() |
int |
numberOfInfiniteRepeats() |
Map<String,Object> |
propertiesMap(GeneralSpec generalSpec,
NameEngine nameEngine) |
Map<String,Long> |
randomParameters() |
Map<String,Long> |
randomParameters(Random random) |
Map<String,Long> |
recognize(IrSignal irSignal) |
Map<String,Long> |
recognize(IrSignal irSignal,
boolean strict) |
Map<String,Long> |
recognize(IrSignal irSignal,
boolean strict,
double frequencyTolerance,
double absoluteTolerance,
double relativeTolerance,
double minimumLeadout)
Tries to match the IrSignal in the argument.If it matches, return the matching parametewith the found parameters with their actual values.If no match, throws a SignalRecognitionException.
|
Map<String,Long> |
recognize(IrSignal irSignal,
Decoder.DecoderParameters parameters) |
Decoder.Decode |
recognize(ModulatedIrSequence irSequence,
boolean rejectNoRepeats,
boolean strict) |
Decoder.Decode |
recognize(ModulatedIrSequence irSequence,
int beginPos,
boolean rejectNoRepeats,
Decoder.DecoderParameters params)
Tries to match the ModulatedIrSequence in the argument, if match, return the matching parameters.
|
void |
removeDefaulteds(Map<String,Long> params) |
boolean |
startsWithFlash() |
Protocol |
substituteConstantVariables()
Returns a Protocol with all of the variables which are constant
literals in the Definitions replaced by their values.
|
Element |
toElement(Document document) |
String |
toIrpString(int radix) |
String |
toIrpString(int radix,
boolean usePeriods) |
String |
toIrpString(int radix,
boolean usePeriods,
boolean tsvOptimized) |
String |
toIrpString(int radix,
boolean usePeriods,
String separator) |
IrSignal |
toIrSignal(Map<String,Long> params) |
IrSignal |
toIrSignal(NameEngine nameEngine) |
ModulatedIrSequence |
toModulatedIrSequence(NameEngine nameEngine,
IrSignal.Pass pass) |
String |
toStringTree() |
org.antlr.v4.gui.TreeViewer |
toTreeViewer() |
String |
warningFrequency() |
String |
warningNonConstantLengthBitFields() |
String |
warningNoParameterSpecs() |
String |
warningRepeatPlus() |
String |
warningsInterleaving() |
String |
warningsString()
This is sort-of a version of classificationString, but for another audience.
|
String |
warningStartsWithFlash() |
String |
warningTrivialBitspec() |
int |
weight()
Returns a (somewhat arbitrary) measure of the complexity of the object.
|
getParseTree, numberOfBits, numberOfBitSpecs, prerender, propertiesMap, stateWhenEntering, stateWhenExiting, toDocument, toIrpString, toString, toStringTree, toStringTree, toTreeViewer, toTreeViewer, toTreeViewerpublic Protocol(GeneralSpec generalSpec, BitspecIrstream bitspecIrstream, NameEngine definitions, ParameterSpecs parameterSpecs)
public Protocol(GeneralSpec generalSpec, BitspecIrstream bitspecIrstream, NameEngine definitions, ParameterSpecs parameterSpecs, IrpParser.ProtocolContext parseTree)
public Protocol(GeneralSpec generalSpec, BitspecIrstream bitspecIrstream, NameEngine definitions, ParameterSpecs parameterSpecs, IrpParser.ProtocolContext parseTree, Class<? extends AbstractDecoder> decoderClass)
public Protocol()
public Protocol(String irpString) throws UnsupportedRepeatException, NameUnassignedException, InvalidNameException, IrpInvalidArgumentException
irpString - InvalidNameExceptionNameUnassignedExceptionUnsupportedRepeatExceptionIrpInvalidArgumentExceptionpublic Protocol(IrpParser.ProtocolContext parseTree) throws UnsupportedRepeatException, NameUnassignedException, InvalidNameException, IrpInvalidArgumentException
public String getDecoderName()
public String toStringTree()
public org.antlr.v4.gui.TreeViewer toTreeViewer()
public boolean constantSequence(IrSignal.Pass pass)
public boolean constantNonEmptySequence(IrSignal.Pass pass)
public Protocol substituteConstantVariables()
public Protocol normalFormProtocol()
public Protocol normalForm(IrSignal.Pass pass)
public BareIrStream normalBareIrStream(IrSignal.Pass pass)
public boolean isEmpty(IrSignal.Pass pass)
public String normalFormIrpString(int radix)
public IrSignal toIrSignal(NameEngine nameEngine) throws DomainViolationException, NameUnassignedException, IrpInvalidArgumentException, InvalidNameException
nameEngine; - may be changedArithmeticExceptionNameUnassignedExceptionIrpInvalidArgumentExceptionInvalidNameExceptionDomainViolationExceptionpublic IrSignal toIrSignal(Map<String,Long> params) throws DomainViolationException, NameUnassignedException, IrpInvalidArgumentException, InvalidNameException
public ModulatedIrSequence toModulatedIrSequence(NameEngine nameEngine, IrSignal.Pass pass) throws NameUnassignedException, IrpInvalidArgumentException
nameEngine, - NameEngine, may be altered.pass - NameUnassignedExceptionIrpInvalidArgumentExceptionpublic int numberOfInfiniteRepeats()
numberOfInfiniteRepeats in class IrpObjectpublic String getIrp()
public BitDirection getBitDirection()
public Double getFrequency()
protected double getFrequencyWithDefault()
public double getUnit()
public Double getDutyCycle()
long getMemoryVariable(String name) throws NameUnassignedException
NameUnassignedExceptionboolean hasMemoryVariable(String name)
public boolean isPWM2()
public boolean isPWM4()
boolean isPWM16()
public boolean isBiphase()
public boolean isTrivial(boolean inverted)
public boolean isTrivial()
public boolean interleavingOk()
public boolean interleavingFlashOk()
public boolean interleavingGapOk()
public boolean isSonyType()
public boolean isRPlus()
public boolean startsWithFlash()
public boolean hasVariation()
public boolean hasExtent()
public BitspecIrstream getBitspecIrstream()
public String toIrpString(int radix)
toIrpString in class IrpObjectpublic String toIrpString(int radix, boolean usePeriods)
public String toIrpString(int radix, boolean usePeriods, boolean tsvOptimized)
public Map<String,Long> recognize(IrSignal irSignal) throws SignalRecognitionException, Protocol.ProtocolNotDecodableException
public Map<String,Long> recognize(IrSignal irSignal, boolean strict) throws SignalRecognitionException, Protocol.ProtocolNotDecodableException
public Map<String,Long> recognize(IrSignal irSignal, boolean strict, double frequencyTolerance, double absoluteTolerance, double relativeTolerance, double minimumLeadout) throws SignalRecognitionException, Protocol.ProtocolNotDecodableException
irSignal - IrSignal to test against the present protocol.strict - Do not allow matching intro as repeat.frequencyTolerance - absoluteTolerance - relativeTolerance - minimumLeadout - SignalRecognitionException - if the IrSignal did not match the present protocol.Protocol.ProtocolNotDecodableExceptionpublic Map<String,Long> recognize(IrSignal irSignal, Decoder.DecoderParameters parameters) throws SignalRecognitionException, Protocol.ProtocolNotDecodableException
public Decoder.Decode recognize(ModulatedIrSequence irSequence, boolean rejectNoRepeats, boolean strict) throws SignalRecognitionException
SignalRecognitionExceptionpublic Decoder.Decode recognize(ModulatedIrSequence irSequence, int beginPos, boolean rejectNoRepeats, Decoder.DecoderParameters params) throws SignalRecognitionException
irSequence - ModulatedIrSequence to be matchedbeginPos - Where the match is supposed to start, normally 0.rejectNoRepeats - If true, at least one repeat sequence must be matched in the sequence given.params - SignalRecognitionExceptionprotected void checkFrequency(Double frequency, Decoder.DecoderParameters params) throws SignalRecognitionException
SignalRecognitionExceptionpublic int weight()
IrpObjectpublic GeneralSpec getGeneralSpec()
protected ParameterSpecs getParameterSpecs()
public NameEngine getDefinitions()
public String classificationString()
public String warningsString()
public String warningFrequency()
public String warningStartsWithFlash()
public String warningTrivialBitspec()
public String warningRepeatPlus()
public String warningsInterleaving()
public String warningNonConstantLengthBitFields()
public String warningNoParameterSpecs()
public Map<String,Object> propertiesMap(GeneralSpec generalSpec, NameEngine nameEngine)
propertiesMap in interface AggregateListerpublic boolean nonConstantBitFieldLength()
public double minDurationDiff()
public boolean hasParameter(String name)
public boolean hasParameterDefault(String name)
public boolean hasParameterMemory(String parameterName)
public Expression getParameterDefault(String parameterName)
public long getParameterMax(String parameterName)
public long getParameterMin(String parameterName)
public boolean hasNonStandardParameters()
Copyright © 2019. All rights reserved.