forked from s520/ATCFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
atsplugin.h
144 lines (115 loc) · 4.06 KB
/
atsplugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef ATSPLUGIN_H_
#define ATSPLUGIN_H_
//=============================
// BVE ATS Plug-in Header File
//
// Rock_On, mackoy
//=============================
#ifdef ATS_EXPORTS
#define ATS_API __declspec(dllexport)
#else
#define ATS_API __declspec(dllimport)
#endif
// ATS Plug-in Version
#define ATS_VERSION 0x00020000
// ATS Keys
#define ATS_KEY_S 0 // S Key
#define ATS_KEY_A1 1 // A1 Key
#define ATS_KEY_A2 2 // A2 Key
#define ATS_KEY_B1 3 // B1 Key
#define ATS_KEY_B2 4 // B2 Key
#define ATS_KEY_C1 5 // C1 Key
#define ATS_KEY_C2 6 // C2 Key
#define ATS_KEY_D 7 // D Key
#define ATS_KEY_E 8 // R Key
#define ATS_KEY_F 9 // F Key
#define ATS_KEY_G 10 // G Key
#define ATS_KEY_H 11 // H Key
#define ATS_KEY_I 12 // I Key
#define ATS_KEY_J 13 // J Key
#define ATS_KEY_K 14 // K Key
#define ATS_KEY_L 15 // L Key
// Initial Position of Handle
#define ATS_INIT_REMOVED 2 // Handle Removed
#define ATS_INIT_EMG 1 // Emergency Brake
#define ATS_INIT_SVC 0 // Service Brake
// Sound Control Instruction
#define ATS_SOUND_STOP -10000 // Stop
#define ATS_SOUND_PLAY 1 // Play Once
#define ATS_SOUND_PLAYLOOPING 0 // Play Repeatedly
#define ATS_SOUND_CONTINUE 2 // Continue
// Type of Horn
#define ATS_HORN_PRIMARY 0 // Horn 1
#define ATS_HORN_SECONDARY 1 // Horn 2
#define ATS_HORN_MUSIC 2 // Music Horn
// Constant Speed Control Instruction
#define ATS_CONSTANTSPEED_CONTINUE 0 // Continue
#define ATS_CONSTANTSPEED_ENABLE 1 // Enable
#define ATS_CONSTANTSPEED_DISABLE 2 // Disable
// Vehicle Specification
struct ATS_VEHICLESPEC {
int BrakeNotches; // Number of Brake Notches
int PowerNotches; // Number of Power Notches
int AtsNotch; // ATS Cancel Notch
int B67Notch; // 80% Brake (67 degree)
int Cars; // Number of Cars
};
// State Quantity of Vehicle
struct ATS_VEHICLESTATE {
double Location; // Train Position (Z-axis) (m)
float Speed; // Train Speed (km/h)
int Time; // Time (ms)
float BcPressure; // Pressure of Brake Cylinder (Pa)
float MrPressure; // Pressure of MR (Pa)
float ErPressure; // Pressure of ER (Pa)
float BpPressure; // Pressure of BP (Pa)
float SapPressure; // Pressure of SAP (Pa)
float Current; // Current (A)
};
// Received Data from Beacon
struct ATS_BEACONDATA {
int Type; // Type of Beacon
int Signal; // Signal of Connected Section
float Distance; // Distance to Connected Section (m)
int Optional; // Optional Data
};
// Train Operation Instruction
struct ATS_HANDLES {
int Brake; // Brake Notch
int Power; // Power Notch
int Reverser; // Reverser Position
int ConstantSpeed; // Constant Speed Control
};
// Called when this plug-in is loaded
ATS_API void WINAPI Load(void);
// Called when this plug-in is unloaded
ATS_API void WINAPI Dispose(void);
// Returns the version numbers of ATS plug-in
ATS_API int WINAPI GetPluginVersion(void);
// Called when the train is loaded
ATS_API void WINAPI SetVehicleSpec(ATS_VEHICLESPEC);
// Called when the game is started
ATS_API void WINAPI BVE_Initialize(int);
// Called every frame
ATS_API ATS_HANDLES WINAPI Elapse(ATS_VEHICLESTATE, int *, int *);
// Called when the power is changed
ATS_API void WINAPI SetPower(int);
// Called when the brake is changed
ATS_API void WINAPI SetBrake(int);
// Called when the reverser is changed
ATS_API void WINAPI SetReverser(int);
// Called when any ATS key is pressed
ATS_API void WINAPI KeyDown(int);
// Called when any ATS key is released
ATS_API void WINAPI KeyUp(int);
// Called when the horn is used
ATS_API void WINAPI HornBlow(int);
// Called when the door is opened
ATS_API void WINAPI DoorOpen(void);
// Called when the door is closed
ATS_API void WINAPI DoorClose(void);
// Called when current signal is changed
ATS_API void WINAPI SetSignal(int);
// Called when the beacon data is received
ATS_API void WINAPI SetBeaconData(ATS_BEACONDATA);
#endif // ATSPLUGIN_H_