protected void AddSlider(Panel panel, string text, float min, float max, float value, SliderValueChangedEvent changed, ref int index, ref int verticalOffset, out Slider slider, out DynamicLabel valueLabel) { Label label = new Label(); label.TextAlign = System.Drawing.ContentAlignment.TopLeft; label.FixedSize = true; label.Size = new System.Drawing.Size(this.Size.Width - 100, 15); label.Location = new System.Drawing.Point(0, verticalOffset); label.Text = text; label.FontType = FontType.Small; label.IsVisible = true; label.Padding = new System.Windows.Forms.Padding(5); label.RelitiveZIndex = index++; panel.Controls.Add(label); valueLabel = new DynamicLabel(); valueLabel.TextAlign = System.Drawing.ContentAlignment.TopRight; valueLabel.FixedSize = true; valueLabel.Size = new System.Drawing.Size(95, 15); valueLabel.Location = new System.Drawing.Point(this.Size.Width - 100, verticalOffset); valueLabel.MaxLength = 8; valueLabel.Text = value.ToString("N2"); valueLabel.FontType = FontType.Small; valueLabel.IsVisible = true; valueLabel.Padding = new System.Windows.Forms.Padding(5); valueLabel.RelitiveZIndex = index++; panel.Controls.Add(valueLabel); verticalOffset += 20; slider = new Slider(); slider.MinValue = min; slider.MaxValue = max; slider.Size = new System.Drawing.Size(this.Size.Width - 10, 15); slider.Location = new System.Drawing.Point(5, verticalOffset); slider.IsVisible = true; slider.Value = value; slider.ValueChanged += changed; slider.RelitiveZIndex = index++; panel.Controls.Add(slider); verticalOffset += 15; }
private void CreateStatusBar() { #region Status Bar int index = 20; Panel statusPanel = new Panel(); statusPanel.ShowBackground = true; statusPanel.ShowBorder = false; statusPanel.Docking = System.Windows.Forms.DockStyle.Bottom; statusPanel.IsVisible = true; statusPanel.RelitiveZIndex = index++; statusPanel.Size = new System.Drawing.Size(152, 24); Controls.Add(statusPanel); index = 1; m_SpeedGraph = new MultiGraph(); m_SpeedGraph.Location = new System.Drawing.Point(2, 2); m_SpeedGraph.Size = new System.Drawing.Size(150, 20); m_SpeedGraph.IsVisible = true; m_SpeedGraph.RelitiveZIndex = index++; statusPanel.Controls.Add(m_SpeedGraph); m_FPSGraph = new SubGraph(150); m_FPSGraph.IsVisible = true; m_FPSGraph.LineColor = new SlimDX.Color4(0.75f, 0.3f, 1f, 0.3f); m_SpeedGraph.Graphs.Add(m_FPSGraph); m_FPSLabel = new DynamicLabel(); m_FPSLabel.ForeColor = new SlimDX.Color4(0.75f, 0.3f, 1f, 0.3f); m_FPSLabel.MaxLength = 16; m_FPSLabel.Location = new System.Drawing.Point(154, 0); m_FPSLabel.FixedSize = false; m_FPSLabel.FontType = FontType.Small; m_FPSLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_FPSLabel.IsVisible = true; m_FPSLabel.RelitiveZIndex = index++; statusPanel.Controls.Add(m_FPSLabel); #endregion }
protected void AddPathControl(Panel panel, string text, string value, EventHandler openFileDialog, EventHandler openLocation, ref int index, ref int verticalOffset, out DynamicLabel valueLabel) { Label label = new Label(); label.TextAlign = System.Drawing.ContentAlignment.TopLeft; label.FixedSize = true; label.Size = new System.Drawing.Size(this.Size.Width - 100, 15); label.Location = new System.Drawing.Point(0, verticalOffset); label.Text = text; label.FontType = FontType.Small; label.IsVisible = true; label.Padding = new System.Windows.Forms.Padding(5); label.RelitiveZIndex = index++; panel.Controls.Add(label); verticalOffset += 20; valueLabel = new DynamicLabel(); valueLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; valueLabel.FixedSize = true; valueLabel.Size = new System.Drawing.Size(this.Size.Width - 70, 15); valueLabel.Location = new System.Drawing.Point(5, verticalOffset); valueLabel.MaxLength = 100; valueLabel.Text = value; valueLabel.FontType = FontType.Small; valueLabel.IsVisible = true; valueLabel.Padding = new System.Windows.Forms.Padding(5); valueLabel.RelitiveZIndex = index++; panel.Controls.Add(valueLabel); Button openFileDialogButton = new Button(); openFileDialogButton.Size = new System.Drawing.Size(25, 20); openFileDialogButton.Location = new System.Drawing.Point(this.Size.Width - 65, verticalOffset); openFileDialogButton.Text = "..."; openFileDialogButton.FontType = FontType.Small; openFileDialogButton.IsVisible = true; openFileDialogButton.RelitiveZIndex = index++; openFileDialogButton.Click += openFileDialog; panel.Controls.Add(openFileDialogButton); Button openLocationButton = new Button(); openLocationButton.Size = new System.Drawing.Size(30, 20); openLocationButton.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset); openLocationButton.Text = "Open"; openLocationButton.FontType = FontType.Small; openLocationButton.IsVisible = true; openLocationButton.RelitiveZIndex = index++; openLocationButton.Click += openLocation; panel.Controls.Add(openLocationButton); verticalOffset += 25; }
public override void Initiate() { int index = 1; Label label = new Label(); label.TextAlign = System.Drawing.ContentAlignment.TopLeft; label.FixedSize = true; label.Size = new System.Drawing.Size(this.Size.Width - 10, 30); label.Location = new System.Drawing.Point(0, 5); label.Text = "Ensemble Tests"; label.FontType = FontType.Heading; label.IsVisible = true; label.Padding = new System.Windows.Forms.Padding(5); label.RelitiveZIndex = index++; this.Controls.Add(label); int verticalOffset = 35; Button button = new Button(); button.Size = new System.Drawing.Size(this.Size.Width - 10, 20); button.Location = new System.Drawing.Point(5, verticalOffset); button.Text = "Start Tests"; button.FontType = FontType.Small; button.IsVisible = true; button.RelitiveZIndex = index++; button.Click += new EventHandler(button_Click); this.Controls.Add(button); verticalOffset += 25; m_ProgressBar = new ProgressBar(); m_ProgressBar.Size = new System.Drawing.Size(this.Size.Width - 10, 20); m_ProgressBar.Location = new System.Drawing.Point(5, verticalOffset); m_ProgressBar.IsVisible = true; m_ProgressBar.RelitiveZIndex = index++; m_ProgressBar.Value = 0; m_ProgressBar.MaxValue = 100; this.Controls.Add(m_ProgressBar); verticalOffset += 25; m_SpeedGraph = new MultiGraph(); m_SpeedGraph.Location = new System.Drawing.Point(5, verticalOffset); m_SpeedGraph.Size = new System.Drawing.Size(this.Size.Width - 40, 200); m_SpeedGraph.IsVisible = true; m_SpeedGraph.RelitiveZIndex = index++; this.Controls.Add(m_SpeedGraph); m_OrginalGraph = new SubGraph(100); m_OrginalGraph.IsVisible = true; m_OrginalGraph.LineColor = new SlimDX.Color4(1f, 1f, 0.3f, 0.3f); m_OrginalGraph.MaxValue = 0.1f; m_OrginalGraph.Scrolling = false; m_SpeedGraph.Graphs.Add(m_OrginalGraph); m_OptoGraph = new SubGraph(100); m_OptoGraph.IsVisible = true; m_OptoGraph.LineColor = new SlimDX.Color4(1f, 0.3f, 1f, 0.3f); m_OptoGraph.MaxValue = 0.1f; m_OptoGraph.Scrolling = false; m_SpeedGraph.Graphs.Add(m_OptoGraph); m_OptoGraph2 = new SubGraph(100); m_OptoGraph2.IsVisible = true; m_OptoGraph2.LineColor = new SlimDX.Color4(1f, 1f, 1f, 0.3f); m_OptoGraph2.MaxValue = 0.1f; m_OptoGraph2.Scrolling = false; m_SpeedGraph.Graphs.Add(m_OptoGraph2); m_GraphMax = new DynamicLabel(); m_GraphMax.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_GraphMax.FixedSize = true; m_GraphMax.Size = new System.Drawing.Size(30, 15); m_GraphMax.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset); m_GraphMax.MaxLength = 10; m_GraphMax.Text = "0"; m_GraphMax.FontType = FontType.Small; m_GraphMax.IsVisible = true; m_GraphMax.Padding = new System.Windows.Forms.Padding(5); m_GraphMax.RelitiveZIndex = index++; this.Controls.Add(m_GraphMax); m_GraphMin = new DynamicLabel(); m_GraphMin.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_GraphMin.FixedSize = true; m_GraphMin.Size = new System.Drawing.Size(30, 15); m_GraphMin.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset + 185); m_GraphMin.MaxLength = 10; m_GraphMin.Text = "0"; m_GraphMin.FontType = FontType.Small; m_GraphMin.IsVisible = true; m_GraphMin.Padding = new System.Windows.Forms.Padding(5); m_GraphMin.RelitiveZIndex = index++; this.Controls.Add(m_GraphMin); verticalOffset += 200; this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5); }
public override void Initiate() { ArtworkStaticObjects.OscControler.ConnectionChanged += new EventHandler(OscControler_ConnectionChanged); int index = 1; Label label = new Label(); label.TextAlign = System.Drawing.ContentAlignment.TopLeft; label.FixedSize = true; label.Size = new System.Drawing.Size(290, 30); label.Location = new System.Drawing.Point(0, 5); label.Text = "Osc Properties"; label.FontType = FontType.Heading; label.IsVisible = true; label.Padding = new System.Windows.Forms.Padding(5); label.RelitiveZIndex = index++; this.Controls.Add(label); int verticalOffset = 35; m_OscMessage = new DynamicLabel(); m_OscMessage.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_OscMessage.FixedSize = true; m_OscMessage.Size = new System.Drawing.Size(Size.Width - 10, 15); m_OscMessage.Location = new System.Drawing.Point(0, verticalOffset); m_OscMessage.Text = ArtworkStaticObjects.OscControler.Message; m_OscMessage.MaxLength = 200; m_OscMessage.FontType = FontType.Small; m_OscMessage.IsVisible = true; m_OscMessage.Padding = new System.Windows.Forms.Padding(5); m_OscMessage.RelitiveZIndex = index++; this.Controls.Add(m_OscMessage); verticalOffset += 20; m_OscAddress = new TextBox(); m_OscAddress.Text = ArtworkStaticObjects.OscControler.Address; m_OscAddress.MaxLength = 80; m_OscAddress.Size = new System.Drawing.Size(Size.Width - 140, 20); m_OscAddress.Location = new System.Drawing.Point(5, verticalOffset); m_OscAddress.FontType = FontType.Small; m_OscAddress.RelitiveZIndex = index++; m_OscAddress.IsVisible = true; m_OscAddress.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; m_OscAddress.TextChanged += new EventHandler(m_OscAddress_TextChanged); this.Controls.Add(m_OscAddress); m_OscPort = new TextBox(); m_OscPort.Text = ArtworkStaticObjects.OscControler.Port.ToString(); m_OscPort.MaxLength = 6; m_OscPort.Size = new System.Drawing.Size(50, 20); m_OscPort.Location = new System.Drawing.Point(Size.Width - 130, verticalOffset); m_OscPort.FontType = FontType.Small; m_OscPort.RelitiveZIndex = index++; m_OscPort.IsVisible = true; m_OscPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; m_OscPort.TextChanged += new EventHandler(m_OscPort_TextChanged); this.Controls.Add(m_OscPort); m_OscConnectButton = new Button(); m_OscConnectButton.Text = ArtworkStaticObjects.OscControler.Connected ? "Dissconnect" : "Connect"; m_OscConnectButton.Size = new System.Drawing.Size(70, 20); m_OscConnectButton.Location = new System.Drawing.Point(Size.Width - 75, verticalOffset); m_OscConnectButton.FontType = FontType.Small; m_OscConnectButton.RelitiveZIndex = index++; m_OscConnectButton.IsVisible = true; m_OscConnectButton.Click += new EventHandler(m_OscConnectButton_Click); this.Controls.Add(m_OscConnectButton); verticalOffset += 25; AddSlider(this, "Movement Threshold", 0, 2, (float)Options.Osc.SpeedThreshold, new SliderValueChangedEvent(m_SpeedThresholdSlider_ValueChanged), ref index, ref verticalOffset, out m_SpeedThresholdSlider, out m_SpeedThresholdValueLabel); AddSlider(this, "Distance Threshold", 0, 10, (float)Options.Osc.DistanceThreshold, new SliderValueChangedEvent(m_DistanceThresholdSlider_ValueChanged), ref index, ref verticalOffset, out m_DistanceThresholdSlider, out m_DistanceThresholdValueLabel); AddSlider(this, "Portal ID", 0, 10, (float)Options.Osc.PortalID, new SliderValueChangedEvent(m_PortalIDSlider_ValueChanged), ref index, ref verticalOffset, out m_PortalIDSlider, out m_PortalIDValueLabel); this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5); }
private void CreateStatusBar() { #region Status Bar int index = 20; m_StatusPanel = new Panel(); m_StatusPanel.ShowBackground = true; m_StatusPanel.ShowBorder = false; m_StatusPanel.Docking = System.Windows.Forms.DockStyle.Bottom; m_StatusPanel.IsVisible = true; m_StatusPanel.RelitiveZIndex = index++; m_StatusPanel.Size = new System.Drawing.Size(152, 50); Controls.Add(m_StatusPanel); index = 1; m_SpeedGraph = new MultiGraph(); m_SpeedGraph.Location = new System.Drawing.Point(2, 2); m_SpeedGraph.Size = new System.Drawing.Size(150, 48); m_SpeedGraph.IsVisible = true; m_SpeedGraph.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_SpeedGraph); m_FPSGraph = new Graph(150); m_FPSGraph.IsVisible = true; m_FPSGraph.LineColor = new SlimDX.Color4(0.75f, 0.3f, 1f, 0.3f); m_SpeedGraph.Graphs.Add(m_FPSGraph); m_FPSLabel = new DynamicLabel(); m_FPSLabel.ForeColor = new SlimDX.Color4(0.75f, 0.3f, 1f, 0.3f); m_FPSLabel.MaxLength = 16; m_FPSLabel.Location = new System.Drawing.Point(154, 0); m_FPSLabel.FixedSize = false; m_FPSLabel.FontType = FontType.Small; m_FPSLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_FPSLabel.IsVisible = true; m_FPSLabel.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_FPSLabel); m_PacketGraph = new Graph(150); m_PacketGraph.IsVisible = true; m_PacketGraph.LineColor = new SlimDX.Color4(0.75f, 1f, 0.3f, 0.3f); m_SpeedGraph.Graphs.Add(m_PacketGraph); m_PacketLabel = new DynamicLabel(); m_PacketLabel.ForeColor = new SlimDX.Color4(0.75f, 1f, 0.3f, 0.3f); m_PacketLabel.MaxLength = 20; m_PacketLabel.Location = new System.Drawing.Point(154, 10); m_PacketLabel.FixedSize = false; m_PacketLabel.FontType = FontType.Small; m_PacketLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_PacketLabel.IsVisible = true; m_PacketLabel.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_PacketLabel); m_DroppedFramesGraph = new Graph(150); m_DroppedFramesGraph.IsVisible = true; m_DroppedFramesGraph.LineColor = new SlimDX.Color4(0.75f, 1f, 0.3f, 1f); m_SpeedGraph.Graphs.Add(m_DroppedFramesGraph); m_DroppedFramesLabel = new DynamicLabel(); m_DroppedFramesLabel.ForeColor = new SlimDX.Color4(0.75f, 1f, 0.3f, 1f); m_DroppedFramesLabel.MaxLength = 20; m_DroppedFramesLabel.Location = new System.Drawing.Point(240, 0); m_DroppedFramesLabel.FixedSize = false; m_DroppedFramesLabel.FontType = FontType.Small; m_DroppedFramesLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_DroppedFramesLabel.IsVisible = true; m_DroppedFramesLabel.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_DroppedFramesLabel); m_RecordingStatusLabel = new DynamicLabel(); m_RecordingStatusLabel.ForeColor = new SlimDX.Color4(0.75f, 1f, 0.3f, 1f); m_RecordingStatusLabel.MaxLength = 20; m_RecordingStatusLabel.Location = new System.Drawing.Point(240, 10); m_RecordingStatusLabel.FixedSize = false; m_RecordingStatusLabel.FontType = FontType.Small; m_RecordingStatusLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft; m_RecordingStatusLabel.IsVisible = true; m_RecordingStatusLabel.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_RecordingStatusLabel); m_FFTGraph = new MultiGraph(); m_FFTGraph.Location = new System.Drawing.Point(340, 2); m_FFTGraph.Size = new System.Drawing.Size(DSParticles3.ParticleEnsemble.VelocityAutoCorrelationLength / 2, 22); //m_FFTGraph.Size = new System.Drawing.Size(512, 22); m_FFTGraph.IsVisible = true; m_FFTGraph.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_FFTGraph); m_CorrelationFunctionGraph = new Graph(ArtworkStaticObjects.Ensemble.xtest.Length);// the number in brackets is how many data points in the graph m_CorrelationFunctionGraph.Scrolling = false; // this may need to be true (test) m_CorrelationFunctionGraph.IsVisible = true; m_CorrelationFunctionGraph.LineColor = new SlimDX.Color4(0.75f, 1f, 1f, 1f); m_CorrelationFunctionGraph.ScaleEveryFrame = true; m_FFTGraph.Graphs.Add(m_CorrelationFunctionGraph); m_FFTGraph2 = new MultiGraph(); m_FFTGraph2.Location = new System.Drawing.Point(340, 26); m_FFTGraph2.Size = new System.Drawing.Size(DSParticles3.ParticleEnsemble.VelocityAutoCorrelationLength / 2, 22); //m_FFTGraph2.Size = new System.Drawing.Size(512, 22); m_FFTGraph2.IsVisible = true; m_FFTGraph2.RelitiveZIndex = index++; m_StatusPanel.Controls.Add(m_FFTGraph2); m_FFTFreqsGraph = new PeakGraph(24, ArtworkStaticObjects.Ensemble.AveragedFFTamplitudes.Length);// the number in brackets is how many data points in the graph m_FFTFreqsGraph.Scrolling = false; // this may need to be true (test) m_FFTFreqsGraph.IsVisible = true; m_FFTFreqsGraph.LineColor = new SlimDX.Color4(0.75f, 1f, 0.2f, 0.2f); m_FFTFreqsGraph.PeakLineColor = new SlimDX.Color4(0.75f, 1f, 0f, 1f); m_FFTFreqsGraph.ShowTicks = true; m_FFTFreqsGraph.ShowPeaks = true; m_FFTFreqsGraph.TickSpace = ArtworkStaticObjects.Ensemble.AveragedFFTamplitudes.Length / 64; m_FFTFreqsGraph.ScaleEveryFrame = true; m_FFTGraph2.Graphs.Add(m_FFTFreqsGraph); #endregion }