private void LoadOperations()
 {
     try
     {
         _activeOperations = OperationRegisterController.GetActiveOperations();
         _lastOperations   = OperationRegisterController.GetLastOperations();
     }
     catch (Exception ex)
     {
         ViewController.ShowError(ex.Message);
     }
 }
Beispiel #2
0
        private void AskForReferencePart(Station station, Pallet pallet, Operation operation, Mold mold)
        {
            var reference = string.Empty;
            FrmPartReference frmPartReference = new FrmPartReference();

            frmPartReference.ShowDialog();
            reference = frmPartReference.Reference;

            OperationRegisterController.Register(station, pallet, operation, mold, reference);

            AppGlobal.Snap7Server.WriteWord(station.StatusChangeS7Ack, (ushort)operation.Code);

            station.Bussy = false;
        }
Beispiel #3
0
        //Motor de la aplicación Estaciones, Bandejas, Moldes, Operaciones, Ordenes de fabricación y piezas
        private void TimerComunicationStatus_Tick(object sender, EventArgs e)
        {
            TimerS7ComunicationStatus.Stop();

            foreach (var station in AppGlobal.Stations)
            {
                if (station.Bussy)
                {
                    continue;
                }

                if (!S7.GetBitAt(AppGlobal.Snap7Server.Read(station.StatusChangeS7), 0, 0))
                {
                    continue;
                }

                var data = AppGlobal.Snap7Server.Read(station.DataAddressS7);
                station.DataContent = Common.GetDataContent(data);

                var pallet    = PalletController.GetByCode(station.DataContent.PalletCode);
                var operation = OperationController.GetByCode(station.DataContent.OperationCode);
                var mold      = MoldRepository.GetByCode(station.DataContent.MoldCode);

                station.ActiveOperation = operation;

                if (operation.InitPart || operation.EndPart)
                {
                    station.Bussy = true;
                    Thread AskForReferencePartThread = new Thread(new ThreadStart(() => AskForReferencePart(station, pallet, operation, mold)));
                    AskForReferencePartThread.Start();
                }
                else
                {
                    OperationRegisterController.Register(station, pallet, operation, mold, "Pieza 1");
                    AppGlobal.Snap7Server.WriteWord(station.StatusChangeS7Ack, (ushort)operation.Code);
                }
            }

            TimerS7ComunicationStatus.Start();
        }