Panel.cfg

From BVEStation Wiki
Revision as of 20:25, 6 February 2015 by Kevin (Talk | contribs) (Created page with "The panel.cfg file allows to create 2D panels by defining which elements to use, like speedometers, pressure gauges etc., and where they are to be placed. ==Overview== The p...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The panel.cfg file allows to create 2D panels by defining which elements to use, like speedometers, pressure gauges etc., and where they are to be placed.

Overview

The panel.cfg file is a plain text file encoded in any arbitrary encoding, however, UTF-8 with a byte order mark is the preferred choice. The parsing model for numbers is Loose, however, you are encouraged to produce Strict output nonetheless. The file is required to be located inside the train folder and is expected to be named panel.cfg. The file is interpreted on a per-line basis, from top to bottom.

The panel.cfg has been superseded by the panel2.cfg. You can achieve the full functionality of the panel.cfg and more by using the panel2.cfg instead. If both files are present in the train folder, the panel2.cfg has precedence over the panel.cfg.

The cab is rendered as an overlay. This means that the cab will always appear in front of scenery objects. This is intentional, because this way, rain, walls and other obstructing objects cannot be accidentally rendered inside the cab. Furthermore, lighting in the cab is different than in the scenery. While the ambient brightness is reflected in the cab, the ambient color is not, and the cab always appears as if reflecting white light.

Syntax

Each line in the file can be empty (or solely consist of white spaces) and will be ignored, can mark the beginning of a new section or contain key-value pairs inside a section. All key-value pairs relate to the last section opened.

A new section is opened by starting the line with an opening bracket (U+005B) and ending it with a closing bracket (U+005D). The text in-between the brackets indicates the name of the section and is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as at the beginning and the end of the name of the section. Thus, the beginning of the section has the following form:

[NameOfTheSection]

[NameOfTheSection]

A key-value pair is indicated by giving the key, an equals sign (U+003D) and then the value. The key is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as in front and after the equals sign. Alternatively, white spaces surrounding the key and the value are ignored. Thus, a key-value pair as the following form:

[NameOfTheKey]

NameOfTheKey = Value

Some values are further split into multiple parts, separated by commas (U+002C). Instead of a comma, a colon (U+003A) can be used interchangeably.

You can use comments anywhere at the end of a line. A comment is started by a semicolon (U+003B). Comments, if present, are stripped away from all lines before these are processed.

The Panel Section

[View]

The View section defines the viewing angle conditions. Only one View section is expected in a panel.cfg file.

[View]

This starts the section

Yaw

Yaw = ValueInDegrees

ValueInDegrees: A floating-point number measured in degrees indicating the yaw. Positive values represent right, negative ones left. The default value is 0.

Pitch

Pitch = ValueInDegrees

ValueInDegrees: A floating-point number measured in degrees indicating the pitch. Positive values represent up, negative ones down. The default value is 0.

Defines the pitch of the view. Any value entered will be additionally subtract by 11 degrees, resulting in a slight downward pitch if ValueInDegrees is 0. If this key-value pair is not used, the final viewing angle will be -11 degrees.

The PressureIndicator Section

This section creates a pressure indicator. You can use as many of these sections as required.

[PressureIndicator]

[PressureIndicator]
  • The following spelling variations can be used: PressureIndicator, PressureGauge, PressureMeter, 圧力計

Type

This starts the section.

Type = Value

Value: The type of pressure indicator to use. The default value is 0.

Options for Value: 0: The pressure indicator is a gauge. 1: The pressure indicator is an LED.


File:Illustration pressuregauge.png File:Illustration pressuregauge led.png


This defines the type of the pressure indicator. While both the gauge type and the LED type indicators can show two different pressures, this is not generally useful for the LED type as the upper LED shape will block the view into the lower LED shape.

  • The following spelling variations can be used: Type, 形態

LowerNeedle

LowerNeedle = Subject, RedValue, GreenValue, BlueValue

Subject: The kind of pressure to indicate.

RedValue: The red component of the color. Measured from 0 (black) to 255 (red). The default value is 0.

GreenValue: The green component of the color. Measured from 0 (black) to 255 (green). The default value is 0.

BlueValue: The blue component of the color. Measured from 0 (black) to 255 (blue). The default value is 0.

  • Options for Subject

0: Does not show the lower needle.

1 or BC or ブレーキシリンダ: Indicates the pressure of the brake cylinder.

2 or BP or ブレーキ管 or 制動管: Indicates the pressure of the brake pipe.

3 or ER or 釣り合い空気溜め or 釣り合い空気ダメ or つりあい空気溜め or ツリアイ空気ダメ: Indicates the pressure of the equalizing reservoir.

4 or MR or 元空気溜め or 元空気ダメ: Indicates the pressure of the main reservoir.

5 or SAP or 直通管: Indicates the pressure of the straight air pipe.

Creates the lower needle for a gauge-type pressure indicator, or defines the color of the lower shape for an LED-type indicator.

  • The following spelling variations can be used:

LowerNeedle, LowerHand, 下針

UpperNeedle

UpperNeedle = Subject, RedValue, GreenValue, BlueValue

Subject: The kind of pressure to indicate.

RedValue: The red component of the color. Measured from 0 (black) to 255 (red). The default value is 0.

GreenValue: The green component of the color. Measured from 0 (black) to 255 (green). The default value is 0.

BlueValue: The blue component of the color. Measured from 0 (black) to 255 (blue). The default value is 0.

  • Options for Subject

0: Does not show the upper needle.

1 or BC or ブレーキシリンダ: Indicates the pressure of the brake cylinder.

2 or BP or ブレーキ管 or 制動管: Indicates the pressure of the brake pipe.

3 or ER or 釣り合い空気溜め or 釣り合い空気ダメ or つりあい空気溜め or ツリアイ空気ダメ: Indicates the pressure of the equalizing reservoir.

4 or MR or 元空気溜め or 元空気ダメ: Indicates the pressure of the main reservoir.

5 or SAP or 直通管: Indicates the pressure of the straight air pipe.

Creates the upper needle for a gauge-type pressure indicator, or defines the color of the lower shape for an LED-type indicator.

  • The following spelling variations can be used: UpperNeedle, UpperHand, 上針

Center

Center = X, Y

X: The X-coordinate in the panel image at which the center of the pressure indicator is placed in pixels. The default value is 0.

Y: The Y-coordinate in the panel image at which the center of the pressure indicator is placed in pixels. The default value is 0.

  • The following spelling variations can be used: Center, 中心

Radius

Radius = ValueInPixels

ValueInPixels: The radius of the pressure indicator in pixels. The default value is 16.

For gauge-type indicators, defines the radius of the pressure gauge needle in pixels. For LED-type indicators, defines half the edge length of the LED-square in pixels. The radius is measured in pixels of the panel image.

  • The following spelling variations can be used: Radius, 半径

Background

Background = Filename

FileName: The background image to use, relative to the train folder.

Creates a background for the pressure indicator. The background is shown below the needles or the LED-square. Pure blue in the image (red=0, green=0, blue=255) represents transparent pixels.

  • The following spelling variations can be used: Background, 背景

Cover

Cover = Filename

FileName: The cover image to use, relative to the train folder.

Creates a cover for the pressure indicator. The cover is shown on top of the needles or the LED-square. Pure blue in the image (red=0, green=0, blue=255) represents transparent pixels.

  • The following spelling variations can be used:

Cover, ふた

Unit

Unit = Value

Value: The type of unit to use for the Minimum and Maximum settings. The default value is 0.

  • Options for Value:

0 or kpa: The unit is kilo-pascal (1000 Pa).

1 or kgf/cm2 or kgf/cm^2 or kg/cm2 or kg/cm^2: The unit is kilogram-force per centimeter squared (98066.5 Pa).

  • The following spelling variations can be used:

Unit, 単位

Minimum

Minimum = PressureValue

PressureValue: The minimum pressure corresponding to Angle. The unit is defined via Unit.

Defines the minimum pressure corresponding to the Angle measured clockwise from the 6 o'clock position. The default value is 0.

  • The following spelling variations can be used: Minimum, 最小

Maximum

Maximum = Pressurevalue

PressureValue: The maximum pressure corresponding to Angle. The unit is defined via Unit.

Defines the maximum pressure corresponding to the Angle measured counter-clockwise from the 6 o'clock position. The default value is 1000.

  • The following spelling variations can be used: Maximum, 最大

Angle

Angle = ValueInDegrees

ValueInDegrees: The angle corresponding to the Minimum and Maximum pressures in degrees.

Defines the angle, measured clockwise from the 6 o'clock position, corresponding to the Minimum pressure, and also the angle, measured counter-clockwise from the 6 o'clock position, corresponding to the Maximum pressure. The default value is 45.

  • The following spelling variations can be used: Angle, 角度

To Be Finished Later

This article will be finished later.