public void loadDefaults()
        {
            IRegMemoryFolder reg = host.GetRegistryFolder("CncPlugin");

            jog_key_x_minus = reg.GetInt("jog_x_minus", 37); // LEFT
            jog_key_x_plus  = reg.GetInt("jog_x_plus", 39);  // RIGHT
            jog_key_y_minus = reg.GetInt("jog_y_minus", 40); // DOWN
            jog_key_y_plus  = reg.GetInt("jog_y_plus", 38);  // UP
            jog_key_z_minus = reg.GetInt("jog_z_minus", 34); // PGDN
            jog_key_z_plus  = reg.GetInt("jog_z_plus", 33);  // PGUP

            jog_step_1 = reg.GetDouble("jog_step_1", 50);
            jog_step_2 = reg.GetDouble("jog_step_2", 10);
            jog_step_3 = reg.GetDouble("jog_step_3", 1);
            jog_step_4 = reg.GetDouble("jog_step_4", 0.1);

            step_key_1 = reg.GetInt("step_key_1", 120); // F9
            step_key_2 = reg.GetInt("step_key_2", 121); // F10
            step_key_3 = reg.GetInt("step_key_3", 122); // F11
            step_key_4 = reg.GetInt("step_key_4", 123); // F12

            spindle_start = reg.GetString("spindle_start", "M106 S%p");
            spindle_stop  = reg.GetString("spindle_stop", "M107");
            spindle_pwm   = reg.GetString("spindle_pwm", "M106 S%p");

            jog_unit   = reg.GetString("jog_unit", "mm");
            globalkeys = reg.GetBool("globalkeys", false);
        }
        public void save()
        {
            IRegMemoryFolder reg = host.GetRegistryFolder("CncPlugin");

            reg.SetInt("jog_x_minus", jog_key_x_minus);
            reg.SetInt("jog_x_plus", jog_key_x_plus);
            reg.SetInt("jog_y_minus", jog_key_y_minus);
            reg.SetInt("jog_y_plus", jog_key_y_plus);
            reg.SetInt("jog_z_minus", jog_key_z_minus);
            reg.SetInt("jog_z_plus", jog_key_z_plus);

            reg.SetDouble("jog_step_1", jog_step_1);
            reg.SetDouble("jog_step_2", jog_step_2);
            reg.SetDouble("jog_step_3", jog_step_3);
            reg.SetDouble("jog_step_4", jog_step_4);

            reg.SetInt("step_key_1", step_key_1);
            reg.SetInt("step_key_2", step_key_2);
            reg.SetInt("step_key_3", step_key_3);
            reg.SetInt("step_key_4", step_key_4);

            reg.SetString("spindle_start", spindle_start);
            reg.SetString("spindle_stop", spindle_stop);
            reg.SetString("spindle_pwm", spindle_pwm);

            reg.SetString("jog_unit", jog_unit);

            reg.SetBool("globalkeys", globalkeys);
        }
Example #3
0
 public KisSlicerInstance(string name, IHost host)
 {
     this._name = name;
     this._host = host;
     this._reg  = host.GetRegistryFolder(KisSlicer.SlicersFolder + name);
     InitWatcher();
 }
        // Save the list in the registry
        private void saveRegistry()
        {
            IRegMemoryFolder Ireg = host.GetRegistryFolder("FilamentInfo_plugin");

            // if no items in the list delete all registry value
            if (listView_filament.Items.Count == 0)
            {
                Ireg.DeleteValue("filamentList");
                return;
            }

            // all items ar saved into single string, items ar separed by "|", subitems by ";"
            string regString = "";

            foreach (ListViewItem item in listView_filament.Items)
            {
                regString += "|" + item.SubItems[0].Text;
                regString += ";" + item.SubItems[1].Text;
                regString += ";" + item.SubItems[2].Text;
                regString += ";" + item.SubItems[3].Text;
                regString += ";" + item.SubItems[4].Text;
                regString += ";" + item.SubItems[5].Text;
                regString += ";" + item.SubItems[6].Text;
                regString += ";" + item.Group.Header;
            }

            Ireg.SetString("filamentList", regString.TrimStart('|'));
        }
        // control load event
        private void testControl_Load(object sender, System.EventArgs e)
        {
            // translation
            load_Translations();
            host.languageChanged += load_Translations;

            // Read the filament list from the registry and load into listview
            IRegMemoryFolder Ireg = host.GetRegistryFolder("FilamentInfo_plugin");


            // items ar separed by "|" params by ";"
            string[] items = Ireg.GetString("filamentList", "").Split('|');
            string[] allParams;

            listView_filament.BeginUpdate();
            foreach (string item in items)
            {
                allParams = item.Split(';');
                if (allParams.Count() < 8)
                {
                    continue;
                }

                createAddNewItem(allParams);
            }
            listView_filament.EndUpdate();
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            IRegMemoryFolder reg = host.GetRegistryFolder("CncPlugin");

            reg.DeleteThisFolder();
            pref.loadDefaults();
            loadDefault();
            _cc.refreshPref();
        }
Example #7
0
        /// <summary>
        /// Load all settings from the registry
        /// </summary>
        /// <param name="_host">IHost</param>
        public static void load_Settings(IHost _host)
        {
            IRegMemoryFolder Ireg = _host.GetRegistryFolder("FilamentInfo_plugin");

            // Taskbar icon
            filamentListPos = Ireg.GetInt("filamentListPos", 0);

            TabPos = Ireg.GetInt("TabPos", 8000);

            showCalculator = Ireg.GetInt("showCalculator", 1);
        }
Example #8
0
 public KisSlicer(IHost host)
 {
     this._host = host;
     this._reg  = this._host.GetRegistryFolder(SlicersFolder);
     foreach (string str in this._reg.folders())
     {
         this.CreateInstance(str);
     }
     if ((this._list.Count == 0))
     {
         this.CreateInstance("KISSlicer");
     }
 }
        private void saveSettings()
        {
            if (!_controlLoaded)
            {
                return;
            }

            IRegMemoryFolder Ireg = host.GetRegistryFolder("FilamentInfo_plugin");


            Ireg.SetInt("filamentListPos", comboBox_pos.SelectedIndex);

            int tabPos = (Convert.ToInt32(numericUpDown_tabPos.Value) - 1) * 1000;

            Ireg.SetInt("TabPos", tabPos);


            Ireg.SetInt("showCalculator", comboBox_showCalc.SelectedIndex);
        }