Exemplo n.º 1
0
 public MainUserControl()
 {
     this.InitializeComponent();
     this.virtualPanel = new VirtualPanel(this);
     this.userControl1 = new CommonControl();
     this.userControl2 = new CommonControl();
     this.userControl3 = new CommonControl();
     this.userControl4 = new CommonControl();
     this.userControl5 = new CommonControl();
     this.userControl6 = new CommonDataView();
     this.userControl7 = new CommonControl();
     this.userControl8 = new CommonControl();
     this.dlgViewSettings = new ViewSettings();
     AxeInformation item = new AxeInformation();
     this.dataSet1.Tables[0].PrimaryKey = new DataColumn[] { this.dataSet1.Tables[0].Columns.Add("Timestamp", System.Type.GetType("System.Double")) };
     ControlComponentConfiguration ctrlConf = new ControlComponentConfiguration {
         DataInMemory = this.dataSet1.Tables[0],
         GroupName = "Accelerometer"
     };
     ctrlConf.Axes.Clear();
     item.Name = "X";
     item.Unit = "mg";
     item.MinValue = -2000.0;
     item.MaxValue = 2000.0;
     item.Visible = true;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Y";
     item.Color = AxeColor.YColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Z";
     item.Color = AxeColor.ZColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl1.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "Gyroscope";
     item.Name = "X";
     item.Unit = "dps";
     item.MinValue = -300.0;
     item.MaxValue = 300.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Y";
     item.Color = AxeColor.YColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Z";
     item.Visible = true;
     item.Color = AxeColor.ZColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl2.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "Magnetometer";
     item.Name = "X";
     item.Unit = "mGa";
     item.MinValue = -700.0;
     item.MaxValue = 700.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Y";
     item.Color = AxeColor.YColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Z";
     item.Color = AxeColor.ZColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl3.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "";
     item.Name = "Pressure";
     item.Unit = "mbar";
     item.MinValue = 980.0;
     item.MaxValue = 1080.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     item.Precision = 1;
     item.StrType = "System.Double";
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl4.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "";
     item.Name = "Temperature";
     item.Unit = "\x00baC";
     item.MinValue = 15.0;
     item.MaxValue = 45.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     item.Precision = 1;
     item.StrType = "System.Double";
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl5.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "Rotation";
     item.Name = "Roll";
     item.Unit = "degree";
     item.MinValue = -180.0;
     item.MaxValue = 180.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     item.StrType = "System.Double";
     ctrlConf.Axes.Add(item);
     item.Name = "Pitch";
     item.Color = AxeColor.YColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Yaw";
     item.Color = AxeColor.ZColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl7.Configure(ctrlConf);
     ctrlConf.Axes.Clear();
     ctrlConf.GroupName = "Quaternion";
     item.Name = "Q0";
     item.Unit = "";
     item.MinValue = -1.0;
     item.MaxValue = 1.0;
     item.Color = AxeColor.XColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     item.StrType = "System.Double";
     ctrlConf.Axes.Add(item);
     item.Name = "Q1";
     item.Color = AxeColor.YColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Q2";
     item.Color = AxeColor.ZColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     item.Name = "Q3";
     item.Color = AxeColor.WColor;
     item.LineStyle = TxiPlotLineStyle.iplsSolid;
     ctrlConf.Axes.Add(item);
     ctrlConf.ShowStacked = true;
     this.userControl8.Configure(ctrlConf);
     ctrlConf.Source = this.bindingSource1;
     this.userControl6.Configure(ctrlConf);
     this.virtualPanel.Add(this.button1, this.userControl1, this.accelerometerToolStripMenuItem);
     this.virtualPanel.Add(this.button2, this.userControl2, this.gyroscopeToolStripMenuItem);
     this.virtualPanel.Add(this.button3, this.userControl3, this.magneticToolStripMenuItem);
     this.virtualPanel.Add(this.button5, this.userControl4, this.pressureToolStripMenuItem);
     this.virtualPanel.Add(this.button4, this.userControl5, this.temperatureToolStripMenuItem);
     this.virtualPanel.Add(this.button7, this.userControl7, this.rotationToolStripMenuItem);
     this.virtualPanel.Add(this.button8, this.userControl8, this.quaternionToolStripMenuItem);
     this.virtualPanel.Add(this.button6, this.userControl6, this.tableToolStripMenuItem);
     this.virtualPanel.BackColor = this.BackColor;
     this.virtualPanel.AdjustLayout(base.Size);
     this.button1.PerformClick();
     this.menuStrip1.Visible = false;
     this.menuStrip2.Visible = false;
     this.toolStripButton1.Checked = true;
     this.toolStripButton2.Checked = false;
     this.toolStripButton3.Checked = true;
     this.stackedViewToolStripMenuItem.Checked = this.toolStripButton1.Checked;
     this.cursorsToolStripMenuItem.Checked = this.toolStripButton2.Checked;
     this.enableTrackingToolStripMenuItem.Checked = this.toolStripButton3.Checked;
     this.toolStripComboBox1.SelectedIndex = 0;
     this.DeviceSensors = DeviceSensorDataAvailable.DSDA_ALL;
     this.EnableRotationDataView = false;
     this.SetVisibleData();
     this.ThereAreDataNotSaved = false;
     this.virtualPanel.SetBigButtons(true);
 }
