public void Activate(bool activate, CNC_App.UIMode chgMode)
        {
            if (activate && GrblSettings.Loaded)
            {
                if (!initOk)
                {
                    initOk = true;

                    if (config == null)
                    {
                        config = new WizardConfig(this, "Turning");
                        config.Load();
                        profileSource.DataSource = config.Profiles;
                        cbxProfile.DataSource    = profileSource;
                    }

                    config.Update();

                    if (fMetric != config.metric)
                    {
                        fMetric        = config.metric;
                        chkCSS.Checked = config.css;
                        SetUnitLabels(this);
                    }
                }
                else
                {
                    txtGCode.Text = "";
                }
            }
        }
Example #2
0
 public void LoadProfiles(CNC_App.UIMode Mode)
 {
     this.ModeName = Mode.ToString();
     this.viewProfile.RowFilter = "Mode='" + this.ModeName + "'";
     this.cmbProfile.Refresh();
     if (this.cmbProfile.Text != "")
     {
         cmbProfile_SelectedValueChanged(null, EventArgs.Empty);
     }
 }
        public void Activate(bool activate, CNC_App.UIMode chgMode)
        {
            if (activate)
            {
                GrblSDCard.Load();
                source.DataSource = GrblSDCard.data;

                this.GrblFileView.DataSource = source;
                this.GrblFileView.Refresh();
            }
        }
        public void Activate(bool activate, CNC_App.UIMode chgMode)
        {
            if (activate)
            {
                Comms.com.DataReceived += DataReceived;
                //  Comms.com.WriteByte(GrblLegacy.ConvertRTCommand(GrblConstants.CMD_STATUS_REPORT));
                //                dgrTools.DataSource = GrblWorkParameters.tool.Select(Tool => new {Tool.code, Tool.x}).ToList();

                dgrOffsets.DataSource = GrblWorkParameters.offset;
            }
            else
            {
                Comms.com.DataReceived -= DataReceived;
            }
        }
        public LatheOptions(UserControl parent, WizardConfig options, CNC_App.UIMode uiMode)
        {
            InitializeComponent();

            this.options = options;
            this.parent  = parent;
            this.Text   += " - " + options.Name;
            this.Load   += new EventHandler(LatheOptions_Load);

            cvFirstCut.Value   = options.passdepth_first;
            cvLastCut.Value    = options.passdepth_last;
            cvMinCut.Value     = options.passdepth_min;
            cvXClearance.Value = options.xclear;

            cvFeedRate.Visible = cvFeedRateLast.Visible = chkCSS.Visible = uiMode != CNC_App.UIMode.G76Threading;

            btnRadius.Checked   = options.xmode == LatheMode.Radius;
            btnDiameter.Checked = options.xmode == LatheMode.Diameter;
            btnRadius.Enabled   = btnDiameter.Enabled = !options.xmodelock;

            btnOk.Click           += new EventHandler(btnOk_Click);
            btnCancel.Click       += new EventHandler(btnCancel_Click);
            btnAddProfile.Click   += new EventHandler(btnAddProfile_Click);
            chkCSS.CheckedChanged += new EventHandler(chkCSS_CheckedChanged);

            bSource.DataSource               = options.Profiles;
            cbxProfile.ValueMember           = "Id";
            cbxProfile.DisplayMember         = "Name";
            cbxProfile.SelectedIndexChanged += new EventHandler(cbxProfile_SelectedIndexChanged);
            cbxProfile.DataSource            = bSource;
            cbxProfile.SelectedIndex         = options.Current.Id;
            cbxProfile.TextChanged          += new EventHandler(cbxProfile_TextChanged);

            UIUtils.SetMask(txtSpindleRPM, "###0");
            UIUtils.SetMask(txtCSSMaxRPM, "###0");
            UIUtils.GroupBoxCaptionBold(groupBox1);
            UIUtils.GroupBoxCaptionBold(groupBox2);
            UIUtils.GroupBoxCaptionBold(groupBox3);
        }
Example #6
0
 public void Activate(bool activate, CNC_App.UIMode chgMode)
 {
 }