Пример #1
0
        public override void CreateDatabaseRow(MazakPartRow newPart, string fixture, MazakDbType mazakTy)
        {
            var newPartProcRow = new MazakPartProcessRow();

            newPartProcRow.PartName      = Part.PartName;
            newPartProcRow.ProcessNumber = ProcessNumber;
            newPartProcRow.Fixture       = fixture;
            newPartProcRow.FixQuantity   = Math.Max(1, Job.PartsPerPallet(ProcessNumber, Path));

            newPartProcRow.ContinueCut = 0;
            //newPartProcRow.FixPhoto = "";
            //newPartProcRow.RemovePhoto = "";
            newPartProcRow.WashType = 0;

            char[] FixLDS   = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' };
            char[] UnfixLDS = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' };
            char[] Cut      = { '0', '0', '0', '0', '0', '0', '0', '0' };

            string program = "";

            foreach (var routeEntry in Job.GetMachiningStop(ProcessNumber, Path))
            {
                program = routeEntry.ProgramName;
                foreach (int statNum in routeEntry.Stations)
                {
                    Cut[statNum - 1] = statNum.ToString()[0];
                }
            }

            foreach (int statNum in Job.LoadStations(ProcessNumber, Path))
            {
                FixLDS[statNum - 1] = statNum.ToString()[0];
            }

            foreach (int statNum in Job.UnloadStations(ProcessNumber, Path))
            {
                UnfixLDS[statNum - 1] = statNum.ToString()[0];
            }

            newPartProcRow.MainProgram = program;
            newPartProcRow.FixLDS      = new string(FixLDS);
            newPartProcRow.RemoveLDS   = new string(UnfixLDS);
            newPartProcRow.CutMc       = new string(Cut);

            if (mazakTy != MazakDbType.MazakVersionE)
            {
                newPartProcRow.FixLDS    = ConvertStatStrV1ToV2(newPartProcRow.FixLDS).ToString();
                newPartProcRow.RemoveLDS = ConvertStatStrV1ToV2(newPartProcRow.RemoveLDS).ToString();
                newPartProcRow.CutMc     = ConvertStatStrV1ToV2(newPartProcRow.CutMc).ToString();
            }

            newPart.Processes.Add(newPartProcRow);
        }
Пример #2
0
 public MazakProcessFromTemplate(MazakPart parent, MazakPartProcessRow template, int path)
     : base(parent, template.ProcessNumber, path)
 {
     TemplateProcessRow = template;
 }