Subversion Repositories group.electronics

Rev

Rev 145 | Rev 153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 145 Rev 149
Line 60... Line 60...
60
        public void UpdateInput(byte display) {
60
        public void UpdateInput(byte display) {
61
            navcomm.updateInput();
61
            navcomm.updateInput();
62
            cmdSwap0.Checked = navcomm.isSwapSet(0);
62
            cmdSwap0.Checked = navcomm.isSwapSet(0);
63
            cmdFlip0.Checked = navcomm.isFlipSet(0);
63
            cmdFlip0.Checked = navcomm.isFlipSet(0);
64
            txtRot0.Text = navcomm.getRotary(0, 0).ToString("X");
64
            txtRot0.Text = navcomm.getRotary(0, 0).ToString("X");
-
 
65
 
-
 
66
            cmdSwap1.Checked = navcomm.isSwapSet(1);
-
 
67
            cmdFlip1.Checked = navcomm.isFlipSet(1);
-
 
68
            txtRot1.Text = navcomm.getRotary(1, 0).ToString("X");
65
        }
69
        }
66
 
70
 
67
        private string byteArraytoString(ref byte[] data, byte len) {
71
        private string byteArraytoString(ref byte[] data, byte len) {
68
            StringBuilder sb = new StringBuilder();
72
            StringBuilder sb = new StringBuilder();
69
            for (byte i = 0; i < len; i++) {
73
            for (byte i = 0; i < len; i++) {
Line 132... Line 136...
132
                this.SwapFreq(0);
136
                this.SwapFreq(0);
133
        }
137
        }
134
 
138
 
135
        private void cmdSwap0_Click(object sender, EventArgs e) {
139
        private void cmdSwap0_Click(object sender, EventArgs e) {
136
            cmdSwap0.Checked = false;
140
            cmdSwap0.Checked = false;
137
            this.SwapFreq(0);
-
 
138
        }
141
        }
139
 
142
 
140
 
143
 
141
        private void inputTimer_Tick(object sender, EventArgs e) {
144
        private void inputTimer_Tick(object sender, EventArgs e) {
142
            this.UpdateInput();
145
            this.UpdateInput();
143
        }
146
        }
144
 
147
 
-
 
148
        private void cmdSwap1_CheckedChanged(object sender, EventArgs e) {
-
 
149
            if (cmdSwap1.Checked)
-
 
150
                this.SwapFreq(1);
-
 
151
        }
-
 
152
 
-
 
153
        private void cmdFlip1_CheckedChanged(object sender, EventArgs e) {
-
 
154
 
-
 
155
        }
-
 
156
 
-
 
157
        private void cmdSwap1_Click(object sender, EventArgs e) {
-
 
158
            cmdSwap1.Checked = false;
-
 
159
        }
-
 
160
 
-
 
161
        private void txtRot0_Click(object sender, EventArgs e) {
-
 
162
            navcomm.resetRotary(0, 0);
-
 
163
        }
-
 
164
 
-
 
165
        private void txtRot1_Click(object sender, EventArgs e) {
-
 
166
            navcomm.resetRotary(1, 0);
-
 
167
        }
-
 
168
 
-
 
169
        private void freq0_Click(object sender, EventArgs e) {
-
 
170
            byte[] bytes = {0x0a, 0x0a, 0x0a, 0x0a, 0x0a};
-
 
171
            navcomm.setFreq(0, ref bytes);
-
 
172
            this.UpdateDisplay(0);
-
 
173
        }
-
 
174
 
-
 
175
        private void freq1_Click(object sender, EventArgs e) {
-
 
176
            byte[] bytes = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a };
-
 
177
            navcomm.setFreq(1, ref bytes);
-
 
178
            this.UpdateDisplay(0);
-
 
179
        }
-
 
180
 
-
 
181
        private void freq2_Click(object sender, EventArgs e) {
-
 
182
            byte[] bytes = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a };
-
 
183
            navcomm.setFreq(2, ref bytes);
-
 
184
            this.UpdateDisplay(1);
-
 
185
        }
-
 
186
 
-
 
187
        private void freq3_Click(object sender, EventArgs e) {
-
 
188
            byte[] bytes = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a };
-
 
189
            navcomm.setFreq(3, ref bytes);
-
 
190
            this.UpdateDisplay(1);
-
 
191
        }
-
 
192
 
145
    }
193
    }
146
}
194
}