Subversion Repositories group.electronics

Rev

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

Rev 145 Rev 147
Line 28... Line 28...
28
        public NITNavCommDevice(UsbRegistry usbRegistry, string type, int vid, int pid) :
28
        public NITNavCommDevice(UsbRegistry usbRegistry, string type, int vid, int pid) :
29
            base(usbRegistry, "NITNavComm", 0x20a0, 0x4236) {
29
            base(usbRegistry, "NITNavComm", 0x20a0, 0x4236) {
30
            init();
30
            init();
31
        }
31
        }
32
 
32
 
-
 
33
        private void init()
-
 
34
        {
-
 
35
            this.display = new byte[2, 10];
-
 
36
            for (byte j = 0; j < 2; j++)
-
 
37
                for (byte i = 0; i < 10; i++)
-
 
38
                    this.display[j, i] = 0x0a;
-
 
39
            this.buttons = new byte[2];
-
 
40
            this.buttons[0] = 0x00;
-
 
41
            this.buttons[1] = 0x00;
-
 
42
            this.rotary = new byte[2, 2];
-
 
43
            this.rotary[0, 0] = 0x00;
-
 
44
            this.rotary[0, 1] = 0x00;
-
 
45
            this.rotary[1, 0] = 0x00;
-
 
46
            this.rotary[1, 1] = 0x00;
-
 
47
        }
-
 
48
 
33
        new public bool Close() {
49
        new public bool Close() {
34
            byte[] blank = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a };
50
            byte[] blank = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a };
35
            for (byte i = 0; i < 4; i++)
51
            for (byte i = 0; i < 4; i++)
36
                setFreq(i, ref blank);
52
                setFreq(i, ref blank);
37
            this.updateDisplay();
53
            this.updateDisplay();
Line 80... Line 96...
80
                        display[1, i + 5] = data[i];
96
                        display[1, i + 5] = data[i];
81
                    break;
97
                    break;
82
            }
98
            }
83
        }
99
        }
84
 
100
 
85
 
-
 
86
        private void init() {
-
 
87
            this.display = new byte[2,10];
-
 
88
            for (byte j=0; j<2; j++)
-
 
89
                for (byte i = 0; i < 10; i++)
-
 
90
                    this.display[j,i] = 0x0a;
-
 
91
            this.buttons = new byte[2];
-
 
92
            this.buttons[0] = 0x00;
-
 
93
            this.buttons[1] = 0x00;
-
 
94
            this.rotary = new byte[2,2];
-
 
95
            this.rotary[0,0] = 0x00;
-
 
96
            this.rotary[0,1] = 0x00;
-
 
97
            this.rotary[1,0] = 0x00;
-
 
98
            this.rotary[1,1] = 0x00;
-
 
99
        }
-
 
100
 
-
 
101
        private void sendDigit(byte dis, byte dig, byte val, byte dp) {
101
        private void sendDigit(byte dis, byte dig, byte val, byte dp) {
102
            ushort wxValue = (ushort)(dis <<8);
102
            ushort wxValue = (ushort)(dis <<8);
103
            wxValue |= dig;
103
            wxValue |= dig;
104
            ushort wxIndex = (ushort)(dp << 8);
104
            ushort wxIndex = (ushort)(dp << 8);
105
            wxIndex |= val;
105
            wxIndex |= val;