Subversion Repositories group.electronics

Rev

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

Rev 156 Rev 157
Line 9... Line 9...
9
using System.Windows.Forms;
9
using System.Windows.Forms;
10
 
10
 
11
namespace NITNavComm {
11
namespace NITNavComm {
12
    public partial class NITAudioSelForm : Form {
12
    public partial class NITAudioSelForm : Form {
13
 
13
 
14
        private NITAudioSelDevice audiosel = null;
14
        private NITAudioSelDevice device = null;
15
 
15
 
16
        public NITAudioSelForm() {
16
        public NITAudioSelForm() {
17
            InitializeComponent();
17
            InitializeComponent();
18
 
18
 
19
            this.controlStatus(false);
19
            this.controlStatus(false);
Line 32... Line 32...
32
        public void UpdateDisplay() {
32
        public void UpdateDisplay() {
33
 
33
 
34
        }
34
        }
35
 
35
 
36
        public void UpdateInput() {
36
        public void UpdateInput() {
37
            audiosel.updateInput();
37
            device.updateInput();
38
            button0.Checked = audiosel.isButtonSet(0);
38
            button0.Checked = device.isButtonSet(0);
39
            button1.Checked = audiosel.isButtonSet(1);
39
            button1.Checked = device.isButtonSet(1);
40
            button2.Checked = audiosel.isButtonSet(2);
40
            button2.Checked = device.isButtonSet(2);
41
            button3.Checked = audiosel.isButtonSet(3);
41
            button3.Checked = device.isButtonSet(3);
42
            button4.Checked = audiosel.isButtonSet(4);
42
            button4.Checked = device.isButtonSet(4);
43
            button5.Checked = audiosel.isButtonSet(5);
43
            button5.Checked = device.isButtonSet(5);
44
            button6.Checked = audiosel.isButtonSet(6);
44
            button6.Checked = device.isButtonSet(6);
45
            button7.Checked = audiosel.isButtonSet(7);
45
            button7.Checked = device.isButtonSet(7);
46
 
46
 
47
            this.led0.On = audiosel.isLedSet(0);
47
            this.led0.On = device.isLedSet(0);
48
            this.led1.On = audiosel.isLedSet(1);
48
            this.led1.On = device.isLedSet(1);
49
            this.led2.On = audiosel.isLedSet(2);
49
            this.led2.On = device.isLedSet(2);
50
            this.led3.On = audiosel.isLedSet(3);
50
            this.led3.On = device.isLedSet(3);
51
            this.led4.On = audiosel.isLedSet(4);
51
            this.led4.On = device.isLedSet(4);
52
            this.led5.On = audiosel.isLedSet(5);
52
            this.led5.On = device.isLedSet(5);
53
            this.led6.On = audiosel.isLedSet(6);
53
            this.led6.On = device.isLedSet(6);
54
            this.led7.On = audiosel.isLedSet(7);
54
            this.led7.On = device.isLedSet(7);
55
        }
55
        }
56
 
56
 
57
        public void setDevice(NITAudioSelDevice audiosel) {
57
        public void setDevice(NITAudioSelDevice audiosel) {
58
            this.audiosel = audiosel;
58
            this.device = audiosel;
59
 
59
 
60
            if (!audiosel.isOpen())
60
            if (!this.device.isOpen())
61
                audiosel.Open();
61
                this.device.Open();
62
 
62
 
63
            if (audiosel.isOpen())
63
            if (this.device.isOpen())
64
                this.controlStatus(true);
64
                this.controlStatus(true);
65
        }
65
        }
66
 
66
 
67
        private void inputTimer_Tick(object sender, EventArgs e) {
67
        private void inputTimer_Tick(object sender, EventArgs e) {
68
            this.UpdateInput();
68
            this.UpdateInput();
69
        }
69
        }
70
 
70
 
71
        private void cmdClose_Click(object sender, EventArgs e) {
71
        private void cmdClose_Click(object sender, EventArgs e) {
-
 
72
            if (this.device != null && device.isOpen()) {
-
 
73
                device.ClearDisplay();
-
 
74
            }
72
            this.Close();
75
            this.Close();
73
        }
76
        }
74
 
77
 
75
        private void led0_Click(object sender, EventArgs e) {
78
        private void led0_Click(object sender, EventArgs e) {
76
            bool status = this.audiosel.isLedSet(0);
79
            bool status = this.device.isLedSet(0);
77
            this.audiosel.setLed(0, !status);
80
            this.device.setLed(0, !status);
78
            this.audiosel.UpdateDisplay();
81
            this.device.UpdateDisplay();
79
        }
82
        }
80
 
83
 
81
        private void led1_Click(object sender, EventArgs e) {
84
        private void led1_Click(object sender, EventArgs e) {
82
            bool status = this.audiosel.isLedSet(1);
85
            bool status = this.device.isLedSet(1);
83
            this.audiosel.setLed(1, !status);
86
            this.device.setLed(1, !status);
84
            this.audiosel.UpdateDisplay();
87
            this.device.UpdateDisplay();
85
        }
88
        }
86
 
89
 
87
        private void led2_Click(object sender, EventArgs e) {
90
        private void led2_Click(object sender, EventArgs e) {
88
            bool status = this.audiosel.isLedSet(2);
91
            bool status = this.device.isLedSet(2);
89
            this.audiosel.setLed(2, !status);
92
            this.device.setLed(2, !status);
90
            this.audiosel.UpdateDisplay();
93
            this.device.UpdateDisplay();
91
        }
94
        }
92
 
95
 
93
        private void led3_Click(object sender, EventArgs e) {
96
        private void led3_Click(object sender, EventArgs e) {
94
            bool status = this.audiosel.isLedSet(3);
97
            bool status = this.device.isLedSet(3);
95
            this.audiosel.setLed(3, !status);
98
            this.device.setLed(3, !status);
96
            this.audiosel.UpdateDisplay();
99
            this.device.UpdateDisplay();
97
        }
100
        }
98
 
101
 
99
        private void led4_Click(object sender, EventArgs e) {
102
        private void led4_Click(object sender, EventArgs e) {
100
            bool status = this.audiosel.isLedSet(4);
103
            bool status = this.device.isLedSet(4);
101
            this.audiosel.setLed(4, !status);
104
            this.device.setLed(4, !status);
102
            this.audiosel.UpdateDisplay();
105
            this.device.UpdateDisplay();
103
        }
106
        }
104
 
107
 
105
        private void led5_Click(object sender, EventArgs e) {
108
        private void led5_Click(object sender, EventArgs e) {
106
            bool status = this.audiosel.isLedSet(5);
109
            bool status = this.device.isLedSet(5);
107
            this.audiosel.setLed(5, !status);
110
            this.device.setLed(5, !status);
108
            this.audiosel.UpdateDisplay();
111
            this.device.UpdateDisplay();
109
        }
112
        }
110
 
113
 
111
        private void led6_Click(object sender, EventArgs e) {
114
        private void led6_Click(object sender, EventArgs e) {
112
            bool status = this.audiosel.isLedSet(6);
115
            bool status = this.device.isLedSet(6);
113
            this.audiosel.setLed(6, !status);
116
            this.device.setLed(6, !status);
114
            this.audiosel.UpdateDisplay();
117
            this.device.UpdateDisplay();
115
        }
118
        }
116
 
119
 
117
        private void led7_Click(object sender, EventArgs e) {
120
        private void led7_Click(object sender, EventArgs e) {
118
            bool status = this.audiosel.isLedSet(7);
121
            bool status = this.device.isLedSet(7);
119
            this.audiosel.setLed(7, !status);
122
            this.device.setLed(7, !status);
120
            this.audiosel.UpdateDisplay();
123
            this.device.UpdateDisplay();
121
        }
124
        }
122
 
125
 
123
    }
126
    }
124
}
127
}