Example #1
0
 public void PushDataToDictionary(FilamentDictionary dictionary)
 {
     foreach (SettingsManager.Filament profile in profiles)
     {
         FilamentProfile.TypeColorKey typeColorKey;
         typeColorKey.type  = FilamentConstants.StringToType(profile.Type);
         typeColorKey.color = FilamentConstants.StringToFilamentColors(profile.Color);
         FilamentProfile.CustomOptions customOptions;
         customOptions.temperature = profile.Temperature;
         dictionary.AddCustomTemperature(typeColorKey.type, typeColorKey.color, customOptions.temperature);
     }
 }
Example #2
0
        public override void MyButtonCallback(ButtonWidget button)
        {
            switch (button.ID)
            {
            case 7:
                MainWindow.ActivateFrame(Manage3DInkMainWindow.PageID.Page11_CheatCodePage, CurrentDetails);
                break;

            case 8:
                FilamentConstants.ColorsEnum filamentColors = FilamentConstants.StringToFilamentColors(color_combobox.EditBox.Text);
                for (var index = 0; index < CurrentDetails.user_filaments.Count; ++index)
                {
                    if (CurrentDetails.user_filaments[index].Color != filamentColors)
                    {
                        if (CurrentDetails.user_filaments[index].Color == FilamentConstants.ColorsEnum.Other)
                        {
                            CurrentDetails.user_filaments[index] = new M3D.Spooling.Common.Filament(CurrentDetails.user_filaments[0].Type, filamentColors, CurrentDetails.user_filaments[0].CodeStr, CurrentDetails.user_filaments[0].Brand);
                        }
                        else if (CurrentDetails.user_filaments.Count == 1)
                        {
                            CurrentDetails.user_filaments.RemoveAt(index);
                            --index;
                        }
                    }
                }
                M3D.Spooling.Common.Filament filament;
                int temperature;
                if (!settingsManager.FilamentDictionary.ResolveToEncodedFilament(CurrentDetails.user_filaments[0].CodeStr, out filament, out temperature))
                {
                    temperature = settingsManager.GetFilamentTemperature(CurrentDetails.current_spool.filament_type, filamentColors);
                }

                CurrentDetails.current_spool.filament_color_code  = (uint)filamentColors;
                CurrentDetails.current_spool.filament_temperature = temperature;
                if (CurrentDetails.mode == Manage3DInkMainWindow.Mode.AddFilament)
                {
                    CurrentDetails.mode = Manage3DInkMainWindow.Mode.SetFilamentLocationInsertingNew;
                }
                else if (CurrentDetails.mode == Manage3DInkMainWindow.Mode.SetDetails)
                {
                    CurrentDetails.mode = Manage3DInkMainWindow.Mode.SetFilamentLocationAlreadyInserted;
                }

                MainWindow.ActivateFrame(Manage3DInkMainWindow.PageID.Page18_FilamentSpoolSize, CurrentDetails);
                break;
            }
        }
Example #3
0
        public void MyButtonCallback(ButtonWidget button)
        {
            switch (button.ID)
            {
            case 3:
                FilamentSpool.TypeEnum       type           = ((FilamentSpool.TypeEnum[])Enum.GetValues(typeof(FilamentSpool.TypeEnum)))[type_combobox.ListBox.Selected];
                FilamentConstants.ColorsEnum filamentColors = FilamentConstants.StringToFilamentColors(color_combobox.EditBox.Text);
                settings_manager.FilamentDictionary.AddCustomTemperature(type, filamentColors, FilamentConstants.Temperature.Default(type));
                Enabled = false;
                Visible = false;
                host.GlobalChildDialog -= (this);
                if (manageFilamentPage != null)
                {
                    manageFilamentPage.Enabled = true;
                }

                if (manageFilamentPage == null)
                {
                    break;
                }

                manageFilamentPage.UpdateProfileList(type, filamentColors);
                break;

            case 4:
                Enabled = false;
                Visible = false;
                if (manageFilamentPage != null)
                {
                    manageFilamentPage.Enabled = true;
                }

                host.GlobalChildDialog -= (this);
                break;
            }
        }