示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeProxyView" /> class.
        /// </summary>
        public TreeProxyView(ViewBase owner) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.TreeProxyView.glade", "vpaned1");
            gxml.Autoconnect(this);
            _mainWidget             = vpaned1;
            this.pBelowGround       = new OxyPlot.GtkSharp.PlotView();
            this.pAboveGround       = new OxyPlot.GtkSharp.PlotView();
            this.pAboveGround.Model = new PlotModel();
            this.pBelowGround.Model = new PlotModel();
            plots.Add(pAboveGround);
            plots.Add(pBelowGround);
            pAboveGround.SetSizeRequest(-1, 100);
            hbox1.PackStart(pAboveGround, true, true, 0);
            pBelowGround.SetSizeRequest(-1, 100);
            hbox1.PackStart(pBelowGround, true, true, 0);

            smallestDate          = DateTime.MaxValue;
            largestDate           = DateTime.MinValue;
            this.LeftRightPadding = 40;
            this.gridView1        = new Views.GridView(this);
            alignment1.Add(this.gridView1.MainWidget);
            smallestDate             = DateTime.MaxValue;
            largestDate              = DateTime.MinValue;
            treeview2.CursorChanged += GridCursorChanged;
            MainWidget.ShowAll();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphView" /> class.
        /// </summary>
        public GraphView(ViewBase owner = null) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.GraphView.glade");

            vbox1           = (VBox)builder.GetObject("vbox1");
            expander1       = (Expander)builder.GetObject("expander1");
            vbox2           = (VBox)builder.GetObject("vbox2");
            captionLabel    = (Label)builder.GetObject("captionLabel");
            captionEventBox = (EventBox)builder.GetObject("captionEventBox");
            label2          = (Label)builder.GetObject("label2");
            _mainWidget     = vbox1;

            plot1       = new PlotView();
            plot1.Model = new PlotModel();
            plot1.SetSizeRequest(-1, 100);
            vbox2.PackStart(plot1, true, true, 0);

            smallestDate            = DateTime.MaxValue;
            largestDate             = DateTime.MinValue;
            this.LeftRightPadding   = 40;
            expander1.Visible       = false;
            captionEventBox.Visible = true;

            plot1.Model.MouseDown += OnChartClick;
            plot1.Model.MouseUp   += OnChartMouseUp;
            plot1.Model.MouseMove += OnChartMouseMove;
            Popup.AttachToWidget(plot1, null);

            captionLabel.Text = null;
            captionEventBox.ButtonPressEvent += OnCaptionLabelDoubleClick;
            _mainWidget.Destroyed            += _mainWidget_Destroyed;
            BackColor = OxyPlot.OxyColors.White;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphView" /> class.
        /// </summary>
        public GraphView(ViewBase owner = null) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.GraphView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            plot1       = new PlotView();
            plot1.Model = new PlotModel();
            plot1.SetSizeRequest(-1, 100);
            vbox2.PackStart(plot1, true, true, 0);

            smallestDate            = DateTime.MaxValue;
            largestDate             = DateTime.MinValue;
            this.LeftRightPadding   = 40;
            expander1.Visible       = false;
            captionEventBox.Visible = true;

            plot1.Model.MouseDown += OnChartClick;
            plot1.Model.MouseUp   += OnChartMouseUp;
            plot1.Model.MouseMove += OnChartMouseMove;
            Popup.AttachToWidget(plot1, null);

            captionLabel.Text = null;
            captionEventBox.ButtonPressEvent += OnCaptionLabelDoubleClick;
            _mainWidget.Destroyed            += _mainWidget_Destroyed;
            BackColor = OxyPlot.OxyColors.White;
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeProxyView" /> class.
        /// </summary>
        public TreeProxyView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.TreeProxyView.glade");

            vpaned1                 = (VPaned)builder.GetObject("vpaned1");
            alignment1              = (Alignment)builder.GetObject("alignment1");
            hbox1                   = (HBox)builder.GetObject("hbox1");
            treeview1               = (TreeView)builder.GetObject("treeview1");
            treeview2               = (TreeView)builder.GetObject("treeview2");
            _mainWidget             = vpaned1;
            this.pBelowGround       = new OxyPlot.GtkSharp.PlotView();
            this.pAboveGround       = new OxyPlot.GtkSharp.PlotView();
            this.pAboveGround.Model = new PlotModel();
            this.pBelowGround.Model = new PlotModel();
            plots.Add(pAboveGround);
            plots.Add(pBelowGround);
            pAboveGround.SetSizeRequest(-1, 100);
            hbox1.PackStart(pAboveGround, true, true, 0);
            pBelowGround.SetSizeRequest(-1, 100);
            hbox1.PackStart(pBelowGround, true, true, 0);

            smallestDate          = DateTime.MaxValue;
            largestDate           = DateTime.MinValue;
            this.LeftRightPadding = 40;
            this.gridView1        = new Views.GridView(this);
            alignment1.Add(this.gridView1.MainWidget);
            smallestDate             = DateTime.MaxValue;
            largestDate              = DateTime.MinValue;
            treeview2.CursorChanged += GridCursorChanged;
            MainWidget.ShowAll();
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeProxyView" /> class.
 /// </summary>
 public TreeProxyView(ViewBase owner) : base(owner)
 {
     /// TBI this.InitializeComponent();
     this.pBelowGround       = new OxyPlot.GtkSharp.PlotView(); /// TEMP
     this.pAboveGround       = new OxyPlot.GtkSharp.PlotView(); /// TEMP
     this.gridView1          = new Views.GridView(this);        /// TEMP
     this.pAboveGround.Model = new PlotModel();
     this.pBelowGround.Model = new PlotModel();
     plots.Add(pAboveGround);
     plots.Add(pBelowGround);
     smallestDate = DateTime.MaxValue;
     largestDate  = DateTime.MinValue;
 }
