BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

**ALPHA** OS_ATS in C#

+11
graymac
hkmtrhah
HijauKuda
jsiren
Dexter
buckysam
thehoviskid
Greater Anglia Metro
alex_farlie
Northern Line
leezer3
15 posters

Page 3 of 6 Previous  1, 2, 3, 4, 5, 6  Next

Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Wed Jun 11, 2014 12:56 pm

I've implemented this value for v0.20 attached below with electric traction (You're using some interesting fudges!) :

powerloopsound A pair of comma separated values, defining the sound index to be played looped when the power notch is changed to a value above neutral, and the delay before this sound starts. (Equivalent to gearloopsound for diesel traction, just relative to the power notch)

To get the sounds working, they need to be defined first Smile
So, in the BVEC_Ats.cfg file:
Code:
[Electric]
pantographindicator_f=71
pantographindicator_r=72
Breakerindicator=30
breakersound=190
pantographsound=191
powerloopsound=2,1280

[Interlocks]
reverserindex=191
doorpowerlock=1
doorapplybrake=1
customindicators= 198,61,62,63,64,65,66,30

[Vigilance]
overspeedcontrol=1
warningspeed=124
overspeed=130
safespeed=118
overspeedindicator=60
deadmanshandle=1
vigilancelamp=11
vigilancealarm=0
vigilanceinterval=22000
vigilancecancellable=0
vigilanceautorelease=1
overspeedalarm=4

Continue on to the end....

Add these two to the ATS section in the sound.cfg file:
Code:

190 = Sound\breaker.wav
191 = Sound\pantograph.wav

