#flex-dev Logs
Jan 23 2025
#flex-dev Calendar
04:25 AM JT-Cave: morning
04:46 AM Tom_L: morning
06:43 AM lcnc-relay: <meisterdippel@> if len(hal_progressbar) > 0: # setup hal progressbar
06:43 AM lcnc-relay: valid_types = ['HAL_S32', 'HAL_U32', 'HAL_FLOAT']
06:44 AM lcnc-relay: <meisterdippel@> JT-Cave: can you please add HAL_FLOAT to the possible types of hal_progressbar !?!? it works fine
06:45 AM JT-Cave: sure can if it works
06:45 AM JT-Cave: https://doc.qt.io/qt-6/qprogressbar.html
06:46 AM JT-Cave: value : int
06:46 AM JT-Cave: setValue(int value)
06:46 AM JT-Cave: is the decimal part of the float just dropped by the qprogressbar?
06:47 AM lcnc-relay: <meisterdippel@> same with the qsliders, works also , many thanks !
06:47 AM JT-Cave: https://stackoverflow.com/questions/18192454/progress-bar-pass-float-argument
06:48 AM JT-Cave: internet says floats don't work with a qprogressbar
06:49 AM JT-Cave: https://doc.qt.io/qt-6/qabstractslider.html
06:49 AM lcnc-relay: <meisterdippel@> only the places before the comma are used, but in most cases this is not a problem
06:49 AM JT-Cave: docs say value is int for all of them
06:50 AM lcnc-relay: <meisterdippel@> yes, but in flexgui, there is a conversion to int
06:50 AM JT-Cave: hmm
06:51 AM lcnc-relay: <meisterdippel@> another possibility is to use qtpyvcp, which is used for writing * 100 and for reading / 100
06:51 AM lcnc-relay: <meisterdippel@> another possibility, (which uses qtpyvcp,)
06:57 AM JT-Cave: I don't see any conversion to int for a slider
07:00 AM lcnc-relay: <meisterdippel@> i only add float to the valid_types and it works , so there is an int() somewhere
07:04 AM JT-Cave: indeed it seems to work somehow but I'm not converting it to int
07:04 AM JT-Cave: qt must be doing that so it might break
07:04 AM JT-Cave: why not just use int types?
07:08 AM rdtsc-w: I'd say it's trivial to convert (everything) to int explicitly, but knowing Python 3, there's some stipulations buried somewhere heheh
07:11 AM JT-Cave: I'm not fond of using undocumented "features"
07:12 AM lcnc-relay: <meisterdippel@> why i should use a hal component to convert float to int if it works this way more easy
07:19 AM JT-Cave: because it's undocumented that it works so it could break later down the line
07:19 AM lcnc-relay: <meisterdippel@> you can add an int(value) while setting
07:24 AM lcnc-relay: <meisterdippel@> unfortunately i don't really know your code, where is the value for the status bar updated?
07:25 AM JT-Cave: https://github.com/jethornton/flexgui/blob/1.1.1/flexgui/src/libflexgui/utilities.py#L226
07:26 AM lcnc-relay: <meisterdippel@> in the other direction ? i.e. hal -> status-bar
07:28 AM lcnc-relay: <meisterdippel@> * ProgressBar
07:29 AM lcnc-relay: <meisterdippel@> update hal progressbars key is the progressbar name and value is the pin name
07:29 AM lcnc-relay: for key, value in parent.hal_progressbars.items():
07:29 AM lcnc-relay: value = hal.get_value(f'flexhal.{value}')
07:29 AM lcnc-relay: getattr(parent, key).setValue(int(value))
07:30 AM lcnc-relay: <meisterdippel@> here is the int conversion: setValue(int(value)) so all fine 🙂
08:14 AM * JT-Cave calls it a morning
08:19 AM lcnc-relay: <meisterdippel@> https://github.com/jethornton/flexgui/pull/259/files
01:53 PM JT-Shop: me takes 5 then gets back to stacking fire wood
02:42 PM Tom_L: PR #260
03:01 PM lcnc-relay: <meisterdippel@> how about embedded tabs (for vcp / vismach) ?
03:02 PM lcnc-relay: <meisterdippel@> Not quite finished yet, but it works : https://cserver1.multixmedia.org/flexgui-embed_tab.png
03:11 PM JT-Shop: neat
03:24 PM xxcoder: nice
04:13 PM Tom_L: leave it to the robot guy
04:27 PM lcnc-relay: <meisterdippel@> https://github.com/jethornton/flexgui/compare/master...multigcs:flexgui:embed_tabs
04:29 PM lcnc-relay: <meisterdippel@> unfortunately there is still something wrong with the resize of the embedded window, but vismach and qtvcp works and some other own tools
04:51 PM JT-Shop: gotta take the front wheels off the C8 tomorrow morning... getting new tires
04:54 PM JT-Shop: hauled two loads of firewood today so pretty tired