-
Notifications
You must be signed in to change notification settings - Fork 0
/
eettlprt.go
79 lines (61 loc) · 2.12 KB
/
eettlprt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package eeslism
import (
"fmt"
"io"
"strings"
)
/* 標題、注記の出力(時刻別計算値ファイル) */
func __replace_dir_sep(path *string) {
// Replace directory separator to unify them
*path = strings.Replace(*path, "/", "\\", -1)
}
func ttlprint(fo io.Writer, fileid string, simc *SIMCONTL) {
// Replace directory separator to unify them
__replace_dir_sep(&simc.File)
fmt.Fprintf(fo, "%s#\n", fileid)
fmt.Fprintf(fo, "-ver %s\n", EEVERSION)
fmt.Fprintf(fo, "-t %s ;\n", simc.Title)
fmt.Fprintf(fo, "-dtf %s\n", simc.File)
fmt.Fprintf(fo, "-w %s\n", simc.Wfname)
fmt.Fprint(fo, "-tid h\n")
fmt.Fprint(fo, "-tmid ")
for i := 0; i < len(simc.Timeid); i++ {
fmt.Fprint(fo, string(simc.Timeid[i]))
}
fmt.Fprint(fo, "\n")
fmt.Fprintf(fo, "-u %s ;\n", simc.Unit)
fmt.Fprintf(fo, "-dtm %d\n", simc.DTm)
fmt.Fprintf(fo, "-Ntime %d\n", simc.Ntimehrprt)
}
/* ---------------------------------------------------- */
/* 標題、注記の出力(日集計値ファイル) */
func ttldyprint(fo io.Writer, fileid string, simc *SIMCONTL) {
fmt.Fprintf(fo, "%s#\n", fileid)
fmt.Fprintf(fo, "-ver %s\n", EEVERSION)
fmt.Fprintf(fo, "-t %s ;\n", simc.Title)
fmt.Fprintf(fo, "-dtf %s\n", simc.File)
fmt.Fprintf(fo, "-w %s\n", simc.Wfname)
fmt.Fprint(fo, "-tid d\n")
fmt.Fprint(fo, "-tmid ")
for i := 0; i < len(simc.Timeid)-1; i++ {
fmt.Fprint(fo, string(simc.Timeid[i]))
}
fmt.Fprint(fo, "\n")
fmt.Fprintf(fo, "-u %s %s ;\n", simc.Unit, simc.Unitdy)
fmt.Fprintf(fo, "-dtm %d\n", simc.DTm)
fmt.Fprintf(fo, "-Ntime %d\n", simc.Ntimedyprt)
}
/* ---------------------------------------------------- */
/* 標題、注記の出力(日集計値ファイル) */
func ttlmtprint(fo io.Writer, fileid string, simc *SIMCONTL) {
fmt.Fprintf(fo, "%s#\n", fileid)
fmt.Fprintf(fo, "-ver %s\n", EEVERSION)
fmt.Fprintf(fo, "-t %s ;\n", simc.Title)
fmt.Fprintf(fo, "-dtf %s\n", simc.File)
fmt.Fprintf(fo, "-w %s\n", simc.Wfname)
fmt.Fprint(fo, "-tid h\n")
fmt.Fprint(fo, "-tmid MT\n")
fmt.Fprintf(fo, "-u %s %s ;\n", simc.Unit, simc.Unitdy)
fmt.Fprintf(fo, "-dtm %d\n", simc.DTm)
fmt.Fprint(fo, "-Ntime 288\n") // 24 * 12
}