Skip to content

Commit 1f13fdc

Browse files
author
Stanisław Sobczyk
authored
Add files via upload
1 parent 0086a52 commit 1f13fdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+945
-775
lines changed

Funkcje.cpp

Lines changed: 264 additions & 57 deletions
Large diffs are not rendered by default.

Funkcje.h

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ AnsiString ShowEnd(int);
2929
AnsiString ShowSpeed(int);
3030
bool ShowSpot(int);
3131
int FindSection(int);
32+
void OptimizeSections();
3233
void ChangeSection(bool,int,double,double,int,bool);
3334
double ShowLength() const;
3435
int Size();
@@ -68,7 +69,7 @@ Vehicle(TStringList *pointer=0);
6869
//destructor
6970
~Vehicle();
7071
//copying construcotr
71-
Vehicle(Vehicle *V1);
72+
Vehicle(Vehicle*);
7273
//display
7374
AnsiString ShowName();
7475
AnsiString ShowWheels();
@@ -97,6 +98,7 @@ bool ReadyToGo();// checking wether Vehicle is good to counting
9798
};
9899

99100
class Train:public Vehicle {
101+
protected:
100102
int Locos;
101103
int CarWheels;
102104
int CarLength;
@@ -136,25 +138,40 @@ std::map<std::pair<int,int>,std::pair<int,int> > brakecount(Train*,Route*,Brake*
136138
std::map<int,int> staticprofile(Route*,Train*); //board of maximumspeed for Train with Rute
137139
std::map<int,int> trainride(Train*,Route*,Brake*); //board of speed for Train on Route with Brake and acceleration
138140

139-
class TimeTable {
141+
class TimeTable: public Train {
140142
std::map<std::pair<int,int>,double> Times;
141143
std::map<int,AnsiString> Points;
142144
std::map<int,int> Stops;
143145
std::map<int,std::pair<double,double> > Schedule;
144146
int StartTime;
147+
int LeadingPoint;
145148

146149
public:
147-
TimeTable(std::map<int,int>,Route*);
148-
int CountSection();
149-
void ChangeStartTime(int,int,int=0,bool=0);
150-
AnsiString ConvertTime(int);
150+
TimeTable(std::map<int,int>,Route*,Train&);
151+
//functions neccessary to edit TimeTable:
152+
153+
int CountSection() ;
154+
int StartingTime();
155+
double TrainRide(int) ;
156+
double StopTime(int) ;
157+
void ChangeStartTime(int,int=0,bool=0);
158+
int ChangeSection(TimeTable*,int,AnsiString,int,int);
159+
void RoundTimes();
160+
double ReserveTime(int, TimeTable*);
161+
TStringList *FinalReport(TimeTable*);
162+
//Functions to show data in window
163+
AnsiString ConvertTime(int) ;
151164
AnsiString ShowStart(int);
152-
AnsiString ShowEnd(int);
153-
AnsiString ShowTime(int);
154-
AnsiString ShowStop(int);
155-
AnsiString ShowSchedule(int);
156-
AnsiString ShowNamePoint(int);
157-
165+
AnsiString ShowEnd(int) ;
166+
AnsiString ShowTime(int) ;
167+
AnsiString ShowStop(int) ;
168+
AnsiString ShowSchedule(int) ;
169+
AnsiString ShowNamePoint(int) ;
170+
AnsiString ShowTime1(int) ;
171+
AnsiString ShowTime2(int);
172+
AnsiString ShowStop1(int);
173+
AnsiString ShowStop2(int);
174+
AnsiString ShowPosition(int);
158175

159176
};
160177

Project1.dsk

Lines changed: 30 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
11
[Closed Files]
2-
File_0=SourceModule,'c:\program files (x86)\borland\cbuilder6\include\vcl\Classes.hpp',0,1,1122,1,1133,0,0
3-
File_1=SourceModule,'F:\Kulej\Moje programy\OT\Unit8.cpp',0,1,18,12,22,1,0
4-
File_2=SourceModule,'F:\Kulej\Moje programy\OT\Unit2.cpp',0,1,98,1,101,1,0
5-
File_3=SourceModule,'F:\Kulej\Moje programy\OT\Unit4.cpp',0,1,82,1,93,0,0
6-
File_4=SourceModule,'c:\program files (x86)\borland\cbuilder6\include\stl\_vector.h',0,1,154,1,165,0,0
7-
File_5=SourceModule,'c:\program files (x86)\borland\cbuilder6\include\stl\_tree.h',0,1,173,1,184,0,0
2+
File_0=SourceModule,'c:\program files (x86)\borland\cbuilder6\include\stl\_tree.h',0,1,342,1,357,0,0
3+
File_1=SourceModule,'F:\Kulej\Moje programy\OT\Funkcje.h',0,1,70,21,94,0,0
4+
File_2=SourceModule,'F:\Kulej\Moje programy\OT\Unit7.cpp',0,1,18,1,27,0,1
5+
File_3=SourceModule,'F:\Kulej\Moje programy\OT\Unit3.cpp',0,1,138,74,146,0,0
6+
File_4=SourceModule,'c:\program files (x86)\borland\cbuilder6\include\vcl\Classes.hpp',0,1,1122,1,1133,0,0
7+
File_5=SourceModule,'F:\Kulej\Moje programy\OT\Unit8.cpp',0,1,18,12,22,1,0
8+
File_6=SourceModule,'F:\Kulej\Moje programy\OT\Unit2.cpp',0,1,98,1,101,1,0
9+
File_7=SourceModule,'F:\Kulej\Moje programy\OT\Unit4.cpp',0,1,82,1,93,0,0
810

911
[Modules]
1012
Module0=F:\Kulej\Moje programy\OT\Unit1.cpp
11-
Module1=F:\Kulej\Moje programy\OT\Unit7.cpp
12-
Module2=F:\Kulej\Moje programy\OT\Funkcje.cpp
13-
Module3=F:\Kulej\Moje programy\OT\Funkcje.h
14-
Count=4
13+
Module1=F:\Kulej\Moje programy\OT\Funkcje.cpp
14+
Count=2
1515
EditWindowCount=1
1616

1717
[F:\Kulej\Moje programy\OT\Unit1.cpp]
1818
ModuleType=SourceModule
1919
FormState=1
2020
FormOnTop=0
2121

22-
[F:\Kulej\Moje programy\OT\Unit7.cpp]
23-
ModuleType=SourceModule
24-
FormState=1
25-
FormOnTop=0
26-
2722
[F:\Kulej\Moje programy\OT\Funkcje.cpp]
2823
ModuleType=SourceModule
2924
FormState=0
3025
FormOnTop=0
3126

32-
[F:\Kulej\Moje programy\OT\Funkcje.h]
33-
ModuleType=SourceModule
34-
FormState=0
35-
FormOnTop=0
36-
3727
[C:\Windows\system32\ProjectGroup1.bpg]
3828
FormState=0
3929
FormOnTop=0
@@ -43,56 +33,40 @@ FormState=0
4333
FormOnTop=0
4434

4535
[EditWindow0]
46-
ViewCount=4
47-
CurrentView=1
36+
ViewCount=2
37+
CurrentView=0
4838
View0=0
4939
View1=1
50-
View2=2
51-
View3=3
5240
MessageView=MessageView@EditWindow0
5341
Create=1
5442
Visible=1
5543
State=0
56-
Left=177
57-
Top=191
44+
Left=278
45+
Top=150
5846
Width=928
5947
Height=609
60-
MaxLeft=-8
61-
MaxTop=148
48+
MaxLeft=-1
49+
MaxTop=-1
6250
ClientWidth=912
6351
ClientHeight=570
6452
LeftPanelSize=0
6553
RightPanelSize=0
6654
BottomPanelSize=0
6755
BottomPanelClients=MessageView@EditWindow0
68-
BottomPanelData=00000400010000000B0000004D65737361676556696577000000000000000000000000000000000001000000000000000000000000FFFFFFFF
56+
BottomPanelData=00000400010000000B0000004D6573736167655669657700000000000000000000000000000000000100000000000000000B0000004D65737361676556696577FFFFFFFF
6957

7058
[View0]
71-
Module=F:\Kulej\Moje programy\OT\Unit7.cpp
72-
CursorX=1
73-
CursorY=27
74-
TopLine=18
75-
LeftCol=1
76-
77-
[View1]
7859
Module=F:\Kulej\Moje programy\OT\Unit1.cpp
79-
CursorX=1
80-
CursorY=352
81-
TopLine=349
60+
CursorX=41
61+
CursorY=137
62+
TopLine=126
8263
LeftCol=1
8364

84-
[View2]
65+
[View1]
8566
Module=F:\Kulej\Moje programy\OT\Funkcje.cpp
86-
CursorX=35
87-
CursorY=1693
88-
TopLine=1677
89-
LeftCol=1
90-
91-
[View3]
92-
Module=F:\Kulej\Moje programy\OT\Funkcje.h
93-
CursorX=21
94-
CursorY=148
95-
TopLine=137
67+
CursorX=1
68+
CursorY=197
69+
TopLine=182
9670
LeftCol=1
9771

9872
[Watches]
@@ -108,8 +82,8 @@ Count=0
10882
Create=1
10983
Visible=1
11084
State=0
111-
Left=27
112-
Top=280
85+
Left=16
86+
Top=199
11387
Width=1345
11488
Height=151
11589
MaxLeft=-1
@@ -159,7 +133,7 @@ MaxTop=-1
159133
ClientWidth=517
160134
ClientHeight=314
161135
DumpPane=79
162-
DisassemblyPane=297
136+
DisassemblyPane=55
163137
RegisterPane=231
164138
FlagPane=64
165139

@@ -193,7 +167,7 @@ LRDockWidth=190
193167
Dockable=1
194168
SplitPos=85
195169
ArrangeBy=Name
196-
SelectedItem=Text
170+
SelectedItem=Caption
197171
ExpandedItems=HorzScrollBar
198172
HiddenCategories=
199173

@@ -219,11 +193,11 @@ Visible=0
219193
State=0
220194
Left=12
221195
Top=0
222-
Width=1354
196+
Width=900
223197
Height=85
224198
MaxLeft=-1
225199
MaxTop=-1
226-
ClientWidth=1354
200+
ClientWidth=900
227201
ClientHeight=85
228202
TBDockHeight=85
229203
LRDockWidth=443

Project1.exe

46 KB
Binary file not shown.

Project1.obj

0 Bytes
Binary file not shown.

Project1.tds

1.5 MB
Binary file not shown.

Project1.~cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ USEFORM("Unit5.cpp", Form5);
1212
USEFORM("Unit6.cpp", Form6);
1313
USEFORM("Unit7.cpp", Form7);
1414
USEFORM("Unit8.cpp", Form8);
15+
USEFORM("Unit9.cpp", Form9);
1516
//---------------------------------------------------------------------------
1617
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
1718
{
@@ -27,6 +28,7 @@ WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
2728
Application->CreateForm(__classid(TForm6), &Form6);
2829
Application->CreateForm(__classid(TForm7), &Form7);
2930
Application->CreateForm(__classid(TForm8), &Form8);
31+
Application->CreateForm(__classid(TForm9), &Form9);
3032
Application->Run();
3133
}
3234
catch (Exception &exception)

0 commit comments

Comments
 (0)