DerJantob / TSW2_Controller

Control TSW2 with a joystick or other controllers
26 stars 4 forks source link

BR403 - Joystick position mismatch Controls Window vs TSW2_Controller window #21

Closed danbaz101 closed 2 years ago

danbaz101 commented 2 years ago

Hi Jannik,

After having some good runs with BR442 and BR422 I thought to setup my joysticks for the BR403.

In the Controls window I have selected "Inverted" and "Other Joy-Mode" so that with the joystick in the forward position it shows zero in the joystick summary in the top right corner (actually it dissappears altogether). When moving the joystick all the way to the aft position, the emergency brake position, the reading is 100. So this is all good. Now when I save and go back to the main TSW2_Controller window and I select Joystick 1 and I move the joystick, it moves from forward to aft, from 50 to 0, so the opposite numbering and only half the range.

Hope you can help me.

Joystick in middle position: 220320 BR403_Joy1_AxisZ

Joystick almost in full forward position (release) 220320 BR403_Joy1_AxisZ_2

DerJantob commented 2 years ago

I haven't really tried much with multiple joysticks because unfortunately I only own one. I just noticed the bug that the "Inverted" and "Other Joy-Mode" affects all joysticks, not just the one with the selected number. I will have to fix that. So, is it possible that you are using JoyZ of Joystick 0 for the throttle?

danbaz101 commented 2 years ago

Yes, correct. I am using Joystick 0 JoyZ for the throttle.

DerJantob commented 2 years ago

Ok, I think I found the problem. Could you maybe try in advance if it works with the following version? TSW2_Controller_PreRelease_1_1.0.4.zip

danbaz101 commented 2 years ago

Great. I have tried it. It works OK now. The reading in both windows is now the same. Nice! :)

However the brake handle does not behave yet as it should, but perhaps that is a settings error. Applying the brake a first time works fine, but then releasing the brake, moving the handle back forward does not work.

When I applied full braking that was OK, but when I then set the handle back at 50% the lever stayed in the full braking position.

This is what I have in the config csv file: BR403/406,Bremse,1,JoyZ,1,1,,Bremse,,Stufen,9,[14=1][Release=0][Bypass=0][1A=1][1B=2][2=3][3=4][4=5][5=6][6=7][7=8][Full Application=9][Full/Application=9],335, Have I made an error in this?

There is also a default line for the bypass. Assume that one does not bite...?

Thanks for your quick help. Pls do not let this get in the way of studying! :) I can wait.

DerJantob commented 2 years ago

For me, it works with your settings. Could you maybe send me the whole TrainConfig.csv?

danbaz101 commented 2 years ago

Sure. Here you are.

Trainconfig.csv

DerJantob commented 2 years ago

Hmm... even with your config, it works flawlessly for me. It could perhaps be that the button "Bremse nach Umgehung drücken" causes problems for you. Try deleting that one and see if it works for you then. Otherwise, I do not know right now what could cause the problem

danbaz101 commented 2 years ago

I have tried to do this, but it did not solve my problem. When I move the joystick handle down, the train lever goes down, when I move the joystick handle back up, the train lever stays where it was, when I then move the joystick lever down again the train lever moves further down. So in the end my joystick handle is in up position, but the train is in emergency brakes..

The reading in the app is wrong too. It states that the brake is in 1 and should be in 1. The scan results show something like brake is off, but the train lever is in emergency brake position. So there is a disconnect that is not recognized by the error handling yet.

Looking forward to hearing from you.

DerJantob commented 2 years ago

I am unfortunately still not able to reproduce your problem. Can you send me maybe your user.config file, located in the folder next to your TrainConfig? (TSW2_Controller.exeURL[other stuff]/1.0.3.1/user.config)

danbaz101 commented 2 years ago

Sure. Here you are.

I had to zip it as .config files were not accepted. user.zip

