Commit df5cf35f authored by Ludovic Apvrille's avatar Ludovic Apvrille

Adding info on channels and event type in XML generated from TML diags

parent c03f0f28
......@@ -37,8 +37,6 @@
*/
package tmltranslator;
import java.util.ArrayList;
......@@ -47,19 +45,20 @@ import java.util.ArrayList;
/**
* Class TMLReadChannel
* Creation: 23/11/2005
* @version 1.1 18/02/2015
*
* @author Ludovic APVRILLE
* @version 1.1 18/02/2015
*/
public class TMLActivityElementChannel extends TMLActivityElement {
protected ArrayList<TMLChannel> channels;
protected String nbOfSamples;
private boolean isAttacker;
protected boolean isEncForm; //If the Cryptographic
private boolean isAttacker;
protected boolean isEncForm; //If the Cryptographic
public TMLActivityElementChannel(String _name, Object _referenceObject) {
super(_name, _referenceObject);
channels = new ArrayList<TMLChannel>();
isAttacker=false;
isAttacker = false;
}
public void addChannel(TMLChannel _channel) {
......@@ -74,13 +73,13 @@ public class TMLActivityElementChannel extends TMLActivityElement {
return channels.get(_index);
}
public boolean isAttacker(){
return isAttacker;
}
public boolean isAttacker() {
return isAttacker;
}
public void setAttacker(boolean attacker){
isAttacker=attacker;
}
public void setAttacker(boolean attacker) {
isAttacker = attacker;
}
public void setNbOfSamples(String _nbOfSamples) {
nbOfSamples = _nbOfSamples;
......@@ -89,14 +88,15 @@ public class TMLActivityElementChannel extends TMLActivityElement {
public String getNbOfSamples() {
return nbOfSamples;
}
public boolean getEncForm(){
return isEncForm;
public boolean getEncForm() {
return isEncForm;
}
public void setEncForm(boolean form) {
isEncForm = form;
}
public void setEncForm(boolean form){
isEncForm = form;
}
public void replaceChannelWith(TMLChannel oldChan, TMLChannel newChan) {
if (channels.contains(oldChan)) {
channels.remove(oldChan);
......@@ -105,12 +105,15 @@ public class TMLActivityElementChannel extends TMLActivityElement {
}
public String customExtraToXML() {
String s= " nbOfSamples=\"" + nbOfSamples +"\" " ;
String chan= "";
for(TMLChannel ch: channels) {
chan += ch.getName() + " ";
}
s += " channels=\"" + chan + "\" ";
return s;
String s = " nbOfSamples=\"" + nbOfSamples + "\" ";
String chan = "";
String chanType = "0";
for (TMLChannel ch : channels) {
chan += ch.getName() + " ";
chanType = "" + ch.getType();
}
s += " channels=\"" + chan + "\" ";
s += " type=\"" + chanType + "\" ";
return s;
}
}
......@@ -61,7 +61,9 @@ public class TMLSendEvent extends TMLActivityElementEvent {
}
public String customExtraToXML() {
return " event=\"" + event.getName() + "\" params=\"" + getAllParams() + "\" ";
String ret = " event=\"" + event.getName() + "\" params=\"" + getAllParams() + "\" ";
ret += " blocking=\"" + event.isBlocking() + "\" ";
return ret;
}
......
......@@ -46,7 +46,7 @@ package tmltranslator;
/**
* Class TMLWaitEvent
* Creation: 23/11/2005
* @version 1.0 23/11/2005
* @version 1.1 13/06/2019
* @author Ludovic APVRILLE
*/
public class TMLWaitEvent extends TMLActivityElementEvent {
......@@ -60,7 +60,9 @@ public class TMLWaitEvent extends TMLActivityElementEvent {
}
public String customExtraToXML() {
return " event=\"" + event.getName() + "\" params=\"" + getAllParams() + "\" ";
String ret = " event=\"" + event.getName() + "\" params=\"" + getAllParams() + "\" ";
ret += " blocking=\"" + event.isBlocking() + "\" ";
return ret;
}
}
......@@ -51,6 +51,8 @@ public abstract class AbstractTest {
final String fileName ) {
try {
final String expectedCode = FileUtils.loadFile( EXPECTED_CODE_DIR + fileName + XML_EXT );
//FileUtils.saveFile(EXPECTED_CODE_DIR + fileName + XML_EXT, actualCode);
if ( !compareXml( actualCode, expectedCode ) ) {
saveActualResults( fileName + XML_EXT, actualCode );
......
......@@ -7,7 +7,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="2" name="send event">
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" />
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" blocking="false" />
<NEXTACTIVITYELEMENT id="1" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendRequest" value="" id="3" name="send request">
......
......@@ -7,7 +7,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="2" name="send event">
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" />
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" blocking="false" />
<NEXTACTIVITYELEMENT id="1" />
</ACTIVITYELEMENT>
</ACTIVITY>
......@@ -7,7 +7,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="2" name="send event">
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" />
<CUSTOM event="Zigbee_TX__Source_evt_out__Zigbee_TX__bit2symbol_evt_in" params="size" blocking="false" />
<NEXTACTIVITYELEMENT id="1" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLActionState" value="" id="3" name="action">
......
......@@ -7,7 +7,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="2" name="send event">
<CUSTOM event="Zigbee_TX__bit2symbol_evt_out__Zigbee_TX__chip2octet_evt_in" params="size" />
<CUSTOM event="Zigbee_TX__bit2symbol_evt_out__Zigbee_TX__chip2octet_evt_in" params="size" blocking="false" />
<NEXTACTIVITYELEMENT id="1" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendRequest" value="" id="3" name="send request">
......
......@@ -9,7 +9,7 @@
<NEXTACTIVITYELEMENT id="11" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLChoice" value="" id="2" name="choice">
<CUSTOM guards="[ true ];[ x>0 ];" />
<CUSTOM guards="[ true ];[ x&gt;0 ];" />
<NEXTACTIVITYELEMENT id="12" />
<NEXTACTIVITYELEMENT id="14" />
</ACTIVITYELEMENT>
......@@ -18,27 +18,27 @@
<NEXTACTIVITYELEMENT id="4" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="4" name="send event">
<CUSTOM event="AppC__reset__AppC__reset" params="" />
<CUSTOM event="AppC__reset__AppC__reset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="5" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="5" name="wait event">
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" />
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="6" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="6" name="send event">
<CUSTOM event="AppC__pTS__AppC__pTS" params="" />
<CUSTOM event="AppC__pTS__AppC__pTS" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="7" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="7" name="wait event">
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" />
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="16" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="8" name="write channel">
<CUSTOM nbOfSamples="1" channels="AppC__fromDtoSC " />
<CUSTOM nbOfSamples="1" channels="AppC__fromDtoSC " type="1" />
<NEXTACTIVITYELEMENT id="9" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="9" name="send event">
<CUSTOM event="AppC__data_Ready__AppC__data_Ready" params="x,b" />
<CUSTOM event="AppC__data_Ready__AppC__data_Ready" params="x,b" blocking="false" />
<NEXTACTIVITYELEMENT id="10" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLStopState" value="" id="10" name="stop state">
......@@ -52,11 +52,11 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLReadChannel" value="" id="13" name="read channel">
<CUSTOM nbOfSamples="1" channels="AppC__fromSCtoD " />
<CUSTOM nbOfSamples="1" channels="AppC__fromSCtoD " type="1" />
<NEXTACTIVITYELEMENT id="15" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="14" name="wait event">
<CUSTOM event="AppC__data_Ready_SC__AppC__data_Ready_SC" params="" />
<CUSTOM event="AppC__data_Ready_SC__AppC__data_Ready_SC" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="13" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLStopState" value="" id="15" name="stop state">
......
......@@ -18,27 +18,27 @@
<NEXTACTIVITYELEMENT id="4" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="4" name="send event">
<CUSTOM event="AppC__reset__AppC__reset" params="" />
<CUSTOM event="AppC__reset__AppC__reset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="5" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="5" name="wait event">
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" />
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="6" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="6" name="send event">
<CUSTOM event="AppC__pTS__AppC__pTS" params="" />
<CUSTOM event="AppC__pTS__AppC__pTS" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="7" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="7" name="wait event">
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" />
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="13" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="8" name="write channel">
<CUSTOM nbOfSamples="1" channels="AppC__fromDtoSC " />
<CUSTOM nbOfSamples="1" channels="AppC__fromDtoSC " type="1" />
<NEXTACTIVITYELEMENT id="9" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="9" name="send event">
<CUSTOM event="AppC__data_Ready__AppC__data_Ready" params="x,b" />
<CUSTOM event="AppC__data_Ready__AppC__data_Ready" params="x,b" blocking="false" />
<NEXTACTIVITYELEMENT id="10" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLStopState" value="" id="10" name="stop state">
......
......@@ -8,19 +8,19 @@
<NEXTACTIVITYELEMENT id="2" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="2" name="send event">
<CUSTOM event="AppC__reset__AppC__reset" params="" />
<CUSTOM event="AppC__reset__AppC__reset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="3" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="3" name="wait event">
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" />
<CUSTOM event="AppC__answerToReset__AppC__answerToReset" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="4" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLSendEvent" value="" id="4" name="send event">
<CUSTOM event="AppC__pTS__AppC__pTS" params="" />
<CUSTOM event="AppC__pTS__AppC__pTS" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="5" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWaitEvent" value="" id="5" name="wait event">
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" />
<CUSTOM event="AppC__pTSConfirm__AppC__pTSConfirm" params="" blocking="false" />
<NEXTACTIVITYELEMENT id="6" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLStopState" value="" id="6" name="stop state">
......
......@@ -4,14 +4,14 @@
<NEXTACTIVITYELEMENT id="4" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLReadChannel" value="" id="1" name="read channel">
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__symbol2ChipSeq_ch_out__Zigbee_TX__chip2octet_ch_in " />
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__symbol2ChipSeq_ch_out__Zigbee_TX__chip2octet_ch_in " type="0" />
<NEXTACTIVITYELEMENT id="3" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLStopState" value="" id="2" name="stop state">
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="3" name="write channel">
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__chip2octet_ch_out__Zigbee_TX__cwl_ch_in " />
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__chip2octet_ch_out__Zigbee_TX__cwl_ch_in " type="0" />
<NEXTACTIVITYELEMENT id="2" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLActionState" value="" id="4" name="action reading args">
......
......@@ -7,7 +7,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="2" name="write channel">
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__Source_ch_out__Zigbee_TX__symbol2ChipSeq_ch_in " />
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__Source_ch_out__Zigbee_TX__symbol2ChipSeq_ch_in " type="0" />
<NEXTACTIVITYELEMENT id="1" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLActionState" value="" id="3" name="action reading args">
......
......@@ -11,7 +11,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="3" name="write channel">
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__Source_ch_out__Zigbee_TX__symbol2ChipSeq_ch_in " />
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__Source_ch_out__Zigbee_TX__symbol2ChipSeq_ch_in " type="0" />
<NEXTACTIVITYELEMENT id="2" />
</ACTIVITYELEMENT>
</ACTIVITY>
......@@ -11,7 +11,7 @@
<CUSTOM />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLWriteChannel" value="" id="3" name="write channel">
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__symbol2ChipSeq_ch_out__Zigbee_TX__chip2octet_ch_in " />
<CUSTOM nbOfSamples="size" channels="Zigbee_TX__symbol2ChipSeq_ch_out__Zigbee_TX__chip2octet_ch_in " type="0" />
<NEXTACTIVITYELEMENT id="2" />
</ACTIVITYELEMENT>
<ACTIVITYELEMENT type="tmltranslator.TMLActionState" value="" id="4" name="action reading args">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment