openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
126 stars 23 forks source link

OS X 14.5 1.71 Crash on attempt to open gbXML #726

Closed arossti closed 2 weeks ago

arossti commented 1 month ago

Issue overview

Fresh install of 1.7.1. (ARM) Trying to get models from ArchiCad/StruSoft gbXML format to import. Hard crash on open.

Current Behavior

File/Import/gbXML, point to file - kaboom. M-K OS test file.xml.zip

OSX Sonoma 14.5, Silicon, ARM install. OS 1.7.1. (1.8 crashes on opening EPW files)

Just trying to populate a file so I can learn the UI. Would be helpful if you shipped with a few demo files, ie. timber frame house and a concrete to steel commercial building...

macumber commented 1 month ago

Thanks for the bug report @arossti. It looks like this crash is being generated in the OpenStudio SDK:

    openstudiolib.dll!openstudio::gbxml::ReverseTranslator::translateSchedule(const pugi::xml_node & element, const pugi::xml_node & root, openstudio::model::Model & model) Line 180   C++
    openstudiolib.dll!openstudio::gbxml::ReverseTranslator::translateGBXML(const pugi::xml_node & root) Line 277    C++
    openstudiolib.dll!openstudio::gbxml::ReverseTranslator::convert(const pugi::xml_node & root) Line 134   C++
    openstudiolib.dll!openstudio::gbxml::ReverseTranslator::loadModel(const boost::filesystem::path & path, openstudio::ProgressBar * progressBar) Line 97  C++
    OpenStudioApp.exe!openstudio::OpenStudioApp::import(openstudio::OpenStudioApp::fileType type) Line 753  C++
    OpenStudioApp.exe!openstudio::OpenStudioApp::importgbXML() Line 676 C++

The OS SDK is expecting begin and end dates of the schedules to be formatted like:

      <BeginDate>2009-01-01</BeginDate>
      <EndDate>2009-12-30</EndDate>

But they are coming in like:

      <BeginDate>01:00 Jan. 01</BeginDate>
      <EndDate>24:00 Dec. 30</EndDate>

I will file a bug on the OpenStudio SDK site, as a workaround you could do a find/replace using a text editor:

"01:00 Jan. 01" -> "2009-01-01" "24:00 Apr. 01" -> "2009-04-01" "01:00 Apr. 02" -> "2009-04-02" "24:00 Sep. 30" -> "2009-09-30" "01:00 Oct. 01" -> "2009-10-01" "24:00 Dec. 30" -> "2009-12-31"

macumber commented 1 month ago

I think the file is not valid according to https://www.gbxml.org/schema/5-01/GreenBuildingXML_Ver5.01.xsd.txt, BeginDate should be an xsd:date: https://www.w3schools.com/xml/schema_dtypes_date.asp. That would be a bug for ArchiCad/StruSoft