Changing the ammeter to not show any current draw when there are no line volts has been added to the todo list, and I'll get to that over the next few days.
(OS_ATS always shows a current draw, even when it's in a neutral section)

I think that a rotary wiper switch and associated indicator should be achievable without too much trouble, let me think about the best way to implement this and I'll get back to you.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Wed Jun 11, 2014 2:15 pm

OK, I am on my home PC now, so I am going to look into it.

Thank you, you have been very helpful!
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Wed Jun 11, 2014 2:21 pm

Version 0.21
Changes:

  • Tweaked the behaviour of powerloopsound so that it does not play whilst in a neutral section.
  • The ammeter no longer shows a value when it shouldn't. (In neutral sections, with the main breaker off, & when overspeed etc. has cut the power)


Adding these to the [Electric] section of your configuration file should get the voltmeters and ammeters working correctly (I've assumed a linear current draw per power notch, modify to suit):
Code:
ammetervalues=375,750,1125,1500
ammeter=31
powerindicator=53

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Wed Jun 11, 2014 2:22 pm

Oh, I had it there, but it was located at the end of the file as per original os_ats. So it has to be moved. OK, it is quite obvious from the section title... Very Happy
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Wed Jun 11, 2014 6:20 pm

Version 0.211
Changes:

  • Some further fixes in the doors power lock. (Brakes not releasing under certain circumstances)
  • Added more debug messages


Notes:
If the plugin is overriding the driver's input by cutting off power or applying brakes, this will be reflected in the Plugin Message, visible if you press F10 twice.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Wed Jun 11, 2014 7:29 pm

And may I add it is a very good piece of work. Chris has been massive help for me trying to adjust class 163 to this plugin.
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Thu Jun 12, 2014 3:39 pm

So, with with big help by Chris, I managed to get the engine working. Still in tests though. Smile 

Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Thu Jun 12, 2014 11:08 pm

Version 0.213
Changes:

  • Couple of bugs in overspeed function fixed.
  • pantographalarmbehaviour now works.
  • pantographsound has been changed to pantographupsound and pantographdownsound (Requested, error in this post, see below... Smile )
  • Added breakerloopsound for electric traction - A comma separated pair of values, defining the sound index to be played whilst the main breaker is on, and the delay in ms before playback starts.


Cheers

Chris Lees

http://www.bvecornwall.co.uk


Last edited by leezer3 on Fri Jun 13, 2014 2:55 pm; edited 1 time in total

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Fri Jun 13, 2014 2:55 pm

Version 0.214
Changes:

  • Deadman's handle rewritten to hopefully work correctly this time around  Rolling Eyes
  • Paramaters implemented: 


  1. vigilancedelay1 - Time after deadman's warning light lights, but before alarm sounds in ms. (Default 3000)
  2. vigilancedelay2 - Time after alarm sounds before brakes are applied in ms. (Default 3000)


Note, that there was an error in my previous post, the *correct* pantograph sound paramaters are pantographraisedsound & pantographloweredsound

Cheers

Chris Lees

http://www.bvecornwall.co.uk
Attachments
**ALPHA** OS_ATS in C# - Page 3 Attachment
BVEC_ATS.zip You don't have permission to download attachments.(27 Kb) Downloaded 2 times

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Sun Jun 15, 2014 7:12 pm

Dexter, would you happen to have a set of config files for the 163-133-7? I can't seem to get it to co-operate using version 0.214 of BVEC_ATS.dll. The config file is not being generated, and it seems like the new plugin is not being run at all. OpenBVE 1.4.3 on Ubuntu 14.04.

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Sun Jun 15, 2014 8:07 pm

Hello jsiren,

yes, I do have a working set of files for 163 (most of it thanks to Chris), but it has not even been officially released yet, as I am working on the night panel for the loco. I thought it would be better to release it all at once. Smile  The current publicly available 163 works with the old os_ats. Why would you need the the new version? Do you want to test it or something?  Smile 

I am running on Win7 64bit, but since the plugin is written in C#, it should not make any difference...
Also, my openBVE is 1.4.1, as the newer versions have made unwanted some modifications to Cylinders.  Very Happy
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Sun Jun 15, 2014 9:10 pm

Dexter wrote:
Hello jsiren,

yes, I do have a working set of files for 163 (most of it thanks to Chris), but it has not even been officially released yet, as I am working on the night panel for the loco. I thought it would be better to release it all at once. Smile  The current publicly available 163 works with the old os_ats. Why would you need the the new version? Do you want to test it or something?  Smile 

I am running on Win7 64bit, but since the plugin is written in C#, it should not make any difference...
Also, my openBVE is 1.4.1, as the newer versions have made unwanted some modifications to Cylinders.  Very Happy

Linux Wink

In answer to the the question, I haven't tried generating configuration files on a Linux system.
However, if you're using the default Ubuntu folder (/usr/share/game/BVE IIRC) to store all routes & trains then my prime suspect would be a permissions issue, as that folder isn't writable to by the standard user account.
Running OpenBVE with sudo may get the configuration file generation working.

If not, can you post up the contents of /home/[youruser]/.config/OpenBve/Settings/log.txt after trying to load the train?

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Sun Jun 15, 2014 9:26 pm

The content of the log file is thus:
The train plugin BVEC_ATS.dll failed to load for the following reason: No supported configuration files exist.

And I'm running a separate instance of OpenBVE 1.4.3 which is newer than the stock Ubuntu one. No permissions problems should arise.

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Sun Jun 15, 2014 9:34 pm

So, at the moment it thinks it hasn't got a supported configuration file.

Believe it or not, that's actually quite good (OpenBVE has found and successfully loaded the plugin, and it hasn't decided to die outright)  Razz


I think the problem at the moment is probably one of case-sensitivity; Open up the train's folder, and find OS_Ats1.cfg
Try renaming it to OS_ATS1.cfg
Note the capitals Smile

If that works, I'm sure I can figure out a way to deal with that in the plugin code.

Cheers

Chris Lees


http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Sun Jun 15, 2014 9:47 pm

@jsiren: I can send you the current config of the 163, but it will give you errors, as new sounds have been assigned etc. As mentioned before, it is still in development, so no public release has been made yet.

At this point, it looks like the direction taken is the right one. :-)
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Sun Jun 15, 2014 9:58 pm

Did the renaming, no good came of it. Here's the directory now:
Code:
jsiren@here:~/OpenBVE/Train/163-133-7v4$ ls -l
total 480
-rw-rw-r-- 1 jsiren jsiren    12 huhti 30 12:15 Ats.cfg
-rw-rw-r-- 1 jsiren jsiren  90112 kesä  13 14:48 BVEC_ATS.dll
drwx------ 2 jsiren jsiren  4096 helmi  5  2012 CabView
-rw-rw-r-- 1 jsiren jsiren 189274 touko 15  2012 Controls.png
-rw-rw-r-- 1 jsiren jsiren    509 joulu 11  2010 extensions.cfg
drwx------ 3 jsiren jsiren  4096 helmi 22  2012 ext_view
-rw-rw-r-- 1 jsiren jsiren    896 touko 15  2012 OS_ATS1.cfg
-rw-rw-r-- 1 jsiren jsiren 131070 maali 21  2005 OS_Ats1.dll
-rw-rw-r-- 1 jsiren jsiren  15011 helmi  5  2012 Panel2.cfg
drwx------ 2 jsiren jsiren  4096 tammi 20  2012 Sound
-rw-rw-r-- 1 jsiren jsiren  1479 helmi  5  2012 Sound.cfg
-rw-rw-r-- 1 jsiren jsiren  25848 helmi 23  2012 Train.dat
-rw-rw-r-- 1 jsiren jsiren    400 joulu 31  2011 Train.txt

