-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PV inverter error display and clean up product IDs #1320
Conversation
Use the same error text that is shown when clicking on a PV Inverter from the Device List. Fixes #1303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, nits
src/productinfo.h
Outdated
class ProductInfo : public QObject | ||
{ | ||
Q_OBJECT | ||
QML_NAMED_ELEMENT(ProductInfo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just QML_ELEMENT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh true, the QML_NAMED_ELEMENT wasn't necessary. Fixed.
src/productinfo.h
Outdated
~ProductInfo() override {} | ||
|
||
enum ProductId_Alternator { | ||
ProductId_Wakespeed = 0xB080, // VE_PROD_ID_WAKESPEED_WS500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe prefix the enum entry with the enum title, eg. ProductId_Alternator_Wakespeed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, some of the others didn't have a clear grouping, so I added Product_Misc
and put those enums there.
src/productinfo.h
Outdated
Q_ENUM(ProductId_Genset) | ||
|
||
Q_INVOKABLE bool isGensetProduct(int productId) { | ||
static const QVector<int> productIds = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a switch/case instead of a QVector with static lifetime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, much nicer. Fixed, thanks.
092ee25
to
1fe2bb4
Compare
1fe2bb4
to
09a1485
Compare
No description provided.