Public Class C에너지소요량OD Dim T As String = "에너지소요량" Dim Midx As Integer Public Mon As String Private ErrMsg As String = "에너지소요량 계산되지 않았습니다" Public Sub New(Optional ByVal pmIdx As Integer = 0) Mon = "M" & Format(pmIdx, "00") Me.Midx = pmIdx End Sub Public Sub Calc_Summary() If Midx <> 0 Then MsgBox("계산식은 0번 합계필드만 가능합니다.", MsgBoxStyle.Critical, "확인") Return End If Dim I10 As Decimal = 0 Dim I20 As Decimal = 0 Dim I30 As Decimal = 0 Dim I40 As Decimal = 0 Dim I50 As Decimal = 0 Dim I60 As Decimal = 0 Dim IH As Decimal = 0 Dim IC As Decimal = 0 Dim IL As Decimal = 0 Dim IW As Decimal = 0 Dim IV As Decimal = 0 Dim I4 As Decimal = 0 '//난방 Dim I5 As Decimal = 0 '//냉방 Dim I6 As Decimal = 0 '//조명 Dim I7 As Decimal = 0 '//급탕 Dim I8 As Decimal = 0 '//환기 For i As Integer = 1 To 12 '//12월을 다더해서 0번열에 기록한다. I10 += Result1o.E소요량(i).난방 I20 += Result1o.E소요량(i).난방보조 I30 += Result1o.E소요량(i).냉방 I40 += Result1o.E소요량(i).냉방보조 I50 += Result1o.E소요량(i).급탕 I60 += Result1o.E소요량(i).급탕보조 IH += Result1o.E소요량(i).난방S IC += Result1o.E소요량(i).냉방S IL += Result1o.E소요량(i).조명S IW += Result1o.E소요량(i).급탕S IV += Result1o.E소요량(i).환기S I4 += Result1o.일차E소요량(i).난방전력 I5 += Result1o.일차E소요량(i).냉방전력 I6 += Result1o.일차E소요량(i).조명전력 I7 += Result1o.일차E소요량(i).급탕전력 I8 += Result1o.일차E소요량(i).환기전력 'Console.WriteLine(String.Format(">>C에너지소요량 IV={0},i={1}", IV, i)) Next Me.난방 = I10 Me.난방보조 = I20 Me.냉방 = I30 Me.냉방보조 = I40 Me.급탕 = I50 Me.급탕보조 = I60 If (I4 + I5 + I6 + I7 + I8 <> 0) Then Dim baseValue As Double = (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) Me.난방S = IH - baseValue / (I4 + I5 + I6 + I7 + I8) * I4 Me.냉방S = IC - baseValue / (I4 + I5 + I6 + I7 + I8) * I5 Me.조명S = IL - baseValue / (I4 + I5 + I6 + I7 + I8) * I6 Me.급탕S = IW - baseValue / (I4 + I5 + I6 + I7 + I8) * I7 Me.환기S = IV - baseValue / (I4 + I5 + I6 + I7 + I8) * I8 Else Me.난방S = IH Me.냉방S = IC Me.조명S = IL Me.급탕S = IW Me.환기S = IV End If 'If I4 = 0 Then ' Me.난방S = 0 'Else ' Me.난방S = IH - (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) / (I4 + I5 + I6 + I7 + I8) * I4 'End If 'If I5 = 0 Then ' Me.냉방S = 0 'Else ' Me.냉방S = IC - (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) / (I4 + I5 + I6 + I7 + I8) * I5 'End If 'If I6 = 0 Then ' Me.조명S = 0 'Else ' Me.조명S = IL - (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) / (I4 + I5 + I6 + I7 + I8) * I6 'End If 'If I7 = 0 Then ' Me.급탕S = 0 'Else ' Me.급탕S = IW - (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) / (I4 + I5 + I6 + I7 + I8) * I7 'End If 'If I8 = 0 Then ' Me.환기S = 0 'Else ' Me.환기S = IV - (Result1o.생산E(0).태양광전력생산량 + Result1o.생산E(0).열병합전력생산량) / (I4 + I5 + I6 + I7 + I8) * I8 'End If End Sub ReadOnly Property 소요량() As Decimal Get Return 난방S + 냉방S + 조명S + 환기S + 급탕S End Get End Property ReadOnly Property 면적소요량() As Decimal Get Return 난방면적 + 냉방면적 + 조명면적 + 급탕면적 + 환기면적 End Get End Property Property 난방S() As Decimal Get If Midx = 0 Then Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("난방")) End If Else Return 난방 + 난방보조 End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("난방") = value End If End Set End Property Property 난방() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("난방에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("난방에너지소요량") = value End If End Set End Property Property 난방보조() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("난방보조에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("난방보조에너지소요량") = value End If End Set End Property ReadOnly Property 난방면적() As Decimal Get If Result1o.사용면적.H = 0 Then Return 0 Else Return Me.난방S / Result1o.사용면적.H End If End Get End Property Property 냉방S() As Decimal Get If Midx = 0 Then Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("냉방")) End If Else Return 냉방 + 냉방보조 End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("냉방") = value End If End Set End Property Property 냉방() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("냉방에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("냉방에너지소요량") = value End If End Set End Property Property 냉방보조() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("냉방보조에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("냉방보조에너지소요량") = value End If End Set End Property ReadOnly Property 냉방면적() As Decimal Get If Result1o.사용면적.C = 0 Then Return 0 Else Return Me.냉방S / Result1o.사용면적.C End If End Get End Property Property 조명S() As Decimal Get If Midx = 0 Then Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("조명")) End If Else Return Result1o.E분석(Midx).조명에너지요구량 End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("조명") = value End If End Set End Property ReadOnly Property 조명면적() As Decimal Get If Result1o.사용면적.L = 0 Then Return 0 Else Return Me.조명S / Result1o.사용면적.L End If End Get End Property Property 급탕S() As Decimal Get If Midx = 0 Then Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("급탕")) End If Else Return 급탕 + 급탕보조 End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("급탕") = value End If End Set End Property Property 급탕() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("급탕에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("급탕에너지소요량") = value End If End Set End Property Property 급탕보조() As Decimal Get Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("급탕보조에너지소요량")) End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("급탕보조에너지소요량") = value End If End Set End Property ReadOnly Property 급탕면적() As Decimal Get If Result1o.사용면적.W = 0 Then Return 0 Else Return 급탕S / Result1o.사용면적.W End If End Get End Property Property 환기S() As Decimal Get If Midx = 0 Then Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Return 0 Else Return TOSG(T, DR(0)("환기")) End If Else Return Result1o.E분석(Midx).환기에너지요구량 End If End Get Set(ByVal value As Decimal) Dim DR() As DSR.에너지소요량Row = CType(DSETR1.에너지소요량.Select("mon='" & Mon & "'"), DSR.에너지소요량Row()) If DR.GetUpperBound(0) = -1 Then MsgBox(ErrMsg) Else DR(0)("환기") = value End If End Set End Property ReadOnly Property 환기면적() As Decimal Get If Result1o.사용면적.V = 0 Then Return 0 Else Return 환기S / Result1o.사용면적.V End If End Get End Property End Class