Version FC
Dependencies: DmTftLibrary eeprom SX1280Lib filesystem mbed
Fork of MSNV2-Terminal_V1-5 by
Diff: Value.cpp
- Branch:
- Integration
- Revision:
- 38:9b43b2415093
- Parent:
- 24:92c30dabfda4
- Child:
- 39:13e66d087ae9
--- a/Value.cpp Tue Oct 16 11:28:33 2018 +0000 +++ b/Value.cpp Fri Oct 19 06:32:59 2018 +0000 @@ -42,6 +42,14 @@ this->_value.value.int32_value = value.value.int32_value; break; + case Value::UINT64_T: + this->_value.value.uint64_value = value.value.uint64_value; + break; + + case Value::INT64_T: + this->_value.value.int64_value = value.value.int64_value; + break; + case Value::FLOAT: this->_value.value.float_value = value.value.float_value; break; @@ -161,6 +169,28 @@ return -1; break; + case Value::UINT64_T: + if (this->_value.value.uint64_value == otherValue._value.value.uint64_value) { + return 0; + } + else if (this->_value.value.uint64_value > otherValue._value.value.uint64_value) { + return 1; + } + + return -1; + break; + + case Value::INT64_T: + if (this->_value.value.int64_value == otherValue._value.value.int64_value) { + return 0; + } + else if (this->_value.value.int64_value > otherValue._value.value.int64_value) { + return 1; + } + + return -1; + break; + case Value::FLOAT: if (this->_value.value.float_value == otherValue._value.value.float_value) { return 0; @@ -196,8 +226,8 @@ case Value::TRIPLE_DOUBLE: if ((this->_value.value.triple_double_values[0] == otherValue._value.value.triple_double_values[0]) - && (this->_value.value.triple_double_values[1] == otherValue._value.value.triple_double_values[2]) - && (this->_value.value.triple_double_values[1] == otherValue._value.value.triple_double_values[2])) { + && (this->_value.value.triple_double_values[1] == otherValue._value.value.triple_double_values[1]) + && (this->_value.value.triple_double_values[2] == otherValue._value.value.triple_double_values[2])) { return 0; } else if (this->_value.value.triple_double_values[0] > otherValue._value.value.triple_double_values[0]) { @@ -214,12 +244,8 @@ } +#ifdef TEST_ENVIRONMENT std::string Value::toString() { - /* - DEBUG("ENTREE\n"); - DEBUG("This = %p\n", this); - */ - std::ostringstream stringStream; switch (this->_value.type) { @@ -289,6 +315,7 @@ return stringStream.str(); } +#endif Value Value::substract(Value& otherValue) {