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
05faded9
Commit
05faded9
authored
Feb 01, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix: was wrong sequence of initialization of the control interfaces
parent
5c95f009
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
XMLConfig.java
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
+8
-0
ControlInterface.java
src/com/elphel/vdt/core/tools/params/ControlInterface.java
+33
-2
No files found.
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
View file @
05faded9
...
@@ -385,6 +385,14 @@ public class XMLConfig extends Config {
...
@@ -385,6 +385,14 @@ public class XMLConfig extends Config {
private
void
initControlInterfaces
()
throws
ConfigException
{
private
void
initControlInterfaces
()
throws
ConfigException
{
for
(
Iterator
ci
=
controlInterfaceList
.
iterator
();
ci
.
hasNext
();)
for
(
Iterator
ci
=
controlInterfaceList
.
iterator
();
ci
.
hasNext
();)
((
ControlInterface
)
ci
.
next
()).
init
();
((
ControlInterface
)
ci
.
next
()).
init
();
//Andrey: had to split in two separate passes, otherwise failed to initialize types
//when parent control interface was not yet set up (only name was known)
//Alternatively it was possible to check baseInterfaceName if baseInterface was null,
//Replace null name with BasicInterface, ...
for
(
Iterator
ci
=
controlInterfaceList
.
iterator
();
ci
.
hasNext
();)
((
ControlInterface
)
ci
.
next
()).
initTypes
();
}
}
private
void
checkConfig
()
throws
ConfigException
{
private
void
checkConfig
()
throws
ConfigException
{
...
...
src/com/elphel/vdt/core/tools/params/ControlInterface.java
View file @
05faded9
...
@@ -77,13 +77,44 @@ public class ControlInterface implements Inheritable {
...
@@ -77,13 +77,44 @@ public class ControlInterface implements Inheritable {
// we don't check base interface absence, because in
// we don't check base interface absence, because in
// such a case a cyclic inheritance error would happen
// such a case a cyclic inheritance error would happen
}
}
/*
for(Iterator ti = typedefList.iterator(); ti.hasNext();)
for(Iterator ti = typedefList.iterator(); ti.hasNext();)
((TypeDef)ti.next()).init(this);
((TypeDef)ti.next()).init(this);
*/
initialized
=
true
;
initialized
=
true
;
}
}
public
void
initTypes
()
throws
ConfigException
{
/* if(initialized)
throw new ConfigException("Control interface cannot be re-initialized");
if(!name.equals(BASIC_INTERFACE_NAME)) {
if(baseInterfaceName == null)
baseInterfaceName = BASIC_INTERFACE_NAME;
baseInterface = config.findControlInterface(baseInterfaceName);
if(baseInterface == null) {
if(!baseInterfaceName.equals(BASIC_INTERFACE_NAME))
throw new ConfigException("Base interface '" + baseInterfaceName +
"' of control interface '" + name +
"' is absent");
else
throw new ConfigException("The basic interface '" + BASIC_INTERFACE_NAME +
"' is absent");
}
} else {
// we don't check base interface absence, because in
// such a case a cyclic inheritance error would happen
}
*/
for
(
Iterator
ti
=
typedefList
.
iterator
();
ti
.
hasNext
();)
((
TypeDef
)
ti
.
next
()).
init
(
this
);
// initialized = true;
}
public
void
check
()
throws
ConfigException
{
public
void
check
()
throws
ConfigException
{
Checks
.
checkCyclicInheritance
(
this
,
"control interface"
);
Checks
.
checkCyclicInheritance
(
this
,
"control interface"
);
...
...
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