-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITRANS.PAS
332 lines (308 loc) · 10.4 KB
/
ITRANS.PAS
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
(***********************************************************************)
(* *)
(* Inventaire Transmission *)
(* *)
(***********************************************************************)
Unit ITrans;
{$V-}
(***********************************************************************)
Interface
(***********************************************************************)
Uses Drivers,EcrMono,IVisuel,IClavier,IChaine;
Type TransmissionType = Record
Ass : Byte;
APrix : Word;
ACent : Byte;
Automat : Byte;
Manuel : Byte;
Traction : Byte;
Detail : String[31];
XxX : Byte;
Turbo : Byte;
Actif : Array[0..2] of Byte;
Prix : Array[0..2] of Word;
Cent : Array[0..2] of Byte;
Code : Array[0..2] of String[7];
Loc : Array[0..2] of String[7];
Clush : Byte;
FlyWheel : Byte;
Modele : String[21];
End;
Procedure AffichePieceTransmission(X,Y,Couleur:Byte);
Procedure FixeTransmission(Var Trans:TransmissionType;Var Escape:Boolean);
(***********************************************************************)
Implementation
(***********************************************************************)
Procedure AffichePieceTransmission(X,Y,Couleur:Byte);
Begin
EcritSpecial(X,Y,#3+Chr(Couleur)+
'Pressure piate'+#1+
'Fly wheel'+#1+
'Transfer case');
End;
(***********************************************************************)
{
012345678901234567890123456789012345
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»0
º º1
º Transmission complŠte º2
º º3
º Automatique º4
º Propultion arriŠre º5
º 2x4 º6
º Turbo º7
º Detail : _____________________ º8
º Prix : _____.__ º9
º Localise : _______ º10
º Code hollander : _______ º11
º º12
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ13
}
Procedure TransAssemble(Var Trans:TransmissionType;Var Escape:Byte);
Label 10,20,30,40,50,60,70,80,90;
Const X = 2;
Y = 4;
Ligne = 24;
Auto : Array[0..5] of String[16] = ('Automatique Nor.',
'Auto. Over Drive',
'Manuel 3 vitesse',
'Manuel 4 vitesse',
'Manuel 5 vitesse',
'Manuel 6 vitesse');
Depl : Array[0..1] of String[18] = ('Traction avant ',
'Propultion arriŠre');
YxY : Array[0..1] of String[3] = ('2x4','4x4');
TTur : Array[0..1] of String[11] = ('Automatique',
'Turbo ');
Var Touche : Word;
Begin
With Trans do
Begin
{ Initialise ‚cran }
FixeCurseurFermer;
FixeFormatDouble;
FixeCadrePlain(X,Y,X+35,Y+13,15);
Ecrit(X+7,Y+2,'Transmission complŠte',15);
EcritSpecial(X+3,Y+4,#28'Automatique Nor.'#1'Traction avant'#1'2x4'#1+
'Automatique'#1'D‚tail :'#1'Prix :'#1'Localise :'#1'Code hollander :');
BarDeplacement;
10:Repeat
Ecrit(X+3,Y+4,Auto[Automat],15);
FixeUnCaractere(X+2,Y+4,16);
Touche := LitClavier;
FixeUnCaractere(X+2,Y+4,32);
Case Touche of
kbESC : Exit;
kbIns : Max(Automat,5);
kbDown : Goto 20;
kbUp : Goto 80;
End;
Until (Touche = kbEnter);
20:Repeat
FixeUnCaractere(X+2,Y+5,16);
Ecrit(X+3,Y+5,Depl[Traction],15);
Touche := LitClavier;
FixeUnCaractere(X+2,Y+5,32);
Case Touche of
kbESC : Exit;
kbIns : Max(Traction,1);
kbUp : Goto 10;
kbDown : Goto 30;
End;
Until (Touche = kbEnter);
30:Repeat
FixeUnCaractere(X+2,Y+6,16);
Ecrit(X+3,Y+6,YxY[XxX],15);
Touche := LitClavier;
FixeUnCaractere(X+2,Y+6,32);
Case Touche of
kbESC : Exit;
kbIns : Max(XxX,1);
kbUp : Goto 20;
kbDown : Goto 40;
End;
Until (Touche = kbEnter);
40:Repeat
FixeUnCaractere(X+2,Y+7,16);
Ecrit(X+3,Y+7,TTur[Turbo],15);
Touche := LitClavier;
FixeUnCaractere(X+2,Y+7,32);
Case Touche of
kbESC : Exit;
kbIns : Max(Turbo,1);
kbUp : Goto 30;
kbDown : Goto 50;
End;
Until (Touche = kbEnter);
50:FixeUnCaractere(X+2,Y+8,16);
FixeLocaliseUD(X+12,Y+8,21,Detail,Escape);
FixeUnCaractere(X+2,Y+8,32);
Case Escape of
1 : Exit;
2 : Goto 40;
End;
60:FixeUnCaractere(X+2,Y+9,16);
FixeDollarUD(X+10,Y+9,8,APrix,ACent,Escape);
FixeUnCaractere(X+2,Y+9,32);
Case Escape of
1 : Exit;
2 : Goto 50;
End;
70:FixeUnCaractere(X+2,Y+10,16);
FixeLocaliseUD(X+14,Y+10,7,Loc[0],Escape);
FixeUnCaractere(X+2,Y+10,32);
Case Escape of
1 : Exit;
2 : Goto 60;
End;
80:FixeUnCaractere(X+2,Y+11,16);
FixeLocaliseUD(X+20,Y+11,7,Code[0],Escape);
FixeUnCaractere(X+2,Y+11,32);
Case Escape of
1 : Exit;
2 : Goto 70;
3 : Goto 10;
End;
90:
End;
End;
{ 1 2 3 4 5 6 7
01234567890123456789012345678901234567890123456789012345678901234567890123456
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍ»0
º PiŠce ³ Prix ³ Description ³ Localise ³ Code hol. º1
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄĶ2
º Pressure piate ³ xxxxx.xx ³ ³ ³ º3
º Fly wheel ³ xxxxx.xx ³ ³ ³ º4
º Transfer case ³ xxxxx.xx ³ ³ ³ º5
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍͼ6}
Procedure TransDesassemble(Var Trans:TransmissionType;Var Escape:Byte);
Const X = 2;
Y = 4;
Hauteur = 2;
NomBar = 3;
Position : Byte = 0;
XPos : Byte = 0;
Serie : Array[0..NomBar,0..2] of Byte = ((X+17,Y,Y+4+Hauteur),
(X+28,Y,Y+4+Hauteur),
(X+53,Y,Y+4+Hauteur),
(X+64,Y,Y+4+Hauteur));
TabBar : Array[0..NomBar+1,0..2] of Byte = ((X+1,Y+3,X+16),
(X+18,Y+3,X+27),
(X+29,Y+3,X+52),
(X+54,Y+3,X+63),
(X+65,Y+3,X+75));
Var Touche : Word;
Ancien : Word;
Compteur : Byte;
kbAncien : Word Absolute $0040:$1A;
Procedure TClush;
Const Choix : Array[0..1] of String[6] = ('Normal','Clush ');
Begin
Max(Trans.Clush,1);
Ecrit(X+30,Y+3,Choix[Trans.Clush],15);
End;
Procedure TFlyWheel;
Const Choix : Array[0..2] of String[11] = ('Non ',
'Automatique',
'Manuel ');
Begin
Max(Trans.FlyWheel,2);
Ecrit(X+30,Y+4,Choix[Trans.FlyWheel],15);
End;
Procedure TModele;
Var Escape : Byte;
Begin
FixeLocalise(X+30,Y+5,21,Trans.Modele,Escape);
End;
Begin
With Trans do
Begin
For Compteur := 0 to 2 do
Begin
If(Actif[Compteur] > 2)and
(Cent[Compteur] > 100)and
(Length(Code[Compteur]) > 7)and
(Length(Loc[Compteur]) > 7)Then
Begin
Actif[Compteur] := 0;
Prix[Compteur] := 0;
Cent[Compteur] := 0;
FillChar(Code[Compteur],SizeOf(Code[Compteur]),0);
FillChar(Loc[Compteur],SizeOf(Loc[Compteur]),0);
End;
End;
Escape := 0;
BaseVisuel(X,Y,X+76,Y+6,NomBar+1,Serie,X+19,X+55,X+66);
FixeFormatBar(NomBar+2,TabBar);
Ecrit(X+30,Y+1,'Description',14);
AffichePieceTransmission(X+2,Y+3,7);
For Compteur := 0 to 2 do
Begin
If(Prix[Compteur] > 0)and(Cent[Compteur] > 0)Then
Begin
Ecrit(X+19,Y+3+Compteur,Strg(Prix[Compteur])+','+
Strg(Cent[Compteur])+'$',7+Actif[Compteur]*8);
End
else
If(Prix[Compteur] > 0)Then
Begin
Ecrit(X+19,Y+3+Compteur,Strg(Prix[Compteur])+'$',Actif[Compteur]*8);
End;
Ecrit(X+55,Y+3+Compteur,Loc[Compteur],7+Actif[Compteur]*8);
Ecrit(X+66,Y+3+Compteur,Code[Compteur],7+Actif[Compteur]*8);
AfficheBar(Compteur,7+Actif[Compteur]*8);
End;
Repeat
Ancien := kbAncien;
Touche := AfficheBarTouche(Position,XPos,$F0,Actif[Position]*8+7);
ToucheTab(2,4,Touche,Position,XPos,Actif[Position]);
Case Touche of
kbIns : Begin
Case XPos of
0 : Max(Actif[Position],1);
1 : FixeDollar(X+19,Y+3+Position,8,Prix[Position],Cent[Position],Escape);
2 : Case Position of
0 : TClush;
1 : TFlyWheel;
2 : TModele;
End;
3 : FixeLocalise(X+55,Y+3+Position,7,Loc[Position],Escape);
4 : FixeLocalise(X+66,Y+3+Position,7,Code[Position],Escape);
End;
If(Position > 0)Then Actif[Position] := 1;
BarSelecteHori(X+1,Y+3+Position,X+75,Actif[Position]*8+7);
End;
End;
Until (Touche = kbEnter)or(Touche = kbESC);
If(Touche = kbESC)Then Escape := 1;
End;
End;
{ 0123456789012345678901234567890123456
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»0
º º1
º Transmission complŠte (O/N) ? _ º2
º º3
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ4 }
Function DemandeAssemble:Byte;
Const X = 0;
Y = 1;
Begin
FixeFormatDouble;
FixeCadrePlain(X,Y,X+36,Y+4,15);
Ecrit_OuiNon(X+3,Y+2,'Transmission complŠte (O/N) ?');
DemandeAssemble := RepOuiNon(X+33,Y+2);
End;
Procedure FixeTransmission(Var Trans:TransmissionType;Var Escape:Boolean);
Var Reponse : Byte;
Begin
Escape := False;
Reponse := DemandeAssemble;
Trans.Ass := Reponse + 1;
Case Reponse of
0 : TransDesassemble(Trans,Reponse);
1 : TransAssemble(Trans,Reponse);
End;
If(Reponse > 0)Then Escape := True;
End;
BEGIN
END.