Subversion Repositories group.electronics

Rev

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

Rev 113 Rev 114
Line 63... Line 63...
63
 
63
 
64
 
64
 
65
HANDLE  hSimConnect = NULL;
65
HANDLE  hSimConnect = NULL;
66
bool    keep_going = false;
66
bool    keep_going = false;
67
bool	Paused = true;
67
bool	Paused = true;
68
char string[80];
68
char 	string[80];
69
bool	updateLeds = true;
69
bool	updateLeds = true;
70
char ledStatus = 0x00;
70
char 	ledStatus = 0x00;
-
 
71
int		nBytes = 0;
-
 
72
char	buffer[16];
71
 
73
 
72
struct Struct1 {
74
struct CommSelectData {
73
	double	comm_1;
75
	double	comm1;
74
	double	comm_2;
76
	double	comm2;
75
	double	comm_both;
77
	double	commb;
-
 
78
	double	vor1;
-
 
79
	double	vor2;
-
 
80
	double	mkr;
-
 
81
	double	dme;
-
 
82
	double	adf;
76
};
83
};
77
 
84
 
78
static enum DATA_DEFINE_ID {
85
static enum DATA_DEFINE_ID {
79
    DEFINITION_1,
86
    DEFINITION_1,
80
};
87
};
Line 84... Line 91...
84
};
91
};
85
 
92
 
86
 
93
 
87
 
94
 
88
static enum EVENT_ID {
95
static enum EVENT_ID {
89
    EVENT_BRAKES,
-
 
90
	EVENT_COM1_TRANSMIT_SELECT,
96
	EVENT_COM1_TRANSMIT_SELECT,
91
	EVENT_COM2_TRANSMIT_SELECT,
97
	EVENT_COM2_TRANSMIT_SELECT,
92
	EVENT_COM_RECEIVE_ALL_TOGGLE,
98
	EVENT_COM_RECEIVE_ALL_TOGGLE,
-
 
99
	EVENT_RADIO_VOR1_IDENT_TOGGLE,
-
 
100
	EVENT_RADIO_VOR2_IDENT_TOGGLE
-
 
101
	EVENT_MARKER_SOUND_TOGGLE,
-
 
102
	EVENT_RADIO_DME1_IDENT_TOGGLE,
-
 
103
	EVENT_RADIO_ADF_IDENT_TOGGLE,
93
};
104
};
94
 
105
 
95
static enum INPUT_ID {
106
static enum INPUT_ID {
96
    INPUT0,
107
    INPUT0,
97
};
108
};
Line 112... Line 123...
112
            fprintf(stderr, "Could not find USB device\n");
123
            fprintf(stderr, "Could not find USB device\n");
113
            exit(1);
124
            exit(1);
114
    }
125
    }
115
 
126
 
116
	//testCode(handle);
127
	//testCode(handle);
-
 
128
	
-
 
129
	int i;
-
 
130
	for (i = 0; i < 15; i++) {
-
 
131
		buffer[i] = 0x00;
-
 
132
	}
-
 
133
	
-
 
134
	nBytes = usb_control_msg(handle,
-
 
135
					USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
-
 
136
					USB_LEDS_SET, ledStatus, 0, (char *)buffer, sizeof(buffer), 5000);	
117
 
137
 
118
	Connect();
138
	Connect();
119
 
139
 
