Subversion Repositories group.NITPanels

Rev

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

Rev 3 Rev 4
Line 152... Line 152...
152
            this.hSimConnect.MenuAddItem("NITPanels", FSXObject.MENU_ID.NIT_PANELS, 0);
152
            this.hSimConnect.MenuAddItem("NITPanels", FSXObject.MENU_ID.NIT_PANELS, 0);
153
 
153
 
154
        }
154
        }
155
 
155
 
156
        public void FsxReady() {
156
        public void FsxReady() {
-
 
157
            
157
            this.hSimConnect.RequestDataOnSimObject(
158
            this.hSimConnect.RequestDataOnSimObject(
158
                FSXObject.DATA_REQUESTS.AUDIOSEL_REQ,
159
                FSXObject.DATA_REQUESTS.AUDIOSEL_REQ,
159
                FSXObject.DEFINITIONS.AUDIOSEL_DATA,
160
                FSXObject.DEFINITIONS.AUDIOSEL_DATA,
160
                this.simdata.objectid,
161
                this.simdata.objectid,
161
                SIMCONNECT_PERIOD.SIM_FRAME,
162
                SIMCONNECT_PERIOD.SIM_FRAME,
162
                SIMCONNECT_DATA_REQUEST_FLAG.CHANGED,
163
                SIMCONNECT_DATA_REQUEST_FLAG.CHANGED,
163
                0, 0, 0);
164
                0, 0, 0);
-
 
165
 
164
            this.hSimConnect.RequestDataOnSimObject(
166
            this.hSimConnect.RequestDataOnSimObject(
165
                FSXObject.DATA_REQUESTS.NAVCOM1_REQ,
167
                FSXObject.DATA_REQUESTS.NAVCOM1_REQ,
166
                FSXObject.DEFINITIONS.NAVCOM1_DATA,
168
                FSXObject.DEFINITIONS.NAVCOM1_DATA,
167
                this.simdata.objectid,
169
                this.simdata.objectid,
168
                SIMCONNECT_PERIOD.SIM_FRAME,
170
                SIMCONNECT_PERIOD.SIM_FRAME,
Line 182... Line 184...
182
                FSXObject.DEFINITIONS.AVIONICS,
184
                FSXObject.DEFINITIONS.AVIONICS,
183
                this.simdata.objectid,
185
                this.simdata.objectid,
184
                SIMCONNECT_PERIOD.SIM_FRAME,
186
                SIMCONNECT_PERIOD.SIM_FRAME,
185
                SIMCONNECT_DATA_REQUEST_FLAG.CHANGED,
187
                SIMCONNECT_DATA_REQUEST_FLAG.CHANGED,
186
                0, 0, 0);
188
                0, 0, 0);
-
 
189
             
-
 
190
        }
-
 
191
 
-
 
192
        public void MapEvents() {
-
 
193
            
-
 
194
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM1_SWAP_FREQ, "COM_STBY_RADIO_SWAP");
-
 
195
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV1_SWAP_FREQ, "NAV1_RADIO_SWAP");
-
 
196
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM_RADIO_WHOLE_INC, "COM_RADIO_WHOLE_INC");
-
 
197
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM_RADIO_WHOLE_DEC, "COM_RADIO_WHOLE_DEC");
-
 
198
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM_RADIO_FRACT_INC, "COM_RADIO_FRACT_INC");
-
 
199
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM_RADIO_FRACT_DEC, "COM_RADIO_FRACT_DEC");
-
 
200
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV1_RADIO_WHOLE_INC, "NAV1_RADIO_WHOLE_INC");
-
 
201
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV1_RADIO_WHOLE_DEC, "NAV1_RADIO_WHOLE_DEC");
-
 
202
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV1_RADIO_FRACT_INC, "NAV1_RADIO_FRACT_INC");
-
 
203
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV1_RADIO_FRACT_DEC, "NAV1_RADIO_FRACT_DEC");
-
 
204
 
-
 
205
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_SWAP_FREQ, "COM2_RADIO_SWAP");
-
 
206
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV2_SWAP_FREQ, "NAV2_RADIO_SWAP");
-
 
207
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_RADIO_WHOLE_INC, "COM2_RADIO_WHOLE_INC");
-
 
208
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_RADIO_WHOLE_DEC, "COM2_RADIO_WHOLE_DEC");
-
 
209
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_RADIO_FRACT_INC, "COM2_RADIO_FRACT_INC");
-
 
210
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_RADIO_FRACT_DEC, "COM2_RADIO_FRACT_DEC");
-
 
211
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV2_RADIO_WHOLE_INC, "NAV2_RADIO_WHOLE_INC");
-
 
212
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV2_RADIO_WHOLE_DEC, "NAV2_RADIO_WHOLE_DEC");
-
 
213
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV2_RADIO_FRACT_INC, "NAV2_RADIO_FRACT_INC");
-
 
214
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.NAV2_RADIO_FRACT_DEC, "NAV2_RADIO_FRACT_DEC");
-
 
215
 
-
 
