Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mylin/17 pv preview #30

Merged
merged 12 commits into from
Jul 18, 2023
21 changes: 21 additions & 0 deletions src/test/MessageController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,27 @@ export class MessageController {
return false;
}

spectialSetRegion(fileId: number, regionId: number, region: RegionStore, isRequestingPreview?: boolean): boolean {
if (this.connectionStatus === ConnectionStatus.ACTIVE) {
const message = CARTA.SetRegion.create({
fileId,
regionId,
regionInfo: {
regionType: region.regionType,
rotation: region.rotation,
controlPoints: region.controlPoints.slice()
},
previewRegion: isRequestingPreview
});
const requestId = this.eventCounter;
this.logEvent(CARTA.EventType.SET_REGION, requestId, message, false);
if (this.sendEvent(CARTA.EventType.SET_REGION, CARTA.SetRegion.encode(message).finish())) {
return true;
}
}
return false;
}

async setRegion(fileId: number, regionId: number, region: RegionStore, isRequestingPreview?: boolean): Promise<CARTA.ISetRegionAck> {
if (this.connectionStatus !== ConnectionStatus.ACTIVE) {
throw new Error("Not connected");
Expand Down
Loading