Jump to content
The simFlight Network Forums

Recommended Posts

Tried to set tug heading and  speed controlled by integer by 


    Private TugH As New Offset(Of UInteger)(&H31F8)
    Private TugS As New Offset(Of UInteger)(&H31FC)
    Private TugState As New Offset(Of UInteger)(&H31F4)
 FSUIPCConnection.Process()
Dim HDG as integer = TextHDG.text
Dim SPD as integer = TextSPD.text
Dim Status as integer = TextSts.text

FSUIPCConnection.SendControlToFS(FsControl.KEY_TUG_HEADING, HDG)
FSUIPCConnection.SendControlToFS(FsControl.KEY_TUG_SPEED, SPD)

TugH.value= HDG
TugS.value= SPD
TugState.value= Status

So for the heading of the tug no one worked it just make the heading of aircraft is 357 degree whatever i change the heading in TextHDG , whatever integer i input just turn the tug to heads the aircraft to 357 .

for the speed it doesn't work 

for the status integer : 0 Pushback Straight 

1 to left 

2 to right 

3 stop pushback 

any helps plz ..  

Link to post
Share on other sites

First, please make sure you're only declaring offsets once. Usually this is at the main class or form level.

All these offsets are write-only so they should be marked as write-only when you declare them. They should also be placed in their own group so you can process them separately.

The pushback seems to be different from the tug. The tug goes forward, not back.

    Private TugH As New Offset(Of UInteger)("tug", &H31F8, True)
    Private TugS As New Offset(Of UInteger)("tug", &H31FC, True)

    Private PushBackState As New Offset(Of UInteger)("pushback", &H31F4, True)

For offset 31F8, the heading in degrees needs to be converted to FSUIPC Units:

Dim HDG as integer = TextHDG.text * 360D / (65536D * 65536D)

For offset 31FC the values are in feet/second. 

The Process() call must come after you set the values so the new value can be written:

Dim HDG as UInteger = TextHDG.text
Dim SPD as UInteger = TextSPD.text
TugH.Value = HDG  * 360D / (65536D * 65536D)
TugS.Value = SPD
FSUIPCConnection.Process("tug")

Paul

 

Link to post
Share on other sites

i tried it works for the Heading with no luck for the speed the plane doesn't move until i disconnect the tug what i want to do is to stop the pushing back while the tug still connected and re push back in button click whatever stopped or not the tug still connected so i try to make speed 0 while it connected ..

thanks Paul at all 

15 hours ago, Paul Henty said:

First, please make sure you're only declaring offsets once. Usually this is at the main class or form level.

All these offsets are write-only so they should be marked as write-only when you declare them. They should also be placed in their own group so you can process them separately.

The pushback seems to be different from the tug. The tug goes forward, not back.


    Private TugH As New Offset(Of UInteger)("tug", &H31F8, True)
    Private TugS As New Offset(Of UInteger)("tug", &H31FC, True)

    Private PushBackState As New Offset(Of UInteger)("pushback", &H31F4, True)

For offset 31F8, the heading in degrees needs to be converted to FSUIPC Units:


Dim HDG as integer = TextHDG.text * 360D / (65536D * 65536D)

For offset 31FC the values are in feet/second. 

The Process() call must come after you set the values so the new value can be written:


Dim HDG as UInteger = TextHDG.text
Dim SPD as UInteger = TextSPD.text
TugH.Value = HDG  * 360D / (65536D * 65536D)
TugS.Value = SPD
FSUIPCConnection.Process("tug")

Paul

 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • 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.