github.com/archlabjp/eeslism-go@v0.0.0-20231109122333-4bb7bfcdf292/eeslism/blsrprint.go (about) 1 //This file is part of EESLISM. 2 // 3 //Foobar is free software : you can redistribute itand /or modify 4 //it under the terms of the GNU General Public License as published by 5 //the Free Software Foundation, either version 3 of the License, or 6 //(at your option) any later version. 7 // 8 //Foobar is distributed in the hope that it will be useful, 9 //but WITHOUT ANY WARRANTY; without even the implied warranty of 10 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 11 //GNU General Public License for more details. 12 // 13 //You should have received a copy of the GNU General Public License 14 //along with Foobar.If not, see < https://www.gnu.org/licenses/>. 15 16 /* srprint.c */ 17 18 package eeslism 19 20 /* 時間別PMVの出力 */ 21 22 import ( 23 "fmt" 24 "io" 25 ) 26 27 var __Pmvprint_count = 0 28 29 func Pmvprint(fpout io.Writer, title string, Room []*ROOM, Mon, Day int, time float64) { 30 var Nr int 31 if __Pmvprint_count == 0 && Room != nil { 32 for i := range Room { 33 Rm := Room[i] 34 if Rm.Metsch != nil { 35 Nr++ 36 } 37 } 38 39 fmt.Fprintf(fpout, "%s ;\n", title) 40 fmt.Fprintf(fpout, "%d ", Nr) 41 42 for i := range Room { 43 Rm := Room[i] 44 if Rm.Metsch != nil { 45 fmt.Fprintf(fpout, " %s ", Rm.Name) 46 } 47 } 48 49 fmt.Fprintf(fpout, "\n") 50 51 __Pmvprint_count = 1 52 } 53 54 fmt.Fprintf(fpout, "%02d %02d %5.2f ", Mon, Day, time) 55 56 for i := range Room { 57 Rm := Room[i] 58 if Rm.Metsch != nil { 59 fmt.Fprintf(fpout, " %4.3f ", Rm.PMV) 60 } 61 } 62 fmt.Fprintf(fpout, "\n") 63 } 64 65 /* ----------------------------------------------------- */ 66 67 /* 室内温・湿度、室内表面平均温度の出力 68 */ 69 70 var __Rmevprint_count = 0 71 72 func Rmevprint(fpout io.Writer, title string, Room []*ROOM, Mon, Day int, time float64) { 73 if __Rmevprint_count == 0 { 74 fmt.Fprintf(fpout, "%s ;\n", title) 75 fmt.Fprintf(fpout, "%d室\t\t\t", len(Room)) 76 77 for i := range Room { 78 Rm := Room[i] 79 fmt.Fprintf(fpout, "%s\t\t\t\t", Rm.Name) 80 } 81 fmt.Fprintf(fpout, "\n") 82 83 __Rmevprint_count = 1 84 } 85 /*======================================= */ 86 fmt.Fprintf(fpout, "%d\t%d\t%.2f\t", Mon, Day, time) 87 88 for i := range Room { 89 Rm := Room[i] 90 fmt.Fprintf(fpout, "%.1f\t%.4f\t%.1f\t%.0f\t", Rm.Tr, Rm.xr, Rm.Tsav, Rm.RH) 91 } 92 93 fmt.Fprintf(fpout, "\n") 94 } 95 96 /* ----------------------------------------------------- */