RiverWare Model Reports (COE): Image Items Bug Number: n/a Release notes (y/n): Yes For Release Nums: 6.7 Image item support for Model Reports has been implemented. Image items are created from an image file, but from that point on, their data is serialized in the Model Report Output Device record, in the model file. This uses a Base64-based encoding for the image's binary data, as it has existed in the original image file. In memory, the image data is stored in a QByteArray field within the IMAGE item's ModelReportItem. Images support an optional CAPTION string. The caption string can be long, wrapping to multiple lines. If the image is sufficiently wide (currently, at least 300 pixels wide), the caption text block under the image is limited to the image width, and the text is centered within that width. Otherwise, for images narrower than 300 pixels, the caption flows to the full width of the webpage, and is left aligned. This example demonstrates these two cases. (If long caption had been provided, they would be multiple lines under the image): http://cadswes2.colorado.edu/~philw/2015/CoeModelRep/2015-04-17/ImageReport4.png http://cadswes2.colorado.edu/~philw/2015/CoeModelRep/2015-04-17/testOut.html Note: IMAGE items have three _hidden_ settings: the width, height, and original file path. This was apparently the first time the "sibling dependency" rwSetting provision (which is used for hiding settings) was applied to the Model Report application -- and it had a problem. That dependency relationship was lost when the model (with model report output device) was saved and reloaded. (That mechanism does work, and is broadly used in the Output Canvas Configuration rwSetting application). So, for Model Reports, the following work-around method was devised. We might choose to revisit the actual problem in the future. void ModelReportItem::dependencyBugFix() { // Note [Phil, 4-2015, RW 6.7]: There is apparently an existing problem // with rwSetting "sibling" dependencies in the ModelReportItem's // application of rwSettings. The first time such dependencies are being // used here is with the introduction of IMAGE items, where width, // height, and original image file path are recorded as rwSettings, but // are not actually intended to be presented as visible settings. // // When creating a new IMAGE item, the dependencies (for hiding those // settings) does function -- see method initImageItem(). BUT after // saving and reloading a model having model report output devices, // these dependency relationships are LOST. // // This method is called from Q3GUI/ModelReportConfigDlg right before // installing a newly selected ModelReportItem's settings into the // rwSettingTree, i.e. before calling rwSettingTree::setReportItem(). const int settingCnt = _settings.size(); for (int inx = 0; inx < settingCnt; ++inx) { rwSetting* sett = _settings[inx]; const rwSetting::Identifier id = sett->identifier(); if (!SHOW_REP_IMAGE_DETAIL_SETTINGS) { if ( (id == rwSetting::REP_IMAGE_SRC_WIDTH) || (id == rwSetting::REP_IMAGE_SRC_HEIGHT) || (id == rwSetting::REP_IMAGE_SRC_PATH) ) { sett->setDependentOnSibling (id, "NotFound-AlwaysHidden"); } } } }