Skip to content

Commit

Permalink
Show more details about the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rs22 committed Jan 2, 2024
1 parent 5c8f334 commit 4545d64
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"./src/Point/rasta-point-web",
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
}
2 changes: 1 addition & 1 deletion src/Point/Point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Point(ILogger<Point> logger, IConfiguration configuration, IPointToInterl
Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>(h => PropertyChanged += h, h => PropertyChanged -= h)
.Select(x => Unit.Default)
.Merge(Observable.Interval(TimeSpan.FromSeconds(1)).Select(x => Unit.Default))
.Subscribe(x => statusHub.Clients.All.SendAsync("ReceiveStatus", _initialized, PointState, SimulatedPointState, new { AllPointMachinesCrucial, ObserveAbilityToMove, _config.ConnectionProtocol }));
.Subscribe(x => statusHub.Clients.All.SendAsync("ReceiveStatus", _initialized, PointState, SimulatedPointState, _config));
}

public async Task SendSciMessage(SciMessage message)
Expand Down
10 changes: 9 additions & 1 deletion src/Point/rasta-point-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ export type SimulatedPointState = {
};

export type SimulatorConfiguration = {
observeAbilityToMove: boolean,
localId: string,
localRastaId: number,
remoteId: string,
simulatedTransitioningTimeSeconds: number,
allPointMachinesCrucial: boolean,
observeAbilityToMove: boolean,
initialLastCommandedPointPosition: string,
initialPointPosition: string,
initialDegradedPointPosition: string,
initialAbilityToMove: string,
connectionProtocol: 'EulynxBaseline4R1' | 'EulynxBaseline4R2',
};

Expand Down
33 changes: 30 additions & 3 deletions src/Point/rasta-point-web/src/Point.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,36 @@ function Point({

<div className="col-span-full sm:col-span-6 xl:col-span-3 bg-white dark:bg-slate-800 shadow-lg rounded-sm border border-slate-200 dark:border-slate-700 p-4">
<h2 className="text-l font-semibold text-slate-800 dark:text-slate-100">Simulator Configuration</h2>
<div className="m-3 text-sm inline-flex font-medium bg-slate-100 dark:bg-slate-300 text-slate-600 dark:text-slate-600 rounded-full text-center px-2.5 py-1">{simulatorConfiguration?.connectionProtocol ?? 'Loading...'}</div>
<Toggle label="Observe Ability to Move" active={simulatorConfiguration?.observeAbilityToMove || false} disabled />
<Toggle label="All Point Machines Crucial" active={simulatorConfiguration?.allPointMachinesCrucial || false} disabled />
<div className="py-3">
<div className="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase">
Connection Protocol
</div>
<div className="m-3 text-sm inline-flex font-medium bg-slate-100 dark:bg-slate-300 text-slate-600 dark:text-slate-600 rounded-full text-center px-2.5 py-1">
{simulatorConfiguration?.connectionProtocol ?? 'Loading...'}
</div>
<div className="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase">
Point technical identifier
</div>
<div className="m-3 text-sm inline-flex font-medium bg-slate-100 dark:bg-slate-300 text-slate-600 dark:text-slate-600 rounded-full text-center px-2.5 py-1">
{simulatorConfiguration?.localId}
</div>
<div className="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase">
Electronic interlocking technical identifier
</div>
<div className="m-3 text-sm inline-flex font-medium bg-slate-100 dark:bg-slate-300 text-slate-600 dark:text-slate-600 rounded-full text-center px-2.5 py-1">
{simulatorConfiguration?.remoteId}
</div>
<div className="text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase">
Simulated Point Transitioning Time
</div>
<div className="m-3 text-sm inline-flex font-medium bg-slate-100 dark:bg-slate-300 text-slate-600 dark:text-slate-600 rounded-full text-center px-2.5 py-1">
{simulatorConfiguration?.simulatedTransitioningTimeSeconds}
{' '}
s
</div>
<Toggle label="Observe Ability to Move" active={simulatorConfiguration?.observeAbilityToMove || false} disabled />
<Toggle label="All Point Machines Crucial" active={simulatorConfiguration?.allPointMachinesCrucial || false} disabled />
</div>
</div>

<div className="col-span-full sm:col-span-6 xl:col-span-4 bg-white dark:bg-slate-800 shadow-lg rounded-sm border border-slate-200 dark:border-slate-700 p-4">
Expand Down

0 comments on commit 4545d64

Please sign in to comment.