Skip to content

Commit

Permalink
feat(nd): improved vspeed/traffic indicator svg, removed tcas ExecTas…
Browse files Browse the repository at this point in the history
…k from igniter build
  • Loading branch information
2hwk committed Oct 10, 2021
1 parent 0626781 commit f6090bb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion igniter.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default new TaskOfTasks('a32nx', [
new ExecTask('behavior','node src/behavior/build.js', ['src/behavior', 'flybywire-aircraft-a320-neo/ModelBehaviorDefs/A32NX/generated']),
new ExecTask('model','node src/model/build.js', ['src/model', 'flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model']),
new ExecTask('fmgc','npm run build:fmgc', ['src/fmgc', 'flybywire-aircraft-a320-neo/html_ui/JS/fmgc']),
new ExecTask('tcas','npm run build:tcas', ['src/tcas', 'flybywire-aircraft-a320-neo/html_ui/JS/tcas']),
new ExecTask('systems', [
'cargo build --target wasm32-wasi --release',
'wasm-opt -O3 -o flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/systems.wasm target/wasm32-wasi/release/systems.wasm',
Expand Down
37 changes: 18 additions & 19 deletions src/instruments/src/ND/elements/Traffic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export const Traffic: FC<TcasProps> = ({ mode, mapParams }) => {

return (
<Layer x={x} y={y}>
<TrafficIndicator
key="test"
x={50}
y={50}
relativeAlt={99}
vertSpeed={-500}
intrusionLevel={1}
/>
{airTraffic.map((tf) => (
<TrafficIndicator
key={tf.ID}
Expand Down Expand Up @@ -140,31 +148,22 @@ const TrafficIndicator: FC<TrafficProp> = memo(({ x, y, relativeAlt, vertSpeed,
{intrusionLevel === TaRaIntrusion.TA && <image x={0} y={0} width={45} height={32} xlinkHref="/Images/ND/TRAFFIC_TA.svg" />}
{intrusionLevel === TaRaIntrusion.RA && <image x={0} y={0} width={45} height={32} xlinkHref="/Images/ND/TRAFFIC_RA.svg" />}
<g>
<text x="36.165964" y={relAltY} fill={color} height={1.25} strokeWidth={0.3} textAnchor="end" xmlSpace="preserve">
<tspan x="19.165966" y={relAltY} fill={color} fontSize="20px" strokeWidth={0.3} textAnchor="middle">
<text x="30" y={relAltY} fill={color} height={1.25} strokeWidth={0.3} textAnchor="end" xmlSpace="preserve">
<tspan x="15.4" y={relAltY} fill={color} fontSize="20px" strokeWidth={0.3} textAnchor="middle">
{`${relativeAlt > 0 ? '+' : '-'}${Math.abs(relativeAlt) < 10 ? '0' : ''}${Math.abs(relativeAlt)}`}
</tspan>
</text>
{(vertSpeed >= 500 || vertSpeed <= -500) && (
<path d="m38.3 23.2v-13.5" fill="none" stroke={color} strokeWidth={2} />
)}
{(vertSpeed <= -500) && (
<path
d="m38.3 23.2-2.05-1.42 2.05 5.66 2.05-5.66z"
fill={color}
stroke={color}
fillRule="evenodd"
strokeWidth=".2pt"
/>
<>
<path fill="none" stroke={color} strokeWidth={2.75} d="M38.3,24V6.6" />
<path fill={color} stroke="none" fillRule="evenodd" d="M34,18l3.8,9.6h1l3.8-9.6H34z" />
</>
)}
{(vertSpeed >= 500) && (
<path
d="m38.3 9.7 2.05 1.42-2.05-5.66-2.05 5.66z"
fill={color}
stroke={color}
fillRule="evenodd"
strokeWidth=".2pt"
/>
<>
<path fill="none" stroke={color} strokeWidth={2.75} d="M38.3,9.5v17.4" />
<path fill={color} stroke="none" fillRule="evenodd" d="M42.6,15.5l-3.8-9.6h-1L34,15.5H42.6z" />
</>
)}
</g>
</Layer>
Expand Down

0 comments on commit f6090bb

Please sign in to comment.