예제 #1
0
        public bool Update(ProfileData profile, double xclear, LatheMode xmode)
        {
            WizardConfig.xmode = xmode;

            if (profile != null)
            {
                ActiveProfile.Profile            = profile;
                ActiveProfile.Profile.XClearance = xclear;
            }

            this.profile.Save();

            return(true);
        }
예제 #2
0
        void btnOk_Click(object sender, EventArgs e)
        {
            LatheMode   xmode   = btnRadius.Checked ? LatheMode.Radius : LatheMode.Diameter;
            ProfileData profile = null;

            if (cbxProfile.SelectedValue != null)
            {
                profile = options.Profiles[(int)cbxProfile.SelectedValue];
                assignValues(options.Profiles[(int)cbxProfile.SelectedValue]);
            }

            options.Update(profile, cvXClearance.Value, xmode);

            this.Close();
        }
예제 #3
0
        public static double ConvertX(LatheMode source, LatheMode target, double value)
        {
            if (source != target)
            {
                switch (target)
                {
                case LatheMode.Radius:
                    value /= 2.0d;
                    break;

                case LatheMode.Diameter:
                    value *= 2.0d;
                    break;
                }
            }

            return(value);
        }
예제 #4
0
        public bool Update(ProfileData profile, double xclear, LatheMode xmode)
        {
            this.xmode = xmode;

            if (profile != null)
            {
                Current            = profile;
                Current.XClearance = xclear;
            }

            this.profile.Save();

            if (dialog != null)
            {
                dialog.InitUI(); // use event instead?
            }
            return(true);
        }
예제 #5
0
 public void setXMode(LatheMode xmode)
 {
     this.lblXMode.Visible = true;
     this.lblXMode.Text    = xmode == LatheMode.Radius ? "Radius" : "Diameter";
 }