Skip to content

Commit

Permalink
refactor: ♻️ move freqBand from RfSensor to DetailedSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Mar 11, 2024
1 parent 035c7e2 commit 185cc50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/objects/DetailedSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ export class DetailedSensor extends Sensor {
uiName?: string;
country?: string;
dwellTime?: Milliseconds;
freqBand?: string;
commLinks: CommLink[];
/** Is this sensor volumetric? */
isVolumetric?: boolean;
/** The ideal zoom to see the sensor's full FOV */
zoom: ZoomValue | number;
zoom?: ZoomValue | number;
system?: string;
operator?: string;
url?: string;
Expand All @@ -40,6 +41,7 @@ export class DetailedSensor extends Sensor {
this.commLinks = info.commLinks ?? [];
this.country = info.country;
this.dwellTime = info.changeObjectInterval;
this.freqBand = info.freqBand;
this.isVolumetric = info.volume;
this.objName = info.objName;
this.operator = info.operator;
Expand Down
2 changes: 0 additions & 2 deletions src/objects/RfSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class RfSensor extends DetailedSensor {
boresightAz: Degrees[];
boresightEl: Degrees[];
faces: number;
freqBand?: string;
beamwidth: Degrees;

constructor(info: RfSensorParams) {
Expand All @@ -51,7 +50,6 @@ export class RfSensor extends DetailedSensor {
}
this.faces = info.boresightAz.length;
this.beamwidth = info.beamwidth;
this.freqBand = info.freqBand;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ export interface DetailedSensorParams extends SensorParams {
shortName?: string;
changeObjectInterval?: Milliseconds;
commLinks?: CommLink[];
freqBand?: string;
static?: boolean;
sensorId?: number;
url?: string;
/** Does this sensor use a volumetric search pattern? */
volume?: boolean;
/** How far away should we zoom when selecting this sensor? */
zoom: ZoomValue;
zoom?: ZoomValue;
/** This is the name of the object in the array */
objName?: string;
/** This is the name of the object in the UI */
Expand Down
8 changes: 4 additions & 4 deletions test/transforms/transforms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ it('should convert valid RAE coordinates to RAE Off Boresight', () => {
maxEl: 0 as Degrees,
minRng: 0 as Kilometers,
maxRng: 0 as Kilometers,
boresightAz: 0 as Degrees,
boresightEl: 0 as Degrees,
coneHalfAngle: 0 as Degrees,
boresightAz: [0 as Degrees],
boresightEl: [0 as Degrees],
beamwidth: 0 as Degrees,
});

const raeOffBoresightCoordinates = rae2raeOffBoresight(rae, senor, 10 as Degrees);
const raeOffBoresightCoordinates = rae2raeOffBoresight(rae, senor, 0, 10 as Degrees);

expect(raeOffBoresightCoordinates).toMatchSnapshot();
});
Expand Down

0 comments on commit 185cc50

Please sign in to comment.