feat: add --ip/--si CLI flags to skip the EnergyPlus units dialog#197
Open
Ski90Moo wants to merge 1 commit into
Open
feat: add --ip/--si CLI flags to skip the EnergyPlus units dialog#197Ski90Moo wants to merge 1 commit into
Ski90Moo wants to merge 1 commit into
Conversation
Add --ip and --si command-line switches to DView so callers (e.g. OpenStudio Application) can pre-answer the 'Would you like to display your Energy+ data in IP units?' dialog rather than showing it to the user twice. When neither flag is supplied DView behaviour is unchanged (dialog is shown as before). - dvfilereader.h/cpp: ReadSQLFile and FastRead accept ipUnits (-1=ask, 0=SI, 1=IP); dialog is skipped when ipUnits >= 0 - dview.cpp: DViewFrame::Load forwards ipUnits; DViewApp parses --ip and --si switches and passes the result to Load Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--ipand--silong switches to thedviewcommand-line toolMotivation
OpenStudio Application PR #873 adds comprehensive i18n/translation support to the OpenStudio GUI. One outstanding gap is the DView Units Conversion dialog — it is rendered by the
dviewx64.exebinary (wxWidgets) and therefore cannot be translated through Qt's.tssystem.The proposed solution is for OpenStudio to show its own translated Qt dialog asking the user about units, then forward the answer to DView via CLI flag, bypassing DView's English-only prompt entirely.
Changes
include/wex/dview/dvfilereader.hint ipUnits = -1parameter toFastReadandReadSQLFiledeclarationssrc/dview/dvfilereader.cppReadSQLFile: shows dialog only whenipUnits < 0; otherwise maps1→wxYES,0→wxNO.FastRead: passesipUnitsthrough toReadSQLFile.tools/dview/dview.cppm_arg_ipUnitsmember; registered--ip/--siswitches inOnInitCmdLine; parsed inOnCmdLineParsed; forwarded viaframe->Load(filenames, ipUnits)Backward compatibility
All new parameters default to
-1(ask via dialog), so existing callers that do not pass the argument get identical behaviour to today.Test plan
dview file.sql— dialog still appears as beforedview --ip file.sql— no dialog, data loads in IP unitsdview --si file.sql— no dialog, data loads in SI units--ipand--si—--ipwins (first match wins inOnCmdLineParsed)🤖 Generated with Claude Code