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
35b57a4b
Commit
35b57a4b
authored
Feb 02, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed command blocks disabling with conditionals, bug fix in launch
sequence.
parent
5c54ebba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
24 deletions
+53
-24
VDTRunner.java
src/com/elphel/vdt/core/launching/VDTRunner.java
+9
-6
VDTRunnerConfiguration.java
...com/elphel/vdt/core/launching/VDTRunnerConfiguration.java
+9
-2
BuildParamsItem.java
src/com/elphel/vdt/core/tools/contexts/BuildParamsItem.java
+24
-14
Context.java
src/com/elphel/vdt/core/tools/contexts/Context.java
+8
-1
CommandLinesBlock.java
src/com/elphel/vdt/core/tools/params/CommandLinesBlock.java
+3
-1
No files found.
src/com/elphel/vdt/core/launching/VDTRunner.java
View file @
35b57a4b
...
...
@@ -155,12 +155,15 @@ public class VDTRunner {
runningBuilds
.
removeConfiguration
(
consoleName
);
return
;
}
if
(
numItem
<(
argumentsItemsArray
.
length
-
1
)){
// Not for the last
// IConsoleManager man = ConsolePlugin.getDefault().getConsoleManager(); // debugging
// IConsole[] consoles=(IConsole[]) man.getConsoles();
// if (numItem<(argumentsItemsArray.length-1)){ // Not for the last
// find out if there are any non-parsers left
boolean
moreToProcess
=
false
;
for
(
int
i
=
numItem
+
1
;
i
<
argumentsItemsArray
.
length
;
numItem
++)
if
(
argumentsItemsArray
[
numItem
].
getNameAsParser
()==
null
)
{
moreToProcess
=
true
;
break
;
}
if
(
moreToProcess
){
IOConsole
iCons
=
(
IOConsole
)
DebugUITools
.
getConsole
(
process
);
// had non-null fPatternMatcher , fType="org.eclipse.debug.ui.ProcessConsoleType"
if
(
iCons
==
null
){
System
.
out
.
println
(
"Could not get console for the specified process"
);
...
...
src/com/elphel/vdt/core/launching/VDTRunnerConfiguration.java
View file @
35b57a4b
...
...
@@ -64,7 +64,9 @@ public class VDTRunnerConfiguration {
private
String
consoleFinish
;
// double prompt? - string to look for in consoleBuffer to finish
private
String
consoleBuffer
;
// accumulates stdout & stderr, looking for consoleFinish (endsWith() )
private
int
extraChars
=
100
;
// Allow these chars to appear in the output after consoleFinish (user pressed smth.?)
private
String
originalConsoleName
=
null
;
private
String
originalConsoleName
=
null
;
// will replace
private
String
buildDateTime
=
null
;
private
Set
<
IConsole
>
consoles
=
null
;
// parser consoles opened for this console
private
VDTConsoleRunner
consoleRunner
=
null
;
...
...
@@ -216,12 +218,17 @@ public class VDTRunnerConfiguration {
}
public
void
setToolName
(
String
str
)
{
this
.
toolName
=
str
;
this
.
buildDateTime
=
VDTRunner
.
renderProcessLabel
(
""
);
this
.
originalConsoleName
=
VDTRunner
.
renderProcessLabel
(
this
.
toolName
);
//
}
public
String
getOriginalConsoleName
()
{
return
originalConsoleName
;
}
public
String
getBuildDateTime
()
{
return
this
.
buildDateTime
;
}
public
String
getToolName
()
{
return
toolName
;
}
...
...
src/com/elphel/vdt/core/tools/contexts/BuildParamsItem.java
View file @
35b57a4b
...
...
@@ -23,8 +23,10 @@ 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
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 nameAsParser; // name as a parser, null if not used as a parser
private
String
name
;
// name of a block
private
boolean
is_parser
;
private
String
toolErrors
;
// Eclipse pattern for pattern recognizer
private
String
toolWarnings
;
// Eclipse pattern for pattern recognizer
private
String
toolInfo
;
// Eclipse pattern for pattern recognizer
...
...
@@ -41,8 +43,9 @@ public class BuildParamsItem implements Cloneable{
public
BuildParamsItem
(
String
[]
params
,
String
consoleName
,
String
nameAsParser
,
// String mark,
// String nameAsParser,
String
name
,
// boolean is_parser,
String
toolErrors
,
String
toolWarnings
,
String
toolInfo
,
...
...
@@ -54,8 +57,9 @@ public class BuildParamsItem implements Cloneable{
)
{
this
.
consoleName
=
consoleName
;
this
.
params
=
params
;
// no need to clone?
this
.
nameAsParser
=
nameAsParser
;
// this.mark=mark;
// this.nameAsParser=nameAsParser;
this
.
name
=
name
;
this
.
is_parser
=(
name
!=
null
);
// true
this
.
toolErrors
=
toolErrors
;
this
.
toolWarnings
=
toolWarnings
;
this
.
toolInfo
=
toolInfo
;
...
...
@@ -70,8 +74,9 @@ public class BuildParamsItem implements Cloneable{
this
(
item
.
params
,
item
.
consoleName
,
item
.
nameAsParser
,
// item.mark,
// item.nameAsParser,
item
.
name
,
// item.is_parser,
item
.
toolErrors
,
item
.
toolWarnings
,
item
.
toolInfo
,
...
...
@@ -81,6 +86,7 @@ public class BuildParamsItem implements Cloneable{
item
.
stdout
,
item
.
timeout
);
this
.
is_parser
=
item
.
is_parser
;
}
public
BuildParamsItem
clone
()
{
...
...
@@ -113,23 +119,27 @@ public class BuildParamsItem implements Cloneable{
}
*/
public
void
removeNonParser
(
List
<
BuildParamsItem
>
items
){
// if (items==null) return; should never happen as the list includes itself
if
(
nameAsParser
==
null
)
return
;
// if (nameAsParser==null) return;
if
(
!
is_parser
)
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
)){
// nameAsParser.equals(item.stderr) ||
// nameAsParser.equals(item.stdout)){
name
.
equals
(
item
.
stderr
)
||
name
.
equals
(
item
.
stdout
)){
return
;
// do nothing - keep nameAsParser
}
}
}
nameAsParser
=
null
;
is_parser
=
false
;
}
public
String
getNameAsParser
(){
return
nameAsParser
;
}
// public String getNameAsParser(){ return nameAsParser; }
public
String
getNameAsParser
(){
return
is_parser
?
name:
null
;
}
public
String
getName
()
{
return
name
;
}
// public String getMark() { return mark; }
public
String
getErrors
()
{
return
toolErrors
;
}
public
String
getWarnings
()
{
return
toolWarnings
;
}
...
...
src/com/elphel/vdt/core/tools/contexts/Context.java
View file @
35b57a4b
...
...
@@ -34,6 +34,8 @@ import com.elphel.vdt.core.tools.params.types.ParamTypeString;
import
com.elphel.vdt.core.tools.params.Parameter
;
import
com.elphel.vdt.core.tools.params.conditions.StringConditionParser
;
import
com.elphel.vdt.util.StringPair
;
import
com.elphel.vdt.veditor.VerilogPlugin
;
import
com.elphel.vdt.veditor.preference.PreferenceStrings
;
public
abstract
class
Context
{
...
...
@@ -225,7 +227,12 @@ public abstract class Context {
prompt
=
commandLinesBlock
.
parseCntrl
(
prompt
);
// replace control character codes (\n,\t,\x)
prompt
=
commandLinesBlock
.
applyMark
(
prompt
);
// remove mark sequence
String
interrupt
=
commandLinesBlock
.
getInterrupt
();
List
<
String
>
lines
=
commandLinesBlock
.
getLines
();
// [%Param_Shell_Options, echo BuildDir=%BuildDir ;, echo SimulationTopFile=%SimulationTopFile ;, echo SimulationTopModule=%SimulationTopModule ;, echo BuildDir=%BuildDir;, %Param_PreExe, %Param_Exe, %Param_TopModule, %TopModulesOther, %ModuleLibrary, %LegacyModel, %NoSpecify, %v, %SourceList, %ExtraFiles, %Filter_String]
List
<
String
>
lines
=
commandLinesBlock
.
getLines
();
// [%Param_Shell_Options, echo BuildDir=%BuildDir ;, echo SimulationTopFile=%SimulationTopFile ;, echo SimulationTopModule=%SimulationTopModule ;, echo BuildDir=%BuildDir;, %Param_PreExe, %Param_Exe, %Param_TopModule, %TopModulesOther, %ModuleLibrary, %LegacyModel, %NoSpecify, %v, %SourceList, %ExtraFiles, %Filter_String]
if
((
lines
.
size
()==
0
)
&&
commandLinesBlock
.
hadStrings
()){
if
(
VerilogPlugin
.
getPreferenceBoolean
(
PreferenceStrings
.
DEBUG_LAUNCHING
))
System
.
out
.
println
(
"Removing command lines block by false condition"
);
continue
;
// to enable conditionals for the command line blocks, still making possible to use emty blocks for no-arguments programs
}
List
<
List
<
String
>>
commandSequence
=
new
ArrayList
<
List
<
String
>>();
for
(
Iterator
<
String
>
lineIter
=
lines
.
iterator
();
lineIter
.
hasNext
();)
{
String
line
=
(
String
)
lineIter
.
next
();
...
...
src/com/elphel/vdt/core/tools/params/CommandLinesBlock.java
View file @
35b57a4b
...
...
@@ -199,6 +199,8 @@ public class CommandLinesBlock extends UpdateableStringsContainer
public
boolean
isFileKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
FILE
;
}
public
boolean
isConsoleKind
()
{
return
kind
==
ParamTypeString
.
KIND
.
TEXT
;
}
public
List
<
String
>
getLines
()
{
return
ConditionUtils
.
resolveConditionStrings
(
strings
);
}
// to distinguish between empty command block (program w/o any parameters) and conditionally removed one
public
boolean
hadStrings
()
{
return
(
strings
!=
null
)
&&
(
strings
.
getEntries
().
size
()>
0
);
}
public
String
getName
()
{
return
name
;
}
public
String
getSeparator
()
{
return
separator
;
}
public
String
getMark
()
{
return
mark
;
}
...
...
@@ -206,7 +208,7 @@ public class CommandLinesBlock extends UpdateableStringsContainer
public
String
getWarnings
()
{
return
toolWarnings
;
}
public
String
getInfo
()
{
return
toolInfo
;
}
public
String
getPrompt
()
{
return
prompt
;
}
public
String
getInterrupt
()
{
return
prom
pt
;
}
public
String
getInterrupt
()
{
return
interru
pt
;
}
public
String
getStderr
()
{
return
stderr
;
}
public
String
getStdout
()
{
return
stdout
;
}
public
String
getTimeout
()
{
return
timeout
;
}
...
...
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