// Copyright © Selmo Technology GmbH. All Rights Reserved

using SelmoStudio.Hmi.Server.SelmoHmi.Dashboard.Components;
using SelmoStudio.Hmi.Server.SelmoHmi.Dashboard.Model;

namespace SelmoStudio.Hmi.Server.SelmoHmi.Dashboard.Pages
{
    public partial class SelmoDashboard
    {
        private const string DashboardComponentClasses = "dashboard-component dashboard-padding";

        private List<DashboardComponentInfo> _componentsInfo;

        protected override void OnInitialized()
        {
            // TODO Get the Dashboard components from the configuration
            _componentsInfo = GetDashboardComponents();

            base.OnInitialized();
        }

        private List<DashboardComponentInfo> GetDashboardComponents()
        {
            return new List<DashboardComponentInfo>
            {
                new DashboardComponentInfo { Type = typeof(DashboardLineChartComponent), Row = 1, Column = 2, ColumnSpan = 2,
                    Parameters = new Dictionary<string, object>() { {"Id", "@WellKnownElementIds.DashboardLineChart1ComponentId" } } },
                new DashboardComponentInfo { Type = typeof(DashboardColumnChartComponent), Row = 0, Column = 0, ColumnSpan = 4,
                    Parameters = new Dictionary<string, object>() { {"Id", "@WellKnownElementIds.DashboardColumnChartComponentId" } } },
                new DashboardComponentInfo { Type = typeof(DashboardLineChartComponent), Row = 2, Column = 1, ColumnSpan = 3,
                    Parameters = new Dictionary<string, object>() { {"Id", "@WellKnownElementIds.DashboardLineChart2ComponentId" } } },
                new DashboardComponentInfo { Type = typeof(DashboardProcessValuesDisplayComponent), Row = 1, Column = 0, ColumnSpan = 2,
                    Parameters = new Dictionary<string, object>() { {"Id", "@WellKnownElementIds.DashboardProcessValuesDisplayComponentId" } } },
                new DashboardComponentInfo { Type = typeof(DashboardPieChartComponent), Row = 2, Column = 0, ColumnSpan = 1,
                    Parameters = new Dictionary<string, object>()  { {"Id", "@WellKnownElementIds.DashboardPieChartComponentId" } } }
            };
        }
    }
}