I've tried the same with Ats.cfg named ats.cfg and OS_ATS1.cfg named OS_Ats1.cfg. No effect. The error message remains the same. Errors and warnings are turned on in options.

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Sun Jun 15, 2014 10:21 pm

The case of ats.cfg shouldn't matter, as it's loaded internally by OpenBVE, which is case insensitive internally.

The attached is a slightly modified version of the plugin. There's no functional difference from .214, but it'll produce an error.log file in the train directory containing three lines- The location the plugin thinks it's executing from, whether it's found OS_ATS and whether it's found a configuration file suitable for modification.

Let me know the output of that log and I can figure out exactly where it's failing.

Edit:
Found it- Please rename OS_Ats1.dll to OS_ATS1.dll too and it should now work.
Looking into trying to handle things in a case insensitive manner Smile

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Sun Jun 15, 2014 11:35 pm

Okay, now we're getting somewhere. Changing the case of the dll did the trick. Here's the cfg file BVEC_ATS produced:
Code:
[Diesel]
gearindicator=53
gearchangesound=1,3
gearloopsound=2,1280
gearratios=11.1
[Interlocks]
reverserindex=191
doorpowerlock=1
doorapplybrake=1
customindicators=198,198,61,62,63,64,65,66,71,72,100
[Vigilance]
overspeedcontrol=1
warningspeed=124
overspeed=130
safespeed=118
overspeedindicator=60
overspeedalarm=4
deadmanshandle=1
vigilancelamp=11
vigilancealarm=0
vigilanceinterval=22000
vigilancedelay1=6700
vigilancedelay2=6700
vigilancecancellable=0
vigilanceautorelease=1
[Windscreen]
wiperindex=199
wiperrate=1000
wiperdelay=3000
wiperholdposition=100
drywipesound=17
wipersoundbehaviour=0
dropstartindex=200
numberofdrops=55
dropstartindex=200
dropsound=250,5

and here's the error message it produced:
Code:
The train plugin BVEC_ATS.dll failed to load for the following reason: Error loading the configuration file: Unknown char: ,

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Sun Jun 15, 2014 11:38 pm

...mind you, I can't still raise either pan or close the main breaker, but the loco will still pump the brakes and accelerate four cars at a good clip with kV and kA meters indicating a constant zero... VR Group (our domestic de facto monopoly operator) should have ordered these instead of the Vectrons... Smile

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Sun Jun 15, 2014 11:54 pm

The final (lol) problem is the gearchangesound parameter.
If you delete the ,3 from the end of it, you'll get going Smile
I need to sort out some more descriptive error handling, and try and add something to remove these on upgrade if at all possible.

I *think* all features of this train should work as released, although the pantographs are only dummy at the moment.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Mon Jun 16, 2014 12:04 am

Just had a quick look - if you are testing this with the 163, it should probably not say [diesel] at the start, but [electric].  Smile 

Here's my working config:

Code:
[Electric]
powerindicator=54
breakerindicator=53
breakersound=1
heatingpart=0
ammeter=31
ammetervalues=375,750,1125,1500
pantographindicator_f=71
pantographindicator_r=72
pantographraisedsound=4
pantographloweredsound=5
breakerloopsound=2,500

[Vigilance]
overspeedcontrol=1
warningspeed=124
overspeed=130
safespeed=115
overspeedindicator=60
overspeedalarm=3
deadmanshandle=1
vigilanceinterval=60000
vigilancelamp=11
vigilancealarm=0
vigilanceautorelease=1
vigilancecancellable=1
independentvigilance=1
vigilancedelay1=5000
vigilancedelay2=5000

[Interlocks]
doorpowerlock=1
doorapplybrake=1
neutralrvrbrake=0
reverserindex=191
customindicators=61,62,63,64,65,66,71

[Windscreen]
wiperindex=199
wiperrate=1000
wiperdelay=2000
wiperholdposition=100
drywipesound=17
wetwipesound=18
wipersoundbehaviour=0
dropstartindex=200
numberofdrops=55
dropstartindex=200
dropsound=250,5

[KeyAssignments]
safetykey=S
customindicatorkey1=D
customindicatorkey2=E
frontpantographkey=F
rearpantographkey=G
customindicatorkey1=A1
customindicatorkey2=A2
customindicatorkey3=B1
customindicatorkey4=B2
customindicatorkey5=C1
customindicatorkey6=C2
wiperspeedup=H
wiperspeeddown=I
customindicatorkey9=J
fuelkey=K

