Public Class Frm_Upload Dim fn As String = "" Dim silentmode As Boolean = False Public Sub New() ' 이 호출은 디자이너에 필요합니다. InitializeComponent() fn = "" ' InitializeComponent() 호출 뒤에 초기화 코드를 추가하십시오. End Sub Public Sub New(_file As String, Optional silent As Boolean = False) ' 이 호출은 디자이너에 필요합니다. InitializeComponent() fn = _file silentmode = silent ' InitializeComponent() 호출 뒤에 초기화 코드를 추가하십시오. End Sub Private Sub Frm_Upload_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ' Me.Hide() Application.DoEvents() LoadFile() MakeData() If fn <> "" Then Try If FpSpread1.SaveExcel(fn) Then If silentmode = False Then MsgBox("다음파일이 생성되었습니다" + vbCrLf + fn, MsgBoxStyle.Information, "확인") End If DialogResult = Windows.Forms.DialogResult.OK Else MsgBox("저장실패" + vbCrLf + fn, MsgBoxStyle.Critical, "확인") Me.Close() End If Catch ex As Exception MsgBox("저장실패" + vbCrLf + fn + vbCrLf + ex.Message, MsgBoxStyle.Critical, "확인") Me.Close() End Try End If End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click LoadFile() MakeData() End Sub Private Sub LoadFile() Dim fn As String = AppDomain.CurrentDomain.BaseDirectory + "\upload.xlsx" If Not System.IO.File.Exists(fn) Then MsgBox("업로드샘플파일(" + fn + ")가 존재하지 않습니다", MsgBoxStyle.Critical, "확인") Return End If Try If Me.FpSpread1.OpenExcel(fn) Then MakeData() End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Error") End Try End Sub Private Sub MakeData() '//결과데이터에서 자료를 추출하고 그 값을 넣는다 Dim DataColumnIndex As Integer = 10 Dim Row As Integer = 1 Dim DsReport As New DSR '//건물개요 건물개요-공공기관 체크된 경우 '공공기관' 표시 - 160211 Dim drDesc As DS.tbl_DescRow = DSET1.tbl_Desc.Rows(0) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drDesc.buildm21 : Row += 1 '//대지면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drDesc.buildm23 : Row += 1 '//연면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drDesc.buildm22 : Row += 1 '//건축면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drDesc.gujo : Row += 1 '//구조 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = String.Format("지하{0}층/지상{1}층", drDesc.builds1, drDesc.builds2) : Row += 1 '//건물규모 If drDesc.공공 = "1" Then '// FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "공공" : Row += 1 '//주체 Else FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "민간" : Row += 1 '//주체 End If Dim 주거용 As Integer = CInt(drDesc.isjugo) '//에너지 요구량 ' Result1.E요구량(0).면적당요구량 Dim v1_1 As Double = Math.Round(Result1.E요구량(0).난방면적, 1) Dim v1_2 As Double = Math.Round(Result1.E요구량(0).냉방면적, 1) Dim v1_3 As Double = Math.Round(Result1.E요구량(0).급탕면적, 1) Dim v1_4 As Double = Math.Round(Result1.E요구량(0).조명면적, 1) Dim v1_s As Double = v1_1 + v1_2 + v1_3 + v1_4 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v1_1.ToString("N1") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v1_2.ToString("N1") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v1_3.ToString("N1") : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v1_4.ToString("N1") : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "0" : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v1_s.ToString("N1") : Row += 1 '//환기 '//에너지 소요량 Dim v2_1 As Double = Math.Round(Result1.E소요량(0).난방면적, 1) Dim v2_2 As Double = Math.Round(Result1.E소요량(0).냉방면적, 1) Dim v2_3 As Double = Math.Round(Result1.E소요량(0).급탕면적, 1) Dim v2_4 As Double = Math.Round(Result1.E소요량(0).조명면적, 1) Dim v2_5 As Double = Math.Round(Result1.E소요량(0).환기면적, 1) Dim v2_s As Double = v2_1 + v2_2 + v2_3 + v2_4 + v2_5 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_1.ToString("N1") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_2.ToString("N1") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_3.ToString("N1") : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_4.ToString("N1") : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_5.ToString("N1") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v2_s.ToString("N1") : Row += 1 '//합계 '//1차에너지 소요량 Dim v3_1 As Double = Math.Round(Result1.일차E소요량(0).난방면적, 1) Dim v3_2 As Double = Math.Round(Result1.일차E소요량(0).냉방면적, 1) Dim v3_3 As Double = Math.Round(Result1.일차E소요량(0).급탕면적, 1) Dim v3_4 As Double = Math.Round(Result1.일차E소요량(0).조명면적, 1) Dim v3_5 As Double = Math.Round(Result1.일차E소요량(0).환기면적, 1) Dim v3_s As Double = v3_1 + v3_2 + v3_3 + v3_4 + v3_5 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_1.ToString("N1") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_2.ToString("N1") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_3.ToString("N1") : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_4.ToString("N1") : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_5.ToString("N1") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = v3_s.ToString("N1") : Row += 1 '//환기 Dim 합계 As Decimal = 0 '//등급용1차에너지 Dim 일차에너지소요량합계 As Decimal = 0 '//등급계산에서 사용함 Dim 난방에너지, 냉방에너지, 급탕에너지, 조명에너지, 환기에너지 As Single If (Result1.사용면적.H_WF = 0) Then 난방에너지 = 0 Else 난방에너지 = Math.Round(Result1.일차E소요량(0).난방면적2 * Result1.사용면적.H / Result1.사용면적.H_WF, 1) End If If (Result1.사용면적.C_WF = 0) Then 냉방에너지 = 0 Else 냉방에너지 = Math.Round(TOSG(Result1.일차E소요량(0).냉방면적 * Result1.사용면적.C / Result1.사용면적.C_WF), 1) End If If (Result1.사용면적.W_WF = 0) Then 급탕에너지 = 0 Else 급탕에너지 = Math.Round(Result1.일차E소요량(0).급탕면적2 * Result1.사용면적.W / Result1.사용면적.W_WF, 1) End If If (Result1.사용면적.L_WF = 0) Then 조명에너지 = 0 Else 조명에너지 = Math.Round(Result1.일차E소요량(0).조명면적 * Result1.사용면적.L / Result1.사용면적.L_WF, 1) End If If (Result1.사용면적.V_WF = 0) Then 환기에너지 = 0 Else 환기에너지 = Math.Round(Result1.일차E소요량(0).환기면적 * Result1.사용면적.V / Result1.사용면적.V_WF, 1) End If 일차에너지소요량합계 = 냉방에너지 + 난방에너지 + 급탕에너지 + 조명에너지 + 환기에너지 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방에너지.ToString : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉방에너지.ToString : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 급탕에너지.ToString : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 조명에너지.ToString : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 환기에너지.ToString : Row += 1 '//환기 합계 = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 합계.ToString("N1") : Row += 1 '//환기 '//연간 CO2발생량 Dim StartCode As Integer = 79 '//76 Dim CO2_1, CO2_2, CO2_3, CO2_4, CO2_5 As Decimal CO2_1 = Math.Round(RData("410", StartCode + 0), 1) CO2_2 = Math.Round(RData("410", StartCode + 7), 1) CO2_3 = Math.Round(RData("410", StartCode + 15), 1) CO2_4 = Math.Round(RData("410", StartCode + 22), 1) CO2_5 = Math.Round(RData("410", StartCode + 25), 1) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_1.ToString : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_2.ToString : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_3.ToString : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_4.ToString : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_5.ToString : Row += 1 '//환기 합계 = CO2_1 + CO2_2 + CO2_3 + CO2_4 + CO2_5 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 합계.ToString() : Row += 1 '//환기 '//단위면적당 CO2발생량 CO2_1 = Math.Round(RData("410", StartCode + 6), 1) CO2_2 = Math.Round(RData("410", StartCode + 14), 1) CO2_3 = Math.Round(RData("410", StartCode + 21), 1) CO2_4 = Math.Round(RData("410", StartCode + 24), 1) CO2_5 = Math.Round(RData("410", StartCode + 27), 1) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_1.ToString : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_2.ToString : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_3.ToString : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_4.ToString : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = CO2_5.ToString : Row += 1 '//환기 합계 = CO2_1 + CO2_2 + CO2_3 + CO2_4 + CO2_5 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 합계.ToString() : Row += 1 '//환기 '//평가결과값(report_pyonga 에서 가져옴) Pub.항목별평가결과(DsReport) If DsReport.Pyonga_YK.Rows.Count < 1 Then MsgBox("구조체값이 생성되지 않았습니다", MsgBoxStyle.Critical, "확인") Return End If Dim drYK As DSR.Pyonga_YKRow = DsReport.Pyonga_YK.Rows(0) '//구조체 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.벽체종류 : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.벽체값.ToString("N3") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지붕종류 : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지붕값.ToString("N3") : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.바닥종류 : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.바닥값.ToString("N3") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.창호종류 : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.창호값.ToString("N3") : Row += 1 '//환기 '//창면적비 9개(?) Dim 창및문면적비, 외벽열관류율_평균 As Decimal Dim 외벽열관류율_남 As Decimal Dim 외벽열관류율_남동 As Decimal Dim 외벽열관류율_동 As Decimal Dim 외벽열관류율_북동 As Decimal Dim 외벽열관류율_북 As Decimal Dim 외벽열관류율_북서 As Decimal Dim 외벽열관류율_서 As Decimal Dim 외벽열관류율_남서 As Decimal Dim 창열관류율_평균 As Decimal Dim 창열관류율_남 As Decimal Dim 창열관류율_남동 As Decimal Dim 창열관류율_동 As Decimal Dim 창열관류율_북동 As Decimal Dim 창열관류율_북 As Decimal Dim 창열관류율_북서 As Decimal Dim 창열관류율_서 As Decimal Dim 창열관류율_남서 As Decimal Dim 일사에너지투과율_평균 As Decimal Dim 일사에너지투과율_남 As Decimal Dim 일사에너지투과율_남동 As Decimal Dim 일사에너지투과율_동 As Decimal Dim 일사에너지투과율_북동 As Decimal Dim 일사에너지투과율_북 As Decimal Dim 일사에너지투과율_북서 As Decimal Dim 일사에너지투과율_서 As Decimal Dim 일사에너지투과율_남서 As Decimal calc_창및문면적비(창및문면적비, 외벽열관류율_평균, 창열관류율_평균, 일사에너지투과율_평균) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//난방 calc_창및문면적비(창및문면적비, 외벽열관류율_남, 창열관류율_남, 일사에너지투과율_남, "남") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//냉방 calc_창및문면적비(창및문면적비, 외벽열관류율_남동, 창열관류율_남동, 일사에너지투과율_남동, "남동") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//급탕 calc_창및문면적비(창및문면적비, 외벽열관류율_동, 창열관류율_동, 일사에너지투과율_동, "동") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//조명 calc_창및문면적비(창및문면적비, 외벽열관류율_북동, 창열관류율_북동, 일사에너지투과율_북동, "북동") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//환기 calc_창및문면적비(창및문면적비, 외벽열관류율_북, 창열관류율_북, 일사에너지투과율_북, "북") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//환기 calc_창및문면적비(창및문면적비, 외벽열관류율_북서, 창열관류율_북서, 일사에너지투과율_북서, "북서") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//환기 calc_창및문면적비(창및문면적비, 외벽열관류율_서, 창열관류율_서, 일사에너지투과율_서, "서") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//환기 calc_창및문면적비(창및문면적비, 외벽열관류율_남서, 창열관류율_남서, 일사에너지투과율_남서, "남서") FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 창및문면적비.ToString("N2") : Row += 1 '//환기 '//평균열관류율 11개(?) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_평균.ToString("N3") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_남.ToString("N3") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_남동.ToString("N3") : Row += 1 '//급탕 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_동.ToString("N3") : Row += 1 '//조명 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_북동.ToString("N3") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_북.ToString("N3") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_북서.ToString("N3") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_서.ToString("N3") : Row += 1 '//환기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 외벽열관류율_남서.ToString("N3") : Row += 1 '//환기 '//외벽지붕(평균열관류율) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = calc_평균열관류율(New String() {"외벽(지붕)", "내벽(지붕)"}).ToString("N3") : Row += 1 '//환기 '//외벽바닥(평균열관류율) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = calc_평균열관류율(New String() {"외벽(바닥)", "내벽(바닥)"}).ToString("N3") : Row += 1 '//환기 '//기밀성능(주거용 본인증) Dim 기밀성능_침기율면적합 As Decimal = 0 Dim 기밀성능_면적합 As Decimal = 0 For Each drZOne As DS.tbl_zoneRow In DSET1.tbl_zone.Select("code <> '0'") '//입력존수값이 없는것은 기본값 1로 처리를 한다 If String.IsNullOrWhiteSpace(drZOne.입력존의수) Then drZOne.입력존의수 = "1" If Not IsNumeric(drZOne.입력존의수) Then drZOne.입력존의수 = "1" Dim 존수 As Integer = TOSG(drZOne.입력존의수) If 존수 < 1 Then Continue For If Not IsNumeric(drZOne.면적) Then drZOne.면적 = "0" If CInt(drZOne.면적) = 0 Then MsgBox("입력존(" + drZOne.설명 + ") 의 면적이 입력되지 않았습니다", MsgBoxStyle.Critical, "확인") Continue For End If 기밀성능_면적합 += (존수 * drZOne.면적) 기밀성능_침기율면적합 += (drZOne.침기율 * (존수 * drZOne.면적)) Next Dim 기밀성능 As Decimal = 0 If 기밀성능_면적합 <> 0 Then 기밀성능 = 기밀성능_침기율면적합 / 기밀성능_면적합 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 기밀성능.ToString("N2") : Row += 1 '//환기 '//용도프로필 (tbl_profile, tbl_zone , zone에서 profile 을 연결함 필드명은 프로필 Dim 면적_총합 As Decimal = 0 Dim 면적_소규모사무실 As Decimal = 0 Dim 면적_대규모사무실 As Decimal = 0 Dim 면적_회의및세미나실 As Decimal = 0 Dim 면적_강당 As Decimal = 0 Dim 면적_구내식당 As Decimal = 0 Dim 면적_화장실 As Decimal = 0 Dim 면적_그외체류공간 As Decimal = 0 Dim 면적_부속공간 As Decimal = 0 Dim 면적_창고설비문서실 As Decimal = 0 Dim 면적_전산실 As Decimal = 0 Dim 면적_주방및조리실 As Decimal = 0 Dim 면적_병실 As Decimal = 0 Dim 면적_객실 As Decimal = 0 Dim 면적_교실 As Decimal = 0 Dim 면적_강의실 As Decimal = 0 Dim 면적_매장 As Decimal = 0 Dim 면적_전시실 As Decimal = 0 Dim 면적_열람실 As Decimal = 0 Dim 면적_체육시설 As Decimal = 0 '''''''''''''''''''''''''''''''''''''' Dim 비중_소규모사무실 As Decimal = 0 '//0001 Dim 비중_대규모사무실 As Decimal = 0 '//0002 Dim 비중_회의및세미나실 As Decimal = 0 '//0003 Dim 비중_강당 As Decimal = 0 '//0004 Dim 비중_구내식당 As Decimal = 0 '//0005 Dim 비중_화장실 As Decimal = 0 '//0006 Dim 비중_그외체류공간 As Decimal = 0 '//0007 Dim 비중_부속공간 As Decimal = 0 '//0008 Dim 비중_창고설비문서실 As Decimal = 0 '//0009 Dim 비중_전산실 As Decimal = 0 '//0010 Dim 비중_주방및조리실 As Decimal = 0 '//0011 Dim 비중_병실 As Decimal = 0 '//0012 Dim 비중_객실 As Decimal = 0 '//0013 Dim 비중_교실 As Decimal = 0 '//0014 Dim 비중_강의실 As Decimal = 0 '//0015 Dim 비중_매장 As Decimal = 0 '//0016 Dim 비중_전시실 As Decimal = 0 '//0017 Dim 비중_열람실 As Decimal = 0 '//0018 Dim 비중_체육시설 As Decimal = 0 '//0019 Dim 면적 As Decimal = 0 For Each drzone As DS.tbl_zoneRow In DSET1.tbl_zone.Select("code <> '0' and 프로필 <> '' and 면적 <> '0' and 면적 <> '' ") If Not IsNumeric(drzone.면적) Then drzone.면적 = "0" Dim 존수 As Integer = 0 If IsNumeric(drzone.입력존의수) Then 존수 = CInt(drzone.입력존의수) Else 존수 = 1 End If If IsNumeric(drzone.면적) Then 면적 = drzone.면적 * 존수 Else 면적 = 0 End If 면적_총합 += 면적 If drzone.프로필 = "0001" Then 면적_소규모사무실 += 면적 '//0001 If drzone.프로필 = "0002" Then 면적_대규모사무실 += 면적 '//0002 If drzone.프로필 = "0003" Then 면적_회의및세미나실 += 면적 '//0003 If drzone.프로필 = "0004" Then 면적_강당 += 면적 '//0004 If drzone.프로필 = "0005" Then 면적_구내식당 += 면적 '//0005 If drzone.프로필 = "0006" Then 면적_화장실 += 면적 '//0006 If drzone.프로필 = "0007" Then 면적_그외체류공간 += 면적 '//0007 If drzone.프로필 = "0008" Then 면적_부속공간 += 면적 '//0008 If drzone.프로필 = "0009" Then 면적_창고설비문서실 += 면적 '//0009 If drzone.프로필 = "0010" Then 면적_전산실 += 면적 '//0010 If drzone.프로필 = "0011" Then 면적_주방및조리실 += 면적 '//0011 If drzone.프로필 = "0012" Then 면적_병실 += 면적 '//0012 If drzone.프로필 = "0013" Then 면적_객실 += 면적 '//0013 If drzone.프로필 = "0014" Then 면적_교실 += 면적 '//0014 If drzone.프로필 = "0015" Then 면적_강의실 += 면적 '//0015 If drzone.프로필 = "0016" Then 면적_매장 += 면적 '//0016 If drzone.프로필 = "0017" Then 면적_전시실 += 면적 '//0017 If drzone.프로필 = "0018" Then 면적_열람실 += 면적 '//0018 If drzone.프로필 = "0019" Then 면적_체육시설 += 면적 '//0019 Next 비중_소규모사무실 = (면적_소규모사무실 / 면적_총합) * 100 '//0001 비중_대규모사무실 = (면적_대규모사무실 / 면적_총합) * 100 '//0002 비중_회의및세미나실 = (면적_회의및세미나실 / 면적_총합) * 100 '//0003 비중_강당 = (면적_강당 / 면적_총합) * 100 '//0004 비중_구내식당 = (면적_구내식당 / 면적_총합) * 100 '//0005 비중_화장실 = (면적_화장실 / 면적_총합) * 100 '//0006 비중_그외체류공간 = (면적_그외체류공간 / 면적_총합) * 100 '//0007 비중_부속공간 = (면적_부속공간 / 면적_총합) * 100 '//0008 비중_창고설비문서실 = (면적_창고설비문서실 / 면적_총합) * 100 '//0009 비중_전산실 = (면적_전산실 / 면적_총합) * 100 '//0010 비중_주방및조리실 = (면적_주방및조리실 / 면적_총합) * 100 '//0011 비중_병실 = (면적_병실 / 면적_총합) * 100 '//0012 비중_객실 = (면적_객실 / 면적_총합) * 100 '//0013 비중_교실 = (면적_교실 / 면적_총합) * 100 '//0014 비중_강의실 = (면적_강의실 / 면적_총합) * 100 '//0015 비중_매장 = (면적_매장 / 면적_총합) * 100 '//0016 비중_전시실 = (면적_전시실 / 면적_총합) * 100 '//0017 비중_열람실 = (면적_열람실 / 면적_총합) * 100 '//0018 비중_체육시설 = (면적_체육시설 / 면적_총합) * 100 '//0019 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_소규모사무실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_소규모사무실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_대규모사무실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_대규모사무실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_회의및세미나실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_회의및세미나실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_강당.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_강당.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_구내식당.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_구내식당.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_화장실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_화장실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_그외체류공간.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_그외체류공간.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_부속공간.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_부속공간.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_창고설비문서실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_창고설비문서실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_전산실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_전산실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_주방및조리실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_주방및조리실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_병실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_병실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_객실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_객실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_교실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_교실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_강의실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_강의실.ToString("N2") : Row += 1 '//난방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_매장.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_매장.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_전시실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_전시실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_열람실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_열람실.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 면적_체육시설.ToString("N2") : Row += 1 '//냉방 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비중_체육시설.ToString("N2") : Row += 1 '//냉방 '//기계부문평가항목-냉난방방식-난방 ' Dim MaxValue As Decimal = 0 'Dim MaxValueTitle As String = "" Dim 난방용량합 As Decimal = 0 Dim 난방용량합_전기 As Decimal = 0 Dim 난방용량합_비전기 As Decimal = 0 Dim 난방용량비율_전기 As Decimal = 0 Dim 난방용량비율_비전기 As Decimal = 0 Dim 펌프동력합 As Decimal = 0 Dim 냉난방방식_난방 As String = "" For Each dr난방 As DS.tbl_nanbangkikiRow In DSET1.tbl_nanbangkiki.Select("code <> '0'") Dim filter As String = String.Format("code <> '0' and 열생산난방생산기기='{0}' or 공조난방생산기기='{0}'", dr난방.code) Dim 존수 As Integer = 0 For Each dr존 As DS.tbl_zoneRow In DSET1.tbl_zone.Select(filter) If Not IsNumeric(dr존.입력존의수) Then dr존.입력존의수 = "1" 존수 += CInt(dr존.입력존의수) Next If Not IsNumeric(dr난방.보일러정격출력) Then dr난방.보일러정격출력 = "0" If Not IsNumeric(dr난방.열교환기정격출력) Then dr난방.열교환기정격출력 = "0" If Not IsNumeric(dr난방.히트난방용량) Then dr난방.히트난방용량 = "0" Dim 개별식형태 As Boolean = dr난방.개별기기적용 If Not 개별식형태 AndAlso 존수 = 1 Then 개별식형태 = True '//입력존이 1이면 개별식형태로 한다 If 냉난방방식_난방 = "" Then 냉난방방식_난방 = IIf(개별식형태, "개별식", "중앙식") ElseIf 냉난방방식_난방 = "개별식" AndAlso Not 개별식형태 Then 냉난방방식_난방 = "혼합식" ElseIf 냉난방방식_난방 = "중앙식" AndAlso 개별식형태 Then 냉난방방식_난방 = "혼합식" End If Dim 최대값 As Decimal = 0 If dr난방.개별기기적용 Then 최대값 = Math.Max(TOSG(dr난방.보일러정격출력), TOSG(dr난방.열교환기정격출력)) 최대값 = Math.Max(최대값, TOSG(dr난방.히트난방용량)) 최대값 *= 존수 펌프동력합 += TOSG(dr난방.펌프동력) * 존수 If dr난방.열생산기기방식 = "히트펌프" Then 난방용량합 += TOSG(dr난방.히트난방용량) * 존수 If dr난방.히트연료 = "전기" Then 난방용량합_전기 += TOSG(dr난방.히트난방용량) * 존수 ElseIf dr난방.열생산기기방식 = "전기보일러" Then 난방용량합 += TOSG(dr난방.보일러정격출력) * 존수 난방용량합_전기 += TOSG(dr난방.보일러정격출력) * 존수 ElseIf dr난방.열생산기기방식 = "지역난방" Then 난방용량합 += TOSG(dr난방.열교환기정격출력) * 존수 Else 난방용량합 += 최대값 '//모를경우에는 해당값중 최대값을 사용함(임의처리함 arin) End If Else 펌프동력합 += TOSG(dr난방.펌프동력) 최대값 = Math.Max(TOSG(dr난방.보일러정격출력), TOSG(dr난방.열교환기정격출력)) If dr난방.열생산기기방식 = "히트펌프" Then 난방용량합 += TOSG(dr난방.히트난방용량) If dr난방.히트연료 = "전기" Then 난방용량합_전기 += TOSG(dr난방.히트난방용량) ElseIf dr난방.열생산기기방식 = "전기보일러" Then 난방용량합 += TOSG(dr난방.보일러정격출력) 난방용량합_전기 += TOSG(dr난방.보일러정격출력) ElseIf dr난방.열생산기기방식 = "지역난방" Then 난방용량합 += TOSG(dr난방.열교환기정격출력) Else 난방용량합 += 최대값 '//모를경우에는 해당값중 최대값을 사용함(임의처리함 arin) End If End If 'If 최대값 > MaxValue Then ' MaxValue = 최대값 ' MaxValueTitle = dr난방.설명 'End If Next 난방용량합_비전기 = 난방용량합 - 난방용량합_전기 If 난방용량합 <> 0 Then 난방용량비율_전기 = (난방용량합_전기 / 난방용량합) * 100 난방용량비율_비전기 = (난방용량합_비전기 / 난방용량합) * 100 End If FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉난방방식_난방 : Row += 1 '//난방 '//기계부문평가항목-냉난방방식-냉방 'MaxValue = 0 'MaxValueTitle = "" Dim 냉방용량합 As Decimal = 0 Dim 냉방용량합_전기 As Decimal = 0 Dim 냉난방방식_냉방 As String = "" For Each dr냉방 As DS.tbl_nangbangkikiRow In DSET1.tbl_nangbangkiki.Select("code <> '0'") Dim filter As String = String.Format("열생산냉방생산기기='{0}' or 공조냉방생산기기='{0}'", dr냉방.code) Dim 존수 As Integer = 0 For Each dr존 As DS.tbl_zoneRow In DSET1.tbl_zone.Select(filter) If Not IsNumeric(dr존.입력존의수) Then dr존.입력존의수 = "1" 존수 += CInt(dr존.입력존의수) Next If Not IsNumeric(dr냉방.냉동기용량) Then dr냉방.냉동기용량 = "0" Dim 개별식형태 As Boolean = dr냉방.개별기기적용 If Not 개별식형태 AndAlso 존수 = 1 Then 개별식형태 = True '//입력존이 1이면 개별식형태로 한다 If 냉난방방식_냉방 = "" Then 냉난방방식_냉방 = IIf(개별식형태, "개별식", "중앙식") ElseIf 냉난방방식_냉방 = "개별식" AndAlso Not 개별식형태 Then 냉난방방식_냉방 = "혼합식" ElseIf 냉난방방식_냉방 = "중앙식" AndAlso 개별식형태 Then 냉난방방식_냉방 = "혼합식" End If Dim 최대값 As Decimal = 0 If dr냉방.개별기기적용 Then 최대값 = TOSG(dr냉방.냉동기용량) * 존수 냉방용량합 += TOSG(dr냉방.냉동기용량) * 존수 If dr냉방.냉동기방식 = "압축식" Then 냉방용량합_전기 += TOSG(dr냉방.냉동기용량) * 존수 Else 최대값 = TOSG(dr냉방.냉동기용량) 냉방용량합 += TOSG(dr냉방.냉동기용량) If dr냉방.냉동기방식 = "압축식" Then 냉방용량합_전기 += TOSG(dr냉방.냉동기용량) End If 'If 최대값 > MaxValue Then ' MaxValue = 최대값 ' MaxValueTitle = dr냉방.설명 'End If Next Dim 냉방용량합_비전기 As Decimal = 냉방용량합 - 냉방용량합_전기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉난방방식_냉방 : Row += 1 '//냉방 '//전력수요관리시설(냉방)-전기사용설비-용량합 % FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉방용량합_전기.ToString("N2") : Row += 1 '//전력수요관리시설(냉방)-전기사용설비-비중 % Dim 전기사용설비비중 As Decimal = 0 If 냉방용량합 <> 0 Then 전기사용설비비중 = (냉방용량합_전기 / 냉방용량합) * 100 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 전기사용설비비중.ToString("N2") : Row += 1 '//전력수요관리시설(냉방)-비전기사용설비-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉방용량합_비전기.ToString("N2") : Row += 1 '//전력수요관리시설(냉방)-비전기사용설비-비중 Dim 비전기사용설비비중 As Decimal = 0 If 냉방용량합 <> 0 Then 비전기사용설비비중 = (냉방용량합_비전기 / 냉방용량합) * 100 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 비전기사용설비비중.ToString("N2") : Row += 1 '//전력수요관리시설(난방)-전기사용설비-용량 kw FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방용량합_전기.ToString("N2") : Row += 1 '//전력수요관리시설(난방)-전기사용설비-비중 % FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방용량비율_전기.ToString("N2") : Row += 1 '//전력수요관리시설(난방)-비전기사용설비-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방용량합_비전기.ToString("N2") : Row += 1 '//전력수요관리시설(난방)-비전기사용설비-비중 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방용량비율_비전기.ToString("N2") : Row += 1 '/온열월설비-난방방식 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.온열원설비방식 : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.온열원설비연료 : Row += 1 '/온열월설비-사용연료 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.온열원용량 : Row += 1 '/온열월설비-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.온열원효율 : Row += 1 '/온열월설비-효율 '/냉열원설비-냉방방식 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.냉열원설비방식 : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.냉열원설비연료 : Row += 1 '/냉열원설비-사용연료 '//냉열원설비용량 160214 Dim 냉열원설비용량 As Decimal = 0 For Each dr냉방 As DS.tbl_nangbangkikiRow In DSET1.tbl_nangbangkiki.Select("code <> '0'") If Not IsNumeric(dr냉방.냉동기용량) Then dr냉방.냉동기용량 = "0" If Not dr냉방.개별기기적용 Then 냉열원설비용량 += dr냉방.냉동기용량 Else Dim filter As String = String.Format("열생산냉방생산기기='{0}' or 공조냉방생산기기='{0}'", dr냉방.code) Dim DR() As DS.tbl_zoneRow = DSET1.tbl_zone.Select(filter) Dim cnt As Integer = 0 For Each drow As DS.tbl_zoneRow In DR Dim 입력존수문자 As Integer = drow.입력존의수 If IsNumeric(입력존수문자) = False Then 입력존수문자 = "1" cnt += CInt(입력존수문자) Next 냉열원설비용량 += (dr냉방.냉동기용량 * cnt) End If Next FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 냉열원설비용량 : Row += 1 '/냉열원설비-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.냉열원효율 : Row += 1 '/냉열원설비-효율 '//급탕설비-급탕방식 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.급탕설비방식 : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.급탕설비연료 : Row += 1 '//급탕설비-사용연료 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.급탕용량 : Row += 1 '//급탕설비-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.급탕효율 : Row += 1 '//급탕설비-효율 '//펌프-순환수용-동력 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 펌프동력합.ToString("N2") : Row += 1 '//펌프-순환수용-효율(eco2 미지원) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//펌프-급탕용-동력 Dim dr난방기기() As DS.tbl_nanbangkikiRow = DSET1.tbl_nanbangkiki.Select("code <> '0' and code <> '0000'") Dim 펌프_급탕용_동력합 As Decimal = 0.0F For Each dr난방 As DS.tbl_nanbangkikiRow In dr난방기기 Dim 연결존수 As Integer = 0 Dim DRZ() As DS.tbl_zoneRow = DSET1.tbl_zone.Select("code <> '0' and 열생산급탕생산기기='" & dr난방.code & "'") For Each drow As DS.tbl_zoneRow In DRZ Dim 입력존수문자 As Integer = drow.입력존의수 If IsNumeric(입력존수문자) = False Then 입력존수문자 = "1" 연결존수 += CInt(입력존수문자) Next If 연결존수 > 0 Then If Not IsNumeric(dr난방.펌프동력급탕) Then dr난방.펌프동력급탕 = "0" 펌프_급탕용_동력합 += TOSG(dr난방.펌프동력급탕) End If Next FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 펌프_급탕용_동력합 : Row += 1 '//펌프-급탕용-효율(eco2 미지원) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//송풍기관련로직(160211) Dim filter2 As String = "code <> '0' and code <> '0000' and ( 열교환기유형 = '전열교환' or 열교환기유형='현열교환' or 열교환기유형 = '열회수불가')" filter2 = "code <> '0' and code <> '0000'" Dim dr공조기기() As DS.tbl_kongjoRow = DSET1.tbl_kongjo.Select(filter2) Dim 송풍기_급기_풍량_합 As Decimal = 0 Dim 송풍기_급기_팬동력_합 As Decimal = 0 Dim 송풍기_급기_팬효율_평균 As Decimal = 0 Dim 송풍기_급기_팬효율_합 As Decimal = 0 Dim 송풍기_배기_풍량_합 As Decimal = 0 Dim 송풍기_배기_팬동력_합 As Decimal = 0 Dim 송풍기_배기_팬효율_평균 As Decimal = 0 Dim 송풍기_배기_팬효율_합 As Decimal = 0 Dim 전열교환기_풍량_합 As Decimal = 0 Dim 전열교환기_전열풍량_합 As Decimal = 0 Dim 전열교환기_열회수효율_난방_합 As Decimal = 0 Dim 전열교환기_열회수효율_냉방_합 As Decimal = 0 Dim 전열교환기_열회수효율_난방_수 As Integer = 0 Dim 전열교환기_열회수효율_냉방_수 As Integer = 0 'Dim 송풍기연결면적합 As Decimal = 0 '//전체면적합 '//160327 로직변경 For Each dr공조 As DS.tbl_kongjoRow In dr공조기기 Dim 연결존수 As Integer = 0 Dim DRz() As DS.tbl_zoneRow = DSET1.tbl_zone.Select("냉난방공조처리시스템='" & dr공조.code & "'") If DRz.Length < 1 Then Continue For '//연결이되지 않은 기기는 넘어가도록 한다 For Each drow As DS.tbl_zoneRow In DRz If Not IsNumeric(drow.입력존의수) Then drow.입력존의수 = "0" If Not IsNumeric(drow.면적) Then drow.면적 = "0" 연결존수 += CInt(drow.입력존의수) '송풍기연결면적합 += (TOSG(drow.면적) * TOSG(drow.입력존의수)) Next '//연결된 존중 입력존의수값이 0이라면 처리하지 않는다 If 연결존수 < 1 Then Continue For '//160327 - 열교환기유형에따라서 계산식 변경 If dr공조.열교환기유형 = "열회수불가" Then '//송풍기 송풍기_급기_풍량_합 += TOSG(dr공조.급기풍량) 송풍기_급기_팬동력_합 += TOSG(dr공조.급기팬동력) If TOSG(dr공조.총효율급기팬) > 0 Then 송풍기_급기_팬효율_합 += TOSG(dr공조.총효율급기팬) * TOSG(dr공조.급기풍량) End If 송풍기_배기_풍량_합 += TOSG(dr공조.배기풍량) 송풍기_배기_팬동력_합 += TOSG(dr공조.배기팬동력) If TOSG(dr공조.총효율배기팬) > 0 Then 송풍기_배기_팬효율_합 += TOSG(dr공조.총효율배기팬) * TOSG(dr공조.배기풍량) End If Else '//전열교환기 If TOSG(dr공조.열회수율) <> 0 Then 전열교환기_열회수효율_난방_합 += TOSG(dr공조.열회수율) 전열교환기_열회수효율_난방_수 += 1 End If If TOSG(dr공조.열회수율냉) <> 0 Then 전열교환기_열회수효율_냉방_합 += TOSG(dr공조.열회수율냉) 전열교환기_열회수효율_냉방_수 += 1 End If 전열교환기_풍량_합 += TOSG(dr공조.급기풍량) + TOSG(dr공조.배기풍량) If dr공조.열교환기유형 = "전열교환" Then 전열교환기_전열풍량_합 += TOSG(dr공조.급기풍량) + TOSG(dr공조.배기풍량) End If End If Next If 송풍기_급기_풍량_합 > 0 Then 송풍기_급기_팬효율_평균 = 송풍기_급기_팬효율_합 / 송풍기_급기_풍량_합 End If If 송풍기_배기_풍량_합 > 0 Then 송풍기_배기_팬효율_평균 = 송풍기_배기_팬효율_합 / 송풍기_배기_풍량_합 End If '//송풍기-급기-풍량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_급기_풍량_합 : Row += 1 '//송풍기-급기-동력 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_급기_팬동력_합 : Row += 1 '//송풍기-급기-효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_급기_팬효율_평균.ToString("N3") : Row += 1 '//송풍기-배기-풍량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_배기_풍량_합 : Row += 1 '//송풍기-배기-동력 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_배기_팬동력_합 : Row += 1 '//송풍기-배기-효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 송풍기_배기_팬효율_평균.ToString("N3") : Row += 1 '//전열교환기-풍량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 전열교환기_풍량_합 : Row += 1 '//전열교환기-비중 Dim 전열교환기비중 As Decimal = 0 If 전열교환기_풍량_합 > 0 Then 전열교환기비중 = (전열교환기_풍량_합 / (전열교환기_풍량_합 + 송풍기_배기_풍량_합 + 송풍기_급기_풍량_합)) * 100 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 전열교환기비중.ToString("N3") + "%" : Row += 1 '//전열교환기-열회수효율-난방 Dim 전열교환기_열회수효율_난방_평균 As Decimal = 0 If 전열교환기_열회수효율_난방_수 > 0 Then 전열교환기_열회수효율_난방_평균 = 전열교환기_열회수효율_난방_합 / 전열교환기_열회수효율_난방_수 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 전열교환기_열회수효율_난방_평균 : Row += 1 '//전열교환기-열회수효율-냉방 Dim 전열교환기_열회수효율_냉방_평균 As Decimal = 0 If 전열교환기_열회수효율_냉방_수 > 0 Then 전열교환기_열회수효율_냉방_평균 = 전열교환기_열회수효율_냉방_합 / 전열교환기_열회수효율_냉방_수 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 전열교환기_열회수효율_냉방_평균 : Row += 1 '//조명에너지-평균조명에너지부하율 Dim 조명에너지_부하율합 As Decimal = 0 Dim 조명에너지_면적합 As Decimal = 0 For Each drZone As DS.tbl_zoneRow In DSET1.tbl_zone.Select("code <> '0' and code <>'0000' and 면적 <> '0' and 면적 <> ''") '//입력오류 체크 If Not IsNumeric(drZone.면적) Then drZone.면적 = "0" If Not IsNumeric(drZone.입력존의수) Then drZone.입력존의수 = "1" If Not IsNumeric(drZone.조명에너지부하율입력치) Then drZone.조명에너지부하율입력치 = "0" If Not IsNumeric(drZone.조명에너지부하율계산치) Then drZone.조명에너지부하율계산치 = "0" If drZone.면적 <> "0" Then 조명에너지_면적합 += CInt(drZone.입력존의수) * TOSG(drZone.면적) '//모든면적의총합 If drZone.조명부하산출방법 = "입력치" Then 조명에너지_부하율합 += TOSG(drZone.조명에너지부하율입력치) * (CInt(drZone.입력존의수) * TOSG(drZone.면적)) ElseIf drZone.조명부하산출방법 = "계산치" Then 조명에너지_부하율합 += TOSG(drZone.조명에너지부하율계산치) * (CInt(drZone.입력존의수) * TOSG(drZone.면적)) End If End If Next Dim 평균조명에너지부하율 As Decimal = 0 If 조명에너지_면적합 <> 0 Then 평균조명에너지부하율 = (조명에너지_부하율합 / 조명에너지_면적합) FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 평균조명에너지부하율.ToString("N2") : Row += 1 '//조명에너지-주조명광원 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.주조명광원 : Row += 1 '//태양열-난방-용량 Dim 난방축열탱크용량_합 As Decimal = 0 Dim 급탕축열탱크용량_합 As Decimal = 0 Dim 태영열면적_합 As Decimal = 0 Dim 태양열계수_합 As Decimal = 0 Dim 태양광모듈효율_합 As Decimal = 0 Dim 태양광면적_합 As Decimal = 0 Dim 태양광용량_합 As Decimal = 0 For Each dr신재생 As DS.tbl_newRow In DSET1.tbl_new.Select("code <> '0'") If dr신재생.기기종류 = "태양열" Then If Not IsNumeric(dr신재생.축열탱크체적급탕) Then dr신재생.축열탱크체적급탕 = "0" If Not IsNumeric(dr신재생.축열탱크체적난방) Then dr신재생.축열탱크체적난방 = "0" If Not IsNumeric(dr신재생.집열판면적) Then dr신재생.집열판면적 = "0" If Not IsNumeric(dr신재생.무손실효율계수) Then dr신재생.무손실효율계수 = "0" 급탕축열탱크용량_합 += dr신재생.축열탱크체적급탕 난방축열탱크용량_합 += dr신재생.축열탱크체적난방 If dr신재생.무손실효율계수 <> "0" Then 태영열면적_합 += dr신재생.집열판면적 태양열계수_합 += (dr신재생.무손실효율계수 * dr신재생.집열판면적) End If ElseIf dr신재생.기기종류 = "태양광" Then If Not IsNumeric(dr신재생.태양광모듈면적) Then dr신재생.태양광모듈면적 = "0" If Not IsNumeric(dr신재생.태양광모듈효율) Then dr신재생.태양광모듈효율 = "0" If Not IsNumeric(dr신재생.태양광용량) Then dr신재생.태양광용량 = "0" 태양광용량_합 += dr신재생.태양광용량 If dr신재생.태양광모듈효율 <> "0" Then 태양광면적_합 += dr신재생.태양광모듈면적 태양광모듈효율_합 += (dr신재생.태양광모듈효율 * dr신재생.태양광모듈면적) End If End If Next FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 난방축열탱크용량_합.ToString("N3") : Row += 1 '//태양열-난방-효율 Dim 태양열난방_효율 As Decimal = 0 If 태영열면적_합 <> 0 Then 태양열난방_효율 = 태양열계수_합 / 태영열면적_합 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 태양열난방_효율.ToString("N3") : Row += 1 '//태양열-급탕-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 급탕축열탱크용량_합.ToString("N3") : Row += 1 '//태양열-급탕-효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//태양열-집열판면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양열집열판면적 : Row += 1 '//태양열-집열판유형 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양열집열기유형 : Row += 1 '//태양열-집열판방위 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양열집열판방위 : Row += 1 '//태양광-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 태양광용량_합.ToString("N3") : Row += 1 '//태양광-효율 Dim 태양광_효율 As Decimal = 0 If 태양광면적_합 <> 0 Then 태양광_효율 = 태양광모듈효율_합 / 태양광면적_합 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 태양광_효율.ToString("N3") : Row += 1 '//태양광-모듈면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양광모듈면적 : Row += 1 '//태양광-모듈기울기 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양광모듈기울기 : Row += 1 '//태양광-모듈방위 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양광모듈방위 : Row += 1 '//태양광-모듈종류 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양광모듈종류 : Row += 1 '//태양광-모듈적용타입 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.태양광모듈적용타입 : Row += 1 '//지열-난방-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지열히트펌프용량 : Row += 1 '//지열-난방-효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지열난방COP : Row += 1 '//지열-냉방-용량 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지열히트펌프용량냉방 : Row += 1 '//지열-냉방-효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.지열냉방COP : Row += 1 '//열병합-열생산능력 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.열병합열생산능력 : Row += 1 '//열병합-열생산효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.열병합열생산효율 : Row += 1 '//열병합-발전효율 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.열병합발전효율 : Row += 1 '//열병합-가동연료 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = drYK.열병합가동연료 : Row += 1 '//신재생 및 열병합 에너지생산량 (68 69 70 71 2page 계산결과 treq, grp=310) Dim 신재생에너지생산량합 As Decimal = 0 Dim 신재생에너지생산량 As Decimal = 0 For Each dr As DSR.TReqUseRow In DSETR1.TReqUse.Select("grp = '310'") If dr.Code = "068" OrElse dr.Code = "069" OrElse dr.Code = "070" OrElse dr.Code = "071" Then 신재생에너지생산량합 += dr.M00 End If Next Dim 조명사용면적 As Decimal = 0 For Each dr As DSR.TReqUseRow In DSETR1.TReqUse.Select("grp = '110'") If dr.Code = "015" Then 조명사용면적 += dr.M00 Exit For End If Next If 조명사용면적 <> 0 Then 신재생에너지생산량 = 신재생에너지생산량합 / 조명사용면적 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 신재생에너지생산량.ToString("N2") : Row += 1 '//평가책임자 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//평가자 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//에너지효율등급 Dim 에너지효율등급 As Integer = 평가결과등급(주거용, 일차에너지소요량합계) Dim 등급문자 As String = "" Select Case 에너지효율등급 Case 1 등급문자 = "1+++등급" Case 2 등급문자 = "1++등급" Case 3 등급문자 = "1+등급" Case 4 등급문자 = "1등급" Case 5 등급문자 = "2등급" Case 6 등급문자 = "3등급" Case 7 등급문자 = "4등급" Case 8 등급문자 = "5등급" Case 9 등급문자 = "6등급" Case 10 등급문자 = "7등급" End Select FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 등급문자 : Row += 1 '//예비인증 등급 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = "X" : Row += 1 '//냉방시스템설치여부(입력존에서 열생산기기 냉방에 연결된 데이터가 있다면 O) Dim 냉방시스템설치여부 As Boolean = False For Each drZone As DS.tbl_zoneRow In DSET1.tbl_zone.Select("code <> '0'") If drZone.열생산냉방생산기기 <> "0" AndAlso drZone.열생산냉방생산기기.Length > 3 Then 냉방시스템설치여부 = True Exit For End If Next FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = IIf(냉방시스템설치여부, "Y", "N") : Row += 1 '//신청지역 Dim 지역코드 As String = drDesc.buildarea Dim 지역명 As String = "" If 지역코드 <> "0000" Then Dim drWeather() As DS.tbl_weatherRow = DSET1.tbl_weather.Select("code='" + 지역코드 + "'") If drWeather.Length = 1 Then 지역명 = drWeather(0).건물위치 End If FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 지역명 : Row += 1 '//자립률관련추가 170725 '//170725 Dim 단위면적당신재생1차에너지합 As Decimal = 0 Dim 단위면적당신재생1차에너지합_offsite As Decimal = 0 Dim 단위면적당1차에너소비량합 As Decimal = 0 Dim 에너지자립률 As Double = 0 Dim 에너지자립률_offsite As Double = 0 Dim Sum As Decimal = (Result1.생산E(0).태양광전력생산량 + Result1.생산E(0).풍력전력생산량 + Result1.생산E(0).신재생열병합전력생산량) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력) Dim Sum_offsite As Decimal = (Result1.생산E(0).태양광전력생산량_offsite + Result1.생산E(0).풍력전력생산량_offsite) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력) Dim 난방 As Decimal = Sum * Result1.일차E소요량(0).난방전력 '//아마게산이안도잇으니 여기값들이 0이잇을거에요. Dim 냉방 As Decimal = Sum * Result1.일차E소요량(0).냉방전력 Dim 조명 As Decimal = Sum * Result1.일차E소요량(0).조명전력 Dim 급탕 As Decimal = Sum * Result1.일차E소요량(0).급탕전력 Dim 환기 As Decimal = Sum * Result1.일차E소요량(0).환기전력 Dim 난방_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).난방전력 '//아마게산이안도잇으니 여기값들이 0이잇을거에요. Dim 냉방_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).냉방전력 Dim 조명_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).조명전력 Dim 급탕_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).급탕전력 Dim 환기_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).환기전력 Dim 난방면적 As Decimal = 0 Dim 냉방면적 As Decimal = 0 Dim 조명면적 As Decimal = 0 Dim 급탕면적 As Decimal = 0 Dim 환기면적 As Decimal = 0 Dim 난방면적_offsite As Decimal = 0 Dim 냉방면적_offsite As Decimal = 0 Dim 조명면적_offsite As Decimal = 0 Dim 급탕면적_offsite As Decimal = 0 Dim 환기면적_offsite As Decimal = 0 If Result1.사용면적.H <> 0 Then 난방면적 = TOSG(IIf(난방 = 0, 0, 난방 / Result1.사용면적.H)) End If If Result1.사용면적.C <> 0 Then 냉방면적 = TOSG(IIf(냉방 = 0, 0, 냉방 / Result1.사용면적.C)) End If If Result1.사용면적.L <> 0 Then 조명면적 = TOSG(IIf(조명 = 0, 0, 조명 / Result1.사용면적.L)) End If If Result1.사용면적.W <> 0 Then 급탕면적 = TOSG(IIf(급탕 = 0, 0, 급탕 / Result1.사용면적.W)) End If If Result1.사용면적.V <> 0 Then 환기면적 = TOSG(IIf(환기 = 0, 0, 환기 / Result1.사용면적.V)) End If If Result1.사용면적.H <> 0 Then 난방면적_offsite = TOSG(IIf(난방_offsite = 0, 0, 난방_offsite / Result1.사용면적.H)) End If If Result1.사용면적.C <> 0 Then 냉방면적_offsite = TOSG(IIf(냉방_offsite = 0, 0, 냉방_offsite / Result1.사용면적.C)) End If If Result1.사용면적.L <> 0 Then 조명면적_offsite = TOSG(IIf(조명_offsite = 0, 0, 조명_offsite / Result1.사용면적.L)) End If If Result1.사용면적.W <> 0 Then 급탕면적_offsite = TOSG(IIf(급탕_offsite = 0, 0, 급탕_offsite / Result1.사용면적.W)) End If If Result1.사용면적.V <> 0 Then 환기면적_offsite = TOSG(IIf(환기_offsite = 0, 0, 환기_offsite / Result1.사용면적.V)) End If Dim 전기 As Decimal = 난방면적 + 냉방면적 + 조명면적 + 급탕면적 + 환기면적 Dim 전기_offsite As Decimal = 난방면적_offsite + 냉방면적_offsite + 조명면적_offsite + 급탕면적_offsite + 환기면적_offsite '//열병합신재생에너지추가 130831 arin Dim _자립_신재생에너지 As Single = -1 * (Result1.생산E(0).면적당생산량태양열 + Result1.생산E(0).신재생면적당열생산량 + Result1.생산E(0).면적당생산량지열 + 전기 * 2.75) Dim _자립_신재생에너지_offsite As Single = -1 * (전기_offsite * 2.75) 난방에너지 = Math.Round(Result1.일차E소요량(0).난방면적, 1) 냉방에너지 = Math.Round(Result1.일차E소요량(0).냉방면적, 1) 급탕에너지 = Math.Round(Result1.일차E소요량(0).급탕면적, 1) 조명에너지 = Math.Round(Result1.일차E소요량(0).조명면적, 1) 환기에너지 = Math.Round(Result1.일차E소요량(0).환기면적, 1) 단위면적당신재생1차에너지합 = Math.Round(-1 * _자립_신재생에너지, 1) 단위면적당신재생1차에너지합_offsite = Math.Round(-1 * _자립_신재생에너지_offsite, 1) 단위면적당1차에너소비량합 = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지 + 단위면적당신재생1차에너지합 If 단위면적당1차에너소비량합 <> 0 Then '에너지자립률 = (단위면적당신재생1차에너지합 / 단위면적당1차에너소비량합) * 100 에너지자립률 = (Math.Round(단위면적당신재생1차에너지합, 1) / 단위면적당1차에너소비량합) * 100 Dim scale As Decimal = 0 If 에너지자립률 >= 20 Then scale = 1.0 ElseIf 에너지자립률 >= 15 Then scale = 0.9 ElseIf 에너지자립률 >= 10 Then scale = 0.8 Else scale = 0.7 End If 에너지자립률_offsite = (Math.Round(단위면적당신재생1차에너지합_offsite * scale, 1) / 단위면적당1차에너소비량합) * 100 에너지자립률 += 에너지자립률_offsite Else 에너지자립률 = 0 에너지자립률_offsite = 0 End If FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 에너지자립률.ToString("N2") : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 단위면적당신재생1차에너지합.ToString("N1") : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 단위면적당1차에너소비량합.ToString("N1") : Row += 1 '//210702 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 에너지자립률_offsite.ToString("N2") : Row += 1 FpSpread1_Sheet1.Cells(Row, DataColumnIndex).Value = 단위면적당신재생1차에너지합_offsite.ToString("N1") : Row += 1 End Sub Private Function RData(grp As String, code As Integer) As Decimal Dim filter As String = String.Format("GRP='{0}' and code='{1}'", grp, code.ToString("000")) Dim DR() As DSR.TReqUseRow = DSETR1.TReqUse.Select(filter) If DR.GetUpperBound(0) = -1 Then Return 0 Return DR(0).M00 End Function Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim sd As New SaveFileDialog() sd.Filter = "Excel(*.xls)|*.xls" sd.FilterIndex = 0 If sd.ShowDialog = Windows.Forms.DialogResult.OK Then Try If FpSpread1.SaveExcel(sd.FileName, FarPoint.Excel.ExcelSaveFlags.NoFlagsSet) Then MsgBox("저장완료", MsgBoxStyle.Information, "확인") End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "error") End Try End If End Sub End Class