private void initializeTeensies()
        {
            bool      active = this.active && this.config.domeHardwareSetup == 0;
            TeensyAPI api1, api2, api3, api4, api5;

            try {
                api1 = new TeensyAPI(
                    this.config.domeTeensyUSBPort1,
                    this.config.domeOutputInSeparateThread,
                    newFPS => this.config.domeTeensyFPS1 = newFPS
                    );
                api1.Active = active;
            } catch (Exception) {
                api1 = null;
            }
            try {
                api2 = new TeensyAPI(
                    this.config.domeTeensyUSBPort2,
                    this.config.domeOutputInSeparateThread,
                    newFPS => this.config.domeTeensyFPS2 = newFPS
                    );
                api2.Active = active;
            } catch (Exception) {
                api2 = null;
            }
            try {
                api3 = new TeensyAPI(
                    this.config.domeTeensyUSBPort3,
                    this.config.domeOutputInSeparateThread,
                    newFPS => this.config.domeTeensyFPS3 = newFPS
                    );
                api3.Active = active;
            } catch (Exception) {
                api3 = null;
            }
            try {
                api4 = new TeensyAPI(
                    this.config.domeTeensyUSBPort4,
                    this.config.domeOutputInSeparateThread,
                    newFPS => this.config.domeTeensyFPS4 = newFPS
                    );
                api4.Active = active;
            } catch (Exception) {
                api4 = null;
            }
            try {
                api5 = new TeensyAPI(
                    this.config.domeTeensyUSBPort5,
                    this.config.domeOutputInSeparateThread,
                    newFPS => this.config.domeTeensyFPS5 = newFPS
                    );
                api5.Active = active;
            } catch (Exception) {
                api5 = null;
            }
            this.teensies = new TeensyAPI[] { api1, api2, api3, api4, api5 };
        }
 private void initializeTeensyAPI()
 {
     this.teensyAPI = new TeensyAPI(
         this.config.boardTeensyUSBPort,
         this.config.ledBoardOutputInSeparateThread,
         newFPS => this.config.boardTeensyFPS = newFPS
         );
     this.teensyAPI.Active = this.active &&
                             this.config.boardHardwareSetup == 0;
 }
Exemple #3
0
 private void initializeTeensyAPI()
 {
     if (this.dome != null)
     {
         return;
     }
     this.teensyAPI = new TeensyAPI(
         this.config.barTeensyUSBPort,
         this.config.barOutputInSeparateThread,
         newFPS => this.config.barTeensyFPS = newFPS
         );
     this.teensyAPI.Active = this.active &&
                             this.config.barHardwareSetup == 0;
 }
 private void initializeTeensies()
 {
     try {
         TeensyAPI api1 = new TeensyAPI(
             this.config.stageTeensyUSBPort1,
             this.config.stageOutputInSeparateThread,
             newFPS => this.config.stageTeensyFPS1 = newFPS
             );
         TeensyAPI api2 = new TeensyAPI(
             this.config.stageTeensyUSBPort2,
             this.config.stageOutputInSeparateThread,
             newFPS => this.config.stageTeensyFPS2 = newFPS
             );
         api1.Active   = this.active && this.config.stageHardwareSetup == 0;
         api2.Active   = this.active && this.config.stageHardwareSetup == 0;
         this.teensies = new TeensyAPI[] { api1, api2 };
     } catch (Exception) {
         this.teensies = null;
     }
 }