示例#6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphView" /> class.
        /// </summary>
        public GraphView(ViewBase owner) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.GraphView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            plot1       = new PlotView();
            plot1.Model = new PlotModel();
            plot1.SetSizeRequest(-1, 100);
            vbox2.PackStart(plot1, true, true, 0);

            smallestDate          = DateTime.MaxValue;
            largestDate           = DateTime.MinValue;
            this.LeftRightPadding = 40;
            expander1.Visible     = false;

            plot1.Model.MouseDown += OnChartClick;

            captionLabel.Text = null;
            captionEventBox.ButtonPressEvent += OnCaptionLabelDoubleClick;
        }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeProxyView" /> class.
 /// </summary>
 public TreeProxyView(ViewBase owner)
     : base(owner)
 {
     /// TBI this.InitializeComponent();
     this.pBelowGround = new OxyPlot.GtkSharp.PlotView(); /// TEMP
     this.pAboveGround = new OxyPlot.GtkSharp.PlotView(); /// TEMP
     this.gridView1 = new Views.GridView(this); /// TEMP
     this.pAboveGround.Model = new PlotModel();
     this.pBelowGround.Model = new PlotModel();
     plots.Add(pAboveGround);
     plots.Add(pBelowGround);
     smallestDate = DateTime.MaxValue;
     largestDate = DateTime.MinValue;
 }
示例#8
0
    private void Apply(Limbus.Lab.Settings settings)
    {
        this.lblPoti1.Text = settings.Poti1;
        this.lblPoti2.Text = settings.Poti2;
        this.lblPoti3.Text = settings.Poti3;
        this.lblPoti4.Text = settings.Poti4;
        this.lblPoti5.Text = settings.Poti5;

        this.vscalePoti1.Adjustment.Upper = settings.PotiMax;
        this.vscalePoti1.Adjustment.Lower = settings.PotiMin;

        this.vscalePoti2.Adjustment.Upper = settings.PotiMax;
        this.vscalePoti2.Adjustment.Lower = settings.PotiMin;

        this.vscalePoti3.Adjustment.Upper = settings.PotiMax;
        this.vscalePoti3.Adjustment.Lower = settings.PotiMin;

        this.vscalePoti4.Adjustment.Upper = settings.PotiMax;
        this.vscalePoti4.Adjustment.Lower = settings.PotiMin;

        this.vscalePoti5.Adjustment.Upper = settings.PotiMax;
        this.vscalePoti5.Adjustment.Lower = settings.PotiMin;

        vbxPlot.Remove(timePlotView);
        timePlot = new TimePlot("Oscilloscope", settings.PlotWidth, settings.PlotHeight, DateTimeOffset.UtcNow);
        timePlotView = new OxyPlot.GtkSharp.PlotView { Model = timePlot };
        timePlotView.SetSizeRequest(1000, 200);
        timePlotView.Visible = true;
        this.SetSizeRequest(1000, 600);
        vbxPlot.Add(timePlotView);

        var labSettingsText = settings.ToJson()
            .Replace(",", ",\n").Replace("{", "{\n").Replace("}","\n}");
        txtLabSettings.Buffer.Text = labSettingsText;
    }
