示例#1
0
        public void Clear()
        {
            _parent = null;

            _groupIndex = -1;
            UpdateButtons();
        }
示例#2
0
        public void BindFullSystem(FullSystem fs, int groupIndex)
        {
            _parent = fs;
            _groupIndex = groupIndex;

            UpdateScreen(groupIndex);

            UpdateGroupComboBox();
            UpdateButtons();
        }
示例#3
0
        static void Main(string[] args)
        {
            if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
            {
                Devices.RTC           = new MockRTC();
                Devices.Accelerometer = new MockAccelerometer();
                Devices.Gyroscope     = new MockGyroscope();
                Devices.UART          = new MockUart();
                Devices.GPIO          = new MockGpio();
            }
            else
            {
                var settings = new SpiConnectionSettings(1, 0)
                {
                    Mode = SpiMode.Mode0, ClockFrequency = 1900000
                };

                using (SpiDevice spi = SpiDevice.Create(settings))
                {
                    Devices.Accelerometer = new Mcp3208Custom(spi, (int)Channel.X, (int)Channel.Y, (int)Channel.Z);
                }

                Devices.Gyroscope = new Gyroscope(new SpiConnectionSettings(0, 0)
                {
                    Mode = SpiMode.Mode3, ClockFrequency = 900000
                });
                Devices.GPIO = new GPIO();
                Devices.RTC  = new RTC();
                Devices.UART = new UART(); //mock for now
            }

            FullSystem system = new FullSystem();
            FileInfo   file   = new FileInfo(system.AccelFileName);

            MockUart.FileName = Path.Combine(file.Directory.FullName, "Telemetry.csv");;

            system.SetChunkAmount(1);

            //CancellationTokenSource source = new CancellationTokenSource(TimeSpan.FromMinutes(5)); // for quick tests
            CancellationTokenSource source = new CancellationTokenSource();

            system.Run(source.Token);

            Devices.Accelerometer.Dispose();
            Devices.Gyroscope.Dispose();
            Devices.RTC.Dispose();
            Devices.UART.Dispose();
        }
示例#4
0
        public WeightStatisticsForm(FullSystem fullSystem)
        {
            _fullSystem = fullSystem;

            InitializeComponent();
        }
 public void BindFullSystem(FullSystem fs)
 {
     _fullSystem = fs;
     OnLoad(null, null);
 }