private static Page PageFromTab(View_HistoryPlots.TabConfig tab, View_HistoryPlots.DataExport dataExport) { var hc = new Widgets.HistoryPlotConfig() { PlotConfig = MapPlotConfig(tab.PlotConfig), Items = tab.Items.Select(MapItemConfig).ToArray(), DataExport = MapDataExport(dataExport) }; JObject config = StdJson.ObjectToJObject(hc, indented: true); return(new Page() { ID = tab.Name, Name = tab.Name, Rows = new Row[] { new Row() { Columns = new Column[] { new Column() { Width = ColumnWidth.Fill, Widgets = new Widget[] { new Widget("w1", "HistoryPlot", width: "100%", height: "600px", config: config) } } } } } }); }
private static Widgets.DataExport MapDataExport(View_HistoryPlots.DataExport de) { return(new Widgets.DataExport() { CSV = new Widgets.CsvDataExport() { ColumnSeparator = de.CSV.ColumnSeparator, TimestampFormat = de.CSV.TimestampFormat, }, Spreadsheet = new Widgets.SpreadsheetDataExport() { TimestampFormat = de.Spreadsheet.TimestampFormat, } }); }