Skip to content

Commit

Permalink
Normal-form-IRP now uses +, not *. Resolves #245.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengtmartensson committed Dec 10, 2023
1 parent 3b8a3ac commit 79d3513
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/harctoolbox/irp/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ private void checkSanity() throws UnsupportedRepeatException {
public Protocol normalFormProtocol() {
List<IrStreamItem> list = new ArrayList<>(1);
list.add(normalFormVariation);
return mkProtocol(new BareIrStream(list));
return mkProtocolFromNormalFormVariation(new BareIrStream(list));
}

public Protocol normalForm(IrSignal.Pass pass) {
return mkProtocol(normalFormVariation.select(pass));
return mkProtocolFromNormalFormVariation(normalFormVariation.select(pass));
}

public BareIrStream normalBareIrStream(IrSignal.Pass pass) {
Expand All @@ -284,8 +284,8 @@ public boolean isEmpty(IrSignal.Pass pass) {
return normalFormVariation.select(pass).isEmpty();
}

private Protocol mkProtocol(BareIrStream bareIrStream) {
IrStream irStream = new IrStream(bareIrStream, RepeatMarker.newRepeatMarker('*'));
private Protocol mkProtocolFromNormalFormVariation(BareIrStream bareIrStream) {
IrStream irStream = new IrStream(bareIrStream, RepeatMarker.newRepeatMarker('+'));
BitspecIrstream normalBitspecIrstream = new BitspecIrstream(bitspecIrstream.getBitSpec(), irStream);
return new Protocol(generalSpec, normalBitspecIrstream, definitions, parameterSpecs, null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/harctoolbox/irp/IrpDatabaseNGTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testGetNormalFormIrp() throws Exception {
System.out.println("getNormalFormIrp");
String protocolName = "CanalSat";
int radix = 10;
String expResult = "{55.5k,250,msb}<-1,1|1,-1>([T=0,1,-1,D:7,S:6,T:1,0:1,F:7,-89m,T=1][1,-1,D:7,S:6,T:1,0:1,F:7,-89m,T=1])*[D:0..127,S:0..63,F:0..127]";
String expResult = "{55.5k,250,msb}<-1,1|1,-1>([T=0,1,-1,D:7,S:6,T:1,0:1,F:7,-89m,T=1][1,-1,D:7,S:6,T:1,0:1,F:7,-89m,T=1])+[D:0..127,S:0..63,F:0..127]";
String result = instance.getNormalFormIrp(protocolName, radix);
assertEquals(result, expResult);
}
Expand Down

0 comments on commit 79d3513

Please sign in to comment.