コード例 #1
0
        /// <summary>
        /// This constructor initializes a default configuration for the PlaybackDataProvider
        /// </summary>
        public PlaybackDataProvider()
            : base()
        {
            _framePeriod = 500000; //0.5 msec
            _framesPerTick = 200;
            _rnd = new Random();
            _timer = new FastTimer(3, (_framesPerTick * _framePeriod) / 1000000, GenerateFrame);

            //Iinitialization of anything related to loading playback data from file
            _loadedDataConfig = new RecordingConfig();
            _loadedData = new Recording(_loadedDataConfig);

            _fileReadWriters = new List<IFileReadWriter>();

            //Initialization of available IFileReadWriters
            _fileReadWriters.Add(new HDF5RecordingReadWriter());

            //Composing filter string
            _fileFilters = "";
            foreach (IFileReadWriter fileReadWriter in _fileReadWriters)
            {
                _fileFilters = _fileFilters + fileReadWriter.supportedFormats.ToString() + "|";
            }
            _fileFilters = _fileFilters + "All Files (*.*)|*.*";
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: mgcarmueja/MPTCE
        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();
        }
コード例 #3
0
ファイル: KeyboardConsumer.cs プロジェクト: mgcarmueja/MPTCE
        public KeyboardConsumer()
            : base()
        {
            singleStroke = false;

            keymappings = new BindingList<Keymapping>();
            InitKeys();
            _converter = new MovCodeToStringConverter();

            _movsToKeyCodes = new Dictionary<int, VirtualKeyCode>();

            _keyboardControl = new KeyboardControl();
            _keyboardControl.viewModel.keyboardConsumer = this;

            consumerControl = new BaseControl();

            ((BaseControl)consumerControl).viewModel.realtimeConsumer = this;
            ((BaseControl)consumerControl).itemsGrid.Children.Clear();
            ((BaseControl)consumerControl).itemsGrid.Children.Add(_keyboardControl);

            _simulator = new InputSimulator();

            //UpdateKeymappings();

            keymappings.ListChanged += keymappings_ListChanged;

            //Configuring a timer that will call the Keystroke method each 100 milliseconds.
            _timer = new FastTimer(3, 100, Keystroke);
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: mgcarmueja/MPTCE
        //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();
        }