ATCFS
 全て クラス 名前空間 ファイル 関数 変数 型定義 マクロ定義 ページ
Sub.h
[詳解]
1 // Copyright 2018 S520
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met :
6 //
7 // 1. Redistributions of source code must retain the above copyright notice,
8 // this list of conditions and the following disclaimer.
9 // 2. Redistributions in binary form must reproduce the above copyright notice,
10 // this list of conditions and the following disclaimer in the documentation
11 // and / or other materials provided with the distribution.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 // DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17 // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 
24 #ifndef SUB_H_
25 #define SUB_H_
26 #include <boost/array.hpp>
27 
31 class Sub {
32  private:
40 
41  void PlayAtcAirSound(void);
42  void DisplayClock(void);
43  void DisplayAnalogClock(void);
44  void DisplayCurrent(void);
45  void DisplayReverser(void);
46  void ResetSpeedometer(void);
47  void RunSpeedometer(void);
48  void PlaySound(void);
49 
50  public:
51  const float *TrainSpeed;
52  const int *Time;
53  const int *Reverser;
54  const int *atc_brake_notch_;
55  float Current;
57  boost::array<int, 4>current_list_;
62  int lcd_sw_;
66  int light_sw_;
70  boost::array<int, 6>digital_clock_;
71  boost::array<int, 3>analog_clock_;
72  boost::array<int, 28>speedometer_;
73  int adj_loc_;
74 
75  Sub(void);
76  virtual ~Sub(void);
77  void Init(void);
78  void LcdSwDown(void);
79  void LcdSwUp(void);
80  void LightSwDown(void);
81  void LightSwUp(void);
82  void SetAdjLoc(int distance);
83  void Exe(void);
84 };
85 
86 #endif // SUB_H_
void LcdSwUp(void)
LCD切り替えSWが開放された際に実行する関数
Definition: Sub.cpp:67
int adj_loc_
距離表示に加算する補正値[m]
Definition: Sub.h:73
void DisplayCurrent(void)
1桁ごと分割された電流値を出力する関数
Definition: Sub.cpp:135
int next_lcd_sw_down_sound_
1フレーム後のLCD切り替えSWの押下音の状態
Definition: Sub.h:36
virtual ~Sub(void)
Definition: Sub.cpp:31
void ResetSpeedometer(void)
0系/200系用速度計の針の表示を初期化する関数
Definition: Sub.cpp:178
void RunSpeedometer(void)
0系/200系用速度計の針を表示する関数
Definition: Sub.cpp:185
float Current
電流値[A]
Definition: Sub.h:55
void LightSwUp(void)
手元灯SWが開放された際に実行する関数
Definition: Sub.cpp:88
int next_lcd_sw_up_sound_
1フレーム後のLCD切り替えSWの開放音の状態
Definition: Sub.h:37
int light_status_
手元灯の状態(0: 消灯, 1: 点灯)
Definition: Sub.h:67
int light_sw_up_sound_
手元灯SWの開放音の状態
Definition: Sub.h:69
int cv_voltage_
制御電圧
Definition: Sub.h:59
const int * Reverser
レバーサー位置(-1: 後, 0: 中立, 1: 前)
Definition: Sub.h:53
void LcdSwDown(void)
LCD切り替えSWが押下された際に呼び出される関数
Definition: Sub.cpp:56
const int * atc_brake_notch_
ATCブレーキ出力ノッチ
Definition: Sub.h:54
その他機能を再現するクラス
Definition: Sub.h:31
boost::array< int, 6 > digital_clock_
1桁ごと表示するデジタル時計
Definition: Sub.h:70
int next_light_sw_down_sound_
1フレーム後の手元灯SWの押下音の状態
Definition: Sub.h:38
int lcd_sw_down_sound_
LCD切り替えSWの押下音の状態
Definition: Sub.h:64
int current_negative_
電流値[A]の負号
Definition: Sub.h:56
Sub(void)
Definition: Sub.cpp:28
void PlayAtcAirSound(void)
ATCブレーキの緩解音を再生する関数
Definition: Sub.cpp:45
int atc_air_sound_
ATCブレーキの緩解音の状態
Definition: Sub.h:60
void PlaySound(void)
サウンドを再生する関数
Definition: Sub.cpp:198
const float * TrainSpeed
列車速度[km/h]
Definition: Sub.h:51
void DisplayAnalogClock(void)
アナログ時計を表示する関数
Definition: Sub.cpp:123
void SetAdjLoc(int distance)
距離表示に加算する補正値を受け取る関数
Definition: Sub.cpp:99
int prev_brake_status_
1フレーム前のATCブレーキの状態(0: 緩解, 1: 作動)
Definition: Sub.h:34
boost::array< int, 4 > current_list_
1桁ごと表示する電流値[A]
Definition: Sub.h:57
int next_atc_air_sound_
1フレーム後のATCブレーキの緩解音の状態
Definition: Sub.h:35
int lcd_sw_up_sound_
LCD切り替えSWの開放音の状態
Definition: Sub.h:65
int brake_status_
ATCブレーキの状態(0: 緩解, 1: 作動)
Definition: Sub.h:33
void LightSwDown(void)
手元灯SWが押下された際に呼び出される関数
Definition: Sub.cpp:77
void DisplayClock(void)
1桁ごと分割された時刻を出力する関数
Definition: Sub.cpp:108
void Init(void)
Initializeで実行する関数
Definition: Sub.cpp:37
void DisplayReverser(void)
レバーサの位置を表示する関数
Definition: Sub.cpp:161
int reverser_position_
レバーサー位置(0: 中立, 1: 前, 2: 後)
Definition: Sub.h:61
void Exe(void)
Elapseで実行する関数
Definition: Sub.cpp:218
boost::array< int, 28 > speedometer_
10km/h刻みの0系/200系用速度計の針
Definition: Sub.h:72
int light_sw_down_sound_
手元灯SWの押下音の状態
Definition: Sub.h:68
boost::array< int, 3 > analog_clock_
アナログ時計
Definition: Sub.h:71
int lcd_sw_
LCD切り替えSWの状態(0: 開放, 1: 押下)
Definition: Sub.h:62
int ac_voltage_
交流電圧
Definition: Sub.h:58
int lcd_status_
LCDの状態(0: 表示1, 1: 表示2)
Definition: Sub.h:63
const int * Time
ゲーム内時刻[ms]
Definition: Sub.h:52
int next_light_sw_up_sound_
1フレーム後の手元灯SWの開放音の状態
Definition: Sub.h:39
int light_sw_
手元灯SWの状態(0: 開放, 1: 押下)
Definition: Sub.h:66