node-insim
Version:
An InSim library for NodeJS with TypeScript support
70 lines (69 loc) • 2.39 kB
JavaScript
import { __decorate } from "tslib";
import { byte } from '../decorators';
import { SendablePacket } from './base';
import { PacketType } from './enums';
/**
* General purpose 8 byte packet (Target To Connection)
*
* To request an {@link IS_AXM} for a connection's layout editor selection send this
* {@link IS_TTC}:
*
* - ReqI: non-zero (returned in the reply)
* - SubT: {@link TTC_SEL} (request an {@link IS_AXM} for the current selection)
* - UCID: connection (0 = local / non-zero = guest)
*/
export class IS_TTC extends SendablePacket {
constructor(data) {
super();
this.Size = 8;
this.Type = PacketType.ISP_TTC;
/** 0 unless it is an info request or a reply to an info request */
this.ReqI = 0;
/** Subtype */
this.SubT = 0;
/** Connection's unique id (0 = local) */
this.UCID = 0;
/** May be used in various ways depending on SubT */
this.B1 = 0;
/** May be used in various ways depending on SubT */
this.B2 = 0;
/** May be used in various ways depending on SubT */
this.B3 = 0;
this.initialize(data);
}
}
__decorate([
byte()
], IS_TTC.prototype, "Size", void 0);
__decorate([
byte()
], IS_TTC.prototype, "Type", void 0);
__decorate([
byte()
], IS_TTC.prototype, "ReqI", void 0);
__decorate([
byte()
], IS_TTC.prototype, "SubT", void 0);
__decorate([
byte()
], IS_TTC.prototype, "UCID", void 0);
__decorate([
byte()
], IS_TTC.prototype, "B1", void 0);
__decorate([
byte()
], IS_TTC.prototype, "B2", void 0);
__decorate([
byte()
], IS_TTC.prototype, "B3", void 0);
export var TargetToConnectionType;
(function (TargetToConnectionType) {
/** Not used */
TargetToConnectionType[TargetToConnectionType["TTC_NONE"] = 0] = "TTC_NONE";
/** Info request: send {@link IS_AXM} for a layout editor selection */
TargetToConnectionType[TargetToConnectionType["TTC_SEL"] = 1] = "TTC_SEL";
/** Info request: send {@link IS_AXM} every time the selection changes */
TargetToConnectionType[TargetToConnectionType["TTC_SEL_START"] = 2] = "TTC_SEL_START";
/** Instruction: switch off {@link IS_AXM} requested by {@link TTC_SEL_START} */
TargetToConnectionType[TargetToConnectionType["TTC_SEL_STOP"] = 3] = "TTC_SEL_STOP";
})(TargetToConnectionType || (TargetToConnectionType = {}));