public void setupColor() { CurrentZoomLevel = RegMemory.GetInt("tempZoomLevel", 15); AvgPeriod = RegMemory.GetInt("tempAverageSeconds", 120); ShowExtruder = RegMemory.GetBool("tempShowExtruder", true); ShowAverage = RegMemory.GetBool("tempShowAverage", true); ShowBed = RegMemory.GetBool("tempShowBed", true); Autoscroll = RegMemory.GetBool("tempAutoscroll", true); ShowOutput = RegMemory.GetBool("tempShowOutput", true); ShowTarget = RegMemory.GetBool(@"tempShowTarget", true); extruderWidth = RegMemory.GetDouble("tempExtruderWidth", 2); avgExtruderWidth = RegMemory.GetDouble("tempAvgExtruderWidth", 7); targetExtruderWidth = RegMemory.GetDouble("tempTargetExtruderWidth", 1); bedWidth = RegMemory.GetDouble("tempBedWidth", 2); avgBedWidth = RegMemory.GetDouble("tempAvgBedWidth", 7); targetBedWidth = RegMemory.GetDouble("tempTargetBedWidth", 1); avgOutputWidth = RegMemory.GetDouble("tempAvgOutputWidth", 2); backgroundColor = RegMemory.GetColor("tempBackgroundColor", Color.Black); gridColor = RegMemory.GetColor("tempGridColor", Color.FromArgb(255, 0, 70, 0)); axisColor = RegMemory.GetColor("tempAxisColor", Color.FromArgb(255, 255, 255, 255)); fontColor = RegMemory.GetColor("tempFontColor", Color.FromArgb(255, 229, 229, 229)); extruderColor = RegMemory.GetColor("tempExtruderColor", Color.FromArgb(255, 255, 2, 61)); avgExtruderColor = RegMemory.GetColor("tempAvgExtruderColor", Color.FromArgb(178, 222, 114, 0)); bedColor = RegMemory.GetColor("tempBedColor", Color.FromArgb(255, 0, 208, 210)); avgBedColor = RegMemory.GetColor("tempAvgBedColor", Color.FromArgb(178, 0, 122, 165)); targetExtruderColor = RegMemory.GetColor("tempTargetExtruderColor", Color.FromArgb(255, 153, 102, 204)); targetBedColor = RegMemory.GetColor("tempTargetBedColor", Color.FromArgb(255, 153, 102, 204)); outputColor = RegMemory.GetColor("tempOutputColor", Color.FromArgb(178, 13, 128, 15)); avgOutputColor = RegMemory.GetColor("tempAvgOutputColor", Color.FromArgb(255, 0, 128, 255)); }
/// <summary> /// Gets values from the registry and sets the text and checkboxes in the forms according to what was /// saved in the regestry. /// </summary> public void RegToForm() { Workdir = (string)repetierKey.GetValue("workdir", Workdir); checkLogfile.Checked = 1 == (int)repetierKey.GetValue("logEnabled", LogEnabled ? 1 : 0); checkDisableQualityReduction.Checked = 1 == (int)repetierKey.GetValue("disableQualityReduction", DisableQualityReduction ? 1 : 0); checkReduceToolbarSize.Checked = 1 == (int)repetierKey.GetValue("reduceToolbarSize", ReduceToolbarSize ? 1 : 0); checkRedGreenSwitch.Checked = 2 == RegMemory.GetInt("onOffImageOffset", 0); }
public BasicConfiguration() { slic3rConfigDir = RegMemory.GetString("slic3rConfigDir", slic3rConfigDir); slic3rExecutable = RegMemory.GetString("slic3rExecutable", slic3rExecutable); slic3rPrintSettings = RegMemory.GetString("slic3rPrintSettings", slic3rPrintSettings); slic3rPrinterSettings = RegMemory.GetString("slic3rPrinterSettings", slic3rPrinterSettings); slic3rFilamentSettings = RegMemory.GetString("slic3rFilamentSettings", slic3rFilamentSettings); slic3rFilament2Settings = RegMemory.GetString("slic3rFilament2Settings", slic3rFilament2Settings); slic3rFilament3Settings = RegMemory.GetString("slic3rFilament3Settings", slic3rFilament3Settings); slic3rVersionGroup = RegMemory.GetInt("slic3rVersionGroup", slic3rVersionGroup); skeinforgeProfile = RegMemory.GetString("skeinforgeProfile", skeinforgeProfile); skeinforgeProfileDir = RegMemory.GetString("skeinforgeProfileDir", skeinforgeProfileDir); externalSlic3rPath = RegMemory.GetString("externalSlic3rPath", externalSlic3rPath); externalSlic3rIniFile = RegMemory.GetString("externalSlic3rIniFile", externalSlic3rIniFile); internalSlic3rUseBundledVersion = RegMemory.GetBool("internalSlic3rUseBundledVersion", internalSlic3rUseBundledVersion); }
public Main() { executeHostCall = new executeHostCommandDelegate(this.executeHostCommand); repetierKey = Registry.CurrentUser.CreateSubKey("Software\\Repetier"); repetierKey.SetValue("installPath", Application.StartupPath); if (Path.DirectorySeparatorChar != '\\' && IsRunningOnMac()) { IsMac = true; } /*String[] parms = Environment.GetCommandLineArgs(); * string lastcom = ""; * foreach (string s in parms) * { * if (lastcom == "-home") * { * repetierKey.SetValue("installPath",s); * lastcom = ""; * continue; * } * if (s == "-macosx") IsMac = true; * lastcom = s; * }*/ main = this; generator = new GCodeGenerator(); globalSettings = new GlobalSettings(); conn = new PrinterConnection(); printerSettings = new FormPrinterSettings(); threeDSettings = new ThreeDSettings(); InitializeComponent(); RegMemory.RestoreWindowPos("mainWindow", this); if (WindowState == FormWindowState.Maximized) { Application.DoEvents(); } splitLog.SplitterDistance = RegMemory.GetInt("logSplitterDistance", splitLog.SplitterDistance); if (IsMono) { if (!IsMac) { splitContainerPrinterGraphic.SplitterDistance += 52; foreach (ToolStripItem m in menu.Items) { m.Text = m.Text.Replace("&", null); } } if (IsMac) { /*Application.Events.Quit += delegate (object sender, ApplicationEventArgs e) { * Application.Quit (); * e.Handled = true; * }; * * ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) { * WindowState = FormWindowState.Normal; * e.Handled = true; * };*/ MinimumSize = new Size(500, 640); tab.MinimumSize = new Size(500, 500); splitLog.Panel1MinSize = 520; splitLog.Panel2MinSize = 100; splitLog.IsSplitterFixed = true; splitJob.IsSplitterFixed = true; //splitContainerPrinterGraphic.SplitterDistance -= 52; splitLog.SplitterDistance = splitLog.Height - 100; } } toolShowLog.Checked = RegMemory.GetBool("logShow", true); conn.eventConnectionChange += OnPrinterConnectionChange; conn.eventPrinterAction += OnPrinterAction; conn.eventJobProgress += OnJobProgress; printPanel = new PrintPanel(); printPanel.Dock = DockStyle.Fill; splitContainerPrinterGraphic.Panel1.Controls.Add(printPanel); printerSettings.formToCon(); logView = new LogView(); logView.Dock = DockStyle.Fill; splitLog.Panel2.Controls.Add(logView); skeinforge = new Skeinforge(); PrinterChanged(printerSettings.currentPrinterKey, true); printerSettings.eventPrinterChanged += PrinterChanged; // GCode print preview printPreview = new ThreeDControl(); printPreview.Dock = DockStyle.Fill; splitContainerPrinterGraphic.Panel2.Controls.Add(printPreview); printPreview.SetEditor(false); printPreview.AutoUpdateable = true; printVisual = new GCodeVisual(conn.analyzer); printVisual.liveView = true; printPreview.models.AddLast(printVisual); basicTitle = Text; jobPreview = new ThreeDControl(); jobPreview.Dock = DockStyle.Fill; splitJob.Panel2.Controls.Add(jobPreview); jobPreview.SetEditor(false); jobPreview.models.AddLast(jobVisual); editor.contentChangedEvent += JobPreview; editor.commands = new Commands(); editor.commands.Read("default", "en"); UpdateHistory(); UpdateConnections(); Main.slic3r = new Slic3r(); slicer = new Slicer(); if (IsMac) { tabGCode.Controls.Remove(splitJob); tabPrint.Controls.Remove(splitContainerPrinterGraphic); } }