Skip to content

Commit

Permalink
Merge pull request #7659 from NREL/FixMinFieldsAndIdfEd
Browse files Browse the repository at this point in the history
Add warning to IDF Editor when \min-fields is greater than number of fields
  • Loading branch information
mjwitte authored Jan 16, 2020
2 parents 717bebf + 0eff486 commit b86c6f5
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
Binary file modified bin/IDFEditor/IDFEditor.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -70731,7 +70731,7 @@ ChillerHeater:Absorption:DoubleEffect,

HeatPump:PlantLoop:EIR:Cooling,
\memo An EIR formulated water to water heat pump model, cooling operation.
\min-fields 15
\min-fields 14
A1, \field Name
\type alpha
\reference PLHPCoolingNames
Expand Down Expand Up @@ -70829,7 +70829,7 @@ HeatPump:PlantLoop:EIR:Cooling,

HeatPump:PlantLoop:EIR:Heating,
\memo An EIR formulated water to water heat pump model, heating operation
\min-fields 15
\min-fields 14
A1, \field Name
\type alpha
\reference PLHPHeatingNames
Expand Down
8 changes: 4 additions & 4 deletions src/IDF_Editor/IDFEd-project.VBP
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\SysWOW64\stdole2.tlb#OLE Automation
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; Msflxgrd.ocx
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; ComDlg32.OCX
Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0; MSCOMCTL.OCX
Object={C0A63B80-4B21-11D3-BD95-D426EF2C7949}#1.0#0; Vsflex7L.ocx
Expand All @@ -27,10 +27,10 @@ HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=5
RevisionVer=0
RevisionVer=1
AutoIncrementVer=0
ServerSupportFiles=0
VersionComments="1.50a"
VersionComments="1.51"
VersionCompanyName="GARD Analytics"
VersionLegalCopyright="(c) 2000-2017 GARD Analytics"
CompilationType=0
Expand Down
6 changes: 3 additions & 3 deletions src/IDF_Editor/IDFEd-project.vbw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
About = 153, 30, 1480, 773, , 47, 79, 1374, 852, C
IDFEdit = 71, 46, 1404, 928, , 363, 158, 1696, 805, C
IDFMain = 175, 174, 1569, 775, Z
About = 153, 30, 1480, 773, Z, 47, 79, 1374, 852, C
IDFEdit = 582, 183, 1915, 1065, , 363, 158, 1696, 805, C
IDFMain = 70, 35, 1464, 636,
parentMDI = 132, 174, 1459, 947, , 74, 106, 1401, 879, C
LayoutOption = 0, 0, 0, 0, C, 44, 58, 1371, 831, C
frmFind = 0, 0, 0, 0, C, 66, 87, 1393, 860, C
Expand Down
25 changes: 24 additions & 1 deletion src/IDF_Editor/IDFEditMain.bas
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Attribute VB_Name = "IDFMain"
' command line argument /idd:iddfilename
'

Public Const ver = "1.50" 'current version of IDFEditor - less than 1 is a beta
Public Const ver = "1.51" 'current version of IDFEditor - less than 1 is a beta
Option Explicit
Option Base 1

Expand Down Expand Up @@ -1847,6 +1847,7 @@ Call resizeClassGroupArray(2)
IDDClassGroup(maxUsedClassGroup + 1).classStart = maxUsedIDDClass + 1
'Stop
Call associateUnits
Call checkMinFields
If extraObjListWarning <> "" Then
MsgBox "The following fields have more than one \object-list slash codes. Only one is allowed per field." & vbCrLf & vbCrLf & extraObjListWarning, vbInformation, "Reading IDD"
End If
Expand Down Expand Up @@ -1973,6 +1974,27 @@ End If
End Sub


'-----------------------------------------------------------------------------
' Make sure the IDD \min-fields is less than or equal to the number of
' fields in each object
'-----------------------------------------------------------------------------
Sub checkMinFields()
Dim numfields As Integer
Dim errMessage As String
Dim i As Integer
errMessage = ""
For i = 1 To maxUsedIDDClass
numfields = 1 + IDDClassDat(i).fieldEnd - IDDClassDat(i).fieldStart
If IDDClassDat(i).minFields > numfields Then
errMessage = errMessage & vbCrLf & IDDClassDat(i).name
End If
Next i
If errMessage <> "" Then
Call MsgBox("\min-fields is greater than the number of fields in: " & vbCrLf & errMessage, vbInformation, "Warning")
End If
End Sub


'-----------------------------------------------------------------------------
' Removes the last slash and what ever is right of it
' This effectively is like moving up one directory for a string
Expand All @@ -1993,6 +2015,7 @@ Else
End If
End Function


'-----------------------------------------------------------------------------
'This displays errors in a pop up dialog box
'-----------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/IDF_Editor/about.frm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Begin VB.Form About
Begin VB.Label lblVersion
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "Version 1.50a"
Caption = "Version 1.51"
BeginProperty Font
Name = "Arial"
Size = 12
Expand All @@ -92,10 +92,10 @@ Begin VB.Form About
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1575
Left = 1710
TabIndex = 1
Top = 960
Width = 1545
Width = 1410
End
Begin VB.Label lblProductName
AutoSize = -1 'True
Expand Down Expand Up @@ -151,7 +151,7 @@ End Sub

Private Sub Form_Load()
lblAboutEPVer.Caption = "EnergyPlus and IDD version number: " & IDDVersion
txtNotice.Text = "Copyright (c) 2000-2016 GARD Analytics, " & vbCrLf
txtNotice.Text = "Copyright (c) 2000-2020 GARD Analytics, " & vbCrLf
txtNotice.Text = txtNotice.Text & "Inc. All rights reserved." & vbCrLf
txtNotice.Text = txtNotice.Text & " " & vbCrLf
txtNotice.Text = txtNotice.Text & "The code for quick select dropdowns " & vbCrLf
Expand Down

0 comments on commit b86c6f5

Please sign in to comment.