Exemple #1
0
        //since we don't know the quantity on the pallet until the very end, can just
        //create a single material ID.  At the very end, when we do know the count (and part name),
        //can add exactly that many material ids as long as the original material id is included.

        private IEnumerable <JobLogDB.EventLogMaterial> CreateLoadMaterial(CincronMessage.PartLoadStart load)
        {
            var matId = _log.AllocateMaterialID(load.WorkId, "", 1);

            Log.Debug("Creating new material id {matid} for load event with work id {workId}", matId, load.WorkId);
            return(new[] {
                new JobLogDB.EventLogMaterial()
                {
                    MaterialID = matId,
                    Process = 1,
                    Face = ""
                }
            });
        }
Exemple #2
0
        private IReadOnlyList <long> AllocateMatIds(int count, string order, string part, int numProcess)
        {
            var matIds = new List <long>();

            for (int i = 0; i < count; i++)
            {
                matIds.Add(_log.AllocateMaterialID(order, part, numProcess));
            }
            return(matIds);
        }
Exemple #3
0
        public void QueueTablesCorrectlyCreated()
        {
            var now   = new DateTime(2018, 7, 12, 5, 6, 7, DateTimeKind.Utc);
            var matId = _log.AllocateMaterialID("uuu5", "part5", 1);
            var mat   = new LogMaterial(matId, "uuu5", 1, "part5", 1, "", "", "");

            _log.RecordAddMaterialToQueue(JobLogDB.EventLogMaterial.FromLogMat(mat), "queue", 5, now.AddHours(2));

            _log.GetMaterialInQueue("queue").Should().BeEquivalentTo(new[] {
                new JobLogDB.QueuedMaterial()
                {
                    MaterialID   = matId,
                    Queue        = "queue",
                    Position     = 0,
                    Unique       = "uuu5",
                    PartName     = "part5",
                    NumProcesses = 1,
                }
            });
        }