Exemplo n.º 1
0
 public DataHandler(MccBoard board, BoardConfiguration bc, Dispatcher ui)
 {
     dataCont = new ADData(board, bc);
     boardConfig = bc;
     models = new List<ChannelControl>();
     uiDispatcher = ui;
 }
Exemplo n.º 2
0
 public ADData(MccBoard board, BoardConfiguration bc)
 {
     lowChannel = bc.LowChannel;
     qChans = bc.QChanns;
     NumPoints = 186;//bc.PointsRead;
     MemHandle = MccDaq.MccService.WinBufAllocEx(10*qChans*NumPoints);
     Board = board;
     rate = bc.Rate;
     adData = new ushort[qChans*NumPoints];
     mCb = new CallbackFunction(this.CreateBackground);
 }
 public BoardConfig(BoardConfiguration bc)
 {
     InitializeComponent();
     chnSlider.RangeStart = 1;
     chnSlider.RangeStop = bc.MaxChannels;
     rate.Text = bc.Rate.ToString();
     chnSlider.RangeStartSelected = bc.LowChannel + 1;
     chnSlider.RangeStopSelected = bc.LowChannel + bc.QChanns;
     num.Text = bc.BoardName;
     BoardProperties = bc;
     lc.Content = chnSlider.RangeStartSelected.ToString();
     hc.Content = chnSlider.RangeStopSelected.ToString();
 }
 private TabItem createTabItem(MccBoard board, int num, BoardConfiguration bc)
 {
     TabItem item = new TabItem();
     item.Header = bc.BoardName;
     Grid grid = new Grid();
     ScrollViewer scrollView = new ScrollViewer();
     scrollView.Content = grid;
     item.Content = scrollView;
     DataHandler dataHand = new DataHandler(board, bc, Dispatcher.CurrentDispatcher);
     dataHand.Finished += ColetaFinished;
     dataHandlers.Add(dataHand);
     for (int i = 0; i < bc.QChanns; i++)
     {
         ChannelControl chCont = new ChannelControl("Channel "+(bc.LowChannel + i + 1).ToString());
         RowDefinition rowDef = new RowDefinition();
         rowDef.Height = new GridLength(250, GridUnitType.Pixel);
         grid.RowDefinitions.Add(rowDef);
         chCont.SetValue(Grid.RowProperty, i);
         grid.Children.Add(chCont);
         dataHand.AddPlotModel(chCont);
     }
     return item;
 }
 private void SetupBoardSelection()
 {
     int numOfAdChans;
     boardConfigs = new List<BoardConfiguration>();
     BoardDetection bd = new BoardDetection(boards.Count);
     bd.Owner = this;
     bd.ShowDialog();
     if (!bd.Aborted)
     {
         for (int i = 0; i < boards.Count; i++)
         {
             if (!bd.Selected[i])
                 boards.RemoveAt(i);
             else
             {
                 boards[i].BoardConfig.GetNumAdChans(out numOfAdChans);
                 if (numOfAdChans > 0)
                 {
                     BoardConfiguration bconf = new BoardConfiguration(0, 4, 2000);
                     bconf.MaxChannels = numOfAdChans;
                     boardConfigs.Add(bconf);
                 }else
                 {
                     boards.RemoveAt(i);
                 }
             }
         }
         if (boards.Count > 0)
         {
             detected = true;
             stsMsg.Content = String.Format("{0} board(s) selected, click the second icon to create a trial", boards.Count);
         }
     }
     if(!detected)
         stsMsg.Content = "No board selected";
 }