Commit 19561db4 authored by Francesco Carraro's avatar Francesco Carraro
Browse files

working on retrieving parent files and summary

parent 063ad5c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,11 +40,11 @@
        public static readonly string XML_CONTINUUM_REMOVAL_SETTINGS_SEGMENT_PARAMETER_VALUE = "ParameterValue";
        public static readonly string XML_ELEMENTS = "Elements";
        public static readonly string XML_ELEMENT = "Element";
        public static readonly string XML_MAX = "Max";
        public static readonly string XML_MIN = "Min";
        public static readonly string XML_NUM_OF_POINTS = "NumOfPoints";
        public static readonly string XML_RAW_FILENAME = "RawFilename";
        public static readonly string XML_INFO = "Info";
        public static readonly string XML_MAX = "Max";
        public static readonly string XML_MIN = "Min";
        public static readonly string XML_PARENT_FILES = "ParentFiles";
        public static readonly string XML_PARENT_FILE_ID = "ParentFileId";
        public static readonly string XML_REF_FILE_ID = "RefFileId";
+6 −6
Original line number Diff line number Diff line
@@ -350,12 +350,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.Extensions
            return xmlelements;
        }

        /* used for 'ToSpectrumFile' extension method */
        public static string ToXmlString(this IChartSpectrumModel spectrum)
        {
            return ((IChartSpectrumOfTypeProcessedModel)spectrum).ToXml().GetXml();
        }

        /* used for 'saveSpectrumOfTypeAsLocalFileAsync' method in BaseUserControlViewModel */
        public static XmlDocument ToXml(this IChartSpectrumOfTypeProcessedModel spectrum)
        {
@@ -388,6 +382,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.Extensions

            return dom;
        }

        /* used for 'ToSpectrumFile' extension method */
        public static string ToXmlString(this IChartSpectrumModel spectrum)
        {
            return ((IChartSpectrumOfTypeProcessedModel)spectrum).ToXml().GetXml();
        }
        #endregion

        #region elements
+129 −109
Original line number Diff line number Diff line
@@ -8,6 +8,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "RawFilename")]
        public string RawFilename { get; set; }

        [XmlElement(ElementName = "Filepath")]
        public string Filepath { get; set; }

        [XmlElement(ElementName = "Type")]
        public string Type { get; set; }
    }
@@ -17,8 +21,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "ParentFileId")]
        public string ParentFileId { get; set; }

        [XmlElement(ElementName = "RefFileId")]
        public string RefFileId { get; set; }

        [XmlElement(ElementName = "RefWhiteFileId")]
        public string RefWhiteFileId { get; set; }
    }
@@ -28,6 +34,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "Min")]
        public string Min { get; set; }

        [XmlElement(ElementName = "Max")]
        public string Max { get; set; }
    }
@@ -37,6 +44,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "NumOfPoints")]
        public string NumOfPoints { get; set; }

        [XmlElement(ElementName = "SegmentBoundaries")]
        public DeserializedSegmentBoundaries SegmentBoundaries { get; set; }
    }
@@ -46,14 +54,19 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "FitMethodName")]
        public string FitMethodName { get; set; }

        [XmlElement(ElementName = "SegmentStart")]
        public string SegmentStart { get; set; }

        [XmlElement(ElementName = "SegmentEnd")]
        public string SegmentEnd { get; set; }

        [XmlElement(ElementName = "ParameterValue")]
        public string ParameterValue { get; set; }

        [XmlElement(ElementName = "PolynomialOrder")]
        public string PolynomialOrder { get; set; }

        [XmlElement(ElementName = "WindowSize")]
        public string WindowSize { get; set; }
    }
@@ -70,6 +83,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "NumOfPoints")]
        public string NumOfPoints { get; set; }

        [XmlElement(ElementName = "Segments")]
        public DeserializedSegments Segments { get; set; }
    }
@@ -86,6 +100,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlAttribute(AttributeName = "Wavelength")]
        public string Wavelength { get; set; }

        [XmlText]
        public string Text { get; set; }
    }
@@ -102,14 +117,19 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders.SpectrumFiles
    {
        [XmlElement(ElementName = "Info")]
        public DeserializedInfo Info { get; set; }

        [XmlElement(ElementName = "ParentFiles")]
        public DeserializedParentFiles ParentFiles { get; set; }

        [XmlElement(ElementName = "AlignmentSettings")]
        public DeserializedAlignmentSettings AlignmentSettings { get; set; }

        [XmlElement(ElementName = "ContinuumRemovalSettings")]
        public DeserializedContinuumRemovalSettings ContinuumRemovalSettings { get; set; }

        [XmlElement(ElementName = "SmoothingSettings")]
        public DeserializedSmoothingSettings SmoothingSettings { get; set; }

        [XmlElement(ElementName = "Elements")]
        public DeserializedElements Elements { get; set; }
    }
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Helpers.FileReaders
                using (var stream = await file.OpenStreamForReadAsync())
                {
                    spectrumObj = (DeserializedSpectrum)xmlSerializer.Deserialize(stream);
                    spectrumObj.Info.Filepath = file.Path;
                }

                if (spectrumObj == null)
+27 −0
Original line number Diff line number Diff line
using INAF.Apps.Uwp.SLabDataManager.Models.Chart;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace INAF.Apps.Uwp.SLabDataManager.Helpers.UI
{
    public class ProcessedFilesSummaryItemsTemplateSelector : DataTemplateSelector
    {
        public DataTemplate AlignedFileSettingsAummary { get; set; }

        public DataTemplate ContinuumRemovedFileSettingsSummary { get; set; }

        public DataTemplate RawOrRefSummary { get; set; }

        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            if (item is ChartSpectrumOfTypeRawModel)
                return RawOrRefSummary;
            else if (item is ChartSpectrumOfTypeAlignedModel)
                return AlignedFileSettingsAummary;
            else if (item is ChartSpectrumOfTypeContinuumRemovedModel)
                return ContinuumRemovedFileSettingsSummary;
            else
                return null;
        }
    }
}
Loading