File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,10 @@ public void extract(){
56
56
// loop for each occupied station
57
57
for (int index =0 ; index <occupiedStations .size (); index ++){
58
58
setupHeader occupiedStation = occupiedStations .get (index );
59
- outputString += "41" + (gsi8_util .getPtIDWord (blockNum , "1" )).substring (2 );
60
- outputString += (occupiedStation .toString ()).substring (15 ) + System .lineSeparator ();
59
+ occupiedStation .setBlockNumber (blockNum );
60
+
61
+ // add an station header before each setup
62
+ outputString += occupiedStation + System .lineSeparator ();
61
63
blockNum ++;
62
64
63
65
pstmt .setInt (1 , occupiedStation .getSetupIndex ());
Original file line number Diff line number Diff line change @@ -4,13 +4,20 @@ public class setupHeader implements Cloneable{
4
4
protected int index ;
5
5
protected String StationName ;
6
6
protected double instrumentHeight ;
7
+ protected int blockNum = 1 ;
7
8
9
+ // constructor
8
10
public setupHeader (int i , String name , double hi ){
9
11
index = i ;
10
12
StationName = new String (name );
11
13
instrumentHeight = hi ;
12
14
}
13
15
16
+ public void setBlockNumber (int b ){
17
+ if (b <1000 )
18
+ blockNum = b ;
19
+ }
20
+
14
21
public int getSetupIndex (){
15
22
return index ;
16
23
}
@@ -25,7 +32,7 @@ public double getHI(){
25
32
26
33
public String toString (){
27
34
// generate Station header in GSI8 format
28
- String sResult = "410001+00000001 42...." ;
35
+ String sResult = "41" + ( gsi8_util . getPtIDWord ( blockNum , "1" )). substring ( 2 ) + " 42...." ;
29
36
sResult += (gsi8_util .getPtIDWord (1 , StationName )).substring (6 );
30
37
sResult += " 43..1" ;
31
38
sResult += (gsi8_util .getDataWord ('0' , instrumentHeight )).substring (5 );
You can’t perform that action at this time.
0 commit comments