УкраїнськаEnglishmRussian
Вхід/Новий
У темі немає нових постів

[BugWrong] FormEl table ceil color


Автор Повідомлення
Повідомлення створено: 09. 10. 2025 [14:33]
walhi
Sergey Karpesh
Автор теми
Зареєстрован(а) с: 26.01.2016
Повідомлення: 40
Hello. I've discovered that widgets like FormEl Table have a non-standard implementation of cell color support. Experiments have shown that the color specification standard adopted in OpenSCADA (the RGB HEX value plus a separate alpha channel in DEC) is not recognized, and the standard HTML is parsed incorrectly. Instead of the RGBA ordering, the ARGB ordering is used, but I couldn't find any mention of this in the documentation.
Повідомлення створено: 09. 10. 2025 [14:48]
roman
Roman Savochenko
Moderator
Contributor
Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3788
"walhi" wrote:

Hello. I've discovered that widgets like FormEl Table have a non-standard implementation of cell color support.

See in the ElFigure primitive due to that is a standard for all primitives!

And that is not a bug!!!

Learn, learn and learn better than work, work and work.
Повідомлення створено: 09. 10. 2025 [16:08]
walhi
Sergey Karpesh
Автор теми
Зареєстрован(а) с: 26.01.2016
Повідомлення: 40
"roman" wrote:

And that is not a bug!!!

I am attaching an example of a table where this appears and a screenshot.

HTML
<tbl colsWdthFit='1' sel = 'row'>"
<h><s width = '45%'>Цвет</s><s width = '45%'>Значение</s></h>
<r><s color='red-127'>_</s><s>red-127</s></r>
<r><s color='red'>_</s><s>red</s></r>
<r><s color='#FF0000-255'>_</s><s>#FF0000-255, непрозрачный красный RGB-A</s></r>
<r><s color='#FF0000FF'>_</s><s>#FF0000FF, непрозрачный красный RGBA</s></r>
<r><s color='#FFFF0000'>_</s><s>#FFFF0000, непрозрачный красный ARGB</s></r>
<r><s color='#FF000040'>_</s><s>#FF000040, прозрачный красный RGBA</s></r>
<r><s color='#40FF0000'>_</s><s>#40FF0000, прозрачный красный ARGB</s></r>
</tbl>


[Повідомлення редагувалось 1 раз(ів), останній раз 09.10.2025 в 16:09.]
Вкладений файл

Screenshot_20251009_160919.png (Тип файлу: image/png, Розмір: 18.54 кілобайтів) — 27 завантажень
Повідомлення створено: 09. 10. 2025 [18:09]
roman
Roman Savochenko
Moderator
Contributor
Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3788
"walhi" wrote:

"roman" wrote:

And that is not a bug!!!

I am attaching an example of a table where this appears and a screenshot.

OK, and where there about bugs?

That is only the WebBrowser behavior at transmission the color in hex, which OpenSCADA treats in noway!

Just see the source code of the related visualizer before open bugs — http://oscada.org/svn/trunk/OpenSCADA/src/moduls/ui/WebVision/WebVisionVCA.js

Learn, learn and learn better than work, work and work.
Повідомлення створено: 09. 10. 2025 [18:51]
walhi
Sergey Karpesh
Автор теми
Зареєстрован(а) с: 26.01.2016
Повідомлення: 40
"roman" wrote:

Just see the source code of the related visualizer before open bugs

The forum section description states that this section should be used to report errors and inaccuracies in the documentation. Since I couldn't find a description of this specific feature in the documentation, the original purpose of this post was to supplement the documentation. But as it turns out, this is more like a problem.

"roman" wrote:

OK, and where there about bugs?

However, as it later turned out, the interfaces in WebVision and QtVision look different, something I only discovered now. I am attaching another screenshot showing the difference in display. The first example showed the working user interface on Qt.



[Повідомлення редагувалось 1 раз(ів), останній раз 09.10.2025 в 18:52.]
Вкладений файл

Screenshot_20251009_183257.png (Тип файлу: image/png, Розмір: 117.27 кілобайтів) — 20 завантажень
Повідомлення створено: 09. 10. 2025 [19:05]
roman
Roman Savochenko
Moderator
Contributor
Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3788
"walhi" wrote:

"roman" wrote:

Just see the source code of the related visualizer before open bugs

The forum section description states that this section should be used to report errors and inaccuracies in the documentation. Since I couldn't find a description of this specific feature in the documentation, the original purpose of this post was to supplement the documentation. But as it turns out, this is more like a problem.

Firstly, OpenSCADA documentation cannot trace all specific of the visualization frameworks and changes in their structures!
Secondary, that is not about errors in the documentation and for such its improvements created independent forum!

"walhi" wrote:

"roman" wrote:

OK, and where there about bugs?

However, as it later turned out, the interfaces in WebVision and QtVision look different, something I only discovered now. I am attaching another screenshot showing the difference in display. The first example showed the working user interface on Qt.

And that is obvious for different visualizers, which smoothing is not a bug fixing also but it is a feature appending.

Your example just show the difference in the extending hex color on Qt and Web, that is the format is not standard in whole and even in Web appeared newly.

Learn, learn and learn better than work, work and work.
Повідомлення створено: 09. 10. 2025 [23:34]
walhi
Sergey Karpesh
Автор теми
Зареєстрован(а) с: 26.01.2016
Повідомлення: 40
"roman" wrote:

And that is obvious for different visualizers, which smoothing is not a bug fixing also but it is a feature appending.

As it turns out, the source code contains a function that solves the problem with displaying on the Qt, but it was not used in the code that populates the table cells.
JAVASCRIPT
QColor OSCADA_QT::getColor( const string &val )


JAVASCRIPT
src/moduls/ui/Vision/vis_shapes.cpp
-- tit->setData(Qt::BackgroundRole, QColor(wVl.c_str()));
++ tit->setData(Qt::BackgroundRole, getColor(wVl.c_str()));
 
-- tit->setData(Qt::ForegroundRole, QColor(wVl.c_str()));
++ tit->setData(Qt::ForegroundRole, getColor(wVl.c_str()));


This doesn't solve the problem of identical display both on the web and locally, but it's better than before. Bonus: experience building from source.
Вкладений файл

Screenshot_20251009_233213.png (Тип файлу: image/png, Розмір: 31.79 кілобайтів) — 25 завантажень
Повідомлення створено: 11. 10. 2025 [21:54]
roman
Roman Savochenko
Moderator
Contributor
Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3788
"walhi" wrote:

JAVASCRIPT
src/moduls/ui/Vision/vis_shapes.cpp
-- tit->setData(Qt::BackgroundRole, QColor(wVl.c_str()));
++ tit->setData(Qt::BackgroundRole, getColor(wVl.c_str()));
 
-- tit->setData(Qt::ForegroundRole, QColor(wVl.c_str()));
++ tit->setData(Qt::ForegroundRole, getColor(wVl.c_str()));


Yes, I have added of using the standard OpenSCADA function getColor() for transparency here.

"walhi" wrote:

This doesn't solve the problem of identical display both on the web and locally, but it's better than before. Bonus: experience building from source.

And for that I have adapted UI.WebVision for parsing alfa value from OpenSCADA format and placing it to "rgba(red, green, blue, alpha)" in case of hex colors, due to named colors are needed of conversion to hex.

Learn, learn and learn better than work, work and work.



7558