120
	if (hSimConnect != NULL) {
140
	if (hSimConnect != NULL) {
121
		keep_going = true;
141
		keep_going = true;
122
 
142
 
123
		int nBytes = 0;
-
 
124
		char buffer[16];
-
 
125
		int i;
-
 
126
		for (i = 0; i < 15; i++) {
-
 
127
			buffer[i] = 0x00;
-
 
128
		}
-
 
129
 
-
 
130
		
-
 
131
		nBytes = usb_control_msg(handle,
-
 
132
						USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
-
 
133
						USB_LEDS_SET, ledStatus, 0, (char *)buffer, sizeof(buffer), 5000);
-
 
134
 
-
 
135
		unsigned int lastButtons = 0;
143
		unsigned int lastButtons = 0;
136
 
144
 
137
		while(keep_going)
145
		while(keep_going)
138
        {
146
        {
139
			HRESULT hr;
147
			HRESULT hr;
140
			
148
			
141
			// Put this in an 'On Event' thing later...
149
			// Put this in an 'On Event' thing later...
142
			hr = SimConnect_RequestDataOnSimObjectType(hSimConnect, REQUEST_1, DEFINITION_1, 0, SIMCONNECT_SIMOBJECT_TYPE_USER);
150
			//hr = SimConnect_RequestDataOnSimObjectType(hSimConnect, REQUEST_1, DEFINITION_1, 0, SIMCONNECT_SIMOBJECT_TYPE_USER);
143
			
151
			
144
			nBytes = usb_control_msg(handle,
152
			nBytes = usb_control_msg(handle,
145
					USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
-
 
146
					USB_LEDS_SET, ledStatus, 0, (char *)buffer, sizeof(buffer), 5000);
-
 
147
 
-
 
148
			nBytes = usb_control_msg(handle,
-
 
149
						USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
153
						USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
150
						USB_STATE_READ, 0, 0, (char *)buffer, sizeof(buffer), 5000);
154
						USB_STATE_READ, 0, 0, (char *)buffer, sizeof(buffer), 5000);
-
 
155
			
151
			unsigned int buttons = (unsigned int)buffer[1];
156
			unsigned int buttons = (unsigned int)buffer[1];
152
 
-
 
153
			if (rbi(buttons, BUTTONS_COM1) && rbi(lastButtons, BUTTONS_COM1) == 0) {
-
 
154
				sbi(lastButtons, BUTTONS_COM1);
-
 
155
				hr = SimConnect_TransmitClientEvent(hSimConnect,0,EVENT_COM1_TRANSMIT_SELECT, 1 ,SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
-
 
156
				printf("\n%s COM1 pressed.", Format_SOL(M_IN));
-
 
157
			}
157
			
158
 
-
 
159
			if (rbi(lastButtons, BUTTONS_COM1) && rbi(buttons, BUTTONS_COM1) == 0x00) {
-
 
160
				cbi(lastButtons, BUTTONS_COM1);
-
 
161
				printf("\n%s COM1 released.", Format_SOL(M_IN));
-
 
162
			}
158
			
163
 
-
 
164
			if (rbi(buttons, BUTTONS_COM2) && rbi(lastButtons, BUTTONS_COM2) == 0) {
-
 
165
				sbi(lastButtons, BUTTONS_COM2);
-
 
166
				hr = SimConnect_TransmitClientEvent(hSimConnect,0,EVENT_COM2_TRANSMIT_SELECT, 1 ,SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
-
 
167
				printf("\n%s COM2 pressed.", Format_SOL(M_IN));
-
 
168
			}
159
			
169
 
-
 
170
			if (rbi(lastButtons, BUTTONS_COM2) && rbi(buttons, BUTTONS_COM2) == 0x00) {
-
 
171
				cbi(lastButtons, BUTTONS_COM2);
160
			for (i=-; i<7; i++) {
172
				printf("\n%s COM2 released.", Format_SOL(M_IN));
-
 
173
			}
-
 
174
 
-
 
175
			if (rbi(buttons, BUTTONS_BOTH) && rbi(lastButtons, BUTTONS_BOTH) == 0) {
161
					if (rbi(buttons, i) && rbi(lastButtons, i) == 0) {
176
				sbi(lastButtons, BUTTONS_BOTH);
162
						sbi(lastButtons, i);
177
				hr = SimConnect_TransmitClientEvent(hSimConnect,0,EVENT_COM_RECEIVE_ALL_TOGGLE, 1 ,SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
-
 
178
				printf("\n%s BOTH pressed.", Format_SOL(M_IN));
163
						hr = SimConnect_TransmitClientEvent(hSimConnect,0, i, 1 ,
179
			}
-
 
180
 
-
 
181
			if (rbi(lastButtons, BUTTONS_BOTH) && rbi(buttons, BUTTONS_BOTH) == 0x00) {
164
								SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
182
				cbi(lastButtons, BUTTONS_BOTH);
-
 
183
				printf("\n%s BOTH released.", Format_SOL(M_IN));
-
 
184
			}
165
					}
185
 
-
 
186
 
-
 
187
 
-
 
188
			if (rbi(buttons, BUTTONS_NAV1) && rbi(lastButtons, BUTTONS_NAV1) == 0) {
-
 
189
				sbi(lastButtons, BUTTONS_NAV1);
-
 
190
				hr = SimConnect_TransmitClientEvent(hSimConnect,0,EVENT_BRAKES, 1 ,SIMCONNECT_GROUP_PRIORITY_STANDARD,SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
-
 
191
				printf("\n%s Buttons brakes engaged.", Format_SOL(M_IN));
-
 
192
			}
166
					
193
 
-
 
194
			if (rbi(lastButtons, BUTTONS_NAV1) && rbi(buttons, BUTTONS_NAV1) == 0x00) {
167
					if (rbi(lastButtons, i) && ! rbi(buttons, i)
195
				cbi(lastButtons, BUTTONS_NAV1);
168
						cbi(lastButtons, i);
196
				printf("\n%s Button brakes released.", Format_SOL(M_IN));
-
 
197
			}
169
			}
198
 
170
 
199
 
-
 
200
            SimConnect_CallDispatch(hSimConnect, dispatchProc, NULL);
171
            SimConnect_CallDispatch(hSimConnect, dispatchProc, NULL);
201
            Sleep(1);
172
            Sleep(1);
202
        }
173
        }
203
        Disconnect();
174
        Disconnect();
204
    } else {
175
    } else {
205
		// Implement retrying
176
		// Implement retrying
206
	}
177
	}
207
 
178
 
208
	// Keeps the window open. Uses old test code
-
 
209
	//  so state of CommSelector can be tested
-
 
210
	//testCode(handle);
-
 
211
 
179
 
212
    usb_close(handle);
180
    usb_close(handle);
213
 
181
 
214
	return 0;
182
	return 0;
215
}
183
}
Line 264... Line 232...
264
			break;
232
			break;
265
 
233
 
266
		case SIMCONNECT_RECV_ID_EVENT: {
234
		case SIMCONNECT_RECV_ID_EVENT: {
267
			SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData;
235
			SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData;
268
			switch (evt->uEventID) {
236
			switch (evt->uEventID) {
269
				case EVENT_BRAKES:
-
 
270
					printf("\nEvent brakes: %d", evt->dwData);
-
 
271
					break;
-
 
272
				case EVENT_COM1_TRANSMIT_SELECT:
-
 
273
					printf("\nEvent com1 select: %d", evt->dwData);
-
 
274
					break;
-
 
275
				case EVENT_COM2_TRANSMIT_SELECT:
-
 
276
					printf("\nEvent com1 select: %d", evt->dwData);
-
 
277
					break;
-
 
278
				case EVENT_COM_RECEIVE_ALL_TOGGLE:
-
 
279
					printf("\nEvent com1 select: %d", evt->dwData);
-
 
280
					break;
-
 
281
				default:
237
				default:
282
					break;
238
					break;
283
			}
239
			}
284
			break;
240
			break;
285
		}
241
		}
286
 
242
 
-
 
243
		case SIMCONNECT_RECV_ID_SIMOBJECT_DATA: {
-
 
244
			SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE*)pData;
-
 
245
 
-
 
246
			switch(pObjData->dwRequestID) {
-
 
247
				case REQUEST_1: {
-
 
248
					DWORD ObjectID = pObjData->dwObjectID;
-
 
249
					CommSelectData *ps = (CommSelectData*)&pObjData->dwData;
-
 
250
					
-
 
251
					hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_1, DEFINITION_1, ObjectID, 
-
 
252
														   SIMCONNECT_PERIOD_SECOND, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
-
 
253
 
-
 
254
					setLed(ps->com1, &ledStatus, BUTTONS_COM1);
-
 
255
					setLed(ps->com2, &ledStatus, BUTTONS_COM2);
-
 
256
					setLed(ps->comb, &ledStatus, BUTTONS_COMB);
-
 
257
					setLed(ps->vor1, &ledStatus, BUTTONS_NAV1);
-
 
258
					setLed(ps->vor2, &ledStatus, BUTTONS_NAV2);
-
 
259
					setLed(ps->mkr, &ledStatus, BUTTONS_MKR);
-
 
260
					setLed(ps->dme, &ledStatus, BUTTONS_DME);
-
 
261
					setLed(ps->adf, &ledStatus, BUTTONS_ADF);
-
 
262
					
-
 
263
					nBytes = usb_control_msg(handle,
-
 
264
						USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
-
 
265
						USB_LEDS_SET, ledStatus, 0, (char *)buffer, sizeof(buffer), 5000);
-
 
266
 
-
 
267
					printf("\nSIMOBJECT_DATA %d LED Update",  );
-
 
268
					break;
-
 
269
				}
-
 
270
			}
-
 
271
			break;	
-
 
272
		}
287
		
273
		
288
		case SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE: {
274
		case SIMCONNECT_RECV_ID_SIMOBJECT_DATA_BYTYPE: {
289
			SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE*)pData;
275
			SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE*)pData;
290
 
276
 
291
			switch(pObjData->dwRequestID) {
277
			switch(pObjData->dwRequestID) {
292
				case REQUEST_1: {
278
				case REQUEST_1: {
293
					DWORD ObjectID = pObjData->dwObjectID;
279
					DWORD ObjectID = pObjData->dwObjectID;
294
					Struct1 *pS = (Struct1*)&pObjData->dwData;
280
					CommSelectData *pS = (CommSelectData*)&pObjData->dwData;
295
					if (pS->comm_1)
-
 
296
						sbi(ledStatus, BUTTONS_COM1);
-
 
297
					else
-
 
298
						cbi(ledStatus, BUTTONS_COM1);
-
 
299
					if (pS->comm_2)
-
 
300
						sbi(ledStatus, BUTTONS_COM2);
-
 
301
					else
-
 
302
						cbi(ledStatus, BUTTONS_COM2);
-
 
303
					if (pS->comm_both)
-
 
304
						sbi(ledStatus, BUTTONS_BOTH);
-
 
305
					else
281
					
306
						cbi(ledStatus, BUTTONS_BOTH);
282
					hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_1, DEFINITION_1, ObjectID, 
307
					updateLeds = true;
-
 
308
					//printf("\nTransmit Both: %f", pS->comm_both );
283
														   SIMCONNECT_PERIOD_SECOND, SIMCONNECT_DATA_REQUEST_FLAG_CHANGED);
309
					break;
284
					break;
310
				}
285
				}
311
			}
286
			}
312
			break;
287
			break;
313
		}
288
		}
