Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlaSim
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lunkeit, Frank
PlaSim
Commits
67ffc5bf
Commit
67ffc5bf
authored
Nov 8, 2016
by
Edilbert Kirk
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in most.c
parent
7d51f869
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
most.c
+58
-12
58 additions, 12 deletions
most.c
with
58 additions
and
12 deletions
most.c
+
58
−
12
View file @
67ffc5bf
...
@@ -343,7 +343,7 @@ int Preprocessed;
...
@@ -343,7 +343,7 @@ int Preprocessed;
int
SAMindex
;
int
SAMindex
;
int
ScreenHeight
;
int
ScreenHeight
;
int
Expert
=
1
;
int
Expert
=
1
;
int
Cat
=
0
;
int
Cat
s
=
0
;
int
LsgEnabled
;
int
LsgEnabled
;
int
ModeRadiusSq
;
int
ModeRadiusSq
;
int
ForceRebuild
;
int
ForceRebuild
;
...
@@ -1048,11 +1048,6 @@ void InitNamelist(void)
...
@@ -1048,11 +1048,6 @@ void InitNamelist(void)
// CAT
// CAT
NL_t
(
CAT
,
"sim"
,
"J1"
,
"JET"
);
NL_i
(
CAT
,
"sim"
,
"J1W1"
,
8
);
NL_i
(
CAT
,
"sim"
,
"J1W2"
,
4
);
NL_i
(
CAT
,
"sim"
,
"J1SCL"
,
1
);
NL_r
(
CAT
,
"sim"
,
"J1AMP"
,
1
.
0
);
NL_r
(
CAT
,
"cat"
,
"ALPHA"
,
0
.
0
);
NL_r
(
CAT
,
"cat"
,
"ALPHA"
,
0
.
0
);
NL_r
(
CAT
,
"cat"
,
"BETA"
,
0
.
0
);
NL_r
(
CAT
,
"cat"
,
"BETA"
,
0
.
0
);
NL_r
(
CAT
,
"cat"
,
"AFORC"
,
0
.
001
);
NL_r
(
CAT
,
"cat"
,
"AFORC"
,
0
.
001
);
...
@@ -1242,10 +1237,15 @@ void InitSelections(void)
...
@@ -1242,10 +1237,15 @@ void InitSelections(void)
// CAT
// CAT
if
(
Cat
)
{
Sel
=
NewSel
(
Sel
);
Sel
=
NewSel
(
Sel
);
InitNextSelection
(
Sel
,
dyn
,
FullModelName
[
CAT
]);
InitNextSelection
(
Sel
,
dyn
,
FullModelName
[
CAT
]);
// Hide CAT until released
if
(
!
Cats
)
{
Sel
->
no
=
1
;
Sel
->
lt
=
0
;
}
}
// Planet Simulator
// Planet Simulator
...
@@ -2549,6 +2549,51 @@ int WritePumaNamelist(void) /* also used for model SAM */
...
@@ -2549,6 +2549,51 @@ int WritePumaNamelist(void) /* also used for model SAM */
}
}
/* ================ */
/* WriteCatNamelist */
/* ================ */
int
WriteCatNamelist
(
void
)
{
int
i
,
j
,
k
,
sum
,
val
;
FILE
*
fp
;
char
backup_name
[
256
];
char
nln
[
256
];
struct
SelStruct
*
Sel
;
FinishLine
();
// Write file <cat_namelist>
strcpy
(
nln
,
ShortModelName
[
Model
]);
strcat
(
nln
,
"/run/"
);
strcat
(
nln
,
namelist_name
);
fp
=
fopen
(
nln
,
"w"
);
if
(
fp
==
NULL
)
{
printf
(
"Could not open file <%s> for writing
\n
"
,
nln
);
return
0
;
/* Failure */
}
fprintf
(
fp
,
" &%s_nl
\n
"
,
ShortModelName
[
Model
]);
fprintf
(
fp
,
" %-8s=%6d
\n
"
,
"NGUI"
,
ngui
);
for
(
Sel
=
ComEnd
->
Next
;
Sel
;
Sel
=
Sel
->
Next
)
{
if
(
Sel
->
type
==
SEL_INT
)
fprintf
(
fp
,
" %-8s=%6d
\n
"
,
Sel
->
text
,
Sel
->
iv
);
if
(
Sel
->
type
==
SEL_REAL
)
fprintf
(
fp
,
" %-8s=%s
\n
"
,
Sel
->
text
,
Sel
->
teva
);
}
fprintf
(
fp
,
" /END
\n
"
);
fclose
(
fp
);
return
1
;
/* Success */
}
/* ================ */
/* ================ */
/* WritePPPNamelist */
/* WritePPPNamelist */
/* ================ */
/* ================ */
...
@@ -3379,7 +3424,7 @@ void BuildScripts(void)
...
@@ -3379,7 +3424,7 @@ void BuildScripts(void)
{
{
if
(
CheckCATNamelist
())
return
;
if
(
CheckCATNamelist
())
return
;
GenerateNames
();
GenerateNames
();
//
WriteCatNamelist();
WriteCatNamelist
();
if
(
!
Build
(
CAT
))
Exit
();
if
(
!
Build
(
CAT
))
Exit
();
WriteRunScript
(
CAT
);
WriteRunScript
(
CAT
);
}
}
...
@@ -4412,10 +4457,10 @@ void InitGUI(void)
...
@@ -4412,10 +4457,10 @@ void InitGUI(void)
fclose
(
xpp
);
fclose
(
xpp
);
}
}
xpp
=
fopen
(
"Cat"
,
"r"
);
// Cat enabled
xpp
=
fopen
(
"Cat
s
"
,
"r"
);
// Cat enabled
if
(
xpp
)
if
(
xpp
)
{
{
Cat
=
1
;
Cat
s
=
1
;
fclose
(
xpp
);
fclose
(
xpp
);
}
}
...
@@ -4558,6 +4603,7 @@ void OnMouseClick(void)
...
@@ -4558,6 +4603,7 @@ void OnMouseClick(void)
{
{
if
(
HitBox
(
Sel
)
&&
Model
!=
i
)
if
(
HitBox
(
Sel
)
&&
Model
!=
i
)
{
{
if
(
i
==
CAT
&&
Cats
==
0
)
return
;
// Hide CAT
if
(
Debug
)
printf
(
"Change model from %d to %d
\n
"
,
Model
,
i
);
if
(
Debug
)
printf
(
"Change model from %d to %d
\n
"
,
Model
,
i
);
ChangeModel
(
i
);
ChangeModel
(
i
);
CalcFrame
(
Latitudes
);
CalcFrame
(
Latitudes
);
...
...
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