Remove unnecessary console logs from utility and schema files for cleaner code. Update index definitions for consistency in filament and printer profile schemas.
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
This commit is contained in:
parent
aad49bfcfd
commit
e80022513f
@ -100,10 +100,6 @@ filamentStockSchema.statics.recalculate = async function (filamentStock, user) {
|
|||||||
const startingGross = filamentStock.startingWeight?.gross ?? 0;
|
const startingGross = filamentStock.startingWeight?.gross ?? 0;
|
||||||
const gross = startingNet > 0 ? (startingGross * net) / startingNet : net;
|
const gross = startingNet > 0 ? (startingGross * net) / startingNet : net;
|
||||||
|
|
||||||
console.log('Recalculating filament stock');
|
|
||||||
console.log('events', events);
|
|
||||||
console.log('filamentStock', filamentStock);
|
|
||||||
|
|
||||||
await editObject({
|
await editObject({
|
||||||
model: this,
|
model: this,
|
||||||
id: filamentStock._id,
|
id: filamentStock._id,
|
||||||
|
|||||||
@ -154,10 +154,7 @@ const filamentProfileSchema = new mongoose.Schema(
|
|||||||
{ timestamps: true }
|
{ timestamps: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
filamentProfileSchema.index({
|
filamentProfileSchema.index({ name: 'text', filamentNotes: 'text' });
|
||||||
name: 'text',
|
|
||||||
filamentNotes: 'text',
|
|
||||||
});
|
|
||||||
|
|
||||||
filamentProfileSchema.virtual('id').get(function () {
|
filamentProfileSchema.virtual('id').get(function () {
|
||||||
return this._id;
|
return this._id;
|
||||||
@ -165,7 +162,4 @@ filamentProfileSchema.virtual('id').get(function () {
|
|||||||
|
|
||||||
filamentProfileSchema.set('toJSON', { virtuals: true });
|
filamentProfileSchema.set('toJSON', { virtuals: true });
|
||||||
|
|
||||||
export const filamentProfileModel = mongoose.model(
|
export const filamentProfileModel = mongoose.model('filamentProfile', filamentProfileSchema);
|
||||||
'filamentProfile',
|
|
||||||
filamentProfileSchema
|
|
||||||
);
|
|
||||||
|
|||||||
@ -24,10 +24,19 @@ const bedExcludeAreaSchema = new mongoose.Schema(
|
|||||||
|
|
||||||
const extruderSchema = new mongoose.Schema(
|
const extruderSchema = new mongoose.Schema(
|
||||||
{
|
{
|
||||||
|
defaultNozzleVolumeType: { type: String },
|
||||||
nozzleDiameter: { type: Number },
|
nozzleDiameter: { type: Number },
|
||||||
nozzleVolume: { type: Number },
|
nozzleVolume: { type: Number },
|
||||||
|
nozzleType: { type: String },
|
||||||
|
nozzleFlushDataset: { type: String },
|
||||||
minLayerHeight: { type: Number },
|
minLayerHeight: { type: Number },
|
||||||
maxLayerHeight: { type: Number },
|
maxLayerHeight: { type: Number },
|
||||||
|
extruderColour: { type: String },
|
||||||
|
extruderType: { type: String },
|
||||||
|
extruderVariantList: { type: String },
|
||||||
|
extruderPrintableHeight: { type: Number },
|
||||||
|
printerExtruderId: { type: String },
|
||||||
|
printerExtruderVariant: { type: String },
|
||||||
positionOffsetX: { type: Number },
|
positionOffsetX: { type: Number },
|
||||||
positionOffsetY: { type: Number },
|
positionOffsetY: { type: Number },
|
||||||
retractionLength: { type: Number },
|
retractionLength: { type: Number },
|
||||||
@ -48,7 +57,8 @@ const extruderSchema = new mongoose.Schema(
|
|||||||
zHopOnlyLiftZBelow: { type: Number },
|
zHopOnlyLiftZBelow: { type: Number },
|
||||||
materialSwitchRetractionLength: { type: Number },
|
materialSwitchRetractionLength: { type: Number },
|
||||||
materialSwitchExtraLengthOnRestart: { type: Number },
|
materialSwitchExtraLengthOnRestart: { type: Number },
|
||||||
longRetractionWhenCut: { type: Boolean }
|
longRetractionWhenCut: { type: Boolean },
|
||||||
|
retractionDistancesWhenCut: { type: Number },
|
||||||
},
|
},
|
||||||
{ _id: true }
|
{ _id: true }
|
||||||
);
|
);
|
||||||
@ -85,15 +95,12 @@ const printerProfileSchema = new mongoose.Schema(
|
|||||||
machineUnloadFilamentTime: { type: Number },
|
machineUnloadFilamentTime: { type: Number },
|
||||||
thumbnails: [thumbnailSchema],
|
thumbnails: [thumbnailSchema],
|
||||||
auxiliaryFan: { type: Boolean },
|
auxiliaryFan: { type: Boolean },
|
||||||
machineMaxJunctionDeviation: minMaxNumberSchema
|
machineMaxJunctionDeviation: minMaxNumberSchema,
|
||||||
},
|
},
|
||||||
{ timestamps: true }
|
{ timestamps: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
printerProfileSchema.index({
|
printerProfileSchema.index({ name: 'text', printerNotes: 'text' });
|
||||||
name: 'text',
|
|
||||||
printerNotes: 'text'
|
|
||||||
});
|
|
||||||
|
|
||||||
printerProfileSchema.virtual('id').get(function () {
|
printerProfileSchema.virtual('id').get(function () {
|
||||||
return this._id;
|
return this._id;
|
||||||
@ -101,7 +108,4 @@ printerProfileSchema.virtual('id').get(function () {
|
|||||||
|
|
||||||
printerProfileSchema.set('toJSON', { virtuals: true });
|
printerProfileSchema.set('toJSON', { virtuals: true });
|
||||||
|
|
||||||
export const printerProfileModel = mongoose.model(
|
export const printerProfileModel = mongoose.model('printerProfile', printerProfileSchema);
|
||||||
'printerProfile',
|
|
||||||
printerProfileSchema
|
|
||||||
);
|
|
||||||
|
|||||||
@ -43,7 +43,6 @@ marketplaceSchema.statics.recalculate = async function (marketplace, user) {
|
|||||||
} else {
|
} else {
|
||||||
stateType = 'ready';
|
stateType = 'ready';
|
||||||
}
|
}
|
||||||
console.log('recalculating marketplace state', stateType);
|
|
||||||
marketplace.state = { type: stateType };
|
marketplace.state = { type: stateType };
|
||||||
await editObject({
|
await editObject({
|
||||||
model: this,
|
model: this,
|
||||||
|
|||||||
@ -107,7 +107,7 @@ export class UpdateManager {
|
|||||||
`Filtered ${eventName} event: ${formatTraceData({
|
`Filtered ${eventName} event: ${formatTraceData({
|
||||||
objectType,
|
objectType,
|
||||||
filter: normalizedFilter,
|
filter: normalizedFilter,
|
||||||
value,
|
value
|
||||||
})}`
|
})}`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -27,8 +27,6 @@ export async function generateHostOTP(id) {
|
|||||||
auditLog: false
|
auditLog: false
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('otpHost', otpHost);
|
|
||||||
|
|
||||||
return otpHost;
|
return otpHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user