216
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM1_TRANSMIT_SELECT, "COM1_TRANSMIT_SELECT");
-
 
217
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM2_TRANSMIT_SELECT, "COM2_TRANSMIT_SELECT");
-
 
218
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.COM_RECEIVE_ALL_TOGGLE, "COM_RECEIVE_ALL_TOGGLE");
-
 
219
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.RADIO_VOR1_IDENT_TOGGLE, "RADIO_VOR1_IDENT_TOGGLE");
-
 
220
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.RADIO_VOR2_IDENT_TOGGLE, "RADIO_VOR2_IDENT_TOGGLE");
-
 
221
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.MARKER_SOUND_TOGGLE, "MARKER_SOUND_TOGGLE");
-
 
222
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.RADIO_DME1_IDENT_TOGGLE, "RADIO_DME1_IDENT_TOGGLE");
-
 
223
            this.hSimConnect.MapClientEventToSimEvent(FSXObject.EVENT_ID.RADIO_ADF_IDENT_TOGGLE, "RADIO_ADF_IDENT_TOGGLE");
-
 
224
            
-
 
225
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "COM TRANSMIT:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
226
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "COM TRANSMIT:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
227
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "COM RECIEVE ALL", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
228
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "NAV SOUND:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
229
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "NAV SOUND:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
230
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "MARKER SOUND", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
231
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "DME SOUND", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
232
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AUDIOSEL_DATA, "ADF SOUND:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
233
            this.hSimConnect.RegisterDataDefineStruct<FSXObject.AudioSel_Data>(FSXObject.DEFINITIONS.AUDIOSEL_DATA);
-
 
234
 
-
 
235
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AIRCRAFT, "Atc Type", "", SIMCONNECT_DATATYPE.STRING32, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
236
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AIRCRAFT, "ATC Model", "", SIMCONNECT_DATATYPE.STRING32, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
237
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AIRCRAFT, "ATC ID", "", SIMCONNECT_DATATYPE.STRING32, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
238
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AIRCRAFT, "Title", "", SIMCONNECT_DATATYPE.STRING128, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
239
            this.hSimConnect.RegisterDataDefineStruct<FSXObject.Aircraft_Data>(FSXObject.DEFINITIONS.AIRCRAFT);
-
 
240
 
-
 
241
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AVIONICS, "Avionics Master Switch", "bool", SIMCONNECT_DATATYPE.INT32, 0, SimConnect.SIMCONNECT_UNUSED);
-
 
242
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AVIONICS, "Com Status:1", "Enum", SIMCONNECT_DATATYPE.FLOAT64, 0, SimConnect.SIMCONNECT_UNUSED);
-
 
243
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AVIONICS, "Com Status:2", "Enum", SIMCONNECT_DATATYPE.FLOAT64, 0, SimConnect.SIMCONNECT_UNUSED);
-
 
244
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AVIONICS, "Nav Available:1", "bool", SIMCONNECT_DATATYPE.INT32, 0, SimConnect.SIMCONNECT_UNUSED);
-
 
245
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.AVIONICS, "Nav Available:2", "bool", SIMCONNECT_DATATYPE.INT32, 0, SimConnect.SIMCONNECT_UNUSED);
-
 
246
            this.hSimConnect.RegisterDataDefineStruct<FSXObject.Avionics_Data>(FSXObject.DEFINITIONS.AVIONICS);
-
 
247
 
-
 
248
            
-
 
249
            // NavComm1 Frequencies
-
 
250
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM1_DATA, "Com Active Frequency:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
251
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM1_DATA, "Com Standby Frequency:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
252
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM1_DATA, "Nav Active Frequency:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
253
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM1_DATA, "Nav Standby Frequency:1", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
254
            this.hSimConnect.RegisterDataDefineStruct<FSXObject.NavCom_Data>(FSXObject.DEFINITIONS.NAVCOM1_DATA);
-
 
255
 
-
 
256
            // NavComm2 Frequencies
-
 
257
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM2_DATA, "Com Active Frequency:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
258
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM2_DATA, "Com Standby Frequency:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
259
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM2_DATA, "Nav Active Frequency:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
260
            this.hSimConnect.AddToDataDefinition(FSXObject.DEFINITIONS.NAVCOM2_DATA, "Nav Standby Frequency:2", "Number", SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
-
 
261
            this.hSimConnect.RegisterDataDefineStruct<FSXObject.NavCom_Data>(FSXObject.DEFINITIONS.NAVCOM2_DATA);
-
 
262
            
187
        }
263
        }
188
 
264
 
189
        // Individual data requests
265
        // Individual data requests
190
        public void requestNavComm1Data() {
266
        public void requestNavComm1Data() {
191
            this.requestData(FSXObject.DATA_REQUESTS.NAVCOM1_REQ, FSXObject.DEFINITIONS.NAVCOM1_DATA);
267
            this.requestData(FSXObject.DATA_REQUESTS.NAVCOM1_REQ, FSXObject.DEFINITIONS.NAVCOM1_DATA);