示例#9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphView" /> class.
        /// </summary>
        public GraphView(ViewBase owner = null)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.GraphView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            plot1 = new PlotView();
            plot1.Model = new PlotModel();
            plot1.SetSizeRequest(-1, 100);
            vbox2.PackStart(plot1, true, true, 0);

            smallestDate = DateTime.MaxValue;
            largestDate = DateTime.MinValue;
            this.LeftRightPadding = 40;
            expander1.Visible = false;
            captionEventBox.Visible = true;

            plot1.Model.MouseDown += OnChartClick;

            captionLabel.Text = null;
            captionEventBox.ButtonPressEvent += OnCaptionLabelDoubleClick;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
            BackColor = OxyPlot.OxyColors.White;
        }
示例#10
0
        /// <summary>
        /// Setups the oxyplot.
        /// </summary>
        private void SetupOxyPlot()
        {
            XAxis = new LinearAxis {
                Key = "X",
                Position = AxisPosition.Bottom,
                AbsoluteMinimum = TimeSpan.FromSeconds (0).Ticks,
                LabelFormatter = x => {
                    if (x <= TimeSpan.FromSeconds (0).Ticks) {
                        return "Start";
                    }
                    return string.Format ("+{0}", TimeSpan.FromSeconds (x).ToString ("c"));
                },
                MajorGridlineThickness = 1,
                MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineColor = OxyColors.LightGray,
                MinorGridlineStyle = LineStyle.Dot,
                MinorGridlineThickness = .5,
            };

            var YAxis = new LinearAxis {
                Position = AxisPosition.Left,
                Minimum = -0.1,
                Maximum = 1.1,
                LabelFormatter = x => ((int)x == 0) ? "LOW" : "HIGH",
                IsPanEnabled = false,
                IsZoomEnabled = false,
                AbsoluteMaximum = 1.1,
                AbsoluteMinimum = -0.1,
                MinorStep = 1,
                MajorStep = 1,
            };

            sequenceSeries = new OxyPlot.Series.StairStepSeries () {
                DataFieldX = "Time",
                DataFieldY = "Value",
            };

            repeateSeries = new OxyPlot.Series.LineSeries () {
                DataFieldX = "Time",
                DataFieldY = "Value",
                StrokeThickness = 2,
                LineStyle = LineStyle.Dot
            };

            plotModel = new PlotModel {
                PlotType = PlotType.XY,
                Background = OxyPlot.OxyColors.White,
            };
            plotModel.Axes.Add (YAxis);
            plotModel.Axes.Add (XAxis);
            plotModel.Series.Add (sequenceSeries);
            plotView = new PlotView (){ Name = "", Model = plotModel };

            vboxOptions.Add (plotView);
            ((Box.BoxChild)(vboxOptions [plotView])).Position = 2;

            plotView.SetSizeRequest (nvSequenceOptions.WidthRequest, this.HeightRequest / 3);

            plotView.ShowAll ();
        }
