private async void LoadLastDataModel()
        {
            var _fileWorker = DependencyService.Get <IFileWorker>();
            var _jsonKeeper = new JsonDataKeeper <DeviceDataViewModel>();
            var files       = _fileWorker.GetFilesAsync().Result.ToArray();

            if (files.Length == 0)
            {
                _lastData = new DeviceDataViewModel();
            }
            else
            {
                _jsonKeeper.Filename = files[files.Length - 1];
                _lastData            = await _jsonKeeper.Browse();
            }
        }
示例#2
0
        public PulsationAnalyzePage()
        {
            InitializeComponent();

            Bluetooth = DependencyService.Get <Bluetooth>();

#if DEBUG
            _impulseInvoker = new MockImpulseInvoker();
#endif

            _vm    = new DeviceDataViewModel();
            _ddp   = DeviceDataProvider.GetProvider;
            _timer = new StoppableTimer(TimeSpan.FromMilliseconds(Constants.UPDATE_INTERVAL), TimerTick);
            FirstChanelSeries.ItemsSource  = _vm.FirstChanelSeriesData;
            SecondChanelSeries.ItemsSource = _vm.SecondChanelSeriesData;
            _jsonKeeper = new JsonDataKeeper <DeviceDataViewModel>();
        }
        public ArchivePage()
        {
            InitializeComponent();
            OptionsList.ItemsSource = new List <Option>
            {
                new Option
                {
                    Name    = "Open trend",
                    Command = new Command(() => Navigation.PushModalAsync(new OpenTrendPage(_deviceData)))
                },
                new Option
                {
                    Name    = "Open trend graphic",
                    Command = new Command(() => Navigation.PushModalAsync(new NavigationPage(new OpenTrendGraphicPage(_deviceData))))
                }
            };

            OptionsList.ItemSelected += OnOptionSelected;
            _fileWorker = DependencyService.Get <IFileWorker>();
            _jsonKeeper = new JsonDataKeeper <DeviceDataViewModel>();
        }
示例#4
0
 static GameData()
 {
     DataKeeper = new JsonDataKeeper <Data>(Application.persistentDataPath + "/" + FileName, true);
 }
示例#5
0
 public DataKeeper()
 {
     _dataKeeper = new JsonDataKeeper <GameData>(Application.persistentDataPath + "/" + FileName, true);
 }