Line 343... Line 318...
343
		default:
318
		default:
344
			printf("\n%s Message ignored (Unknown RECV_ID)", Format_SOL(M_IN, I_NEX));
319
			printf("\n%s Message ignored (Unknown RECV_ID)", Format_SOL(M_IN, I_NEX));
345
    }
320
    }
346
}
321
}
347
 
322
 
-
 
323
void setLed(double value, char* ledS, int bit) {
-
 
324
	if (value)
-
 
325
		sbi(ledS, bit);
-
 
326
	else
-
 
327
		cbi(ledS, bit);
-
 
328
}
-
 
329
 
348
void Process_Exception(SIMCONNECT_RECV* pData) {
330
void Process_Exception(SIMCONNECT_RECV* pData) {
349
	// SimConnect cannot process a client request
331
	// SimConnect cannot process a client request
350
	SIMCONNECT_RECV_EXCEPTION *except = (SIMCONNECT_RECV_EXCEPTION *) pData;
332
	SIMCONNECT_RECV_EXCEPTION *except = (SIMCONNECT_RECV_EXCEPTION *) pData;
351
	printf("\n%s Exception %d on packet %d, argument %d. (%s)", Format_SOL(M_IN, I_EXE),
333
	printf("\n%s Exception %d on packet %d, argument %d. (%s)", Format_SOL(M_IN, I_EXE),
352
		except->dwException, except->dwSendID, except->dwIndex,
334
		except->dwException, except->dwSendID, except->dwIndex,
Line 354... Line 336...
354
}
336
}
355
 
337
 
356
void Process_Connected() {
338
void Process_Connected() {
357
	printf("\n%s Connected.", Format_SOL(M_IN));
339
	printf("\n%s Connected.", Format_SOL(M_IN));
358
 
340
 
-
 
341
	EVENT_COM1_TRANSMIT_SELECT,
-
 
342
	EVENT_COM2_TRANSMIT_SELECT,
-
 
343
	EVENT_COM_RECEIVE_ALL_TOGGLE,
-
 
344
	EVENT_RADIO_VOR1_IDENT_TOGGLE,
-
 
345
	EVENT_RADIO_VOR2_IDENT_TOGGLE
-
 
346
	EVENT_MARKER_SOUND_TOGGLE,
-
 
347
	RADIO_DME1_IDENT_TOGGLE,
-
 
348
	RADIO_ADF_IDENT_TOGGLE,	
-
 
349
	
359
		HRESULT hr;
350
	HRESULT hr;
360
    hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_BRAKES, "brakes");
-
 
361
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM1_TRANSMIT_SELECT, "COM1_TRANSMIT_SELECT");
351
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM1_TRANSMIT_SELECT, "COM1_TRANSMIT_SELECT");
362
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM2_TRANSMIT_SELECT, "COM2_TRANSMIT_SELECT");
352
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM2_TRANSMIT_SELECT, "COM2_TRANSMIT_SELECT");
363
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM_RECEIVE_ALL_TOGGLE, "COM_RECEIVE_ALL_TOGGLE");
353
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_COM_RECEIVE_ALL_TOGGLE, "COM_RECEIVE_ALL_TOGGLE");
-
 