Exemplo n.º 2
0
 public void Configure(ControlComponentConfiguration ctrlConf)
 {
     this.mTemp = ctrlConf.Source;
 }
Exemplo n.º 3
0
 public void Configure(ControlComponentConfiguration ctrlConf)
 {
     double num2 = 0.0;
     XAxe = axiPlotX.get_XAxis(axiPlotX.AddXAxis());
     XAxe.Name = "T";
     XAxe.Title = "Time (s)";
     XAxe.TitleShow = true;
     XAxe.Min = 0.0;
     XAxe.Span = 10.0;
     mMinX = XAxe.Min;
     XAxe.PopupEnabled = false;
     double num = (1.0 / ((double) (ctrlConf.Axes.Count + 1))) * 100.0;
     foreach (AxeInformation information in ctrlConf.Axes)
     {
         PlotYAxeInfo item = new PlotYAxeInfo {
             AxeName = information.Name
         };
         if (information.Unit != "")
             item.AxeName = item.AxeName + " (" + information.Unit + ")";
         item.Axe = axiPlotX.get_YAxis(axiPlotX.AddYAxis());
         item.Axe.Name = information.Name;
         item.Axe.Title = item.AxeName;
         item.Axe.Min = information.MinValue;
         mMinY = item.Axe.Min;
         item.Axe.Span = information.MaxValue - information.MinValue;
         mSpanY = item.Axe.Span;
         item.Axe.TrackingEnabled = true;
         item.Axe.Enabled = true;
         item.Axe.Visible = information.Visible;
         item.Channel = axiPlotX.get_Channel(axiPlotX.AddChannel());
         item.Channel.Name = information.Name;
         item.Channel.YAxisName = information.Name;
         item.Channel.TitleText = item.AxeName;
         item.Channel.VisibleInLegend = information.Visible;
         item.Channel.Visible = information.Visible;
         item.Channel.Color = (uint) information.Color;
         item.Channel.TraceLineStyle = information.LineStyle;
         if (information.Precision > 0)
         {
             item.Axe.LabelsPrecisionStyle = TxiPrecisionStyle.ipsFixedDecimalPoints;
             item.Axe.LabelsPrecision = information.Precision;
         }
         item.Cursor = axiPlotX.get_DataCursor(axiPlotX.AddDataCursor());
         item.Cursor.ChannelName = information.Name;
         item.Cursor.Visible = false;
         item.Cursor.MenuUserCanChangeOptions = false;
         item.Cursor.SnapToDataPoint = true;
         item.Cursor.ChannelAllowAll = false;
         num2 += num;
         item.Cursor.Pointer1Position = num2;
         item.Visible = information.Visible;
         if (information.StrType == null)
             ctrlConf.DataInMemory.Columns.Add(ctrlConf.GroupName + " " + item.AxeName, System.Type.GetType("System.Int16"));
         else
             ctrlConf.DataInMemory.Columns.Add(ctrlConf.GroupName + " " + item.AxeName, System.Type.GetType(information.StrType));
         YAxes.Add(item);
     }
     ShowStacked = ctrlConf.ShowStacked;
 }