1 /*
2 **
3 ** Copyright (c) 2003 The Regents of the University of California. All
4 ** rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions
8 ** are met:
9 **
10 ** - Redistributions of source code must retain the above copyright
11 ** notice, this list of conditions and the following disclaimer.
12 **
13 ** - Neither the name of the University nor the names of its
14 ** contributors may be used to endorse or promote products derived
15 ** from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
18 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19 ** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
21 ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 ** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 ** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 ** OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 **
29 **/
30
31
32 //header file for data structure
33 //
34 #ifndef __DATA_REPLAY_H__
35 #define __DATA_REPLAY_H__
36 #include <sys/time.h>
37
38 //right now, the coordinates is defined in terms of pixels,
39 //
40 #define INT_COORD
41
42 //the highest resolution of a Stratum node.
43 //a Stratum node is at least LOW_THRE in each dimension
44 #define LOW_THRE 2
45 #define MAX_CHILDREN 4
46 #define ALPHA 0.5
47
48 //!! fix me: what is the right variance threshold:$
49 //
50 #define VARIANCE_THRE 20 //for radar data: 60x60
51 //#define VARIANCE_THRE 10 //for radar data: 16x16
52 //#define VARIANCE_THRE 2 //for humidity data
53 #define INVALID_VALUE -100000
54 #define MAX_INT 100000
55
56 #define PORT_NUMBER 3335
57
58 //constant type value
59 #define LOCATION 1
60 #define LOC_N_VALUE 2
61
62 typedef int COORD_UNIT;
63
64 typedef float Sample_Type;
65
66 //pixel coordinates
67 typedef struct {
68 COORD_UNIT x, y;
69 } loc_2d;
70
71 //world coordinates
72 typedef struct {
73 float x, y;
74 } loc_world_2d;
75
76 // loc_n stands for location definition for NIMS
77 // you can define location coordinate system for 3D and change this line.
78 typedef loc_2d loc_n;
79 typedef loc_world_2d loc_world;
80 typedef struct timeval Time;
81
82 //used in the sample list in the stratum node.
83 typedef struct {
84 float value;
85 loc_world loc;
86 Time time;
87 } Sample_Stamp;
88
89
90 // used in sensor data array.
91 typedef struct {
92 float x;
93 float y;
94 float val;
95 } DataItem;
96
97 void * read_input(char *fname);
98 Sample_Type value_at_loc(void * datalist, loc_world pos );
99
100 #endif /*__DATA_REPLAY_H__*/
101
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.