| 406 | } |
| 407 | |
| 408 | void ColorMapper::loadPlaylist(const QStringPairList &attributes) |
| 409 | { |
| 410 | for (auto attribute : attributes) |
| 411 | { |
| 412 | if (attribute.first == "colorMapperType") |
| 413 | { |
| 414 | bool ok = false; |
| 415 | auto value = attribute.second.toInt(&ok); |
| 416 | if (ok) |
| 417 | { |
| 418 | if (auto type = MappingTypeMapper.at(value)) |
| 419 | this->mappingType = *type; |
| 420 | } |
| 421 | else if (auto type = MappingTypeMapper.getValue(attribute.second.toStdString())) |
| 422 | this->mappingType = *type; |
| 423 | } |
| 424 | else if (attribute.first == "colorMapperMinColor" || |
| 425 | attribute.first == "colorMapperGradientStart") |
| 426 | this->gradientColorStart = Color(attribute.second.toStdString()); |
| 427 | else if (attribute.first == "colorMapperMaxColor" || |
| 428 | attribute.first == "colorMapperGradientEnd") |
| 429 | this->gradientColorEnd = Color(attribute.second.toStdString()); |
| 430 | else if (attribute.first == "colorMapperRangeMin") |
| 431 | this->valueRange.min = attribute.second.toInt(); |
| 432 | else if (attribute.first == "colorMapperRangeMax") |
| 433 | this->valueRange.max = attribute.second.toInt(); |
| 434 | else if (attribute.first == "colorMapperRange") |
| 435 | this->valueRange = rangeFromString(attribute.second.toStdString()); |
| 436 | else if (attribute.first == "colorMapperComplexType" || |
| 437 | attribute.first == "colorMapperPredefinedType") |
| 438 | { |
| 439 | if (auto type = PredefinedTypeMapper.getValueCaseInsensitive(attribute.second.toStdString())) |
| 440 | this->predefinedType = *type; |
| 441 | } |
| 442 | else if (attribute.first.startsWith("colorMapperMapValue")) |
| 443 | { |
| 444 | auto key = attribute.first.mid(19).toInt(); |
| 445 | auto value = Color(attribute.second.toStdString()); |
| 446 | this->colorMap[key] = value; |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | bool ColorMapper::operator!=(const ColorMapper &other) const |
| 452 | { |
nothing calls this directly
no test coverage detected