Zone rename, model rename, clear panel and locked panel API and socket completed

This commit is contained in:
2025-04-09 18:22:12 +05:30
parent c4d8fc14c8
commit 40eb9d8fb9
12 changed files with 450 additions and 124 deletions

View File

@@ -56,6 +56,7 @@ interface IPointConveyor extends IPointBase {
}
interface IPointVehicle extends IPointBase {
rotation: number[];
actions: {
uuid: string;
name: string;
@@ -78,44 +79,48 @@ interface IPointArmbot extends IPointBase {
uuid: string;
name: string;
speed: number;
processes: { triggerId: string; startPoint: string; endPoint: string }[]
processes: { triggerId: string; startPoint: string; endPoint: string }[];
};
triggers: { uuid: string; name: string; type: string };
connections: {
source: { modelUUID: string; pointUUID: string };
targets: { modelUUID: string; pointUUID: string }[]
targets: { modelUUID: string; pointUUID: string }[];
};
}
interface IPointStaticMachine extends IPointBase{
interface IPointStaticMachine extends IPointBase {
rotation: number[];
actions: {
uuid: string;
name: string;
buffer: number ;
buffer: number;
material: string;
},
isUsed: boolean;
};
triggers: { uuid: string; name: string; type: string };
connections: {
source: { modelUUID: string; pointUUID: string };
targets: { modelUUID: string; pointUUID: string }[] };
connections: {
source: { modelUUID: string; pointUUID: string };
targets: { modelUUID: string; pointUUID: string }[];
};
}
// Main Document Interface
interface IPointModel extends Document {
modelfileID: string;
type: "Conveyor" | "Vehicle" |"ArmBot" |"StaticMachine",
points: IPointConveyor[] | IPointVehicle |IPointArmbot |IPointStaticMachine;
type: "Conveyor" | "Vehicle" | "ArmBot" | "StaticMachine";
points: IPointConveyor[] | IPointVehicle | IPointArmbot | IPointStaticMachine;
isArchive: boolean;
}
// Single Schema for both types
const PointSchema = new Schema<IPointModel>(
{
modelfileID: { type: String },
type: { type: String, enum: ["Conveyor", "Vehicle","ArmBot","StaticMachine"], required: true },
type: {
type: String,
enum: ["Conveyor", "Vehicle", "ArmBot", "StaticMachine"],
required: true,
},
isArchive: { type: Boolean, default: false },
points: {
type: Schema.Types.Mixed, // Flexible structure based on type
type: Schema.Types.Mixed,
required: true,
},
},
@@ -124,7 +129,7 @@ const PointSchema = new Schema<IPointModel>(
// Model Creation
const pointModel = (db: string) => {
return MainModel(db, "Points", PointSchema, "Points"); // Single collection
return MainModel(db, "Points", PointSchema, "Points");
};
export default pointModel;