| 44 | } |
| 45 | |
| 46 | const QString EQ::reverseLookup(const QVector<double> &data) |
| 47 | { |
| 48 | auto table = EQ_LOOKUP_TABLE(); |
| 49 | |
| 50 | for (auto key : table.keys()) |
| 51 | { |
| 52 | QVector<double> row(table[key]); |
| 53 | int it = 0; |
| 54 | bool different = false; |
| 55 | |
| 56 | for (auto cur_data : row) |
| 57 | { |
| 58 | bool equal = isApproximatelyEqual<double>(cur_data, data.at(it), 0.01); |
| 59 | |
| 60 | if (!equal) |
| 61 | { |
| 62 | different = true; |
| 63 | break; |
| 64 | } |
| 65 | |
| 66 | it++; |
| 67 | } |
| 68 | |
| 69 | if (!different) |
| 70 | { |
| 71 | return key; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | return ""; |
| 76 | } |
| 77 | |
| 78 | const QMap<EQ_UNIT> EQ::EQ_LOOKUP_TABLE() |
| 79 | { |