Commit ad2afc3e authored by Andrey Filippov's avatar Andrey Filippov

Added optional local echo (for generated commands) on remote console

parent c5781ccb
......@@ -236,7 +236,6 @@ public class VDTRunner {
, IProgressMonitor monitor
) throws CoreException{
//TODO: Handle monitor
System.out.println("VDTLaunchConfigurationDelegate.doLaunch: console ("+consolePrefix+") commands not yet implemented");
// Find console with name starting with consolePrefix
IConsoleManager man = ConsolePlugin.getDefault().getConsoleManager(); // debugging
IConsole[] consoles=(IConsole[]) man.getConsoles();
......@@ -254,6 +253,9 @@ public class VDTRunner {
// try to send
String[] arguments = configuration.getToolArguments();
if (arguments == null) arguments=new String[0];
log("Writing to console "+iCons.getName()+":", arguments, null, false, true); /* Appears in the console of the target Eclipse (immediately erased) */
log("Writing to console "+iCons.getName()+":", arguments, null, false, false); /* Appears in the console of the parent Eclipse */
// IOConsoleInputStream inStream= iCons.getInputStream();
IOConsoleOutputStream outStream= iCons.newOutputStream();
IProcess process=((ProcessConsole)iCons).getProcess();
......@@ -261,7 +263,9 @@ public class VDTRunner {
try {
for (int i=0;i<arguments.length;i++){
// outStream.write(arguments[i]); // writes to console itself
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.LOCAL_ECHO)) {
outStream.write(arguments[i]+"\n"); // writes to console itself
}
iStreamProxy.write(arguments[i]+"\n");
}
} catch (IOException e) {
......@@ -273,27 +277,7 @@ public class VDTRunner {
}
/* process.getStreamsProxy().getOutputStreamMonitor().addListener(new IStreamListener(){
public void streamAppended (String text, IStreamMonitor monitor){
//TODO: As per user requirement.
}
});
*/
/*
public void parserSetup(
VDTRunnerConfiguration configuration,
IProcess process
){
iCons= (IOConsole) DebugUITools.getConsole(process); // had non-null fPatternMatcher , fType="org.eclipse.debug.ui.ProcessConsoleType"
if (iCons==null){
System.out.println("Could not get a console for the specified process");
}
}
*/
public void resumeLaunch( String consoleName ) throws CoreException
{
try {
......@@ -400,8 +384,8 @@ public class VDTRunner {
}
}
String[] controlFiles = configuration.getControlFiles();
log(cmdLine, controlFiles, false, true); /* Appears in the console of the target Eclipse (immediately erased) */
log(cmdLine, controlFiles, false, false); /* Appears in the console of the parent Eclipse */
log(null,cmdLine, controlFiles, false, true); /* Appears in the console of the target Eclipse (immediately erased) */
log(null,cmdLine, controlFiles, false, false); /* Appears in the console of the parent Eclipse */
String[] envp = configuration.getEnvironment();
......@@ -458,22 +442,26 @@ public class VDTRunner {
} // run()
private void log(String[] strings,
private void log(String header,
String[] strings,
String[] controlFiles,
boolean formatColumn,
boolean printToUser)
{
println("Control files created:", printToUser);
if(controlFiles.length == 0) {
println("(none)", printToUser);
} else {
for(int i = 0; i < controlFiles.length; i++)
println(controlFiles[i], printToUser);
if(controlFiles!=null) {
println("Control files created:", printToUser);
if(controlFiles.length == 0) {
println("(none)", printToUser);
} else {
for(int i = 0; i < controlFiles.length; i++)
println(controlFiles[i], printToUser);
}
}
println(printToUser);
println("Launching:", printToUser);
if (header==null) {
header="Launching:";
}
println(header, printToUser);
if(formatColumn)
println(printToUser);
......
......@@ -2,6 +2,7 @@
<vdt-project>
<interface name="RemoteInterface" extends="project_interface">
<syntax name="ProgramSyntax" format="%(%%ParamValue%|\n%)" />
</interface>
<tool name = "RemotePython"
project = "FPGA_project"
......@@ -127,9 +128,9 @@
<parameter id = "RemoteCommand"
label = "Remote Command to send"
type = "String"
format = "CopyValue"
default = "print &quot;Hello, World!&quot;"
type = "Stringlist"
format = "ProgramSyntax"
default = "print &quot;Hello, World!, 2*2=&quot;,2*2"
readonly = "false"
visible = "true"/>
......@@ -145,8 +146,8 @@
<output>
<line name="command_line">
"-c"
"echo 'Nothing to do, sleepiing 15' ;"
"sleep 15 ;"
"echo 'Nothing to do, sleeping 5' ;"
"sleep 5 ;"
"echo 'Nothing to do, awakening' ;"
</line>
<line name="console_line" dest="python_console_name" sep="\n">
......@@ -154,9 +155,9 @@
</line>
<line name="command_line">
"-c"
"echo 'Nothing to do second time, sleeping 25' ;"
"sleep 25 ;"
"echo 'Nothing to do again, awakening after sleep 25' ;"
"echo 'Nothing to do second time, sleeping 10' ;"
"sleep 10 ;"
"echo 'Nothing to do again, awakening after sleep 10' ;"
</line>
</output>
......
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