Esempio n. 1
0
 public void SelectProfile(int index)
 {
     if (index >= 0 && index < filamentprofile_list.Items.Count)
     {
         var filamentOptions = (FilamentProfilePage.FilamentOptions)filamentprofile_list.Items[index];
         type_edit.Text                 = filamentOptions.Key.type.ToString();
         color_edit.Text                = FilamentConstants.ColorsToString(filamentOptions.Key.color);
         temperature_edit.Text          = filamentOptions.Options.temperature.ToString();
         TemperatureEditButton.Enabled  = true;
         TemperatureResetButton.Enabled = true;
     }
     else
     {
         type_edit.Text                 = "";
         color_edit.Text                = "";
         temperature_edit.Text          = "";
         TemperatureEditButton.Enabled  = false;
         TemperatureResetButton.Enabled = false;
     }
     temperature_edit.Enabled      = false;
     TemperatureEditButton.Visible = true;
     TemperatureSaveButton.Visible = false;
     TemperatureSaveButton.Enabled = false;
     filamentprofile_list.Selected = index;
     prevSelectedProfile           = index;
 }
 public override void OnActivate(Mangage3DInkStageDetails details)
 {
     base.OnActivate(details);
     filamentset.Value = false;
     Host.SetFocus(custom_temperature_edit);
     custom_temperature_edit.Text = details.current_spool.filament_temperature.ToString();
     textColor.Text    = FilamentConstants.ColorsToString((FilamentConstants.ColorsEnum)Enum.ToObject(typeof(FilamentConstants.ColorsEnum), CurrentDetails.current_spool.filament_color_code));
     textMaterial.Text = CurrentDetails.current_spool.filament_type.ToString();
 }
Esempio n. 3
0
        private void AddColorItems(FilamentSpool.TypeEnum type)
        {
            color_combobox.ClearItems();
            foreach (FilamentConstants.ColorsEnum color in (FilamentConstants.ColorsEnum[])Enum.GetValues(typeof(FilamentConstants.ColorsEnum)))
            {
                color_combobox.AddItem(FilamentConstants.ColorsToString(color));
            }

            color_combobox.Select = 0;
        }
Esempio n. 4
0
 public Filament(FilamentProfile profile)
 {
     if (profile != null)
     {
         Color       = FilamentConstants.ColorsToString(profile.Color);
         Temperature = profile.Temperature;
         Type        = profile.Type.ToString();
     }
     else
     {
         Color       = "";
         Temperature = 0;
         Type        = "";
     }
 }
Esempio n. 5
0
        public List <string> GenerateColors(FilamentSpool.TypeEnum type = FilamentSpool.TypeEnum.NoFilament)
        {
            var stringList = new List <string>();

            if (type == FilamentSpool.TypeEnum.NoFilament)
            {
                for (var index = 0; index < 20; ++index)
                {
                    stringList.Add(FilamentConstants.ColorsToString((FilamentConstants.ColorsEnum)index));
                }

                stringList.Add(FilamentConstants.ColorsToString(FilamentConstants.ColorsEnum.Grey));
            }
            else
            {
                dictionary.TryGetValue(type.ToString(), out List <Filament> filamentList);
                foreach (Filament filament in filamentList.FindAll(x => x.Type == type))
                {
                    stringList.Add(filament.ColorStr);
                }
            }
            return(stringList);
        }
Esempio n. 6
0
        private void ShowCurrentFilament(PrinterObject printer, FilamentSpool current_spool)
        {
            text_title.Text             = "3D Ink Currently in use:\n\n" + FilamentProfile.GenerateSpoolName(current_spool, true);
            text_temperature_value.Text = current_spool.filament_temperature.ToString() + " Degrees C";
            FilamentConstants.Branding brandingFrom = FilamentConstants.GetBrandingFrom(current_spool.filament_type, (FilamentConstants.ColorsEnum)current_spool.filament_color_code);
            text_material_value.Text       = brandingFrom == FilamentConstants.Branding.Other ? FilamentConstants.TypesToString(current_spool.filament_type) : FilamentConstants.TypesToString(current_spool.filament_type) + " " + FilamentConstants.BrandingToString(brandingFrom);
            text_color_value.Text          = FilamentConstants.ColorsToString((FilamentConstants.ColorsEnum)current_spool.filament_color_code);
            text_main.Text                 = "";
            text_3dInkAmount_value.Text    = current_spool.estimated_filament_length_printed.ToString("0.00");
            text_temperature_value.Visible = true;
            text_material_value.Visible    = true;
            text_color_value.Visible       = true;
            text_temperature.Visible       = true;
            text_material.Visible          = true;
            text_color.Visible             = true;
            if (!settingsManager.CurrentFilamentSettings.TrackFilament)
            {
                return;
            }

            text_3dInkAmount_value.Visible = true;
            text_3dInkAmount.Visible       = true;
        }