Subversion Repositories group.NITPanels

Rev

Rev 22 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22 Rev 23
Line 19... Line 19...
19
        public const byte USBCMD_READ_BUTTONS = 100;
19
        public const byte USBCMD_READ_BUTTONS = 100;
20
        public const byte USBCMD_LEDS_SET = 101;
20
        public const byte USBCMD_LEDS_SET = 101;
21
        public const byte USBCMD_GET_ANALOG = 102;
21
        public const byte USBCMD_GET_ANALOG = 102;
22
        public const byte USBCMD_SET_POWER_LED = 103;
22
        public const byte USBCMD_SET_POWER_LED = 103;
23
 
23
 
24
        // The min analg value we'll ever read from the pot
24
        // The min analog value we'll ever read from the pot
25
        // If the analog val ever drops below this, a uint to int
25
        // If the analog val ever drops below this, a uint to int
26
        //  conversion will make the number >17k. If its not low enough
26
        //  conversion will make the number >17k. If its not low enough
27
        //  the volume will never be able to be musted. Should probably 
27
        //  the volume will never be able to be musted. Should probably 
28
        //  be calibrated or the protection resistor removed from the 
28
        //  be calibrated or the protection resistor removed from the 
29
        //  analog pot ground line
29
        //  analog pot ground line
Line 75... Line 75...
75
            inputTimer.Interval = NITPanels.CFG_INPUT_TIMER_INTERVAL;
75
            inputTimer.Interval = NITPanels.CFG_INPUT_TIMER_INTERVAL;
76
            inputTimer.Elapsed += inputTimer_Elapsed;
76
            inputTimer.Elapsed += inputTimer_Elapsed;
77
 
77
 
78
            // VolControl Stuff
78
            // VolControl Stuff
79
            // Default the user setting to the first device it not already set
79
            // Default the user setting to the first device it not already set
80
            if (Properties.Settings.Default.volcontroldevice == ""
80
            if (Properties.Settings.Default.volcontroldevice == "" && volcontrol.deviceCount > 0) {
81
                && volcontrol.deviceCount > 0) {
-
 
82
                Properties.Settings.Default.volcontroldevice = volcontrol.devices.ElementAt(0);
81
                Properties.Settings.Default.volcontroldevice = volcontrol.devices.ElementAt(0);
83
                Properties.Settings.Default.Save();
82
                Properties.Settings.Default.Save();
84
            }
83
            }
85
 
84
 
86
            // Retrieve the user setting for the selected device, find its index
85
            // Retrieve the user setting for the selected device, find its index
Line 115... Line 114...
115
            this.simStatus = 2;
114
            this.simStatus = 2;
116
        }
115
        }
117
 
116
 
118
        public void powerUp() {
117
        public void powerUp() {
119
            this.simStatus = 0;
118
            this.simStatus = 0;
-
 
119
            this.setLedPwr(true);
120
            this.fsx.requestAudioSelData();
120
            this.fsx.requestAudioSelData();
121
            this.inputTimer.Enabled = true;
121
            this.inputTimer.Enabled = true;
122
        }
122
        }
123
 
123
 
124
        public override void FsxReady() {
124
        public override void FsxReady() {
Line 207... Line 207...
207
            base.SendCommand(NITAudioSelDevice.USBCMD_SET_POWER_LED, this.powerLedStatus, 0);
207
            base.SendCommand(NITAudioSelDevice.USBCMD_SET_POWER_LED, this.powerLedStatus, 0);
208
        }
208
        }
209
 
209
 
210
        public void ClearDisplay() {
210
        public void ClearDisplay() {
211
            this.ledStatus = 0x00;
211
            this.ledStatus = 0x00;
212
            this.powerLedStatus = 0x00;
212
            this.setLedPwr(false);
213
            this.UpdateDisplay();
213
            this.UpdateDisplay();
214
        }
214
        }
215
 
215
 
216
        public void setLed(int ledNum, double status) {
216
        public void setLed(int ledNum, double status) {
217
            if (status == 1)
217
            if (status == 1)