public void AddUnallocatedCastingToQueue(string part, string queue, int position, string serial) { if (!fmsSettings.Queues.ContainsKey(queue)) { throw new BlackMaple.MachineFramework.BadRequestException("Queue " + queue + " does not exist"); } // num proc will be set later once it is allocated inside the MazakQueues thread var matId = log.AllocateMaterialIDForCasting(part, 1); Log.Debug("Adding unprocessed casting for part {part} to queue {queue} in position {pos} with serial {serial}. " + "Assigned matId {matId}", part, queue, position, serial, matId ); if (!string.IsNullOrEmpty(serial)) { log.RecordSerialForMaterialID( new BlackMaple.MachineFramework.JobLogDB.EventLogMaterial() { MaterialID = matId, Process = 0, Face = "" }, serial); } // the add to queue log entry will use the process, so later when we lookup the latest completed process // for the material in the queue, it will be correctly computed. log.RecordAddMaterialToQueue(matId, 0, queue, position); logReader.RecheckQueues(); RaiseNewCurrentStatus(GetCurrentStatus()); }