Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
317d623f
Commit
317d623f
authored
Sep 24, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing stopRequested interceipt
parent
d9ef3617
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
FocusingField.java
src/main/java/FocusingField.java
+15
-0
No files found.
src/main/java/FocusingField.java
View file @
317d623f
...
...
@@ -4435,6 +4435,10 @@ public boolean LevenbergMarquardt(
// while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
this
.
currentVector
=
null
;
// invalidate for the new series
// boolean wasLastSeries=false;
int
saveStopRequested
=
this
.
stopRequested
.
get
();
// preserve from caller stop requested (like temp. scan)
this
.
stopRequested
.
set
(
0
);
// remove caller stop request
while
(
true
)
{
// loop for the same series
boolean
[]
state
=
stepLevenbergMarquardtFirst
(
debugLevel
);
...
...
@@ -4444,6 +4448,7 @@ public boolean LevenbergMarquardt(
System
.
out
.
println
(
msg
);
commitParameterVector
(
this
.
savedVector
);
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
}
...
...
@@ -4461,6 +4466,7 @@ public boolean LevenbergMarquardt(
(
this
.
stopEachSeries
&&
state
[
1
])
||
(
this
.
stopOnFailure
&&
state
[
1
]
&&
!
state
[
0
])){
if
(
state
[
1
]
&&
!
state
[
0
]
&&
!
calibrate
){
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
}
...
...
@@ -4499,6 +4505,7 @@ public boolean LevenbergMarquardt(
// if RMS was decreased. this.saveSeries==false after dialogLMAStep(state) only if "cancel" was pressed
commitParameterVector
(
this
.
savedVector
);
// either new or original
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
this
.
saveSeries
;
// TODO: Maybe change result?
}
//stepLevenbergMarquardtAction();
...
...
@@ -4506,6 +4513,7 @@ public boolean LevenbergMarquardt(
if
(!
state
[
0
])
{
commitParameterVector
(
this
.
savedVector
);
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
// sequence failed
}
this
.
savedVector
=
this
.
currentVector
.
clone
();
...
...
@@ -4516,6 +4524,7 @@ public boolean LevenbergMarquardt(
// this.seriesNumber++;
break
;
// while (true), proceed to the next series
}
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
}
// while true - same series
// if (wasLastSeries) break;
// } // while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
...
...
@@ -9565,6 +9574,8 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
qCompareDrDerivatives
(
this
.
qSavedVector
);
}
this
.
qCurrentVector
=
null
;
// invalidate for the new series
int
saveStopRequested
=
stopRequested
.
get
();
// preserve from caller stop requested (like temp. scan)
stopRequested
.
set
(
0
);
// remove caller stop request
while
(
true
)
{
// loop for the same series
boolean
[]
state
=
stepQLevenbergMarquardtFirst
(
debugLevel
);
if
(
state
==
null
)
{
...
...
@@ -9574,6 +9585,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
restoreQPars
();
// commitParameterVector(this.savedVector);
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
}
...
...
@@ -9623,6 +9635,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector); // either new or original
commitQPars
(
this
.
qSavedVector
);
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
this
.
qSaveSeries
;
// TODO: Maybe change result?
}
//stepLevenbergMarquardtAction();
...
...
@@ -9631,6 +9644,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector);
commitQPars
(
this
.
qSavedVector
);
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
// sequence failed
}
// this.savedVector=this.currentVector.clone();
...
...
@@ -9653,6 +9667,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector);
saveQPars
();
commitQPars
(
this
.
qSavedVector
);
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
true
;
// all series done
}
public
void
qCompareDrDerivatives
(
double
[]
vector
){
...
...
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