void UserInput_SourceUpdated(object sender, EventArgs e)
        {
            if (sender == NumeroGiri)
            {
                var numeroGiri     = NumeroGiri.Value;
                var velocitaTaglio = (numeroGiri * LarghezzaUtensile * Math.PI) / 1000;

                VelocitaTaglio.SetValue(false, velocitaTaglio);
            }

            else if (sender == VelocitaTaglio)
            {
                var vt         = VelocitaTaglio.Value;
                var numeroGiri = (vt * 1000) / (Math.PI * LarghezzaUtensile);

                NumeroGiri.SetValue(false, numeroGiri);
            }
            else if (sender == LarghezzaPassata)
            {
                LarghezzaPassataPerc.SetValue(false, (LarghezzaPassata.Value / LarghezzaUtensile) * 100);
            }

            else if (sender == LarghezzaPassataPerc)
            {
                LarghezzaPassata.SetValue(false, (LarghezzaPassataPerc.Value / 100) * LarghezzaUtensile);
            }
            else if (sender == ProfonditaPassata)
            {
                ProfonditaPassataPerc.SetValue(false, (ProfonditaPassata.Value / LarghezzaUtensile) * 100);
            }

            else if (sender == ProfonditaPassataPerc)
            {
                ProfonditaPassata.SetValue(false, (ProfonditaPassataPerc.Value / 100) * LarghezzaUtensile);
            }

            OnPropertyChanged("IsValid");

            SourceUpdated();
        }
Esempio n. 2
0
        void UserInput_SourceUpdated(object sender, EventArgs e)
        {
            if (sender == NumeroGiri)
            {
                if (NumeroGiri.Value.HasValue)
                {
                    ParametroFresaBase.SetNumeroGiri(NumeroGiri.Value.Value);
                }

                VelocitaTaglio.Update();
            }

            else if (sender == VelocitaTaglio)
            {
                if (VelocitaTaglio.Value.HasValue)
                {
                    ParametroFresaBase.SetVelocitaTaglio(VelocitaTaglio.Value.Value);
                }

                NumeroGiri.Update();
            }
            else if (sender == LarghezzaPassata)
            {
                LarghezzaPassataPerc.SetValue(false, (LarghezzaPassata.Value / Diametro) * 100);
            }

            else if (sender == LarghezzaPassataPerc)
            {
                LarghezzaPassata.SetValue(false, (LarghezzaPassataPerc.Value / 100) * Diametro);
            }
            else if (sender == ProfonditaPassata)
            {
                ProfonditaPassataPerc.SetValue(false, (ProfonditaPassata.Value / Diametro) * 100);
            }

            else if (sender == ProfonditaPassataPerc)
            {
                ProfonditaPassata.SetValue(false, (ProfonditaPassataPerc.Value / 100) * Diametro);
            }

            else if (sender == AvanzamentoSincrono)
            {
                if (AvanzamentoSincrono.Value.HasValue)
                {
                    ParametroFresaBase.SetFeedSync(AvanzamentoSincrono.Value.Value);
                }

                AvanzamentoAsincrono.Update();
            }
            else if (sender == AvanzamentoAsincrono)
            {
                if (AvanzamentoAsincrono.Value.HasValue)
                {
                    ParametroFresaBase.SetFeedAsync(AvanzamentoAsincrono.Value.Value);
                }

                AvanzamentoSincrono.Update();
            }

            else if (sender == AvanzamentoSincronoPiantata)
            {
                if (AvanzamentoSincronoPiantata.Value.HasValue)
                {
                    ParametroFresaBase.SetPlungeFeedSync(AvanzamentoSincronoPiantata.Value.Value);
                }

                AvanzamentoAsincronoPiantata.Update();
            }
            else if (sender == AvanzamentoAsincronoPiantata)
            {
                if (AvanzamentoAsincronoPiantata.Value.HasValue)
                {
                    ParametroFresaBase.SetPlungeFeedAsync(AvanzamentoAsincronoPiantata.Value.Value);
                }

                AvanzamentoSincronoPiantata.Update();
            }

            RequestUpdate(this);


            // OnPropertyChanged("IsValid");
        }
Esempio n. 3
0
 public void SetLarghPassata(double value)
 {
     LarghezzaPassata.SetValue(true, value);
     LarghezzaPassataPerc.SetValue(false, (LarghezzaPassata.Value / DiametroFresa) * 100);
 }