-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDivCall.ts
More file actions
28 lines (25 loc) · 1.16 KB
/
DivCall.ts
File metadata and controls
28 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js';
import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js';
import { Direction } from '../../../Enums/Direction.js';
import { ArithmeticCall } from './ArithmeticCall.js';
export interface DivCallOptions {
type: string;
in1: IOperationOrSignal;
in2: IOperationOrSignal;
out1?: IOperationOrSignal | null;
eno?: IOperationOrSignal | null;
}
export class DivCall extends ArithmeticCall {
constructor(options: DivCallOptions) {
const { type, in1, in2, out1 = null, eno = null } = options;
super({ functionName: 'Div', eno });
this.disableEno = true;
this.type = type;
this.iface['IN1'] = new IOperationOrSignalDirectionWrapper(in1, Direction.Input);
this.iface['IN2'] = new IOperationOrSignalDirectionWrapper(in2, Direction.Input);
this.iface['OUT'] = new IOperationOrSignalDirectionWrapper(out1, Direction.Output);
for (const w of Object.values(this.iface)) {
if (w.operationOrSignal !== null) this.children.push(w.operationOrSignal);
}
}
}