-
Notifications
You must be signed in to change notification settings - Fork 51
/
TractionPower.h
79 lines (65 loc) · 2.4 KB
/
TractionPower.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
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "Classes.h"
#include "scenenode.h"
#include "Names.h"
class TTractionPowerSource : public scene::basic_node {
friend class debug_panel;
public:
// constructor
TTractionPowerSource( scene::node_data const &Nodedata );
// methods
void Init(double const u, double const i);
bool Load(cParser *parser);
bool Update(double dt);
double CurrentGet(double res);
void VoltageSet(double const v) {
NominalVoltage = v; };
void PowerSet(TTractionPowerSource *ps);
bool Fuse() const {
return ( FastFuse || SlowFuse ); }
// members
TTractionPowerSource *psNode[ 2 ] = { nullptr, nullptr }; // zasilanie na końcach dla sekcji
bool bSection = false; // czy jest sekcją
bool IsAutogenerated { false }; // indicates autogenerated source for individual traction piece
private:
// methods
// serialize() subclass details, sends content of the subclass to provided stream
void serialize_( std::ostream &Output ) const;
// deserialize() subclass details, restores content of the subclass from provided stream
void deserialize_( std::istream &Input );
// export() subclass details, sends basic content of the class in legacy (text) format to provided stream
void export_as_text_( std::ostream &Output ) const;
// members
double NominalVoltage = 0.0;
double VoltageFrequency = 0.0;
double InternalRes = 0.2;
double MaxOutputCurrent = 0.0;
double FastFuseTimeOut = 1.0;
int FastFuseRepetition = 3;
double SlowFuseTimeOut = 60.0;
bool Recuperation = false;
double TotalCurrent = 0.0;
double TotalAdmitance = 1e-10; // 10Mom - jakaś tam upływność
double TotalPreviousAdmitance = 1e-10; // zero jest szkodliwe
double OutputVoltage = 0.0;
bool FastFuse = false;
bool SlowFuse = false;
double FuseTimer = 0.0;
int FuseCounter = 0;
};
// collection of generators for power grid present in the scene
class powergridsource_table : public basic_table<TTractionPowerSource> {
public:
// legacy method, calculates changes in simulation state over specified time
void
update( double const Deltatime );
};
//---------------------------------------------------------------------------