示例#11
0
		/// <summary>
		/// Builds the realtime plot.
		/// </summary>
		private void BuildRealTimePlot ()
		{
			RealTimeXAxis = new DateTimeAxis {
				Key = "RealTimeXAxis",
				Position = AxisPosition.Bottom,
				MajorGridlineThickness = 1,
				MajorGridlineStyle = OxyPlot.LineStyle.Solid,
				MinorGridlineColor = OxyColors.LightGray,
				MinorGridlineStyle = OxyPlot.LineStyle.Dot,
				MinorGridlineThickness = .5,
				MinorStep = TimeSpan.FromSeconds (1).Ticks,
			};

			var YAxis = new LinearAxis {
				Position = AxisPosition.Left,
				IsPanEnabled = false,
				IsZoomEnabled = false,
				MajorGridlineThickness = 1,
				MajorGridlineStyle = OxyPlot.LineStyle.Solid,
				MinorGridlineColor = OxyColors.LightGray,
				MinorGridlineStyle = OxyPlot.LineStyle.Dot,
				MinorGridlineThickness = .5,
			};

			RealTimePlotModel = new PlotModel {
				PlotType = PlotType.XY,
				Background = OxyPlot.OxyColors.White,
				IsLegendVisible = true,
				LegendOrientation = LegendOrientation.Horizontal,
				LegendPlacement = LegendPlacement.Outside,
				LegendPosition = LegendPosition.RightMiddle,
			};

			RealTimePlotController = new PlotController ();

			RealTimePlotModel.Axes.Add (YAxis);
			RealTimePlotModel.Axes.Add (RealTimeXAxis);

			//Enable double buffered to prevent flickering
			RealTimePlotView = new PlotView (){ Name = "", Model = RealTimePlotModel, DoubleBuffered = true  };

			vboxRealTimePlot.PackStart (RealTimePlotView, true, true, 0);
			(vboxRealTimePlot [RealTimePlotView] as Box.BoxChild).Position = 0;

			RealTimePlotView.SetSizeRequest (hbSequences.Allocation.Width, fSequences.Allocation.Height / 2);
			vpanedSequences.Position = fSequences.Allocation.Height / 2;

			RealTimePlotView.ShowAll ();

			cbtnRealTimePlotSmoothValues.Toggled += OnCbtnRealTimePlotSmoothValues;
			cbtnRealTimePlotShowMarker.Toggled += OnCbtnRealTimePlotShowMarkerToggled;
			btnRealTimePlotJumpStart.Clicked += OnBtnRealTimePlotJumpStartClicked;
			btnRealTimePlotJumpLatest.Clicked += OnBtnRealTimePlotJumpLatestClicked;
			btnRealTimePlotSnapshot.Clicked += OnBtnRealTimePlotSnapshotClicked;
			btnRealTimePlotPause.Clicked += OnBtnRealTimePlotPauseClicked;
			btnRealTimePlotResetZoom.Clicked += OnBtnRealTimePlotResetZoomClicked;
			btnRealTimePlotFitData.Clicked += OnBtnRealTimePlotFitDataClicked;
			cbtnRealTimePlotLimitPoints.Active = Frontend.Settings.Default.LimitPlotPoints;
			cbtnRealTimePlotLimitPoints.Toggled += OnCbtnRealTimePlotLimitPoints;
		}
示例#12
0
		/// <summary>
		/// Builds the sequence preview plot.
		/// </summary>
		private void BuildSequencePreviewPlot ()
		{
			XAxis = new LinearAxis {
				Key = "X",
				Position = AxisPosition.Bottom,
				AbsoluteMinimum = TimeSpan.FromSeconds (0).Ticks,
				LabelFormatter = x =>
				{
					if (x <= TimeSpan.FromSeconds (0).Ticks)
					{
						return "Start";
					}
					return string.Format ("+{0}", TimeSpan.FromSeconds (x).ToString ("g"));
				},
				MajorGridlineThickness = 1,
				MajorGridlineStyle = OxyPlot.LineStyle.Solid,
				MinorGridlineColor = OxyColors.LightGray,
				MinorGridlineStyle = OxyPlot.LineStyle.Dot,
				MinorGridlineThickness = .5,
			};

			var YAxis = new LinearAxis {
				Position = AxisPosition.Left,
				Minimum = -0.1,
				Maximum = 1.1,
				LabelFormatter = x => ((int)x == 0) ? "LOW" : "HIGH",
				IsPanEnabled = false,
				IsZoomEnabled = false,
				AbsoluteMaximum = 1.1,
				AbsoluteMinimum = -0.1,
				MinorStep = 1,
				MajorStep = 1,
			};

			SequencePreviewPlotModel = new PlotModel {
				PlotType = PlotType.XY,
				Background = OxyPlot.OxyColors.White,
			};
			SequencePreviewPlotModel.Axes.Add (YAxis);
			SequencePreviewPlotModel.Axes.Add (XAxis);
			SequencePreviewPlotView = new PlotView (){ Name = "", Model = SequencePreviewPlotModel  };

			vpanedSequences.Pack2 (SequencePreviewPlotView, true, true);


			SequencePreviewPlotView.SetSizeRequest (hbSequences.Allocation.Width, fSequences.Allocation.Height / 2);
			vpanedSequences.Position = fSequences.Allocation.Height / 2;


			SequencePreviewPlotView.ShowAll ();
		}