Subversion Repositories group.electronics

Rev

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

Rev 170 Rev 171
Line 85... Line 85...
85
            Dictionary<uint, Command> pad12 = new Dictionary<uint, Command>();
85
            Dictionary<uint, Command> pad12 = new Dictionary<uint, Command>();
86
            pad12.Add(0, new CommandDCS("UFC_CLR"));
86
            pad12.Add(0, new CommandDCS("UFC_CLR"));
87
            pad12.Add(1, new CommandVKey(VirtualKeyCode.F12));
87
            pad12.Add(1, new CommandVKey(VirtualKeyCode.F12));
88
            this.addControl(new Switch2Pos(new CommandIf(selSwitch, pad12), 12));
88
            this.addControl(new Switch2Pos(new CommandIf(selSwitch, pad12), 12));
89
 
89
 
90
            // Joystick Press - Mapped to mouse button 1
-
 
91
            this.addControl(new Switch2Pos(new CommandMouseButton(CommandMouseButton.MB_LEFT), 32));
-
 
92
 
-
 
93
 
-
 
94
            // NMSP
90
            // NMSP
95
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_EGI_BTN"), 16));
91
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_EGI_BTN"), 16));
96
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_HARS_BTN"), 17));
92
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_HARS_BTN"), 17));
97
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ILS_BTN"), 18));
93
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ILS_BTN"), 18));
98
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_TCN_BTN"), 19));
94
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_TCN_BTN"), 19));
99
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ANCHR_BTN"), 20));
95
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ANCHR_BTN"), 20));
100
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_STEERPT_BTN"), 21));
96
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_STEERPT_BTN"), 21));
101
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ABLE_STOW"), 22, true));
97
            this.addControl(new Switch2Pos(new CommandDCS("NMSP_ABLE_STOW"), 22, true));
102
 
98
 
103
 
99
 
-
 
100
            // Joystick Press - Mapped to mouse button 1
-
 
101
            this.addControl(new Switch2Pos(new CommandMouseButton(CommandMouseButton.MB_LEFT), 32));
-
 
102
 
104
            // Enable the mcp23017
103
            // Enable the mcp23017
105
            mcp.WriteGpio(3, 0);
104
            mcp.WriteGpio(3, 0);
106
            Utils.delayms(50);
105
            Utils.delayms(50);
107
            mcp.WriteGpio(3, 1);
106
            mcp.WriteGpio(3, 1);
108
            Utils.delayms(50);
107
            Utils.delayms(50);
Line 113... Line 112...
113
 
112
 
114
            chips[1].SetIODirection(0x00, 0xff);
113
            chips[1].SetIODirection(0x00, 0xff);
115
            chips[1].SetIOPolarity(0x00, 0xff);
114
            chips[1].SetIOPolarity(0x00, 0xff);
116
            chips[1].SetIOPullups(0x00, 0xff);
115
            chips[1].SetIOPullups(0x00, 0xff);
117
 
116
 
-
 
117
            new Led(chips[1], 0, 1, 0x1112, 0x0002, 1);     // NMSP_ANCHR_LED
-
 
118
            new Led(chips[1], 0, 4, 0x1110, 0x0800, 11);    // NMSP_EGI_LED
-
 
119
            new Led(chips[1], 0, 6, 0x11bc, 0x0004, 2);     // NMSP_FM_LED
-
 
120
            new Led(chips[1], 0, 5, 0x1110, 0x0200, 9);     // NMSP_HARS_LEF
-
 
121
            new Led(chips[1], 0, 3, 0x1112, 0x0020, 5);     // NMSP_ILS_LED
-
 
122
            new Led(chips[1], 0, 0, 0x1110, 0x8000, 15);    // NMSP_STEERPT_LED
-
 
123
            new Led(chips[1], 0, 2, 0x1112, 0x0008, 3);     // NMSP_TCN_LED
-
 
124
            new Led(chips[1], 0, 7, 0x11bc, 0x0002, 1);     // NMSP_UHF_LED
-
 
125
 
118
            this.Refresh();
126
            this.Refresh();
119
            data.prev = data.buttons;
127
            data.prev = data.buttons;
120
            data.axis[0].prev = data.axis[0].value;
128
            data.axis[0].prev = data.axis[0].value;
121
            data.axis[1].prev = data.axis[1].value;
129
            data.axis[1].prev = data.axis[1].value;
122
 
-
 
-
 
130
            data.changed = false;
123
 
131
 
124
            return 1;
132
            return 1;
125
        }
133
        }
126
        public override int Refresh() {
134
        public override int Refresh() {
127
            byte[] bytes;
135
            byte[] bytes;