Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
743b1642
Commit
743b1642
authored
Jan 28, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on communicating with remote program, capturing stderr/stdout to
separate external program
parent
ad2afc3e
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
571 additions
and
364 deletions
+571
-364
.gitignore
bin/.gitignore
+0
-1
VDT.java
src/com/elphel/vdt/VDT.java
+2
-0
LaunchCore.java
src/com/elphel/vdt/core/launching/LaunchCore.java
+4
-1
VDTLaunchConfigurationDelegate.java
...el/vdt/core/launching/VDTLaunchConfigurationDelegate.java
+3
-2
VDTRunner.java
src/com/elphel/vdt/core/launching/VDTRunner.java
+145
-22
VDTRunnerConfiguration.java
...com/elphel/vdt/core/launching/VDTRunnerConfiguration.java
+9
-0
CommandLinesNodeReader.java
...hel/vdt/core/tools/config/xml/CommandLinesNodeReader.java
+20
-7
XMLConfig.java
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
+13
-5
BuildParamsItem.java
src/com/elphel/vdt/core/tools/contexts/BuildParamsItem.java
+80
-13
Context.java
src/com/elphel/vdt/core/tools/contexts/Context.java
+85
-31
ChosenActionGenerator.java
...phel/vdt/core/tools/generators/ChosenActionGenerator.java
+11
-11
CurrentFileBaseGenerator.java
...l/vdt/core/tools/generators/CurrentFileBaseGenerator.java
+11
-18
CurrentFileGenerator.java
...lphel/vdt/core/tools/generators/CurrentFileGenerator.java
+11
-24
CommandLinesBlock.java
src/com/elphel/vdt/core/tools/params/CommandLinesBlock.java
+51
-29
FormatProcessor.java
src/com/elphel/vdt/core/tools/params/FormatProcessor.java
+3
-3
Parameter.java
src/com/elphel/vdt/core/tools/params/Parameter.java
+0
-45
SimpleGeneratorRecognizer.java
...e/tools/params/recognizers/SimpleGeneratorRecognizer.java
+3
-1
Remote.xml
tools/SimpleSamples/Remote.xml
+120
-151
No files found.
bin/.gitignore
View file @
743b1642
/com
/BuildParamsItem.class
src/com/elphel/vdt/VDT.java
View file @
743b1642
...
...
@@ -148,4 +148,6 @@ public class VDT {
public
static
final
String
GENERATOR_ID_CURRENT_BASE
=
"CurrentFileBase"
;
public
static
final
String
GENERATOR_ID_CHOSEN_ACTION
=
"ChosenActionIndex"
;
public
static
final
String
GENERATOR_ID_BUILD_STAMP
=
"BuildStamp"
;
public
static
final
String
GENERATOR_ID_BLANK
=
"Blank"
;
public
static
final
String
GENERATOR_ID_NEWLINE
=
"NewLine"
;
}
// class VDT
src/com/elphel/vdt/core/launching/LaunchCore.java
View file @
743b1642
...
...
@@ -328,7 +328,10 @@ public class LaunchCore {
launch
.
setAttribute
(
DebugPlugin
.
ATTR_CAPTURE_OUTPUT
,
null
);
DebugPlugin
.
getDefault
().
getLaunchManager
().
addLaunch
(
launch
);
VDTRunner
runner
=
VDTLaunchUtil
.
getRunner
();
runner
.
run
(
configuration
,
launch
,
null
);
runner
.
run
(
configuration
,
VDTRunner
.
renderProcessLabel
(
configuration
.
getToolName
()),
// toolname + (date)
launch
,
null
);
}
// launch()
...
...
src/com/elphel/vdt/core/launching/VDTLaunchConfigurationDelegate.java
View file @
743b1642
...
...
@@ -29,6 +29,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import
org.eclipse.debug.core.model.ILaunchConfigurationDelegate
;
import
com.elphel.vdt.Txt
;
import
com.elphel.vdt.core.tools.contexts.BuildParamsItem
;
import
com.elphel.vdt.ui.MessageUI
;
...
...
@@ -95,8 +96,8 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
// done the creating arguments phase
monitor
.
worked
(
3
);
// resolve arguments
// resolve arguments
, save them
runConfig
.
setArgumentsItemsArray
(
VDTLaunchUtil
.
getArguments
(
configuration
));
// calculates all parameters
runConfig
.
setIsShell
(
VDTLaunchUtil
.
getIsShell
(
configuration
));
runConfig
.
setPatternErrors
(
VDTLaunchUtil
.
getPatternErrors
(
configuration
));
runConfig
.
setToolName
(
VDTLaunchUtil
.
getToolName
(
configuration
));
...
...
src/com/elphel/vdt/core/launching/VDTRunner.java
View file @
743b1642
This diff is collapsed.
Click to expand it.
src/com/elphel/vdt/core/launching/VDTRunnerConfiguration.java
View file @
743b1642
...
...
@@ -22,6 +22,7 @@ import org.eclipse.debug.core.ILaunch;
import
org.eclipse.debug.core.ILaunchConfiguration
;
import
com.elphel.vdt.Txt
;
import
com.elphel.vdt.core.tools.contexts.BuildParamsItem
;
/**
...
...
@@ -53,8 +54,16 @@ public class VDTRunnerConfiguration {
private
ILaunchConfiguration
configuration
;
private
ILaunch
launch
;
private
IProgressMonitor
monitor
;
private
BuildParamsItem
[]
argumentsItemsArray
;
// calculate once for the launch of the sequence
public
BuildParamsItem
[]
getArgumentsItemsArray
(){
return
argumentsItemsArray
;
}
public
void
setArgumentsItemsArray
(
BuildParamsItem
[]
argumentsItemsArray
){
this
.
argumentsItemsArray
=
argumentsItemsArray
;
}
private
static
final
String
[]
empty
=
new
String
[
0
];
...
...
src/com/elphel/vdt/core/tools/config/xml/CommandLinesNodeReader.java
View file @
743b1642
...
...
@@ -28,6 +28,7 @@ import com.elphel.vdt.core.tools.params.conditions.Condition;
import
com.elphel.vdt.core.tools.params.conditions.ConditionalStringsList
;
import
com.elphel.vdt.core.tools.params.conditions.NamedConditionalStringsList
;
import
com.elphel.vdt.core.tools.params.types.ParamTypeString
;
import
com.elphel.vdt.core.tools.params.types.ParamTypeString.KIND
;
public
class
CommandLinesNodeReader
extends
AbstractConditionNodeReader
{
List
<
CommandLinesBlock
>
commandLinesBlocks
=
new
ArrayList
<
CommandLinesBlock
>();
...
...
@@ -49,13 +50,21 @@ public class CommandLinesNodeReader extends AbstractConditionNodeReader {
}
}
}
/*
*/
private
CommandLinesBlock
readCommandLinesBlock
(
Node
node
,
Condition
condition
)
throws
ConfigException
{
String
name
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_NAME_ATTR
);
String
dest
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_DEST_ATTR
);
String
sep
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_SEP_ATTR
);
String
name
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_NAME_ATTR
);
String
dest
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_DEST_ATTR
);
String
sep
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_SEP_ATTR
);
String
mark
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_MARK_ATTR
);
String
errors
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_ERRORS_ATTR
);
String
warnings
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_WARNINGS_ATTR
);
String
info
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_INFO_ATTR
);
String
prompt
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_PROMPT_ATTR
);
String
stderr
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_STDERR_ATTR
);
String
stdout
=
XMLConfig
.
getAttributeValue
(
node
,
XMLConfig
.
CONTEXT_LINEBLOCK_STDOUT_ATTR
);
if
(
name
==
null
)
throw
new
ConfigException
(
"Unnamed lines block definition in context '"
+
...
...
@@ -73,11 +82,15 @@ public class CommandLinesNodeReader extends AbstractConditionNodeReader {
dest
,
ParamTypeString
.
KIND
.
FILE
,
//Andrey - doesn't know "kind" here yet - TODO: change to attr
sep
,
mark
,
errors
,
warnings
,
info
,
prompt
,
stderr
,
stdout
,
lines
,
deleteLines
,
insertLines
);
}
}
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
View file @
743b1642
...
...
@@ -122,11 +122,19 @@ public class XMLConfig extends Config {
static
final
String
CONTEXT_LINEBLOCK_TAG
=
"line"
;
static
final
String
CONTEXT_LINEBLOCK_NAME_ATTR
=
"name"
;
static
final
String
CONTEXT_LINEBLOCK_DEST_ATTR
=
"dest"
;
static
final
String
CONTEXT_LINEBLOCK_SEP_ATTR
=
"sep"
;
static
final
String
CONTEXT_LINEBLOCK_TAG
=
"line"
;
static
final
String
CONTEXT_LINEBLOCK_NAME_ATTR
=
"name"
;
static
final
String
CONTEXT_LINEBLOCK_DEST_ATTR
=
"dest"
;
static
final
String
CONTEXT_LINEBLOCK_SEP_ATTR
=
"sep"
;
static
final
String
CONTEXT_LINEBLOCK_MARK_ATTR
=
"mark"
;
static
final
String
CONTEXT_LINEBLOCK_ERRORS_ATTR
=
"errors"
;
static
final
String
CONTEXT_LINEBLOCK_WARNINGS_ATTR
=
"warnings"
;
static
final
String
CONTEXT_LINEBLOCK_INFO_ATTR
=
"info"
;
static
final
String
CONTEXT_LINEBLOCK_PROMPT_ATTR
=
"prompt"
;
static
final
String
CONTEXT_LINEBLOCK_STDERR_ATTR
=
"stderr"
;
static
final
String
CONTEXT_LINEBLOCK_STDOUT_ATTR
=
"stdout"
;
static
final
String
CONTEXT_STRINGS_DELETE_TAG
=
"delete"
;
static
final
String
CONTEXT_STRINGS_INSERT_TAG
=
"insert"
;
static
final
String
CONTEXT_STRINGS_INSERT_AFTER_ATTR
=
"after"
;
...
...
src/com/elphel/vdt/core/tools/contexts/BuildParamsItem.java
View file @
743b1642
...
...
@@ -17,21 +17,63 @@
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
.
tools
.
contexts
;
import
java.util.Iterator
;
import
java.util.List
;
public
class
BuildParamsItem
implements
Cloneable
{
private
String
[]
params
;
private
String
consoleName
;
// null for external tools running in a new console
private
String
consoleName
;
// null for external tools running in a new console
private
String
nameAsParser
;
// name as a parser, null if not used as a parser
// private String mark; // remove this sequence on the output only (to preserve white spaces) Already applied
private
String
toolErrors
;
// Eclipse pattern for pattern recognizer
private
String
toolWarnings
;
// Eclipse pattern for pattern recognizer
private
String
toolInfo
;
// Eclipse pattern for pattern recognizer
// for commands being sent to opened remote console:
private
String
prompt
;
// relevant for commands sent to remote console - double prompt means "done" (extra separator on input)
private
String
stderr
;
// name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminal session
private
String
stdout
;
// name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminal session
public
BuildParamsItem
(
String
[]
params
,
String
consoleName
)
{
String
consoleName
,
String
nameAsParser
,
// String mark,
String
toolErrors
,
String
toolWarnings
,
String
toolInfo
,
String
prompt
,
String
stderr
,
String
stdout
)
{
this
.
consoleName
=
consoleName
;
this
.
params
=
params
;
// no need to clone?
this
.
nameAsParser
=
nameAsParser
;
// this.mark=mark;
this
.
toolErrors
=
toolErrors
;
this
.
toolWarnings
=
toolWarnings
;
this
.
toolInfo
=
toolInfo
;
this
.
prompt
=
prompt
;
this
.
stderr
=
stderr
;
this
.
stdout
=
stdout
;
}
public
BuildParamsItem
(
BuildParamsItem
item
){
this
(
item
.
params
,
item
.
consoleName
);
item
.
consoleName
,
item
.
nameAsParser
,
// item.mark,
item
.
toolErrors
,
item
.
toolWarnings
,
item
.
toolInfo
,
item
.
prompt
,
item
.
stderr
,
item
.
stdout
);
}
public
BuildParamsItem
clone
()
{
...
...
@@ -48,19 +90,44 @@ public class BuildParamsItem implements Cloneable{
}
return
arguments
;
}
/*
String[] paramArray = tool.buildParams();
System.out.println("Andrey: called tool.buildParams() here (from VDTLaunchUtils.java");
List<String> arguments = new ArrayList<String>(paramArray.length);
for(int i = 0; i < paramArray.length; i++) {
arguments.add(paramArray[i]);
}
return arguments;
*/
public
String
getConsoleName
(){
return
consoleName
;
}
/*
public void applyMark(){
if ((mark==null) || (mark.length()==0)) return;
if (params!=null) {
for (int i=0;i<params.length;i++){
params[i].replace(mark, "");
}
}
if (prompt!=null) prompt.replace(mark, "");
}
*/
public
void
removeNonParser
(
List
<
BuildParamsItem
>
items
){
// if (items==null) return; should never happen as the list includes itself
if
(
nameAsParser
==
null
)
return
;
if
(
consoleName
==
null
)
{
// console script can not be a parser
Iterator
<
BuildParamsItem
>
itemsIter
=
items
.
iterator
();
// command lines block is empty (yes, there is nothing in project output)
while
(
itemsIter
.
hasNext
())
{
BuildParamsItem
item
=
(
BuildParamsItem
)
itemsIter
.
next
();
if
(
nameAsParser
.
equals
(
item
.
stderr
)
||
nameAsParser
.
equals
(
item
.
stdout
)){
return
;
// do nothing - keep nameAsParser
}
}
}
nameAsParser
=
null
;
}
public
String
getNameAsParser
(){
return
nameAsParser
;
}
// public String getMark() { return mark; }
public
String
getErrors
()
{
return
toolErrors
;
}
public
String
getWarnings
()
{
return
toolWarnings
;
}
public
String
getInfo
()
{
return
toolInfo
;
}
public
String
getPrompt
()
{
return
prompt
;
}
public
String
getStderr
()
{
return
stderr
;
}
public
String
getStdout
()
{
return
stdout
;
}
}
src/com/elphel/vdt/core/tools/contexts/Context.java
View file @
743b1642
This diff is collapsed.
Click to expand it.
src/com/elphel/vdt/core/tools/generators/ChosenActionGenerator.java
View file @
743b1642
/*******************************************************************************
* Copyright (c) 20
06 Elphel, Inc and Excelsior, LLC
.
* Copyright (c) 20
14 Elphel, Inc
.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
the
*
Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
* it under the terms of the GNU General Public License as published by
*
the Free Software Foundation, either version 3 of the License, or
*
(at your option)
any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
but
*
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*
FITNESS FOR A PARTICULAR PURPOSE.
*
See the
GNU General Public License for more details.
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
*
but WITHOUT ANY WARRANTY; without even the implied warranty of
*
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
along
*
with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public License
*
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
.
tools
.
generators
;
...
...
src/com/elphel/vdt/core/tools/generators/CurrentFileBaseGenerator.java
View file @
743b1642
/*******************************************************************************
* Copyright (c) 20
06 Elphel, Inc and Excelsior, LLC
.
* Copyright (c) 20
14 Elphel, Inc
.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
the
*
Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
* it under the terms of the GNU General Public License as published by
*
the Free Software Foundation, either version 3 of the License, or
*
(at your option)
any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
but
*
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*
FITNESS FOR A PARTICULAR PURPOSE.
*
See the
GNU General Public License for more details.
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
*
but WITHOUT ANY WARRANTY; without even the implied warranty of
*
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
along
*
with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public License
*
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
.
tools
.
generators
;
import
org.eclipse.core.resources.IFile
;
//import org.eclipse.core.resources.IResource;
//import org.eclipse.ui.IPageLayout;
import
org.eclipse.core.runtime.Path
;
import
com.elphel.vdt.VDT
;
import
com.elphel.vdt.ui.variables.SelectedResourceManager
;
...
...
@@ -34,7 +28,6 @@ public class CurrentFileBaseGenerator extends AbstractGenerator {
}
protected
String
[]
getStringValues
()
{
// IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
String
name
=
SelectedResourceManager
.
getDefault
().
getChosenShort
();
// last segment of the file name
if
(
name
!=
null
){
int
dot
=
name
.
lastIndexOf
(
'.'
);
...
...
src/com/elphel/vdt/core/tools/generators/CurrentFileGenerator.java
View file @
743b1642
/*******************************************************************************
* Copyright (c) 20
06 Elphel, Inc and Excelsior, LLC
.
* Copyright (c) 20
14 Elphel, Inc
.
* This file is a part of Eclipse/VDT plug-in.
* Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
the
*
Free Software Foundation; either version 2 of the License, or (at your option)
* any later version.
* it under the terms of the GNU General Public License as published by
*
the Free Software Foundation, either version 3 of the License, or
*
(at your option)
any later version.
*
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
but
*
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
*
FITNESS FOR A PARTICULAR PURPOSE.
*
See the
GNU General Public License for more details.
* Eclipse/VDT plug-in is distributed in the hope that it will be useful,
*
but WITHOUT ANY WARRANTY; without even the implied warranty of
*
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
along
*
with Eclipse VDT plug-in; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public License
*
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
package
com
.
elphel
.
vdt
.
core
.
tools
.
generators
;
...
...
@@ -26,22 +26,9 @@ import com.elphel.vdt.ui.variables.SelectedResourceManager;
public
class
CurrentFileGenerator
extends
AbstractGenerator
{
private
static
final
String
NAME
=
VDT
.
GENERATOR_ID_CURRENT_FILE
;
// private boolean menuMode=false; // managing menu items, not running tool
public
String
getName
()
{
return
NAME
;
}
/*
public CurrentFileGenerator(boolean menuMode){
super();
this.menuMode=menuMode;
}
*/
/*
public void setMenuMode(boolean menuMode){
this.menuMode=menuMode;
}
*/
protected
String
[]
getStringValues
()
{
IResource
resource
;
if
(
getMenuMode
())
{
...
...
src/com/elphel/vdt/core/tools/params/CommandLinesBlock.java
View file @
743b1642
...
...
@@ -32,15 +32,36 @@ public class CommandLinesBlock extends UpdateableStringsContainer
{
private
String
contextName
;
private
String
name
;
private
String
destination
;
private
String
destination
;
// now references either file for command file, or console name prefix to send data to
private
String
separator
;
private
KIND
kind
;
//command file name or console name
private
String
mark
;
// remove this sequence on the output only (to preserve white spaces)
private
String
toolErrors
;
// Eclipse pattern for pattern recognizer
private
String
toolWarnings
;
// Eclipse pattern for pattern recognizer
private
String
toolInfo
;
// Eclipse pattern for pattern recognizer
// for commands being sent to opened remote console:
private
String
prompt
;
// relevant for commands sent to remote console - double prompt means "done" (extra separator on input)
private
String
stderr
;
// name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminakl session
private
String
stdout
;
// name of the command to (command line block) to launch in a separate process/console
// and connect to stderr of the terminal session
// If both are specified and pointing to the same command block - two instances/consoles will be launched.
// if only stdout - both stdout and stdin of a session will go to the same process/console
public
CommandLinesBlock
(
String
contextName
,
String
name
,
String
destination
,
KIND
kind
,
String
sep
,
String
mark
,
String
toolErrors
,
String
toolWarnings
,
String
toolInfo
,
String
prompt
,
String
stderr
,
String
stdout
,
ConditionalStringsList
lines
,
ConditionalStringsList
deleteLines
,
List
<
NamedConditionalStringsList
>
insertLines
)
...
...
@@ -52,6 +73,13 @@ public class CommandLinesBlock extends UpdateableStringsContainer
this
.
destination
=
destination
;
this
.
kind
=
kind
;
this
.
separator
=
sep
;
this
.
mark
=
mark
;
this
.
toolErrors
=
toolErrors
;
this
.
toolWarnings
=
toolWarnings
;
this
.
toolInfo
=
toolInfo
;
this
.
prompt
=
prompt
;
this
.
stderr
=
stderr
;
this
.
stdout
=
stdout
;
if
(
separator
!=
null
)
{
separator
=
separator
.
replace
(
"\\n"
,
"\n"
);
...
...
@@ -65,6 +93,13 @@ public class CommandLinesBlock extends UpdateableStringsContainer
block
.
destination
,
block
.
kind
,
block
.
separator
,
block
.
mark
,
block
.
toolErrors
,
block
.
toolWarnings
,
block
.
toolInfo
,
block
.
prompt
,
block
.
stderr
,
block
.
stdout
,
block
.
strings
!=
null
?
(
ConditionalStringsList
)
block
.
strings
.
clone
()
:
null
,
block
.
deleteStrings
!=
null
?
...
...
@@ -105,7 +140,7 @@ public class CommandLinesBlock extends UpdateableStringsContainer
"' or '"
+
ParamTypeString
.
KIND_TEXT_ID
+
"'"
);
}
System
.
out
.
println
(
"Got string text kind for command block (for console name)"
);
//
System.out.println("Got string text kind for command block (for console name)");
}
}
}
...
...
@@ -119,38 +154,25 @@ public class CommandLinesBlock extends UpdateableStringsContainer
return
name
.
equals
(((
CommandLinesBlock
)
other
).
name
);
}
public
String
getDestination
()
{
return
destination
;
}
public
KIND
getKind
()
{
return
kind
;
}
public
boolean
isFileKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
FILE
;
}
public
boolean
isConsoleKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
TEXT
;
}
public
List
<
String
>
getLines
()
{
return
ConditionUtils
.
resolveConditionStrings
(
strings
);
}
public
String
getName
()
{
return
name
;
}
public
String
getDestination
()
{
return
destination
;
}
public
KIND
getKind
()
{
return
kind
;}
public
boolean
isFileKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
FILE
;
}
public
boolean
isConsoleKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
TEXT
;
}
public
List
<
String
>
getLines
()
{
return
ConditionUtils
.
resolveConditionStrings
(
strings
);
}
public
String
getName
()
{
return
name
;
}
public
String
getSeparator
()
{
return
separator
;
}
public
String
getMark
()
{
return
mark
;
}
public
String
getErrors
()
{
return
toolErrors
;
}
public
String
getWarnings
()
{
return
toolWarnings
;
}
public
String
getInfo
()
{
return
toolInfo
;
}
public
String
getPrompt
()
{
return
prompt
;
}
public
String
getStderr
()
{
return
stderr
;
}
public
String
getStdout
()
{
return
stdout
;
}
public
String
getSeparator
()
{
return
separator
;
}
public
boolean
isEnabled
()
{
if
(
destination
==
null
)
// command line
return
true
;
return
!
destination
.
equals
(
""
);
}
...
...
src/com/elphel/vdt/core/tools/params/FormatProcessor.java
View file @
743b1642
...
...
@@ -80,7 +80,7 @@ public class FormatProcessor {
if
(
template
.
startsWith
(
CONTROL_SEQ
,
pos
))
{
pos
+=
CONTROL_SEQ_LEN
;
RecognizerResult
result
=
recognize
(
template
,
pos
);
RecognizerResult
result
=
recognize
(
template
,
pos
);
// Already skipped blank lines (and spaces in each line, added separators - no, on deifferent level
if
(
result
!=
null
&&
result
.
getGenerator
()
!=
null
)
{
assert
result
.
getNewPos
()
>
pos
;
...
...
@@ -167,7 +167,7 @@ public class FormatProcessor {
// we need to check if 'firstLineToAdd' ends with a blank space
// in such a case we just add all the generated lines in the list
// otherwise, we glue the line with first of additional ones
if
(!
Utils
.
stringEndsWithSpace
(
firstLineToAdd
))
{
if
(!
Utils
.
stringEndsWithSpace
(
firstLineToAdd
))
{
//last character is space or \n
glueToLastLine
(
lines
,
processedLines
.
get
(
0
));
addFrom
=
1
;
}
...
...
@@ -175,7 +175,7 @@ public class FormatProcessor {
for
(
int
i
=
addFrom
;
i
<
processedLines
.
size
();
i
++)
{
String
line
=
processedLines
.
get
(
i
);
if
(!
line
.
equals
(
""
))
if
(!
line
.
equals
(
""
))
// Why drop blank lines?
lines
.
add
(
line
);
}
}
...
...
src/com/elphel/vdt/core/tools/params/Parameter.java
View file @
743b1642
...
...
@@ -52,51 +52,6 @@ public class Parameter implements Cloneable, Updateable {
private
boolean
isChild
;
// Andrey: trying to resolve double inheritance - at configuration time and when generating output
private
String
sourceXML
;
// Andrey: For error reporting - individual to parameter
/*
public Parameter(String id,
String outid,
String typeName,
String syntaxName,
String defaultValue,
String label,
String omitValue,
String readonly,
String visible,
Condition relevant){
this(id,
outid,
typeName,
syntaxName,
defaultValue,
label,
omitValue,
readonly,
visible,
relevant,
null);
}
public Parameter(String id,
String outid,
String typeName,
String syntaxName,
String defaultValue,
String label,
String omitValue,
String readonly,
String visible)
{
this(id,
outid,
typeName,
syntaxName,
defaultValue,
label,
omitValue,
readonly,
visible,
null);
}
*/
public
Parameter
(
String
id
,
String
outid
,
String
typeName
,
...
...
src/com/elphel/vdt/core/tools/params/recognizers/SimpleGeneratorRecognizer.java
View file @
743b1642
...
...
@@ -34,7 +34,9 @@ public class SimpleGeneratorRecognizer implements Recognizer {
new
CurrentFileGenerator
(),
new
CurrentFileBaseGenerator
(),
new
ChosenActionGenerator
(),
new
BuildStampGenerator
()
new
BuildStampGenerator
(),
new
BlankGenerator
(),
new
NewLineGenerator
()
};
public
SimpleGeneratorRecognizer
(){
...
...
tools/SimpleSamples/Remote.xml
View file @
743b1642
<?xml version="1.0" encoding="UTF-8"?>
<vdt-project>
<interface
name=
"RemoteInterface"
extends=
"project_interface"
>
<syntax
name=
"ProgramSyntax"
format=
"%(%%ParamValue%|\n%)"
/>
</interface>
<tool
name =
"RemotePython"
project =
"FPGA_project"
label =
"RemotePython"
shell =
"/bin/bash"
interface =
"RemoteInterface"
description =
"Launching remote Python in console"
errors =
"(.*):([0-9]+): [a-z ]*error: (.*)"
warnings =
"(.*):([0-9]+): warning: (.*)"
info =
"(.*):([0-9]+): info: (.*)"
>
<!--does not actually exist -->
<extensions-list>
<extension
mask=
"v"
/>
<extension
mask=
"tf"
/>
</extensions-list>
<interface
name=
"RemoteInterface"
extends=
"project_interface"
>
<syntax
name=
"ProgramSyntax"
format=
"%(%%ParamValue%|\n%)"
/>
</interface>
<tool
name=
"RemotePython"
project=
"FPGA_project"
label=
"RemotePython"
shell=
"/bin/bash"
interface=
"RemoteInterface"
description=
"Launching remote Python in console"
errors=
"(.*):([0-9]+): [a-z ]*error: (.*)"
warnings=
"(.*):([0-9]+): warning: (.*)"
info=
"(.*):([0-9]+): info: (.*)"
>
<!--does not actually exist -->
<extensions-list>
<extension
mask=
"v"
/>
<extension
mask=
"tf"
/>
</extensions-list>
<action-menu>
<action
label=
"Remote Python"
resource=
""
icon=
"python.png"
/>
<action
label=
"Remote Python"
resource=
""
icon=
"python.png"
/>
</action-menu>
<parameter
id =
"RemoteHost"
label =
"Remote Host IP"
type =
"String"
format =
"CopyValue"
default =
"192.168.0.66"
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"RemoteUser"
label =
"Remote user name"
type =
"String"
format =
"CopyValue"
default =
""
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"PreSSH"
label =
"pre-ssh shell parameters"
type =
"String"
format =
"CopyValue"
default =
""
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"ShellSwitches"
label =
"Shell switches"
type =
"String"
format =
"CopyValue"
default =
"-c"
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"SSHSwitches"
label =
"Remote ssh switches"
type =
"String"
format =
"CopyValue"
default =
""
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"RemoteCommand"
label =
"Remote ssh command"
type =
"String"
format =
"CopyValue"
default =
"python -i -u"
readonly =
"false"
visible =
"true"
/>
<parameter
id =
"SSHExtra"
label =
"ssh extra parameters"
type =
"String"
format =
"CopyValue"
default =
""
readonly =
"false"
visible =
"true"
/>
<input>
<group
name=
"General"
>
"RemoteHost"
"RemoteUser"
"ShellSwitches"
"PreSSH"
"SSHSwitches"
"RemoteCommand"
"SSHExtra"
</group>
</input>
<output>
<line
name=
"command_line"
>
"%ShellSwitches"
"%PreSSH"
"ssh"
"-l"
"%RemoteUser"
"%RemoteHost"
"%SSHSwitches"
"'"
"%RemoteCommand"
"'"
"%SSHExtra"
</line>
</output>
</tool>
<tool
name =
"RemotePythonCommand"
project =
"FPGA_project"
label =
"RemotePythonCommand"
shell =
"/bin/bash"
interface =
"RemoteInterface"
description =
"Sending command to a ermote Python session"
errors =
"(.*):([0-9]+): [a-z ]*error: (.*)"
warnings =
"(.*):([0-9]+): warning: (.*)"
info =
"(.*):([0-9]+): info: (.*)"
>
<!--does not actually exist -->
<extensions-list>
<extension
mask=
"v"
/>
<extension
mask=
"tf"
/>
</extensions-list>
<parameter
id=
"RemoteHost"
label=
"Remote Host IP"
type=
"String"
format=
"CopyValue"
default=
"192.168.0.66"
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"RemoteUser"
label=
"Remote user name"
type=
"String"
format=
"CopyValue"
default=
""
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"PreSSH"
label=
"pre-ssh shell parameters"
type=
"String"
format=
"CopyValue"
default=
""
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"ShellSwitches"
label=
"Shell switches"
type=
"String"
format=
"CopyValue"
default=
"-c"
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"SSHSwitches"
label=
"Remote ssh switches"
type=
"String"
format=
"CopyValue"
default=
""
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"RemoteCommand"
label=
"Remote ssh command"
type=
"String"
format=
"CopyValue"
default=
"python -i -u"
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"SSHExtra"
label=
"ssh extra parameters"
type=
"String"
format=
"CopyValue"
default=
""
readonly=
"false"
visible=
"true"
/>
<input>
<group
name=
"General"
>
"RemoteHost"
"RemoteUser"
"ShellSwitches"
"PreSSH"
"SSHSwitches"
"RemoteCommand"
"SSHExtra"
</group>
</input>
<output>
<line
name=
"command_line"
>
"%ShellSwitches"
"%PreSSH"
"ssh"
"-l"
"%RemoteUser"
"%RemoteHost"
"%SSHSwitches"
"'"
"%RemoteCommand"
"'"
"%SSHExtra"
</line>
</output>
</tool>
<tool
name=
"RemotePythonCommand"
project=
"FPGA_project"
label=
"RemotePythonCommand"
shell=
"/bin/bash"
interface=
"RemoteInterface"
description=
"Sending command to a ermote Python session"
errors=
"(.*):([0-9]+): [a-z ]*error: (.*)"
warnings=
"(.*):([0-9]+): warning: (.*)"
info=
"(.*):([0-9]+): info: (.*)"
>
<!--does not actually exist -->
<extensions-list>
<extension
mask=
"v"
/>
<extension
mask=
"tf"
/>
</extensions-list>
<action-menu>
<action
label=
"Remote Python Command"
resource=
""
icon=
"python.png"
/>
<action
label=
"Remote Python Command"
resource=
""
icon=
"python.png"
/>
</action-menu>
<parameter
id =
"RemoteCommand"
label =
"Remote Command to send"
type =
"Stringlist"
format =
"ProgramSyntax"
default =
"print "Hello, World!, 2*2=",2*2"
readonly =
"false"
visible =
"true"
/>
<parameter
id=
"RemoteCommand"
label=
"Remote Command to send"
type=
"Stringlist"
format=
"ProgramSyntax"
default=
"print "Hello, World!, 2*2=",2*2"
readonly=
"false"
visible=
"true"
/>
<parameter
id=
"python_console_name"
default=
"RemotePython"
type=
"String"
format=
"CopyValue"
visible=
"false"
/>
<input>
<group
name=
"General"
>
"RemoteCommand"
</group>
</input>
<output>
<line
name=
"command_line"
>
"-c"
"echo 'Nothing to do, sleeping 5' ;"
"sleep 5 ;"
"echo 'Nothing to do, awakening' ;"
</line>
<line
name=
"console_line"
dest=
"python_console_name"
sep=
"\n"
>
"%RemoteCommand"
</line>
<line
name=
"command_line"
>
"-c"
"echo 'Nothing to do second time, sleeping 10' ;"
"sleep 10 ;"
"echo 'Nothing to do again, awakening after sleep 10' ;"
</line>
</output>
</tool>
<input>
<group
name=
"General"
>
"RemoteCommand"
</group>
</input>
<output>
<line
name=
"command_line_01"
>
"-c"
"echo 'Nothing to do, sleeping 5' ;"
"sleep 5 ;"
"echo 'Nothing to do, awakening' ;"
</line>
<!-- prompt: recognizer should trim spaces too -->
<!-- stdout - both with stderr, stderr only ..., both to the same - to separate console instances -->
<line
name=
"console_line_01"
dest=
"python_console_name"
mark=
"``"
sep=
"\n"
prompt=
">>>"
stdout=
"parser_001"
>
"%RemoteCommand"
"``"
<!-- two new lines should generate a pair of prompts from the remote -->
</line>
<line
name=
"command_line_02"
>
"-c"
"echo 'Nothing to do second time, sleeping 10' ;"
"sleep 10 ;"
"echo 'Nothing to do again, awakening after sleep 10' ;"
</line>
<!-- parser_01 being referenced should be launched in an asynchronous process/console, removed from the launch sequence -->
<line
name=
"parser_001"
errors=
"(.*):([0-9]+): [a-z ]*error: (.*)"
warnings=
"(.*):([0-9]+): warning: (.*)"
info=
"(.*):([0-9]+): info: (.*)"
>
"-c"
"grep --line-buffered 'End'"
</line>
</output>
</tool>
</vdt-project>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment