Subversion Repositories group.electronics

Rev

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

Rev 149 Rev 153
Line 10... Line 10...
10
 
10
 
11
namespace NITNavComm {
11
namespace NITNavComm {
12
    public partial class NITCommNavForm : Form {
12
    public partial class NITCommNavForm : Form {
13
 
13
 
14
        private NITNavCommDevice navcomm = null;
14
        private NITNavCommDevice navcomm = null;
-
 
15
        //private IntPtr navcomm;
15
        
16
        
16
        public NITCommNavForm() {
17
        public NITCommNavForm() {
17
            InitializeComponent();
18
            InitializeComponent();
18
 
19
 
19
            this.controlStatus(false);
20
            this.controlStatus(false);
-
 
21
            txtCount.Text = "0";
20
        }
22
        }
21
 
23
 
22
        private void controlStatus(bool status) {
24
        private void controlStatus(bool status) {
23
            cmdSend0.Enabled = status;
25
            cmdSend0.Enabled = status;
24
            cmdSend1.Enabled = status;
26
            cmdSend1.Enabled = status;
Line 29... Line 31...
29
        public void UpdateDevice() {
31
        public void UpdateDevice() {
30
            this.UpdateDisplay();
32
            this.UpdateDisplay();
31
            this.UpdateInput();
33
            this.UpdateInput();
32
        }
34
        }
33
 
35
 
34
        public void UpdateDisplay(byte display) {
36
        public void UpdateDisplay(byte dis) {
35
            byte[] data;
37
            byte[] data;
36
            if (display == 0) {
38
            if (dis == 0) {
37
                data = navcomm.getFreq(0);
39
                data = navcomm.getFreq(0);
38
                freq0.Value = this.byteArraytoString(ref data, 5);
40
                freq0.Value = this.byteArraytoString(ref data, 5);
39
                data = navcomm.getFreq(1);
41
                data = navcomm.getFreq(1);
40
                freq1.Value = this.byteArraytoString(ref data, 5);
42
                freq1.Value = this.byteArraytoString(ref data, 5);
41
            } else {
43
            } else {
42
                data = navcomm.getFreq(2);
44
                data = navcomm.getFreq(2);
43
                freq2.Value = this.byteArraytoString(ref data, 5);
45
                freq2.Value = this.byteArraytoString(ref data, 5);
44
                data = navcomm.getFreq(3);
46
                data = navcomm.getFreq(3);
45
                freq3.Value = this.byteArraytoString(ref data, 5);
47
                freq3.Value = this.byteArraytoString(ref data, 5);
46
            }
48
            }
47
            navcomm.updateDisplay(display);
49
            navcomm.UpdateDisplay(dis);
48
 
-
 
49
        }
50
        }
50
 
51
 
51
        public void UpdateDisplay() {
52
        public void UpdateDisplay() {
52
            this.UpdateDisplay(0);
53
            this.UpdateDisplay(0);
53
            this.UpdateDisplay(1);
54
            this.UpdateDisplay(1);
Line 166... Line 167...
166
            navcomm.resetRotary(1, 0);
167
            navcomm.resetRotary(1, 0);
167
        }
168
        }
168
 
169
 
169
        private void freq0_Click(object sender, EventArgs e) {
170
        private void freq0_Click(object sender, EventArgs e) {
170
            byte[] bytes = {0x0a, 0x0a, 0x0a, 0x0a, 0x0a};
171
            byte[] bytes = {0x0a, 0x0a, 0x0a, 0x0a, 0x0a};
-
 
172
            System.Windows.Forms.MessageBox.Show("Clicked");
171
            navcomm.setFreq(0, ref bytes);
173
            navcomm.setFreq(0, ref bytes);
172
            this.UpdateDisplay(0);
174
            this.UpdateDisplay(0);
173
        }
175
        }
174
 
176
 
175
        private void freq1_Click(object sender, EventArgs e) {
177
        private void freq1_Click(object sender, EventArgs e) {