Skip to content

Commit

Permalink
refactor: ♻️ make rfSensor an extension of DetailedSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Mar 11, 2024
1 parent 3458e88 commit add7613
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/interfaces/RfSensorParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
* SOFTWARE.
*/

import { Degrees, SensorParams } from 'ootk-core';
import { Degrees } from 'ootk-core';
import { DetailedSensorParams } from '../types/types';

export interface RfSensorParams extends SensorParams {
export interface RfSensorParams extends DetailedSensorParams {
boresightAz: Degrees;
boresightEl: Degrees;
/** For radars, this is the width of the beam */
Expand Down
4 changes: 2 additions & 2 deletions src/objects/DetailedSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
*/

import { BaseObjectParams, Milliseconds, Sensor, SensorParams } from 'ootk-core';
import { Milliseconds, Sensor } from 'ootk-core';
import { DetailedSensorParams, ZoomValue } from '../types/types';
import { CommLink } from '../enums/CommLink';

Expand All @@ -35,7 +35,7 @@ export class DetailedSensor extends Sensor {
operator?: string;
url?: string;

constructor(info: DetailedSensorParams & SensorParams & BaseObjectParams) {
constructor(info: DetailedSensorParams) {
super(info);
this.commLinks = info.commLinks ?? [];
this.country = info.country;
Expand Down
5 changes: 3 additions & 2 deletions src/objects/RfSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
* SOFTWARE.
*/

import { DEG2RAD, Degrees, RAD2DEG, Radians, Sensor, SpaceObjectType } from 'ootk-core';
import { DEG2RAD, Degrees, RAD2DEG, Radians, SpaceObjectType } from 'ootk-core';
import { azel2uv, uv2azel, RfSensorParams } from '../main';
import { DetailedSensor } from './DetailedSensor';

export class RfSensor extends Sensor {
export class RfSensor extends DetailedSensor {
boresightAz: Degrees;
boresightEl: Degrees;
freqBand?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
*/

import { Kilometers, Milliseconds, SatelliteParams, Vec3 } from 'ootk-core';
import { Kilometers, Milliseconds, SatelliteParams, SensorParams, Vec3 } from 'ootk-core';
import { CommLink } from '../main';

export enum ZoomValue {
Expand Down Expand Up @@ -57,7 +57,7 @@ export interface DetailedSatelliteParams extends SatelliteParams {
altName?: string;
}

export interface DetailedSensorParams {
export interface DetailedSensorParams extends SensorParams {
/** The country that owns the sensor */
country?: string;
/** 3 Letter Designation */
Expand Down

0 comments on commit add7613

Please sign in to comment.