public DedFunctions(ISerialComm serialComm, ref AppState appState, ref IBMSReader BMSreader, ref FlightData flightData)
 {
     this.serialComm = serialComm;
     this.appState = appState;
     this.BMSreader = BMSreader;
     this.BMSdata = flightData;
 }
        public MainWindow()
        {
            BMSreader = new BMSReaderWrapper(realBMSreader);  // we should now be able to stub in a fake BMS reader for testing purposes.
            appState  = new AppState(Properties.Settings.Default.CautionPanel);
            appState.CautionPanelVer = Properties.Settings.Default.CautionPanel;
            appState.BMS432          = Properties.Settings.Default.BMS432;
            appState.JshepCP         = Properties.Settings.Default.JshepCP;
            dedFunctions             = new DedFunctions(dedDevice, ref appState, ref BMSreader, ref BMSdata);

            InitializeComponent();
            Thread updater = new System.Threading.Thread(delegate()
            {
                StatusVersioninfo.Text = dedFunctions.checkVersion(URLBase, ref StatusVersioninfo); // Check if a new version is available
            });

            updater.Start();
            ResetTheBoard();
            dedFunctions.updateAvailablePorts(ref comboBoxComSelect); //Scan for Available serial port on the computer
        }