@Chris: Yea, the brake compressor occasionally still turns on without the breaker closed / panto raised. This probably needs to be disposed of...?
@jsiren: Please note the config provided will produce errors as you do not have the required sounds in the directory. Or maybe weird sounds will be played, the sound indexes might be assigned to something else in the old setup. Very Happy 
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Mon Jun 16, 2014 12:12 am

Alright, now I gathered a working BVEC_Ats.cfg with .214 and 163-133-7v4 from information posted in this thread. It looks like this:
Code:
[Electric]
pantographindicator_f=71
pantographindicator_r=72
Breakerindicator=30
breakersound=190
powerloopsound=2,1280
ammetervalues=375,750,1125,1500
ammeter=31
powerindicator=53

[Interlocks]
reverserindex=191
doorpowerlock=1
doorapplybrake=1
customindicators= 198,61,62,63,64,65,66,30

[Vigilance]
overspeedcontrol=1
warningspeed=124
overspeed=130
safespeed=118
overspeedindicator=60
deadmanshandle=1
vigilancelamp=11
vigilancealarm=0
vigilanceinterval=22000
vigilancecancellable=0
vigilanceautorelease=1
overspeedalarm=4

[Windscreen]
wiperindex=199
wiperrate=1000
wiperdelay=3000
wiperholdposition=100
drywipesound=17
wipersoundbehaviour=0
dropstartindex=200
numberofdrops=55
dropstartindex=200
dropsound=250,5

[KeyAssignments]
safetykey=S
frontpantographkey=F
rearpantographkey=G
customindicatorkey1=H
customindicatorkey2=A1
customindicatorkey3=A2
customindicatorkey4=B1
customindicatorkey5=B2
customindicatorkey6=C1
customindicatorkey7=C2
customindicatorkey8=D
wiperspeedup=H
wiperspeeddown=I
fuelkey=D


The parameter pantographsound was producing an error, so I deleted it.

Edit: got this up before I saw @Dexter had posted his - thanks!

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by jsiren Mon Jun 16, 2014 12:17 am

...ah, yes. For some reason when BVEC_ATS automatically generates its config, it thinks the 163 is a diesel engine. I have no idea why. Maybe Chris knows better?  Question

jsiren

Posts : 106
Join date : 2012-09-16

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Dexter Mon Jun 16, 2014 12:36 am

Well, I have created the config manually, since I was first trying the new plugin at work and the PC was refusing to allow write access to C:\  Very Happy  I am not sure what's up with the conversion, just use the electric one I've posted above. Smile  If everything goes well enough, I shall be releasing the official 163 sometime soon.

Anyway, it's 1:30 a.m. here, so I am heading to bed. See you guys tomorrow later today. Smile


Last edited by Dexter on Mon Jun 16, 2014 12:37 am; edited 1 time in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by leezer3 Mon Jun 16, 2014 12:36 am

The brake compressor sound is going to be a minor problem, as that's not actually within the plugin's control at the present time.

I *think* the best way to do that is probably to add another section to the configuration file, and trigger these sounds as follows:
Compressor on- Played once when air pressure starts to rise
Compressor loop- Played whilst air pressure is rising.
Compressor off- Played once when air pressure stops rising.

That in and of itself is not particularly difficult, but I haven't had time to investigate the parameters passed on a train with electromagnetic brakes. There may also be the odd visual glitch with the brake needle, but realistically, I'm getting the sim to do things it wasn't necessarily designed to do in the first place!

I'll take a look Monday or Tuesday and see if I can sort something out.
(I've also added a fix to the upgrader code to handle this one, but these fixes are parameter specific, so if any more malformed ones are found, a fix will have to be done manually)

..ah, yes. For some reason when BVEC_ATS automatically generates its config, it thinks the 163 is a diesel engine. I have no idea why. Maybe Chris knows better?  **ALPHA** OS_ATS in C# - Page 3 Icon_question
That's because that's what it's setup as in the original configuration file Razz
The upgrade process doesn't attempt to second-guess the original train (I suppose it could, but that's more trouble than it's worth), but rather takes all supported values and converts it into a format that BVEC_ATS understands.

The engine types are only really an abstract definition of a set of behaviors, such as what sound to play when.
When the 163 was developed, the best way to get the desired effects was to set it up as a diesel train.

Cheers

Chris Lees

http://www.bvecornwall.co.uk

leezer3

Posts : 1957
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

**ALPHA** OS_ATS in C# - Page 3 Empty Re: **ALPHA** OS_ATS in C#

Post by Sponsored content


Sponsored content


Back to top Go down

Page 3 of 6 Previous  1, 2, 3, 4, 5, 6  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum