Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
669f4c46
Commit
669f4c46
authored
14 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
mittendrin: vereinheitliche askFunction
parent
6f219646
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/src/coord.cpp
+1
-1
1 addition, 1 deletion
pub/src/coord.cpp
pub/src/curve.cpp
+14
-15
14 additions, 15 deletions
pub/src/curve.cpp
with
15 additions
and
16 deletions
pub/src/coord.cpp
+
1
−
1
View file @
669f4c46
...
...
@@ -110,7 +110,7 @@ string CCoord::str( int maxlen ) const
return
name
.
substr
(
0
,
maxlen
);
}
string
CCoord
::
ps_str
()
const
//
just
two blanks instead of one
string
CCoord
::
ps_str
()
const
// two blanks instead of one
, and no unit ""
{
return
name
+
(
unit
!=
""
?
(
" ("
+
unit
+
")"
)
:
""
);
}
...
...
This diff is collapsed.
Click to expand it.
pub/src/curve.cpp
+
14
−
15
View file @
669f4c46
...
...
@@ -52,8 +52,9 @@ bool allow_slow_conv = true;
//! Parse expression, and set auxiliary parameters.
// Used here (Create) and when reading from disk (NFileIn::Load).
void
NCurveFile
::
set
Function
(
POlc
f
,
const
string
&
expr
)
void
NCurveFile
::
ask
Function
(
POlc
f
,
const
string
&
quest
)
{
string
expr
=
sask
(
quest
+
" ?"
);
// parse expression
PTree
T
;
user_xaxparse
(
expr
.
c_str
(),
&
T
);
...
...
@@ -75,19 +76,18 @@ void NCurveFile::setFunction( POlc f, const string& expr )
void
NCurveFile
::
CreateFitcurve
()
{
string
expr
=
sask
(
"Fit function ?"
)
;
if
(
expr
==
""
)
return
;
POlc
fc
;
askFunction
(
fc
,
"Fit function"
)
;
NOlm
::
IterateD
fiter
;
POld
fd
;
while
(
(
fd
=
fiter
())
)
{
POlc
fout
(
new
COlc
);
setFunction
(
fout
,
expr
);
POlc
fout
(
new_olc
(
fc
)
);
vector
<
double
>
P
(
fout
->
nPar
(),
1.0
);
fout
->
name
=
string
(
"fit_"
)
+
fd
->
name
;
fout
->
kd
=
fiter
.
k
();
fout
->
xco
=
CCoord
(
"ip"
,
""
)
;
fout
->
yco
=
CCoord
(
"p[ip]"
,
""
)
;
fout
->
xco
=
fd
->
xco
;
fout
->
yco
=
fd
->
yco
;
fout
->
ZCo
=
fd
->
ZCo
;
fout
->
RPar
=
fd
->
RPar
;
fout
->
lDoc
.
push_back
(
"cc "
+
expr
+
" # z from "
+
fd
->
name
);
...
...
@@ -109,11 +109,9 @@ void NCurveFile::CreateFreecurve()
{
static
int
default_no
=
0
;
string
expr
=
sask
(
"Function ?"
);
if
(
expr
==
""
)
return
;
POlc
fout
(
new
COlc
);
setFunction
(
fout
,
expr
);
askFunction
(
fout
,
"Fit function"
);
fout
->
name
=
string
(
"curve"
)
+
strg
(
default_no
++
);
fout
->
xco
=
CCoord
(
"x"
,
""
);
fout
->
yco
=
CCoord
(
"y"
,
""
);
...
...
@@ -131,16 +129,17 @@ void NCurveFile::CreateFreecurve()
void
NCurveFile
::
ChangeExpr
()
{
string
expr
=
sask
(
"Replace function by ?"
);
if
(
expr
==
""
)
return
;
POlc
ftmp
(
new
COlc
);
askFunction
(
ftmp
,
"Replace function by"
)
;
NOlm
::
IterateC
fiter
;
POlc
fc
;
while
(
(
fc
=
fiter
())
)
{
uint
nParOld
=
fc
->
nPar
();
setFunction
(
fc
,
expr
);
fc
->
expr
=
ftmp
->
expr
;
fc
->
T
=
ftmp
->
tmp
;
fc
->
lDoc
.
push_back
(
"ccm "
+
expr
);
uint
nParNew
=
fc
->
T
->
npar
();
uint
nParNew
=
fc
->
npar
();
fc
->
PCo
.
resize
(
nParNew
);
for
(
uint
ip
=
nParOld
;
ip
<
nParNew
;
ip
++
){
fc
->
PCo
[
ip
]
=
CCoord
(
"p"
+
strg
(
ip
),
""
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment