2024y .
This commit is contained in:
@@ -46,7 +46,7 @@ Public Class MdiMain
|
||||
quitmsg = "현재 열려있는 파일을 저장 후 종료하시겠습니까?"
|
||||
Dim dlg As DialogResult = MsgBox(quitmsg, MsgBoxStyle.Question Or MsgBoxStyle.YesNoCancel, "확인")
|
||||
If dlg = Windows.Forms.DialogResult.Yes Then
|
||||
Me.Save_File(Prj.FileName)
|
||||
Me.Save_File(DSET1, DSETR1, Prj.FileName)
|
||||
'//저장
|
||||
ElseIf dlg = Windows.Forms.DialogResult.No Then
|
||||
'//quit
|
||||
@@ -101,7 +101,10 @@ Public Class MdiMain
|
||||
Dim L As New ArinLogin.ArinLOgin
|
||||
Dim VersionInfo As ArinLogin.ArinLOgin.sVersionInfo = Nothing
|
||||
|
||||
Select Case Prj.UserAuthType
|
||||
Dim authtype As String = Prj.UserAuthType
|
||||
'If authtype.StartsWith("BOTH_C_") Then authtype = "BOTH"
|
||||
|
||||
Select Case authtype
|
||||
Case "ADMIN"
|
||||
Me.bt_etc.Visible = True
|
||||
bt_데이터관리.Visible = True
|
||||
@@ -153,8 +156,20 @@ Public Class MdiMain
|
||||
'bt_계산결과그래프q.Visible = False
|
||||
bt_인증평가서.Visible = False
|
||||
btImport.Visible = False
|
||||
Case Else
|
||||
bt_데이터관리.Visible = False
|
||||
bt_계산결과그래프.Visible = False
|
||||
Me.bt_etc.Visible = False
|
||||
bt_설계개선그래프.Visible = False
|
||||
bt_계산결과.Visible = False
|
||||
bt_인증평가서.Visible = False
|
||||
btImport.Visible = False
|
||||
End Select
|
||||
|
||||
If Prj.UserAuthType_Real.StartsWith("BOTH_C_") Then
|
||||
btcustomprofile.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
Try
|
||||
If Not Prj.UserId.ToLower().StartsWith("guest") AndAlso Not Prj.UserId.ToLower().StartsWith("user") Then
|
||||
@@ -329,7 +344,7 @@ Public Class MdiMain
|
||||
If Save_New() = False Then Return False '//취소를 누른경우 처리하지 않음
|
||||
|
||||
Else
|
||||
Me.Save_File(Prj.FileName, False)
|
||||
Me.Save_File(DSET1, DSETR1, Prj.FileName, False)
|
||||
End If
|
||||
|
||||
|
||||
@@ -865,6 +880,19 @@ Public Class MdiMain
|
||||
|
||||
Menu_건물개요()
|
||||
|
||||
'fix ; custom profile (9999 -> 0002)
|
||||
If Prj.UserAuthType_Real.StartsWith("BOTH_C") = False Then
|
||||
Dim bupdate As Boolean = False
|
||||
For Each dr As DS.tbl_zoneRow In DSET1.tbl_zone
|
||||
If dr.프로필 = "9999" Then
|
||||
dr.프로필 = "0002"
|
||||
dr.EndEdit()
|
||||
bupdate = True
|
||||
End If
|
||||
Next
|
||||
If bupdate Then DSET1.AcceptChanges()
|
||||
End If
|
||||
|
||||
'/기상데이터버젼확인
|
||||
'Try
|
||||
' MyVersion = DSET1.tbl_Desc.Rows(0)("versionw").ToString
|
||||
@@ -899,6 +927,15 @@ Public Class MdiMain
|
||||
' End Try
|
||||
'End If
|
||||
|
||||
'//remove profile data 0023~0027 241229
|
||||
For Each dr As DS.tbl_profileRow In DSET1.tbl_profile
|
||||
If dr.code >= "0023" AndAlso dr.code <= "0027" Then
|
||||
dr.Delete()
|
||||
End If
|
||||
Next
|
||||
DSET1.tbl_profile.AcceptChanges()
|
||||
|
||||
|
||||
PrjChanged = False
|
||||
|
||||
Me.RefreshMenuList("")
|
||||
@@ -1094,6 +1131,201 @@ Public Class MdiMain
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Dim batchfolder As String
|
||||
Public Sub Open_File_and_update_profile(ByVal path As String)
|
||||
'//지정한 폴더내의 모든 파일의 프로필을 업데이트한다.
|
||||
|
||||
'//기존선택된 트리노드를 제거한다.
|
||||
Me.PreNode = Nothing
|
||||
pLog.Add("=======================================")
|
||||
pLog.Add(String.Format("folder = {0}", path))
|
||||
'pLog.Add(String.Format("targetfile File = {0}", targetfile))
|
||||
pLog.Add("=======================================", True)
|
||||
Prj_test.IsError = False '//160509
|
||||
Dim di As New System.IO.DirectoryInfo(path)
|
||||
|
||||
prb1.Value = 0
|
||||
prb1.Maximum = di.GetFiles().Length
|
||||
|
||||
For Each File As System.IO.FileInfo In di.GetFiles()
|
||||
|
||||
If prb1.Value < prb1.Maximum Then prb1.Value += 1
|
||||
|
||||
If File.Extension.ToUpper() <> ".TPL" AndAlso File.Extension.ToUpper() <> ".TPLX" Then Continue For
|
||||
If File.Name.ToUpper().EndsWith("_PROFILEUPDATE.TPL") OrElse File.Name.ToUpper().EndsWith("_PROFILEUPDATE.TPLX") Then Continue For
|
||||
|
||||
|
||||
|
||||
'//파일을 열어서 템플릿이름을 가져온다
|
||||
pLog.Add(String.Format("open File = {0}", File.FullName))
|
||||
Dim FI As New System.IO.FileInfo(File.FullName)
|
||||
Dim Desbuf() As Byte = {}
|
||||
Dim FS As System.IO.Stream
|
||||
'///////////////////////////////////////////////////////////////////////////////////////////////////2011.03.16 입력파일 변조
|
||||
If Not (Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1") Then '//2011.03.16 추가 //eco 파일 불러올때 ADMIN 제거 'Prj.UserAuthType = "ADMIN" OrElse
|
||||
Dim Source() As Byte = My.Computer.FileSystem.ReadAllBytes(FI.FullName)
|
||||
|
||||
If Source.Length < 4 Then
|
||||
Prj.IsError = True
|
||||
MsgboxE("알수없거나 손상된 파일입니다" + vbCrLf + FI.FullName, True)
|
||||
Return
|
||||
End If
|
||||
pLog.Add("암호화 해제")
|
||||
Desbuf = DeCryptArea(Source, New Byte() {&HAC, &H29, &H55, &H42})
|
||||
|
||||
Else
|
||||
Desbuf = System.IO.File.ReadAllBytes(FI.FullName)
|
||||
' FS = New IO.FileStream(FileName, IO.FileMode.Open)
|
||||
End If
|
||||
|
||||
If FI.Extension.ToLower().EndsWith("x") Then '//확장자가 x로끝나면 압축된 포맷
|
||||
Dim datalen As Integer = BitConverter.ToInt32(Desbuf, 0)
|
||||
Dim RealData(Desbuf.Length - 4 - 1) As Byte
|
||||
Array.Copy(Desbuf, 4, RealData, 0, RealData.Length)
|
||||
Dim DeCompress(datalen - 1) As Byte
|
||||
Array.Clear(DeCompress, 0, DeCompress.Length)
|
||||
Utility.MiniLZO.Decompress(RealData, DeCompress)
|
||||
Array.Resize(Desbuf, DeCompress.Length)
|
||||
Array.Clear(Desbuf, 0, Desbuf.Length)
|
||||
Array.Copy(DeCompress, Desbuf, Desbuf.Length)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
FS = New IO.MemoryStream(Desbuf, True)
|
||||
|
||||
'///////////////////////////////////////////////////////////////////////////////////////////////////2011.03.16 입력파일 변조
|
||||
|
||||
Dim Br As New IO.BinaryReader(FS, System.Text.Encoding.Default)
|
||||
Prj_test.FileName = File.FullName ' : Myini.Write("presetting", "filename", Prj.FileName)
|
||||
Prj_test.Opened = False
|
||||
|
||||
|
||||
'//세이브파일구조(2)
|
||||
Prj_test.SFType = STB(Br.ReadBytes(2))
|
||||
pLog.Add("File Type = " + Prj_test.SFType)
|
||||
|
||||
'im DSET1 As New DS()
|
||||
|
||||
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" Then '//2011.03.09 추가 //eco 파일 불러올때 ADMIN 제거 'Prj.UserAuthType = "ADMIN" OrElse
|
||||
|
||||
Select Case Prj.SFType
|
||||
Case "00" '//기본버젼
|
||||
Prj_test.UIVersion = STB(Br.ReadBytes(10))
|
||||
Prj_test.LGVersino = STB(Br.ReadBytes(10))
|
||||
Select Case Prj_test.LGVersino
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
Prj_test.LGVersino = StartVersion
|
||||
End Select
|
||||
Select Case Prj_test.UIVersion
|
||||
Case "2009123100", "2010030700", "2010031400"
|
||||
Prj_test.UIVersion = StartVersion
|
||||
Prj_test.UIVersion = StartVersion
|
||||
End Select
|
||||
|
||||
Prj_test.Name = STB(Br.ReadBytes(100))
|
||||
Prj_test.Desc = STB(Br.ReadBytes(256))
|
||||
Prj_test.MakeTime = STB(Br.ReadBytes(19))
|
||||
Prj_test.EditTime = STB(Br.ReadBytes(19))
|
||||
' MsgBox(Br.BaseStream.Position)
|
||||
|
||||
'//DS1 데이터초기화 및 오픈
|
||||
DSET1_TEST.Clear() : DSET1_TEST.AcceptChanges()
|
||||
Dim DS1Len As Int64 = Br.ReadInt64
|
||||
If DS1Len = 0 Then
|
||||
DS1Len = FS.Length - Br.BaseStream.Position - 2
|
||||
End If
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1Len, MsgBoxStyle.Information, Hex(DS1Len))
|
||||
Dim DS1() As Byte = Nothing
|
||||
Try
|
||||
DS1 = Br.ReadBytes(CInt(DS1Len))
|
||||
Catch ex As Exception
|
||||
Prj_test.IsError = True
|
||||
MsgBox("파일이 손상되었습니다(Read Data Array)." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds1 byteRead Error")
|
||||
End Try
|
||||
|
||||
'MsgBox("pos=" & Br.BaseStream.Position & vbCrLf & DS1.Length, MsgBoxStyle.Information, DS1Len)
|
||||
If Not Prj_test.IsError Then
|
||||
Dim Ms As New IO.MemoryStream(DS1)
|
||||
Try
|
||||
DSET1_TEST.ReadXml(Ms)
|
||||
DSET1_TEST.AcceptChanges()
|
||||
Ms.Close()
|
||||
Catch ex As Exception
|
||||
Prj_test.IsError = True
|
||||
MsgBox("파일이 손상되었습니다(Read DataSet)" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds1_test Open Error")
|
||||
End Try
|
||||
|
||||
If Prj_test.IsError Then
|
||||
MsgBox("load error")
|
||||
Else
|
||||
'//에러가없는경우 다음진행
|
||||
DSET1_TEST.AcceptChanges()
|
||||
|
||||
|
||||
|
||||
'remove old data
|
||||
DSET1_TEST.tbl_profile.Clear()
|
||||
DSET1_TEST.AcceptChanges()
|
||||
|
||||
'merge data
|
||||
DSET1_TEST.tbl_profile.Merge(DSET1.tbl_profile)
|
||||
DSET1_TEST.AcceptChanges()
|
||||
|
||||
|
||||
'//save file
|
||||
Dim newfile As String = File.FullName.Replace(File.Extension, "") + "_ProfileUpdate" + FI.Extension
|
||||
Save_File(DSET1_TEST, DSETR1, newfile, False, False)
|
||||
' MsgBox("(weather+profile) load ok")
|
||||
|
||||
'//DS1가 있다면 게속 한다
|
||||
'DSETR1.Clear() : DSETR1.AcceptChanges()
|
||||
'DS1Len = Br.ReadInt64
|
||||
'DS1 = Br.ReadBytes(CInt(DS1Len))
|
||||
'Ms = New IO.MemoryStream(DS1)
|
||||
'Try
|
||||
' DSETR1.ReadXml(Ms)
|
||||
' DSETR1.AcceptChanges()
|
||||
' Ms.Close()
|
||||
'Catch ex As Exception
|
||||
' MsgBox("기존 버전의 계산결과를 가져올 수 없습니다." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Information, "Ds2 Open Error")
|
||||
'End Try
|
||||
|
||||
Prj.IsError = False
|
||||
|
||||
pLog.Add(String.Format("batch update profile file={0}", newfile))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Case Else
|
||||
MsgBox("파일을 불러올 수 없습니다1", MsgBoxStyle.Critical, "불러오기실패")
|
||||
Prj.IsError = True
|
||||
End Select
|
||||
|
||||
End If
|
||||
|
||||
Br.Close()
|
||||
FS.Close()
|
||||
|
||||
pLog.Add(String.Format("batch update profile Name={0},Desc={1},Version={2}", Prj.Name, Prj.Desc, Prj.UIVersion))
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
MsgboxI("update complete")
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub Open_File_Only_weather(ByVal FileName As String, Optional ByVal SyncServer As Boolean = False, Optional checkVersion As Boolean = True, Optional silent As Boolean = False, Optional isNew As Boolean = False)
|
||||
|
||||
|
||||
@@ -1210,7 +1442,7 @@ Public Class MdiMain
|
||||
DSET1_TEST.AcceptChanges()
|
||||
|
||||
|
||||
|
||||
|
||||
'remove old data
|
||||
DSET1.weather_cha.Clear()
|
||||
DSET1.weather_group.Clear()
|
||||
@@ -1961,10 +2193,10 @@ Public Class MdiMain
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Save_File(ByVal FileName As String, Optional prompt As Boolean = True)
|
||||
Private Sub Save_File(ByRef ds1 As DS, ByRef dsr1 As DSR, ByVal FileName As String, Optional prompt As Boolean = True, Optional updatemenulist As Boolean = True)
|
||||
|
||||
DSET1.AcceptChanges()
|
||||
DSETR1.AcceptChanges()
|
||||
ds1.AcceptChanges()
|
||||
dsr1.AcceptChanges()
|
||||
|
||||
'//파일을 열어서 템플릿이름을 가져온다
|
||||
Dim Fs As New IO.FileStream(FileName, IO.FileMode.Create)
|
||||
@@ -2026,26 +2258,26 @@ Public Class MdiMain
|
||||
|
||||
'//1번쨰 데이터소스를 저장합니다.
|
||||
Dim Pos1 As Int64 = Bw.BaseStream.Position
|
||||
DSET1.WriteXml(Fs)
|
||||
ds1.WriteXml(Fs)
|
||||
Dim Pos1e As Int64 = Bw.BaseStream.Position
|
||||
Dim Dse1Len As Int64 = Pos1e - Pos1 '//데이터셋의 길이
|
||||
Bw.BaseStream.Position = Pos1 '//처음위치로이동
|
||||
Bw.Write(Dse1Len) '//데이터셋길이저장
|
||||
DSET1.WriteXml(Fs) '//데이터셋다시저장
|
||||
ds1.WriteXml(Fs) '//데이터셋다시저장
|
||||
|
||||
'//데이터세 xml 임시저장
|
||||
'Dim dsfile As String = My.Application.Info.DirectoryPath & "\dset1.xml"
|
||||
'DSET1.WriteXml(dsfile)
|
||||
'Dim dsfile As String = My.Application.Info.DirectoryPath & "\ds1.xml"
|
||||
'ds1.WriteXml(dsfile)
|
||||
|
||||
'//2번쨰 데이터소스를 저장합니다.
|
||||
If Prj.UserAuthType = "ADMIN" OrElse Prj.UserAuthType = "BOTH" OrElse Prj.UserAuthType = "BOTH2" OrElse Prj.UserAuthType = "BOTH1" Then '//2011.03.09 추가 eco 파일 저장할 때 admin 제거 Prj.UserAuthType = "ADMIN" OrElse
|
||||
Dim Pos2 As Int64 = Bw.BaseStream.Position
|
||||
DSETR1.WriteXml(Fs)
|
||||
dsr1.WriteXml(Fs)
|
||||
Dim Pos2e As Int64 = Bw.BaseStream.Position
|
||||
Dim Dse2Len As Int64 = Pos2e - Pos2 '//데이터셋의 길이
|
||||
Bw.BaseStream.Position = Pos2 '//처음위치로이동
|
||||
Bw.Write(Dse2Len) '//데이터셋길이저장
|
||||
DSETR1.WriteXml(Fs) '//데이터셋다시저장
|
||||
dsr1.WriteXml(Fs) '//데이터셋다시저장
|
||||
End If
|
||||
|
||||
ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
@@ -2088,7 +2320,7 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
'/////////////////////////////////////////////////////////////////////////////////////////////////////////////저장파일 변조2011.03.16추가
|
||||
|
||||
If prompt Then MsgBox("파일이 저장되었습니다", MsgBoxStyle.Information, "확인")
|
||||
Me.RefreshMenuList("")
|
||||
If updatemenulist Then Me.RefreshMenuList("")
|
||||
|
||||
'Me.bt_desc.PerformClick()
|
||||
|
||||
@@ -2098,7 +2330,7 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
'Bw.Write(CStr(IIf(Prj.Desc = "", "프로젝트설명", Prj.Desc)))
|
||||
''//템플릿 생성시간
|
||||
'Bw.Write(CStr(Format(Now, "yyyy-MM-dd HH:mm:ss")))
|
||||
'DSET1.WriteXml(Fs)
|
||||
'ds1.WriteXml(Fs)
|
||||
End Sub
|
||||
|
||||
#Region "Show_Menu"
|
||||
@@ -2555,7 +2787,7 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
curf.Close()
|
||||
End If
|
||||
|
||||
Me.Save_File(Prj.FileName)
|
||||
Me.Save_File(DSET1, DSETR1, Prj.FileName)
|
||||
|
||||
If lastmenutag <> "" Then
|
||||
Me.show_menu(lastmenutag)
|
||||
@@ -3032,7 +3264,7 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
curf.Close()
|
||||
End If
|
||||
|
||||
Me.Save_File(Prj.FileName)
|
||||
Me.Save_File(DSET1, DSETR1, Prj.FileName)
|
||||
|
||||
If lastmenutag <> "" Then
|
||||
Me.show_menu(lastmenutag)
|
||||
@@ -3226,7 +3458,7 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
Dim f As New Frm_Upload(sd.FileName, 10, "")
|
||||
f.ShowDialog()
|
||||
|
||||
If lbl_user.Text.ToLower = "[arin]" Then '//160327
|
||||
If System.Diagnostics.Debugger.IsAttached OrElse lbl_user.Text.ToLower = "[arin]" Then '//160327
|
||||
Shell("explorer " + Chr(&H22) + sd.FileName + Chr(&H22), AppWinStyle.NormalFocus)
|
||||
End If
|
||||
|
||||
@@ -3539,6 +3771,10 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
If f.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||
If MsgBox("run?", MsgBoxStyle.Information Or MsgBoxStyle.OkCancel, "확인") <> MsgBoxResult.Ok Then Return '//ok 안하면 빠져나가기
|
||||
|
||||
'//히트펌프임시계산 240106
|
||||
Dim heatcalc As Boolean = f.heatpumpcalc
|
||||
|
||||
|
||||
Dim path As String = f.tbPath.Text
|
||||
Dim di As New System.IO.DirectoryInfo(path)
|
||||
Dim files() As System.IO.FileInfo
|
||||
@@ -3556,145 +3792,154 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
Dim ermsg As New System.Text.StringBuilder
|
||||
Dim first As Boolean = True
|
||||
|
||||
'//리포트파일 생성
|
||||
Dim reportorg As String = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "batchreport.xls")
|
||||
Dim reportfile As String = System.IO.Path.Combine(path, "batchreport.xls")
|
||||
System.IO.File.Copy(reportorg, reportfile, True)
|
||||
If heatcalc Then
|
||||
|
||||
Dim 입력면추출 As Boolean = f.chkMyoun.Checked
|
||||
'//리포트파일 생성
|
||||
Dim reportfile As String = System.IO.Path.Combine(path, "batchreport_heat.tab")
|
||||
|
||||
Dim writecol As Integer = 10
|
||||
For Each fitem As KeyValuePair(Of String, System.IO.FileInfo) In files2
|
||||
Dim sb As New System.Text.StringBuilder
|
||||
sb.AppendLine("file" + vbTab + "히트펌프용량_가스_난방" + vbTab + "히트펌프용량_전기_난방" + vbTab + "히트펌프용량_가스_냉방" + vbTab + "히트펌프용량_전기_냉방")
|
||||
|
||||
Dim fi As System.IO.FileInfo = fitem.Value
|
||||
writecol += 1
|
||||
If prb1.Value < prb1.Maximum Then prb1.Value += 1
|
||||
Dim writecol As Integer = 10
|
||||
For Each fitem As KeyValuePair(Of String, System.IO.FileInfo) In files2
|
||||
|
||||
Dim dataitem As New List(Of String)
|
||||
dataitem.Add(fi.Name) '(0) = fi.Name
|
||||
'//close file
|
||||
Dim fi As System.IO.FileInfo = fitem.Value
|
||||
writecol += 1
|
||||
If prb1.Value < prb1.Maximum Then prb1.Value += 1
|
||||
|
||||
'//open file
|
||||
Dim retopen As String = Open_File(fi.FullName, False, True, True)
|
||||
Dim dataitem As New List(Of String)
|
||||
dataitem.Add(fi.Name) '(0) = fi.Name
|
||||
'//close file
|
||||
|
||||
'//calc
|
||||
Dim ret As Boolean = False
|
||||
|
||||
Dim msg As String = String.Format("계산중({0}/{1}) 열번호={3}" + vbCrLf + "{2}" + vbCrLf, prb1.Value, prb1.Maximum, fi.Name, writecol)
|
||||
If String.IsNullOrWhiteSpace(retopen) = False Then ret = func_calc(msg, True)
|
||||
|
||||
'//get message
|
||||
'//open file
|
||||
Dim retopen As String = Open_File(fi.FullName, False, True, True)
|
||||
|
||||
|
||||
'//업로드 양식 데이터 생성
|
||||
Dim fxls As New Frm_Upload(reportfile, writecol, fi.Name, True)
|
||||
Dim drlt = fxls.ShowDialog()
|
||||
If drlt = DialogResult.OK Then
|
||||
ermsg.AppendLine("OK" + vbTab + fi.FullName)
|
||||
dataitem.Add("OK")
|
||||
Else
|
||||
ermsg.AppendLine("NG" + vbTab + fi.FullName)
|
||||
dataitem.Add("NG")
|
||||
End If
|
||||
'//히트펌프
|
||||
Dim 히트펌프용량_가스_난방 As Decimal = 0
|
||||
Dim 히트펌프용량_전기_난방 As Decimal = 0
|
||||
Dim 히트펌프용량_가스_냉방 As Decimal = 0
|
||||
Dim 히트펌프용량_전기_냉방 As Decimal = 0
|
||||
|
||||
'//입력면 추출
|
||||
If 입력면추출 Then
|
||||
|
||||
'//엑셀내보내기기능 추가
|
||||
Dim content As New System.Text.StringBuilder()
|
||||
Dim newfile As String = fi.Directory.FullName + "\" + System.IO.Path.GetFileNameWithoutExtension(fi.FullName) + "_입력면.tab"
|
||||
For Each drz As DS.tbl_zoneRow In DSET1.tbl_zone.Rows
|
||||
If drz.code = "0" Then Continue For
|
||||
content.Append(drz.설명)
|
||||
For Each drm As DS.tbl_myounRow In DSET1.tbl_myoun.Select("존분류='" + drz.code + "'")
|
||||
If drm.code = "0" Then Continue For
|
||||
'입력존1, 입력면1_1, 건축부위방식1_1, 면적1_1,
|
||||
'열관류율1_1, 방위1_1, 입력면1_2, 건축부위방식1_2, 면적1_2, 열관류율1_2, 방위1_2, 입력면1_3, 건축부위방식1_3, 면적1_3, 열관류율1_3, 방위1_3
|
||||
|
||||
Dim 열관류율 As String = drm.열관류율
|
||||
If drm.열관류율2 <> "" AndAlso drm.열관류율2 <> "0" Then
|
||||
Dim ykrows() As DS.tbl_ykRow = DSET1.tbl_yk.Select("code='" + drm.열관류율2 + "'")
|
||||
If ykrows.Length = 1 Then
|
||||
열관류율 = ykrows(0).열관류율
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
content.Append(vbTab + drm.설명 + vbTab + drm.건축부위방식 + vbTab + _
|
||||
drm.건축부위면적 + vbTab + _
|
||||
열관류율 + vbTab + drm.방위)
|
||||
Next
|
||||
content.AppendLine()
|
||||
For Each dr As DS.tbl_nanbangkikiRow In DSET1.tbl_nanbangkiki
|
||||
If dr.히트연료.EndsWith("가스") Then
|
||||
히트펌프용량_가스_난방 += dr.히트난방용량
|
||||
ElseIf dr.히트연료 = "전기" Then
|
||||
히트펌프용량_전기_난방 += dr.히트난방용량
|
||||
End If
|
||||
Next
|
||||
|
||||
System.IO.File.WriteAllText(newfile, content.ToString(), System.Text.Encoding.Default)
|
||||
For Each dr As DS.tbl_nangbangkikiRow In DSET1.tbl_nangbangkiki
|
||||
If dr.냉동기종류 <> "실내공조시스템" Then Continue For
|
||||
If dr.냉동기방식 = "압축식(LNG)" Then
|
||||
히트펌프용량_가스_냉방 += dr.냉동기용량
|
||||
ElseIf dr.냉동기방식 = "압축식" Then
|
||||
히트펌프용량_전기_냉방 += dr.냉동기용량
|
||||
End If
|
||||
Next
|
||||
sb.AppendLine(fi.Name + vbTab + 히트펌프용량_가스_난방.ToString("N1") + vbTab _
|
||||
+ 히트펌프용량_전기_난방.ToString("N1") + vbTab _
|
||||
+ 히트펌프용량_가스_냉방.ToString("N1") + vbTab _
|
||||
+ 히트펌프용량_전기_냉방.ToString("N1"))
|
||||
|
||||
Dim msg As String = String.Format("계산중({0}/{1}) 열번호={3}" + vbCrLf + "{2}" + vbCrLf, prb1.Value, prb1.Maximum, fi.Name, writecol)
|
||||
|
||||
Next
|
||||
|
||||
System.IO.File.WriteAllText(reportfile, sb.ToString(), System.Text.Encoding.Default)
|
||||
If System.Diagnostics.Debugger.IsAttached OrElse lbl_user.Text.ToLower = "[arin]" Then '//160327
|
||||
Shell("explorer " + Chr(&H22) + reportfile + Chr(&H22), AppWinStyle.NormalFocus)
|
||||
End If
|
||||
Else
|
||||
|
||||
'//리포트파일 생성
|
||||
Dim reportorg As String = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "batchreport.tab")
|
||||
Dim reportfile As String = System.IO.Path.Combine(path, "batchreport.tab")
|
||||
|
||||
If System.IO.File.Exists(reportorg) Then
|
||||
System.IO.File.Copy(reportorg, reportfile, True)
|
||||
ElseIf System.IO.File.Exists(reportfile) Then
|
||||
System.IO.File.Delete(reportfile)
|
||||
End If
|
||||
|
||||
'report.Add(dataitem.ToArray())
|
||||
Dim 입력면추출 As Boolean = f.chkMyoun.Checked
|
||||
|
||||
Dim writecol As Integer = 10
|
||||
For Each fitem As KeyValuePair(Of String, System.IO.FileInfo) In files2
|
||||
|
||||
Dim fi As System.IO.FileInfo = fitem.Value
|
||||
writecol += 1
|
||||
If prb1.Value < prb1.Maximum Then prb1.Value += 1
|
||||
|
||||
Dim dataitem As New List(Of String)
|
||||
dataitem.Add(fi.Name) '(0) = fi.Name
|
||||
'//close file
|
||||
|
||||
'//open file
|
||||
Dim retopen As String = Open_File(fi.FullName, False, True, True)
|
||||
|
||||
'//calc
|
||||
Dim ret As Boolean = False
|
||||
|
||||
Dim msg As String = String.Format("계산중({0}/{1}) 열번호={3}" + vbCrLf + "{2}" + vbCrLf, prb1.Value, prb1.Maximum, fi.Name, writecol)
|
||||
If String.IsNullOrWhiteSpace(retopen) = False Then ret = func_calc(msg, True)
|
||||
|
||||
'//get message
|
||||
|
||||
|
||||
'//save to csv
|
||||
'//업로드 양식 데이터 생성
|
||||
Dim fxls As New Frm_Upload(reportfile, writecol, fi.Name, True)
|
||||
Dim drlt = fxls.ShowDialog()
|
||||
If drlt = DialogResult.OK Then
|
||||
ermsg.AppendLine("OK" + vbTab + fi.FullName)
|
||||
dataitem.Add("OK")
|
||||
Else
|
||||
ermsg.AppendLine("NG" + vbTab + fi.FullName)
|
||||
dataitem.Add("NG")
|
||||
End If
|
||||
|
||||
'//입력면 추출
|
||||
If 입력면추출 Then
|
||||
|
||||
'//엑셀내보내기기능 추가
|
||||
Dim content As New System.Text.StringBuilder()
|
||||
Dim newfile As String = fi.Directory.FullName + "\" + System.IO.Path.GetFileNameWithoutExtension(fi.FullName) + "_입력면.tab"
|
||||
For Each drz As DS.tbl_zoneRow In DSET1.tbl_zone.Rows
|
||||
If drz.code = "0" Then Continue For
|
||||
content.Append(drz.설명)
|
||||
For Each drm As DS.tbl_myounRow In DSET1.tbl_myoun.Select("존분류='" + drz.code + "'")
|
||||
If drm.code = "0" Then Continue For
|
||||
'입력존1, 입력면1_1, 건축부위방식1_1, 면적1_1,
|
||||
'열관류율1_1, 방위1_1, 입력면1_2, 건축부위방식1_2, 면적1_2, 열관류율1_2, 방위1_2, 입력면1_3, 건축부위방식1_3, 면적1_3, 열관류율1_3, 방위1_3
|
||||
|
||||
Dim 열관류율 As String = drm.열관류율
|
||||
If drm.열관류율2 <> "" AndAlso drm.열관류율2 <> "0" Then
|
||||
Dim ykrows() As DS.tbl_ykRow = DSET1.tbl_yk.Select("code='" + drm.열관류율2 + "'")
|
||||
If ykrows.Length = 1 Then
|
||||
열관류율 = ykrows(0).열관류율
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'Application.DoEvents()
|
||||
content.Append(vbTab + drm.설명 + vbTab + drm.건축부위방식 + vbTab + _
|
||||
drm.건축부위면적 + vbTab + _
|
||||
열관류율 + vbTab + drm.방위)
|
||||
Next
|
||||
content.AppendLine()
|
||||
Next
|
||||
|
||||
System.IO.File.WriteAllText(newfile, content.ToString(), System.Text.Encoding.Default)
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
closemessagewindow()
|
||||
|
||||
'Dim reportbuffer As New System.Text.StringBuilder
|
||||
|
||||
'Dim maxlin As Integer = 0
|
||||
'For Each item() As String In report
|
||||
' 'reportbuffer.Append(vbTab)
|
||||
' 'reportbuffer.Append(item(0)) '//filename
|
||||
' If item.Length > maxlin Then
|
||||
' maxlin = item.Length
|
||||
' End If
|
||||
'Next
|
||||
|
||||
'For r As Integer = 0 To maxlin - 1
|
||||
' For Each item() As String In report
|
||||
' reportbuffer.Append(vbTab)
|
||||
|
||||
' If r < item.Length Then
|
||||
' reportbuffer.Append(item(r)) '//filename
|
||||
' Else
|
||||
' reportbuffer.Append("")
|
||||
|
||||
' End If
|
||||
|
||||
' Next
|
||||
' reportbuffer.AppendLine()
|
||||
'Next
|
||||
|
||||
'//save to csv
|
||||
'//엑셀내보내기기능 추가
|
||||
'Dim content As String = fi.Name
|
||||
'If String.IsNullOrWhiteSpace(retopen) = True Then
|
||||
' content += vbTab + "open fail"
|
||||
'ElseIf ret = False Then
|
||||
' content += vbTab + "fail"
|
||||
'Else
|
||||
' content += vbTab + Makemacrostring()
|
||||
'End If
|
||||
'content += vbCrLf
|
||||
|
||||
'If first = False Then
|
||||
' System.IO.File.AppendAllText(savefile, content, System.Text.Encoding.Default)
|
||||
'Else
|
||||
' System.IO.File.WriteAllText(savefile, "파일" + vbTab + "오류" + vbTab + "구분" + vbTab + "신재생" + vbTab + "난방" + vbTab + "냉방" + vbTab + "급탕" + vbTab + "조명" + vbTab + "환기" + vbTab + "합계" + vbCrLf, System.Text.Encoding.Default)
|
||||
' System.IO.File.AppendAllText(savefile, content, System.Text.Encoding.Default)
|
||||
' first = False
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
'Dim rptfile As String = System.IO.Path.Combine(path, "report.tab")
|
||||
'System.IO.File.WriteAllText(rptfile, reportbuffer.ToString(), System.Text.Encoding.Default)
|
||||
|
||||
|
||||
Dim logfile As String = System.IO.Path.Combine(path, "log.txt")
|
||||
System.IO.File.WriteAllText(logfile, ermsg.ToString(), System.Text.Encoding.Default)
|
||||
|
||||
@@ -3708,4 +3953,51 @@ ENDSTAT: '//오류발생시 강제종료를 위한 분기문
|
||||
Dim f As New Frm_Macro
|
||||
f.Show()
|
||||
End Sub
|
||||
|
||||
Private Sub BatchUpdateProfileToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles BatchUpdateProfileToolStripMenuItem.Click
|
||||
|
||||
'//update profile
|
||||
|
||||
If Prj.LoginTime = "" Then
|
||||
MsgBox("먼저 로그인을 하세요", MsgBoxStyle.Information, "확인")
|
||||
Frm_Intro.Activate()
|
||||
Frm_Intro.tb_id.Focus()
|
||||
Return
|
||||
End If
|
||||
|
||||
MsgBox("프로필을 일괄 변경할 파일이 있는 폴더를 선택하세요")
|
||||
Dim fd As New FolderBrowserDialog
|
||||
'Od.InitialDirectory = TemplateDir.FullName
|
||||
fd.SelectedPath = batchfolder
|
||||
If fd.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return
|
||||
|
||||
batchfolder = fd.SelectedPath
|
||||
|
||||
If Prj.FileName = "" Then
|
||||
MsgBox(CLang.열린파일없음, MsgBoxStyle.Information, "확인")
|
||||
Return
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
'MsgBox("프로필 파일을 선택하세요")
|
||||
'Dim od As New OpenFileDialog
|
||||
'If od.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return
|
||||
|
||||
|
||||
Open_File_and_update_profile(batchfolder)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btcustomprofile_Click(sender As System.Object, e As System.EventArgs) Handles btcustomprofile.Click
|
||||
If Not Prj.Opened Then
|
||||
Work_msg_timer(CLang.열린파일없음)
|
||||
Return
|
||||
End If
|
||||
Dim f As New Frm_custom_profile(Now.Second.ToString() + "00" + Now.Millisecond.ToString())
|
||||
f.ControlBox = True
|
||||
f.ShowDialog()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user