feat: Support for 8s Cell Sensor such as FrSky FLVS ADV (#2302)
* first commit for FrSky 8s Lipo Sensor FLVS Advanced transfers up to 8 cell voltages for Cels sensor * correcting mistake made transferring local change to PR * complementary extension of Companion telemetry simulator to enable simulation of 8 cells * change to allow selection of cells 7 and 8 in calculated sensor with formula Cell * (cpn) Add bin and yml conversions and basic semantic version helper Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
@@ -240,3 +240,58 @@ private:
|
||||
};
|
||||
|
||||
extern Stopwatch gStopwatch;
|
||||
|
||||
class SemanticVersion
|
||||
{
|
||||
public:
|
||||
explicit SemanticVersion(QString vers);
|
||||
~SemanticVersion() = default;;
|
||||
|
||||
bool isValid(const QString vers);
|
||||
QString toString() const;
|
||||
|
||||
bool operator==(const SemanticVersion& rhs) {
|
||||
return compare(rhs) == 0;
|
||||
}
|
||||
|
||||
bool operator!=(const SemanticVersion& rhs) {
|
||||
return compare(rhs) != 0;
|
||||
}
|
||||
|
||||
bool operator>(const SemanticVersion& rhs) {
|
||||
return compare(rhs) > 0;
|
||||
}
|
||||
|
||||
bool operator>=(const SemanticVersion& rhs) {
|
||||
return compare(rhs) >= 0;
|
||||
}
|
||||
|
||||
bool operator<(const SemanticVersion& rhs) {
|
||||
return compare(rhs) < 0;
|
||||
}
|
||||
|
||||
bool operator<=(const SemanticVersion& rhs) {
|
||||
return compare(rhs) <= 0;
|
||||
}
|
||||
|
||||
private:
|
||||
enum PreRelease {
|
||||
PR_ALPHA = 0,
|
||||
PR_BETA = 1,
|
||||
PR_RC = 2,
|
||||
PR_NONE = 3
|
||||
};
|
||||
|
||||
struct Version {
|
||||
int major = 0;
|
||||
int minor = 1;
|
||||
int patch = 0;
|
||||
PreRelease preReleaseType = PR_NONE;
|
||||
int preReleaseNumber = 0;
|
||||
};
|
||||
|
||||
Version version;
|
||||
|
||||
int compare(const SemanticVersion& other);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user