Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello Pete,

i need your help with offset 3110 to open/close the doors.

 

Since i have installed Prepar3D v2.5 i have this problem:

I use this c# code to control the doors:

    	private Offset<int> sendControl = new Offset<int>(0x3110, true);
    	private readonly int TOGGLE_JETWAY = 66695;
    	private readonly int TOGGLE_WINGFOLD = 66390; // AirStairs for JS800
    	
    	private readonly int TOGGLE_AIRCRAFT_EXIT = 66389; //
    	private readonly int SELECT_1 = 65538;
    	private readonly int SELECT_2 = 65539;
    	private readonly int SELECT_3 = 65540;
    	private readonly int SELECT_4 = 65541;


void Process_FS_Doors(int iDoorNumber)
{
	Fsuipc_Process();
	sendControl.Value = TOGGLE_AIRCRAFT_EXIT;	            
	
	Thread.Sleep(50);			
	
	if(iDoorNumber == 0) sendControl.Value = SELECT_1;
	if(iDoorNumber == 1) sendControl.Value = SELECT_2;
	if(iDoorNumber == 2) sendControl.Value = SELECT_3;
	if(iDoorNumber == 3) sendControl.Value = SELECT_4;
 
	Fsuipc_Process();
}

I am sure, even if you did not speak c#, you understand this code.

 

Now, the problem, since P3D v2.5 , is that bevore this works i must first open the Main Exit via Shift + E on the Keyboard.

Thats crazy...then the code works fine for all doors.

 

Why the hell must i first use the keyboard one times ?

Have you any idea ?

 

Thanks

Mattias

 

Posted

Hi Mattias,

 

You need to call Process() after you've set the value of the offset, not before. So your first two lines need to be reversed. The way you have it now, the Toggle_Exit control is never sent as the process has already been done.

 

I think you need to change your code to this:

void Process_FS_Doors(int iDoorNumber)
{
    // 1. Toggle the selected exit
    sendControl.Value = TOGGLE_AIRCRAFT_EXIT;    
    Fsuipc_Process();   

    // 2. Wait a bit
    Thread.Sleep(50);            

    // 3. Select the exit to control
    if(iDoorNumber == 0) sendControl.Value = SELECT_1;
    if(iDoorNumber == 1) sendControl.Value = SELECT_2;
    if(iDoorNumber == 2) sendControl.Value = SELECT_3;
    if(iDoorNumber == 3) sendControl.Value = SELECT_4;
    Fsuipc_Process();    
}

Paul

Posted

Hello,

 

thanks for your Answers.

I "think" i had it bevor like you proposed, but i am not really sure.

I am at work, so i will test it this afternoon and come back.

 

Thanks

Matthias

Posted

Hello again,

 

i am sorry, but i was too early too happy. It is not working.

 

I use the exactly same Code you provide here.

It is not working since i changed to P3D v2.5. Could that be a Problem?

I have installed the latest FSUIP for sure.

 

The crazy Thing is that i also have a Code for the Air Stairs and this is working fine.

Only the doors wont work.

 

Maybe anyone has any Idea please ?

 

Thanks

Matthias

Posted

Maybe anyone has any Idea please ?

 

I am pretty sure that the Toggle Aircraft Exit controls can take the "select" number (1-4) as the parameter, which saves having to issue separate controls. Alternatively, use the FSUIPC offset provided to open/close doors.

 

Pete

  • 1 month later...
Posted

Hi Volks,

 

i must again ask for help with this Offset.

Now it is the ATC Menu which makes Problems.

With this Code i got now the Doors to work:

				sendControl.Value = TOGGLE_AIRCRAFT_EXIT;
				Fsuipc_Process();
				Thread.Sleep(50);            
				
				if(iDoorNumber == 0) sendControl.Value = SELECT_1;
				if(iDoorNumber == 1) sendControl.Value = SELECT_2;
				if(iDoorNumber == 2) sendControl.Value = SELECT_3;
				if(iDoorNumber == 3) sendControl.Value = SELECT_4;

				Fsuipc_Process();

Now i tried the ATC Menu and add this constants:

 

     private readonly int ATC = 65564;

     private readonly int ATC_MENU_0 = 66181;
     private readonly int ATC_MENU_1 = 66172;
     private readonly int ATC_MENU_2 = 66173;
     private readonly int ATC_MENU_3 = 66174;
     private readonly int ATC_MENU_4 = 66175;
     private readonly int ATC_MENU_5 = 66176;
     private readonly int ATC_MENU_6 = 66177;
     private readonly int ATC_MENU_7 = 66178;
     private readonly int ATC_MENU_8 = 66179;
     private readonly int ATC_MENU_9 = 66180;
 

 

and created this Code to manage the ATC Window

 

switch(msg)
   {
    case "O":
     sendControl.Value = ATC;
     break;
    case "0":
     sendControl.Value = ATC_MENU_0;
     break;
    case "1":
     sendControl.Value = ATC_MENU_1;
     break;
    case "2":
     sendControl.Value = ATC_MENU_2;
     break;
    case "3":
     sendControl.Value = ATC_MENU_3;
     break;
    case "4":
     sendControl.Value = ATC_MENU_4;
     break;
    case "5":
     sendControl.Value = ATC_MENU_5;
     break;
    case "6":
     sendControl.Value = ATC_MENU_6;
     break;
    case "7":
     sendControl.Value = ATC_MENU_7;
     break;
    case "8":
     sendControl.Value = ATC_MENU_8;
     break;
    case "9":
     sendControl.Value = ATC_MENU_9;
     break;    
   }
   Fsuipc_Process();

 

 

When i now call this procedure and give the Variable "msg" the String "O" it opens the ATC Menu. When i call it again and the ATC Menu is still open , then the ATC Menu Closes ... Thats perfect !

 

But when i open the ATC Menu and give then "msg" the string "1" or "2" it dosent work.

 

The other Problem is that same Code works in Prepar3d v2.5 but not in my actual Prepar3d v3.

I also checked Offset 3110 in your FSI and it becomes the correct value.

 

Have you any idea ?

 

Matthias

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.