diff --git a/.github/workflows/app_build.yml b/.github/workflows/app_build.yml index 89a6fb0cd..08f56e358 100644 --- a/.github/workflows/app_build.yml +++ b/.github/workflows/app_build.yml @@ -479,6 +479,8 @@ jobs: echo "Qt $QT_VERSION already installed" else echo "Install aqtinstall, then install Qt $QT_VERSION for ${{ matrix.QT_OS_NAME }} ${{ matrix.QT_ARCH }}" + pip show setuptools + pip install setuptools --upgrade pip3 install aqtinstall aqt install-qt --outputdir ./build/Qt-install/ ${{ matrix.QT_OS_NAME }} desktop $QT_VERSION ${{ matrix.QT_ARCH }} -m qtwebchannel qtwebengine qtwebview qt5compat qtpositioning fi diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 6fe8484b6..dd5687af6 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -12,7 +12,7 @@ jobs: - name: "CLA Assistant" if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' # Beta Release - uses: cla-assistant/github-action@v2.1.3-beta + uses: cla-assistant/github-action@v2.3.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # the below token should have repo scope and must be manually added by you in the repository's secret diff --git a/src/openstudio_app/OpenStudioApp.cpp b/src/openstudio_app/OpenStudioApp.cpp index 100168f3e..74fc469c8 100644 --- a/src/openstudio_app/OpenStudioApp.cpp +++ b/src/openstudio_app/OpenStudioApp.cpp @@ -1288,7 +1288,7 @@ void OpenStudioApp::startMeasureManagerProcess() { tcpServer.close(); QString portString = QString::number(port); - QString urlString = "http://127.0.0.1:" + portString; + QString urlString = "http://localhost:" + portString; QUrl url(urlString); measureManager().setUrl(url); diff --git a/src/openstudio_lib/GeometryEditorView.cpp b/src/openstudio_lib/GeometryEditorView.cpp index 5cd38b426..58a12ca3a 100644 --- a/src/openstudio_lib/GeometryEditorView.cpp +++ b/src/openstudio_lib/GeometryEditorView.cpp @@ -87,6 +87,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -359,7 +362,7 @@ void FloorspaceEditor::loadEditor() { } javascript += "`;\n\ -const style = document.createElement('style')\n\ +const style = document.createElement('style');\n\ style.type = 'text/css';\n\ style.innerHTML = rules;\n\ document.head.appendChild(style);\n"; @@ -412,21 +415,30 @@ document.head.appendChild(style);\n"; m_javascriptRunning = true; std::string json = floorplan.toJSON(false); - // TODO: @macumber: delete this now? - // DLM: temp - // Json::CharReaderBuilder rbuilder; - // std::istringstream ss(json); - // std::string errorString; - // Json::Value value; - // bool parsingSuccessful = Json::parseFromStream(rbuilder, ss, &value, &errorString); - // value.removeMember("stories"); - // Json::StreamWriterBuilder wbuilder; - // // mimic the old FastWriter behavior: - // wbuilder["commentStyle"] = "None"; - // wbuilder["indentation"] = ""; - // const std::string json = Json::writeString(wbuilder, value); - - QString javascript = QString("window.api.importLibrary(JSON.stringify(") + QString::fromStdString(json) + QString("));"); + + QJsonDocument doc = QJsonDocument::fromJson(QString::fromStdString(json).toUtf8()); + + // ensure any missing required properties are set + if (!doc.isNull()) { + if (doc.isObject()) { + QJsonObject obj = doc.object(); + if (!obj.contains("daylighting_control_definitions")) { + obj.insert("daylighting_control_definitions", QJsonArray()); + } + if (!obj.contains("door_definitions")) { + obj.insert("door_definitions", QJsonArray()); + } + if (!obj.contains("pitched_roofs")) { + obj.insert("pitched_roofs", QJsonArray()); + } + if (!obj.contains("window_definitions")) { + obj.insert("window_definitions", QJsonArray()); + } + doc.setObject(obj); + } + } + + QString javascript = QString("window.api.importLibrary(JSON.stringify(") + doc.toJson(QJsonDocument::Compact) + QString("));"); m_view->page()->runJavaScript(javascript, [this](const QVariant& /*v*/) { m_javascriptRunning = false; }); while (m_javascriptRunning) { OSAppBase::instance()->processEvents(QEventLoop::ExcludeUserInputEvents, 200); diff --git a/src/openstudio_lib/library/embeddable_geometry_editor.html b/src/openstudio_lib/library/embeddable_geometry_editor.html index 537eb41f7..c96769623 100644 --- a/src/openstudio_lib/library/embeddable_geometry_editor.html +++ b/src/openstudio_lib/library/embeddable_geometry_editor.html @@ -4,8 +4,7 @@ Floorspace JS @@ -15,245 +14,150 @@