Skip to content

Commit

Permalink
Train: show if names of drivers in INFO vlak.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Jan 21, 2023
1 parent 7964b99 commit 7ee4087
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/trains/Train.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1406,11 +1406,10 @@ function TTrain.Menu(SenderPnl: TIdContext; SenderOR: TObject; SenderTrack: TBlk
train_count := Blocks.GetBlkWithTrain(Self).Count;

if (track.CanStandTrain()) then
Result := Result + 'EDIT vlak,'
else
Result := Result + 'INFO vlak,';
Result := Result + 'EDIT vlak,';
if (Self.speed > 0) then
Result := Result + '!STOP vlak,';
Result := Result + 'INFO vlak,';
if ((track.CanStandTrain()) or (train_count <= 1)) then
Result := Result + '!ZRUŠ vlak,';
if (train_count > 1) then
Expand Down Expand Up @@ -1513,8 +1512,31 @@ function TTrain.InfoWindowItems(): TList<TConfSeqItem>;
Result.Add(CSCondition('Poznámka: '+ Self.data.note));

for var i: Integer := 0 to Self.HVs.Count-1 do
begin
if (HVDb[Self.HVs[i]] <> nil) then
Result.Add(CSCondition('HV '+IntToStr(i+1)+': '+ HVDb[Self.HVs[i]].NiceName()));
begin
var hv := HVDb[Self.HVs[i]];

var comment: string := '';
if (hv.ruc) then
comment := 'Ruční řízení jízdy i funkcí'
else if (hv.state.regulators.Count > 0) then
comment := 'Ruční ovládání funkcí, jízdu řídí hJOP'
else
comment := 'Jízdu i funkce řídí hJOP';

Result.Add(CSCondition('HV '+IntToStr(i+1)+': '+ hv.NiceName() + ' # ' + comment));

for var regulator in hv.state.regulators do
begin
var user := TPanelConnData(regulator.conn.Data).regulator_user;
if (hv.ruc) then
Result.Add(CSCondition(' Ruční řízení jízdy - '+user.fullName))
else
Result.Add(CSCondition(' Ovládání funkcí - '+user.fullName));
end;
end;
end;

except
Result.Free();
Expand Down

0 comments on commit 7ee4087

Please sign in to comment.