Also I have deleted all lines except the one for the brake for the 403 from the config file and I still had the same problem. Therefore I think we can conclude the problem is not in the config file or it has to be related to my system. Some regional setting, but I feel that is unlikely..

DerJantob commented 2 years ago

Hm, I can not see a direct problem with this either. But I still have a few questions:

  1. Does this problem only occur on the prerelease version or also on the version 1.0.3?
  2. Does the lever not move at all, or only a little?
  3. When you click on a text box, do the correct buttons get pressed or does nothing happen here either?
danbaz101 commented 2 years ago

Hi Jannik,

  1. I am on pre release 1 V 1.0.4
  2. The lever only moves one way, in the direction of applying more brake.
  3. I am not sure what you mean by this...sorry. Pls can you explain or show?

I have made another video. In this I slowly add brake until 50%, then go back up. Then I apply brake again until full brake and at last I move my joystick all the to zero again. You will see that the lever in the sim will move only in one direction. Hope it helps.

https://youtu.be/wd7_EiIM0XQ

DerJantob commented 2 years ago

After testing a lot, I think the problem is due to the different keyboard layouts. I have temporarily changed this for you to see if this fixes the problem. If not, then please tell me which keyboard layout / language you are using. TSW2_Controller_PreRelease_2_1.0.4.zip

Kind regards, Jannik

danbaz101 commented 2 years ago

Thanks a lot Jannik,

This has solved the problem. The brake handle is moving in both directions now.

There are my keyboard settings. i have a QWERTY keyboard. Schermafbeelding 2022-04-03 162945

Schermafbeelding 2022-04-03 163548

Kind regards,

Daniel

DerJantob commented 2 years ago

Thanks for the help and for testing!

danbaz101 commented 2 years ago

Hi Jannik, I saw the new version in the app and have installed it. Now the brake handle does not work anymore.

Just letting you know.

I will try to install the version you gave me above again.

Kind regards,

Daniel

DerJantob commented 2 years ago

Have you changed your keys in the new setting? grafik

danbaz101 commented 2 years ago

Of course not.. :)

Done now. So I am on latest version now. It moves in the right direction again.

For some reason it keeps pressing my ; key for decreasing brake. Pls see new movie.

https://youtu.be/DqD34SQuN5o Beginning: Joystick in full up. It keeps pressing ; and hence it shows Bypass. After this I moved joystick to the middle. Brake lever moved in the right direction, but then went back to Bypass Then I moved joystick to full brake. Same happened. I have not modified the settings on my end.

Sorry, I have all these issues....

Kind regards,

Daniel

DerJantob commented 2 years ago

Don't be sorry that you have these problems :) Did you change something with your config? I have tried it with your Trainconfig.csv and user.zip, set my keyboard layout to US, but didn't experience this issue?

Kind regards, Jannik

danbaz101 commented 2 years ago

Thanks!

I have not changed anything.

Is it correct that if I set Increase Brake and Decrease Brake and I press ; that it finds the a umlaut and when I press ' it finds u umlaut? See snip. I had expected it would show my ; and ' image

Kind regards,

Daniel

DerJantob commented 2 years ago

In version 1.0.4 it is correct that it shows äöü or something else. In version 1.1.0 it will be changed to oem1, oem2, ... , to prevent confusion. Since I don't really have experience with programming different keyboard layouts, I haven't managed to get the correct character to be displayed yet. But for now I'll see how I can fix your problem.

DerJantob commented 2 years ago

Do you still have "Bremse nach Umgehung drücken" deleted from the buttons of BR403/406? If your joystick 0 JoyY is inaccurate and the number jumps around, it sometimes presses your brake back down again. This looks similar to your problem.

danbaz101 commented 2 years ago

Will check now

danbaz101 commented 2 years ago

I have this line in my config. Will delete and try again now.

danbaz101 commented 2 years ago

This was the problem. It worked right away now. Thank you very much!

I deleted that whole line from the config file.

DerJantob commented 2 years ago

I'm glad I could help you!