public MainWindow() { InitializeComponent(); _bufferLength = _maxSamples; _nChannels = 8; _graphModels = new GraphModel[_nChannels]; _graphs = new Graph[_nChannels]; for (int i = 0; i < _nChannels; i++) { _graphs[i] = new Graph(); _graphModels[i] = new GraphModel(_graphs[i]); _graphs[i].xMin = 0; _graphs[i].xMax = _maxSamples-1; _graphs[i].yMin = -1500; _graphs[i].yMax = 1500; _graphs[i].topEdge = 5; _graphs[i].bottomEdge = 5; _graphs[i].rightEdge = 5; _graphs[i].leftEdge = 5; _graphs[i].plotColor = Color.FromArgb(200,0,0,255); //Because writable bitmaps use premultiplied alpha! graphsGrid.Children.Add(_graphs[i]); } //Initialising plot data PrepareData(); //Setting and starting timer; _timer = new FastTimer(3, 100, InsertPoints); _timer.Start(); }
//RecordingPlanViewModel myModel; public MainWindow() { InitializeComponent(); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + flexion + pronation",20)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + flexion + pronation",20)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + flexion + pronation",20)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + extension + pronation",24)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + extension + pronation",24)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "rest",0)); myRecordingPlan.planItemList.Add(new PlanItem(3.0, "close + extension + pronation",24)); myRecordingPlan.planItemList.ElementAt(3).completed = true; myRecordingPlan.planItemList.ElementAt(4).selected = true; List<BitmapImage> images = PrepareImages(27); //26 movements + rest myRecordingPlan.movementBitmap = images.ElementAt(1); myRecordingPlan.activeItem = 8; progress = 0; delta = 1; myTimer = new FastTimer(3, 33, MoveBar); myTimer.Start(); }