private void btnCambiaPassword_Click(object sender, EventArgs e)
        {
            try
            {
                bool ok = false;

                if (!string.IsNullOrWhiteSpace(txtNuovaPassword.Text) && txtNuovaPassword.Text == txtConfermaPassword.Text)
                {
                    string psw = txtNuovaPassword.Text;

                    DataType.ConfigurazioneCorrente confObj = DataType.ConfigurazioneCorrente.Deserialize(Path.Combine(Properties.Settings.Default.DatiVisionePath, "ConfigurazioneCorrente.xml"));

                    if (rbLivelloOperatore.Checked == true)
                    {
                        if (confObj.PswTecnico != psw && confObj.PswCostruttore != psw)
                        {
                            confObj.PswOperatore = psw;
                            ok = true;
                        }
                    }
                    else if (rbLivelloTecnico.Checked == true)
                    {
                        if (confObj.PswOperatore != psw && confObj.PswCostruttore != psw)
                        {
                            confObj.PswTecnico = psw;
                            ok = true;
                        }
                    }
                    else if (rbLivelloCostruttore.Checked == true)
                    {
                        if (confObj.PswOperatore != psw && confObj.PswTecnico != psw)
                        {
                            confObj.PswCostruttore = psw;
                            ok = true;
                        }
                    }

                    if (ok)
                    {
                        DataType.ConfigurazioneCorrente.Serialize(confObj, Path.Combine(Properties.Settings.Default.DatiVisionePath, "ConfigurazioneCorrente.xml"));
                    }
                }

                if (ok)
                {
                    MessageBox.Show(linguaMngr.GetTranslation("MSG_CAMBIO_PSW_OK"), linguaMngr.GetTranslation("MSG_ATTENZIONE"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    MessageBox.Show(linguaMngr.GetTranslation("MSG_CAMBIO_PSW_NON_VALIDO"), linguaMngr.GetTranslation("MSG_ERRORE"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.AddException(ex);
            }
        }
Example #2
0
        public void WorkingControlloLivelloAlgorithm(HImage image, CancellationToken token, out ArrayList iconicList, out ElaborateResult result)
        {
            iconicList = new ArrayList();
            result     = new ElaborateResult();
            try
            {
                iconicList.Add(new Utilities.ObjectToDisplay(image));

                if (this.parametri == null)
                {
                    iconicList.Add(new Utilities.ObjectToDisplay(linguaMngr.GetTranslation("MSG_NO_RECIPE"), "red", 0, 0));
                    result.Success = true;
                }
                else
                {
                    if (this.parametri.AbilitaControllo)
                    {
                        double center = FindPositionBottle(image, this.parametri, false, ref iconicList);

                        token.ThrowIfCancellationRequested();

                        bool errorLevelMin, errorLevelMax, errorEmpty;

                        result.Success = AnalisiLivello(image, this.parametri, center, true, out errorLevelMin, out errorLevelMax, out errorEmpty, ref iconicList);

                        result.DettaglioElaborazione.Add("KO_LEVEL_MIN", errorLevelMin);
                        result.DettaglioElaborazione.Add("KO_LEVEL_MAX", errorLevelMax);
                        result.DettaglioElaborazione.Add("KO_LEVEL_EMPTY", errorEmpty);

                        token.ThrowIfCancellationRequested();
                    }
                    else
                    {
                        iconicList.Add(new Utilities.ObjectToDisplay(linguaMngr.GetTranslation("MSG_TEST_DISABLED"), "red", 0, 0));
                        result.Success = true;
                    }
                }
            }
            catch (Exception)
            {
                result.Success = false;
            }
        }
Example #3
0
        private void AdjustCulture()
        {
            lblTitolo.Text = linguaMngr.GetTranslation("FORM_ABILITA_CONTROLLI_TITLE");

            chbAbilitaLivello.Text              = linguaMngr.GetTranslation("LBL_ABILITAZIONE_LIVELLO");
            chbAbilitaPresenza.Text             = linguaMngr.GetTranslation("LBL_ABILITAZIONE_PRESENZA");
            chbAbilitazioneControlloAnello.Text = linguaMngr.GetTranslation("LBL_ABILITAZIONE_CONTROLLO_ANELLO");
            chbAbilitaSerraggio.Text            = linguaMngr.GetTranslation("LBL_ABILITAZIONE_SERRAGGIO");
            chbAbilitaSerraggioStelvin.Text     = linguaMngr.GetTranslation("LBL_ABILITAZIONE_SERRAGGIO_STELVIN");
            chbAbilitaPiantaggio.Text           = linguaMngr.GetTranslation("LBL_ABILITAZIONE_PIANTAGGIO");
        }
Example #4
0
        public FormGestioneFormati(Class.Core[] core, Class.PlcMacchinaManager plcMacchina, int id_formato, DBL.LinguaManager linguaMngr, object repaintLock)
        {
            InitializeComponent();

            this.core        = core;
            this.plcMacchina = plcMacchina;
            this.id_formato  = id_formato;
            this.linguaMngr  = linguaMngr;
            this.repaintLock = repaintLock;

            AdjustCulture();

            DBL.FormatoManager dbmFormati = new DBL.FormatoManager(Properties.Settings.Default.ConnectionStringFormati);

            string descrizioneFormato = dbmFormati.GetDescrizioneFormato(id_formato);

            lblRicettaCorrente.Text = string.Format(linguaMngr.GetTranslation("LBL_RICETTA_CORRENTE"), descrizioneFormato);

            GestioneControlliLivello();
        }
Example #5
0
        private void AdjustCulture()
        {
            lblTitolo.Text = linguaMngr.GetTranslation("FORM_STATISTICHE_TITLE");

            lblRicetta.Text    = linguaMngr.GetTranslation("LBL_RICETTA");
            lblDataInizio.Text = linguaMngr.GetTranslation("LBL_DATA_INIZIO");
            lblDataFine.Text   = linguaMngr.GetTranslation("LBL_DATA_FINE");

            btnUpdate.Text = linguaMngr.GetTranslation("BTN_AGGIORNA");
            btnReset.Text  = linguaMngr.GetTranslation("BTN_ELIMINA");

            tabProduzioneGiornaliera.Text = linguaMngr.GetTranslation("LBL_PROD_GIORNALIERA");
            tabProduzionePerRicetta.Text  = linguaMngr.GetTranslation("LBL_PROD_PER_RICETTA");
            tabProduzioneOraria.Text      = linguaMngr.GetTranslation("LBL_PROD_ORARIA");
            tabStoricoAllarmi.Text        = linguaMngr.GetTranslation("LBL_STORICO_ALLARMI");

            dgvAllarmi.Columns["dataColumn"].HeaderText = linguaMngr.GetTranslation("LBL_DATA");
            dgvAllarmi.Columns["descrizioneAllarmeColumn"].HeaderText = linguaMngr.GetTranslation("LBL_ALLARME");
        }
Example #6
0
        private void PopolaSchermataErrore(Class.PlcMacchinaManager plcMacchinaManager, DBL.LinguaManager linguaMngr)
        {
            txtDescrizioneErrore.Text = string.Empty;

            GestioneVisualizzazioneErrore(Class.PlcMacchinaManager.Allarmi.EMERGENZA_PREMUTA, linguaMngr.GetTranslation("ALLARME_EMERGENZA_PREMUTA"));
            GestioneVisualizzazioneErrore(Class.PlcMacchinaManager.Allarmi.RAGGIUNTO_NUMERO_DI_SCARTI_CONSECUTIVI, linguaMngr.GetTranslation("ALLARME_RAGGIUNTO_NUMERO_DI_SCARTI_CONSECUTIVI"));
            GestioneVisualizzazioneErrore(Class.PlcMacchinaManager.Allarmi.AVARIA_BATTERIE_UPS, linguaMngr.GetTranslation("ALLARME_AVARIA_BATTERIE_UPS"));
            GestioneVisualizzazioneErrore(Class.PlcMacchinaManager.Allarmi.AVARIA_TENSIONE_UPS, linguaMngr.GetTranslation("ALLARME_AVARIA_TENSIONE_UPS"));
            GestioneVisualizzazioneErrore(Class.PlcMacchinaManager.Allarmi.DISALLINEAMENTO, linguaMngr.GetTranslation("ALLARME_DISALLINEAMENTO"));

            if (this.allarmeLicenza)
            {
                txtDescrizioneErrore.Text = string.Format("{0}{1}\n\r\n\r", txtDescrizioneErrore.Text, "H_ERR_WDBID	 4057	 Image data management: object-ID outside the valid range");
            }
        }
        private void AdjustCulture()
        {
            lblTitolo.Text = linguaMngr.GetTranslation("FORM_DATI_DI_PRODUZIONE_TITLE");

            lblDescrizioneTappo.Text = linguaMngr.GetTranslation("LBL_CNT_TAPPO");

            lblContatoreBuoniTappoDescr.Text                  = linguaMngr.GetTranslation("LBL_PEZZI_BUONI_TAPPO");
            lblContatoreScartiTappoDescr.Text                 = linguaMngr.GetTranslation("LBL_PEZZI_SCARTO_TAPPO");
            lblContatoreScartiTappoPresenzaDescr.Text         = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_PRESENZA");
            lblContatoreScartiTappoSerraggioDescr.Text        = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_SERRAGGIO");
            lblContatoreScartiTappoSerraggioStelvinDescr.Text = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_SERRAGGIO_STELVIN");
            lblContatoreScartiTappoPiantaggioDescr.Text       = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_PIANTAGGIO");
            lblContatoreScartiTappoAnelloDescr.Text           = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_ANELLO");
            lblContatoreScartiTappoGabbiettaDescr.Text        = linguaMngr.GetTranslation("LBL_SCARTO_TAPPO_GABBIETTA");

            lblDescrizioneLivello.Text = linguaMngr.GetTranslation("LBL_CNT_LIVELLO");

            lblContatoreBuoniLivelloDescr.Text       = linguaMngr.GetTranslation("LBL_PEZZI_BUONI_LIVELLO");
            lblContatoreScartiLivelloDescr.Text      = linguaMngr.GetTranslation("LBL_PEZZI_SCARTO_LIVELLO");
            lblContatoreScartiLivelloMinDescr.Text   = linguaMngr.GetTranslation("LBL_SCARTO_LIVELLO_MIN");
            lblContatoreScartiLivelloMaxDescr.Text   = linguaMngr.GetTranslation("LBL_SCARTO_LIVELLO_MAX");
            lblContatoreScartiLivelloEmptyDescr.Text = linguaMngr.GetTranslation("LBL_SCARTO_LIVELLO_EMPTY");

            lblTempoMarciaDescr.Text = linguaMngr.GetTranslation("LBL_TEMPO_MARCIA");
            lblTempoFermoDescr.Text  = linguaMngr.GetTranslation("LBL_TEMPO_FERMO");
        }
Example #8
0
 private void AdjustCulture()
 {
     lblTitolo.Text = linguaMngr.GetTranslation("FORM_MENU_HOME_TITLE");
 }
Example #9
0
        public bool CanOpen(LivelloPassword minLevel, DBL.LinguaManager linguaMngr, bool force)
        {
            bool ok = false;

            if (Properties.Settings.Default.UsaPassword || force)
            {
                if (this.lastLivello != LivelloPassword.NN && swTempoLogin.ElapsedMilliseconds < Properties.Settings.Default.TempoPassword * 60 * 1000 && minLevel <= this.lastLivello)
                {
                    ok = minLevel <= this.lastLivello;
                }
                else
                {
                    FormPassword frmPsw = new FormPassword(linguaMngr);

                    if (frmPsw.ShowDialog() == DialogResult.OK)
                    {
                        bool pswTrovata = false;
                        bool livBasso   = true;

                        DataType.ConfigurazioneCorrente confObj = DataType.ConfigurazioneCorrente.Deserialize(Path.Combine(Properties.Settings.Default.DatiVisionePath, "ConfigurazioneCorrente.xml"));

                        string psw = frmPsw.GetPassword();

                        if (psw == confObj.PswCostruttore)
                        {
                            ok          = true;
                            lastLivello = LivelloPassword.Costruttore;
                            swTempoLogin.Restart();

                            pswTrovata = true;
                            livBasso   = false;
                        }

                        if (!ok && psw == confObj.PswTecnico)
                        {
                            if (minLevel <= LivelloPassword.Tecnico)
                            {
                                ok          = true;
                                lastLivello = LivelloPassword.Tecnico;
                                swTempoLogin.Restart();

                                livBasso = false;
                            }

                            pswTrovata = true;
                        }

                        if (!ok && psw == confObj.PswOperatore)
                        {
                            if (minLevel <= LivelloPassword.Operatore)
                            {
                                ok          = true;
                                lastLivello = LivelloPassword.Operatore;
                                swTempoLogin.Restart();

                                livBasso = false;
                            }

                            pswTrovata = true;
                        }

                        if (!pswTrovata)
                        {
                            MessageBox.Show(linguaMngr.GetTranslation("MSG_PSW_ERRATA"), linguaMngr.GetTranslation("MSG_ERRORE"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else if (livBasso)
                        {
                            MessageBox.Show(linguaMngr.GetTranslation("MSG_LIVELLO_PSW_BASSO"), linguaMngr.GetTranslation("MSG_ATTENZIONE"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                    }
                }
            }
            else
            {
                ok = true;
            }

            return(ok);
        }
 private void AdjustCulture()
 {
     lblTitolo.Text = linguaMngr.GetTranslation("FORM_ULTIMI_ERRORI_TITLE");
 }