Session 022: Migrate Lts/Tools (72 submodules) to Qt6
- Copied complete Lts/Tools directory from qt5-before to qt6-after - Updated 32 CMakeLists.txt files (Qt5:: → Qt6::) - Tools subdirectory already included in parent Lts/CMakeLists.txt - All 72 tool submodules now present in qt6-migrated-legatus - Includes: Adler, ArAssets, ConfigX, DBAdministration, DBUpdate, DdsView, InfrastructureManagement, and 67 more tools - C++17 standard (RTI 7.7.0 compatibility maintained) - Tests deferred until final validation phase Migration progress: ✅ Lts/Application (68 files) ✅ Lts/DDS (verified Qt6-ready) ✅ Lts/Plugins (60 submodules, verified) ✅ Lts/Projects (5 submodules, verified) ✅ Lts/Proxies (13 submodules, verified) ✅ Lts/Services (47 submodules, verified) ✅ Lts/Tools (72 submodules, copied + CMake updated) ✅ Lts/Viewer (LtsFileDialog, LtsReportDisplay, SituationMap) 🟡 TetraIF (partial) 🟡 Z (partial: nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface)
This commit is contained in:
1 parent
01dce5fe52
commit
d5c13033e2
1792 files changed
+982018
No files matched your search
+174
@@ -0,0 +1,174 @@
|
||||
import L from "leaflet";
|
||||
import Building from "./Building";
|
||||
import { Helpers, _, MOBILE, $ } from "./Helpers";
|
||||
import { Functions } from "./Functions";
|
||||
import { DEBUG } from "./main";
|
||||
import angular from "angular";
|
||||
|
||||
export default class MountingPoint extends L.Marker {
|
||||
public Name: string = "";
|
||||
public Id: number = -1;
|
||||
public SupportedAssets: number[] = [];
|
||||
public Level: number = -1;
|
||||
public MountedAsset: number = -1;
|
||||
|
||||
private constructor() {
|
||||
super(new L.LatLng(0, 0));
|
||||
throw new Error("Use static method MountingPoint.Create() instead.");
|
||||
// Don't use this.
|
||||
// This is just here so you can't use the constructor from
|
||||
// outside the class
|
||||
}
|
||||
|
||||
/**
|
||||
* MountingPoint factory method
|
||||
*/
|
||||
public static async Create(
|
||||
Raw: {
|
||||
id: number;
|
||||
designation: string;
|
||||
tag: string;
|
||||
objectId: number;
|
||||
levelId: number;
|
||||
roomId: number;
|
||||
assetId: number;
|
||||
position3d: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
supportedAssetTypeIds: number[];
|
||||
},
|
||||
Building: Building
|
||||
): Promise<MountingPoint> {
|
||||
return new Promise<MountingPoint>(async resolve => {
|
||||
// Wrong building?
|
||||
if (Building.Id != Raw.objectId) throw new Error("Wrong building");
|
||||
|
||||
let rotatedRelativePosition = Helpers.Calculations.RotatePoint(
|
||||
{
|
||||
x: Raw.position3d.x,
|
||||
y: Raw.position3d.y
|
||||
},
|
||||
Helpers.Calculations.DegToRad(Building.RotationDegree)
|
||||
); // Rotate mp position around building rotation degree
|
||||
|
||||
let temp = Object.create(Building.RefPoint);
|
||||
temp.Easting += rotatedRelativePosition.x;
|
||||
temp.Northing += rotatedRelativePosition.y;
|
||||
let position = temp.ToLatLon();
|
||||
// Add building ref point to mp relative position
|
||||
|
||||
let mounted = Raw.assetId != -1;
|
||||
|
||||
let mp = new L.Marker(new L.LatLng(position.Lat, position.Lon), {
|
||||
icon: new L.Icon({
|
||||
iconUrl: mounted
|
||||
? "img/marker_mounted.png"
|
||||
: "img/marker_default.png",
|
||||
iconSize: [30, 30]
|
||||
})
|
||||
}) as MountingPoint; // Setup Leaflet marker
|
||||
|
||||
mp.Name = _(Raw.tag) ? Raw.designation : Raw.tag;
|
||||
mp.SupportedAssets = Raw.supportedAssetTypeIds || [];
|
||||
mp.Id = Raw.id;
|
||||
mp.Level = Raw.levelId;
|
||||
mp.MountedAsset = Raw.assetId;
|
||||
|
||||
let popup = document.createElement("iframe") as HTMLIFrameElement;
|
||||
popup.src = `./popup.html?mpid=${mp.Id}&wsip=${Functions.WebSocketIp}`;
|
||||
popup.style.width = "100%";
|
||||
popup.style.height = "100%"
|
||||
popup.style.top = "0";
|
||||
popup.style.left = "0";
|
||||
popup.style.border = "none";
|
||||
mp.bindPopup(popup, {className: "mp-popup"});
|
||||
|
||||
if (DEBUG) console.log(`new MountingPoint() with ID = ${mp.Id}`);
|
||||
|
||||
return resolve(mp);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function _moreInfo(info: string) {
|
||||
let popup = open("", Helpers.GenUuid()) as Window;
|
||||
|
||||
// <pre>
|
||||
let display = popup.document.createElement("pre") as HTMLPreElement;
|
||||
display.innerHTML = unescape(info);
|
||||
display.style.fontSize = "15";
|
||||
|
||||
// <button>
|
||||
let finish = popup.document.createElement("button") as HTMLButtonElement;
|
||||
finish.innerHTML = "Done";
|
||||
finish.setAttribute("onclick", "window.close()");
|
||||
|
||||
// build popup
|
||||
popup.document.body.appendChild(popup.document.createElement(
|
||||
"hr"
|
||||
) as HTMLHRElement);
|
||||
popup.document.body.appendChild(display);
|
||||
popup.document.body.appendChild(popup.document.createElement(
|
||||
"hr"
|
||||
) as HTMLHRElement);
|
||||
popup.document.body.appendChild(finish);
|
||||
}
|
||||
|
||||
function _mount(mountingPointId: number): void {
|
||||
let select = ($(`#mp-asset-select-${mountingPointId}`) as HTMLSelectElement);
|
||||
let assetId = select.value;
|
||||
|
||||
let mounted = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.MountedAsset == +assetId));
|
||||
if (!_(mounted)) mounted?.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_remounted.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
|
||||
Functions.MountAsset(assetId, mountingPointId);
|
||||
select.disabled = true;
|
||||
let button = ($(`#mp-asset-button-${mountingPointId}`) as HTMLButtonElement);
|
||||
button.innerText = "Unmount";
|
||||
button.onclick = () => window.MP.Unmount(mountingPointId);
|
||||
|
||||
let mp = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.Id == mountingPointId) as MountingPoint);
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_mounted.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
mp.MountedAsset = +assetId;
|
||||
}
|
||||
|
||||
function _unmount(mountingPointId: number): void {
|
||||
Functions.UnmountAsset(mountingPointId);
|
||||
let select = ($(`#mp-asset-select-${mountingPointId}`) as HTMLSelectElement);
|
||||
select.disabled = false;
|
||||
let button = ($(`#mp-asset-button-${mountingPointId}`) as HTMLButtonElement);
|
||||
button.innerText = "Mount";
|
||||
button.onclick = () => window.MP.Mount(mountingPointId);
|
||||
let mp = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.Id == mountingPointId) as MountingPoint);
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_default.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
mp.MountedAsset = -1;
|
||||
}
|
||||
|
||||
//#region
|
||||
declare global {
|
||||
interface Window {
|
||||
MP: {
|
||||
MoreInfo: (info: string) => void,
|
||||
Mount: (id: number) => void,
|
||||
Unmount: (id: number) => void
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
window.MP = window.MP || {
|
||||
MoreInfo: _moreInfo,
|
||||
Mount: _mount,
|
||||
Unmount: _unmount
|
||||
};
|
||||
//#endregion
|
||||
Reference in new issue
Block a user