void PopulateChannelMenuOptions() { nameSubMenu = new AlwaysDisabledOption(Name); lineColorSubMenu = new GroupHeadOption("Color"); lineThicknessSubMenu = new GroupHeadOption("Thickness"); lineOpacitySubMenu = new GroupHeadOption("Opacity"); ChannelOptions.SoftwareOptions.SubOptions.Add(nameSubMenu); ChannelOptions.SoftwareOptions.SubOptions.Add(lineColorSubMenu); ChannelOptions.SoftwareOptions.SubOptions.Add(lineThicknessSubMenu); ChannelOptions.SoftwareOptions.SubOptions.Add(lineOpacitySubMenu); ChannelOptions.SoftwareOptions.Enabled = true; for (int i = 1; i <= 8; i++) { var op = new LineThicknessOption(i); op.Checked = i == LineThickness; lineThicknessSubMenu.SubOptions.Add(op); op.MenuItem.Click += LineThicknessItemClick; } foreach (var col in GraphicsUtils.CommonColors()) { var op = new LineColorOption(col); op.Checked = col.R == LineColor.R && col.G == LineColor.G && col.B == LineColor.B; lineColorSubMenu.SubOptions.Add(op); op.MenuItem.Click += LineColorItemClick; } for (int i = 10; i <= 100; i += 10) { var op = new LineOpacityOption(i / 100.0F); int t = (int)Math.Round(LineOpacity * 100); op.Checked = i == t; lineOpacitySubMenu.SubOptions.Add(op); op.MenuItem.Click += LineOpacityItemClick; } }
/// <summary> /// Initializes a collection with NoS number of new channels. /// Each channel is given a unique name and an ID. /// </summary> /// <param name="NoS"></param> public TimeSeriesCollection(int NoS) { for (int i = 0; i < NoS; i++) { var ds = new TimeSeries("Channel " + (seriesList.Count + 1), seriesList.Count); ds.InvalidateRequest += Ds_InvalidateRequest; ds.GetTimeStampsRequest += Ds_GetTimeStampsRequest; ds.LineColor = GraphicsUtils.CommonColors()[seriesList.Count]; if (seriesList.Count > 0) { foreach (var dp in seriesList[0].Values) { ds.Values.Add(0); } } seriesList.Add(ds); } }