354
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_RADIO_VOR1_IDENT_TOGGLE, "RADIO_VOR1_IDENT_TOGGLE");
-
 
355
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_RADIO_VOR2_IDENT_TOGGLE, "RADIO_VOR2_IDENT_TOGGLE");
-
 
356
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_MARKER_SOUND_TOGGLE, "MARKER_SOUND_TOGGLE");
-
 
357
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_RADIO_DME1_IDENT_TOGGLE, "RADIO_DME1_IDENT_TOGGLE");
-
 
358
	hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_RADIO_ADF_IDENT_TOGGLE, "RADIO_ADF_IDENT_TOGGLE");
364
 
359
 
365
 
360
/*
366
    hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_BRAKES);
-
 
367
	hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_COM1_TRANSMIT_SELECT);
361
	hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_COM1_TRANSMIT_SELECT);
368
	hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_COM2_TRANSMIT_SELECT);
-
 
369
	hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP0, EVENT_COM_RECEIVE_ALL_TOGGLE);
-
 
370
    hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST);
362
    hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST);
-
 
363
*/
371
 
364
 
372
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM TRANSMIT:1", "Bool");
365
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM TRANSMIT:1", "Bool");
373
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM TRANSMIT:2", "Bool");
366
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM TRANSMIT:2", "Bool");
374
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM RECIEVE ALL", "Bool");
367
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "COM RECIEVE ALL", "Bool");
-
 
368
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "NAV SOUND:1", "Bool");
-
 
369
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "NAV SOUND:2", "Bool");
-
 
370
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "MARKER SOUND", "Bool");
-
 
371
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "DME SOUND", "Bool");
-
 
372
	hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "ADF SOUND:1", "Bool");
-
 
373
	
-
 
374
	hr = SimConnect_RequestDataOnSimObjectType(hSimConnect, REQUEST_1, DEFINITION_1, 0, SIMCONNECT_SIMOBJECT_TYPE_USER);
375
 
375
 
376
 
376
 
377
    //hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT0, "shift+ctrl+u", EVENT_BRAKES);
-
 
378
    //hr = SimConnect_SetInputGroupState(hSimConnect, INPUT0, SIMCONNECT_STATE_ON);
-
 
379
}
377
}
380
 
378
 
381
void Process_FSX_Quit() {
379
void Process_FSX_Quit() {
382
	// Stop sending commands to SimConnect
380
	// Stop sending commands to SimConnect
383
	keep_going = false;
381
	keep_going = false;