Turn a set of tokens into an operand
| 735 | |
| 736 | //Turn a set of tokens into an operand |
| 737 | void FrameSenderWindow::parseOperandString(QStringList tokens, ModifierOperand &operand) |
| 738 | { |
| 739 | qDebug() << "parseOperandString"; |
| 740 | //example string -> bus:0:id:200:d3 |
| 741 | |
| 742 | operand.bus = -1; |
| 743 | operand.ID = -2; |
| 744 | operand.databyte = 0; |
| 745 | |
| 746 | for (int i = 0; i < tokens.length(); i++) |
| 747 | { |
| 748 | if (tokens[i] == "BUS") |
| 749 | { |
| 750 | operand.bus = Utility::ParseStringToNum(tokens[++i]); |
| 751 | } |
| 752 | else if (tokens[i] == "ID") |
| 753 | { |
| 754 | operand.ID = Utility::ParseStringToNum(tokens[++i]); |
| 755 | } |
| 756 | else if (tokens[i].length() == 2 && tokens[i].startsWith("D")) |
| 757 | { |
| 758 | operand.databyte = Utility::ParseStringToNum(tokens[i].right(tokens[i].length() - 1)); |
| 759 | } |
| 760 | else |
| 761 | { |
| 762 | operand.databyte = Utility::ParseStringToNum(tokens[i]); |
| 763 | operand.ID = 0; //special ID to show this is a number not a look up. |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | ModifierOperationType FrameSenderWindow::parseOperation(QString op) |
| 769 | { |
nothing calls this directly
no outgoing calls
no test coverage detected