using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using directPacking; namespace MyGlassEdit.配置 { public partial class 刀路设置 : Form { string errTipMsg = "数值设置过大"; public 刀路设置(参数设定 parent) { switch (Setting.language) { case 1://英语 // System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("sq"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en"); errTipMsg = "The numerical setting is too large"; break; case 2: System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ru"); break; default: //System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(""); break; } InitializeComponent(); canshuform = parent; } bool begincheck = false; 参数设定 canshuform; private void 刀路设置_Load(object sender, EventArgs e) { arrowCheck.Checked = Setting.displayarror; baibian2.Text = Setting.baibian2.ToString(); securatyCut.Text = Setting.securatycut.ToString(); edgeshrink.Text = Setting.edgeshrink.ToString(); singleChecked.Checked = Setting.singleDirectionCutting; tshrink.Text = Setting.Tshrink.ToString(); ArcLineconnectCheck.Checked = Setting.ArcLineConncect; holeradius.Text = Setting.hole.ToString(); thickControlChk.Checked = Setting.thickcontrol; begincheck = true; } public void save() { float securatycut = 0; float Tshrink = 0; try { Setting.hole = (float)Convert.ToDouble(holeradius.Text); } catch { Setting.hole = 0; } Setting.singleDirectionCutting = singleChecked.Checked; Setting.ArcLineConncect = ArcLineconnectCheck.Checked; Setting.hole = (float)Convert.ToDouble(holeradius.Text); Setting.displayarror = Convert.ToBoolean(arrowCheck.Checked); if (!float.TryParse(securatyCut.Text, out securatycut)) { securatycut = 0; } if (securatycut < 50) Setting.securatycut = securatycut; else globel.ShowFromWarningMessage(errTipMsg); if (!float.TryParse(tshrink.Text, out Tshrink)) { Tshrink = 0; } if (Tshrink < 50) Setting.Tshrink = Tshrink; else globel.ShowFromWarningMessage(errTipMsg); float Edgeshrink = 0; if (!float.TryParse(edgeshrink.Text, out Edgeshrink)) { Edgeshrink = 0; } if (Edgeshrink < 50) Setting.edgeshrink = Edgeshrink; else globel.ShowFromWarningMessage(errTipMsg); double baibian = 0; if (!double.TryParse(baibian2.Text, out baibian)) { baibian = 0; } if (baibian < 50) Setting.baibian2 = baibian; else { globel.ShowFromWarningMessage(errTipMsg); } Setting.UpdateSetting(); canshuform.parent.刷新刀路ToolStripMenuItem_Click(new object(), new EventArgs()); } private void autocutSystemChk_CheckedChanged(object sender, EventArgs e) { Setting.thickcontrol = thickControlChk.Checked; } private void holeradius_TextChanged(object sender, EventArgs e) { } } }