WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
ForeTime.h
1#ifndef _WINC_FORETIME
2#define _WINC_FORETIME
3
4#include <WXP/Const.h>
5#include <WXP/DateVal.h>
6#include <WXP/String.h>
7
8namespace WXP {
9 class ForeTime {
10 int type;
11 int unit;
12 float tim1, tim2;
13 float type_off; // type offset 6acc
14 float off; // time offset
15 DateVal end;
16
17 public:
18 ForeTime();
19 ForeTime( int t, int t1, int t2 );
20 ForeTime( int t );
21 ForeTime( const char *str );
22 int init();
24 inline bool isSet(){ return type != NONE; };
25 int decode( const char *str );
26 int toString( String &str );
27 float getFore();
28 float getHours();
29 int getSeconds();
30 int toTimeLabelDay( String &str );
31 static int toTimeLabel( float ftime, String &str );
32 int toTimeLabel( String &str );
33 int toVarLabel( String &str );
34 int set( int t, float t1, float t2 );
35 int set( int t, int u, float t1, float t2 );
36 int set( int val );
37 int set( const char *str );
38 int setEnd( DateVal &dv );
39 int setOffset( int val ){ off = val; return 1; };
40 float getOffset(){ return off; };
41 int setTypeOffset(float t){ type_off = t; return 1; };
42 float getTypeOffset(){ return type_off; };
43 inline int setType(int t){ type = t; return 1; };
44 inline int getType(){ return type; };
45 inline bool isTypeComplex(){ return type > 0 && type < 9; };
46 inline int setTime1( float val ){ tim1 = val; return 1; };
47 inline float getTime1(){ return tim1; };
48 inline int setTime2( float val ){ tim2 = val; return 1; };
49 inline float getTime2(){ return tim2; };
50 inline DateVal getEnd(){ return end; };
51 inline bool validEnd(){ return end.year != Const::MISS; };
52 inline bool valid(){ return tim1 != Const::MISS || tim2 != Const::MISS; };
53 int toCode();
54 int print();
55 /*
56 Time types
57 */
58 static const int NONE = -9999;
59 static const int FORE = 0;
60 static const int ANAL = 1;
61 static const int RNG = 2;
62 static const int AVG = 3;
63 static const int ACC = 4;
64 static const int DIFF = 5;
65 static const int MAX = 6;
66 static const int MIN = 7;
67 static const int ANY = 9;
68 /*
69 * Time units
70 */
71 static const int MINUTE = 0;
72 static const int HOUR = 1;
73 static const int DAY = 2;
74 static const int MONTH = 3;
75 static const int YEAR = 4;
76 };
77}
78#endif
static const int MISS
Definition Const.h:7
This class defines forecast time parameters.
Definition ForeTime.h:9
static const int DIFF
Definition ForeTime.h:64
static const int FORE
Definition ForeTime.h:59
static const int MAX
Definition ForeTime.h:65
int toCode()
Definition ForeTime.cc:230
int getSeconds()
Definition ForeTime.cc:504
int toString(String &str)
Definition ForeTime.cc:368
int toTimeLabelDay(String &str)
Definition ForeTime.cc:525
static const int DAY
Definition ForeTime.h:73
static const int RNG
Definition ForeTime.h:61
int init()
Definition ForeTime.cc:48
int set(int t, float t1, float t2)
Definition ForeTime.cc:300
static const int HOUR
Definition ForeTime.h:72
static const int ACC
Definition ForeTime.h:63
bool isSet()
Definition ForeTime.h:24
float getFore()
Definition ForeTime.cc:468
static const int ANAL
Definition ForeTime.h:60
static const int ANY
Definition ForeTime.h:67
float getHours()
Definition ForeTime.cc:483
static int toTimeLabel(float ftime, String &str)
Definition ForeTime.cc:550
static const int MONTH
Definition ForeTime.h:74
ForeTime()
Definition ForeTime.cc:22
static const int MINUTE
Definition ForeTime.h:71
int decode(const char *str)
Definition ForeTime.cc:62
static const int AVG
Definition ForeTime.h:62
static const int YEAR
Definition ForeTime.h:75
int print()
Definition ForeTime.cc:635
static const int MIN
Definition ForeTime.h:66
int toVarLabel(String &str)
Definition ForeTime.cc:603
This is a variable length string class.
Definition String.h:5
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines basic date values.
Definition DateVal.h:5
int year
Definition DateVal.h:6