Commit 714f6704 authored by Kristof Szabados's avatar Kristof Szabados Committed by Gerrit Code Review
Browse files

Merge "added start method to TitanPort"

parents 7e148e69 37a1cb45
......@@ -7,6 +7,7 @@
******************************************************************************/
package org.eclipse.titan.designer.AST.TTCN3.statements;
import java.text.MessageFormat;
import java.util.List;
import org.eclipse.titan.designer.AST.ASTVisitor;
......@@ -15,6 +16,7 @@ import org.eclipse.titan.designer.AST.Reference;
import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.compiler.JavaGenData;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException;
import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;
......@@ -112,4 +114,10 @@ public final class Start_Port_Statement extends Statement {
}
return true;
}
@Override
/** {@inheritDoc} */
public void generateCode( final JavaGenData aData, final StringBuilder source ) {
source.append(MessageFormat.format("{0}.start();\n", portReference.getRefdAssignment(getLastTimeChecked(), false).getGenName()));
}
}
......@@ -32,6 +32,7 @@ public class TitanPort {
private String portName;
protected boolean is_active;
protected boolean is_started;
protected boolean is_halted;
private ArrayList<String> systemMappings = new ArrayList<String>();
......@@ -136,12 +137,18 @@ public class TitanPort {
}
if (is_started) {
TtcnError.TtcnWarning(MessageFormat.format("Performing start operation on port {0}, which is already started. The operation will clear the incoming queue.", portName));
//TODO clear queue
clearQueue();
} else {
//FIXME add missing code
if(is_halted) {
// the queue might contain old messages which has to be discarded
clearQueue();
is_halted = false;
}
userStart();
is_started = true;
}
//TODO: TTCN_Logger::log_port_state
}
public static void all_start() {
......
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