cloudy
trunk
Loading...
Searching...
No Matches
source
parse_map.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
/*ParseMap parse map command to produce map of heating and cooling,
4
* map is produced by calling punt(" map") */
5
#include "
cddefines.h
"
6
#include "
hcmap.h
"
7
#include "
parser.h
"
8
9
void
ParseMap
(
Parser
&p )
10
{
11
bool
12
lgLogOn;
13
14
DEBUG_ENTRY
(
"ParseMap()"
);
15
16
/* say output goes to stdout */
17
ioMAP
= (
ioQQQ
== NULL ) ? stdout :
ioQQQ
;
18
19
/* do cooling space map for specified zones
20
* if no number, or <0, do map and punch out without doing first zone */
21
hcmap
.MapZone = (long)p.
FFmtRead
();
22
if
( p.
lgEOL
() )
23
{
24
hcmap
.MapZone = 0;
25
return
;
26
}
27
28
if
( p.
nMatch
(
"RANG"
) )
29
{
30
hcmap
.RangeMap[0] = (
realnum
)p.
FFmtRead
();
31
if
(
hcmap
.RangeMap[0] <= 10. )
32
{
33
hcmap
.RangeMap[0] = (
realnum
)pow((
realnum
)10.f,
hcmap
.RangeMap[0]);
34
lgLogOn =
true
;
35
}
36
else
37
{
38
lgLogOn =
false
;
39
}
40
hcmap
.RangeMap[1] = (
realnum
)p.
FFmtRead
();
41
if
( lgLogOn )
42
hcmap
.RangeMap[1] = (
realnum
)pow((
realnum
)10.f,
hcmap
.RangeMap[1]);
43
44
if
( p.
lgEOL
() )
45
{
46
fprintf(
ioQQQ
,
" There must be a zone number, followed by two temperatures, on this line. Sorry.\n"
);
47
cdEXIT
(
EXIT_FAILURE
);
48
}
49
return
;
50
}
51
return
;
52
}
ioQQQ
FILE * ioQQQ
Definition
cddefines.cpp:7
cddefines.h
ioMAP
FILE * ioMAP
Definition
cdinit.cpp:9
EXIT_FAILURE
#define EXIT_FAILURE
Definition
cddefines.h:140
cdEXIT
#define cdEXIT(FAIL)
Definition
cddefines.h:434
realnum
float realnum
Definition
cddefines.h:103
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition
cddefines.h:684
Parser
Definition
parser.h:32
Parser::FFmtRead
double FFmtRead(void)
Definition
parser.cpp:353
Parser::nMatch
bool nMatch(const char *chKey) const
Definition
parser.h:135
Parser::lgEOL
bool lgEOL(void) const
Definition
parser.h:98
hcmap
t_hcmap hcmap
Definition
hcmap.cpp:21
hcmap.h
ParseMap
void ParseMap(Parser &p)
Definition
parse_map.cpp:9
parser.h
Generated by
1.14.0