| 724 | } |
| 725 | |
| 726 | void PlotCanvas::showMetaData(bool modifiable, Int index) |
| 727 | { |
| 728 | LayerDataBase& layer = getCurrentLayer(); |
| 729 | |
| 730 | MetaDataBrowser dlg(modifiable, this); |
| 731 | if (index == -1) |
| 732 | { |
| 733 | if (auto lp = dynamic_cast<LayerDataPeak*>(&layer)) |
| 734 | { |
| 735 | dlg.add(*lp->getPeakDataMuteable()); |
| 736 | // Exception for Plot1DCanvas, here we add the meta data of the one spectrum |
| 737 | if (auto lp1 = dynamic_cast<LayerData1DPeak*>(&layer)) |
| 738 | { |
| 739 | dlg.add((*lp1->getPeakDataMuteable())[lp1->getCurrentIndex()]); |
| 740 | } |
| 741 | } |
| 742 | if (auto lp = dynamic_cast<LayerDataFeature*>(&layer)) |
| 743 | { |
| 744 | dlg.add(*lp->getFeatureMap()); |
| 745 | } |
| 746 | if (auto lp = dynamic_cast<LayerDataConsensus*>(&layer)) |
| 747 | { |
| 748 | dlg.add(*lp->getConsensusMap()); |
| 749 | } |
| 750 | else if (layer.type == LayerDataBase::DT_CHROMATOGRAM) |
| 751 | { |
| 752 | // TODO CHROM |
| 753 | } |
| 754 | else if (layer.type == LayerDataBase::DT_IDENT) |
| 755 | { |
| 756 | // TODO IDENT |
| 757 | } |
| 758 | } |
| 759 | else // show element meta data |
| 760 | { |
| 761 | if (auto lp = dynamic_cast<LayerDataPeak*>(&layer)) |
| 762 | { |
| 763 | dlg.add((*lp->getPeakDataMuteable())[index]); |
| 764 | } |
| 765 | else if (auto lp = dynamic_cast<LayerDataFeature*>(&layer)) |
| 766 | { |
| 767 | dlg.add((*lp->getFeatureMap())[index]); |
| 768 | } |
| 769 | else if (auto lp = dynamic_cast<LayerDataConsensus*>(&layer)) |
| 770 | { |
| 771 | dlg.add((*lp->getConsensusMap())[index]); |
| 772 | } |
| 773 | else if (layer.type == LayerDataBase::DT_CHROMATOGRAM) |
| 774 | { |
| 775 | // TODO CHROM |
| 776 | } |
| 777 | else if (layer.type == LayerDataBase::DT_IDENT) |
| 778 | { |
| 779 | // TODO IDENT |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | // if the meta data was modified, set the flag |
no test coverage detected