Commit 764f7297 刘韬

增补翻译

1 个父辈 461cbcca
......@@ -147,7 +147,7 @@ namespace AutoScanAndLabel
AlarmBuzzer.BuzzerStateChange += AlarmBuzzer_BuzzerStateChange;
RobotManage.LoadFinishEvent += RobotManage_LoadFinishEvent;
if (Config.Get("EnableLogWindow",false))
AddForm(crc.GetString("Res0007","日志"), lc);
AddForm("Res0007", crc.GetString("Res0007","日志"), lc);
RobotManage.Init();
}
......@@ -163,12 +163,12 @@ namespace AutoScanAndLabel
e.NewWidth = (sender as ListView).Columns[e.ColumnIndex].Width;
e.Cancel = true;
}
const int tabpagecount = 3;
const int tabpagecount = 4;
void addTablePage() {
AddForm(crc.GetString("Res0008","IO调试"), ioc);
AddForm(crc.GetString("Res0009","伺服调试"), ac);
AddForm(crc.GetString("Res0070","Agv调试"), agv);
AddForm(crc.GetString("Res0010","相关设置"), sc);
AddForm("Res0008",crc.GetString("Res0008","IO调试"), ioc);
AddForm("Res0009",crc.GetString("Res0009","伺服调试"), ac);
AddForm("Res0070", crc.GetString("Res0070","Agv调试"), agv);
AddForm("Res0010", crc.GetString("Res0010","相关设置"), sc);
crc.LanguageProcess(this);
}
//public delegate void setstatedelegate(List<MoveInfo> moveinfoList);
......@@ -200,25 +200,29 @@ namespace AutoScanAndLabel
this.ResumeLayout(true);
}
private void AddForm(string text, UserControl form)
private void AddForm(string id, string text, UserControl form)
{
//text = text.PadLeft(10, ' ');
foreach (TabPage tp in tabControl1.TabPages)
{
if (tp.Name == id)
{
tp.Text = text;
return;
}
}
TabPage lineTabPage = new TabPage(text);
// lineTabPage.AutoScroll = true;
//lineTabPage.Tag = robot;
lineTabPage.Name = id;
Panel linePan = new Panel();
linePan.Dock = DockStyle.Fill;
linePan.AutoScroll = true;
lineTabPage.Controls.Add(linePan);
//form.FormBorderStyle = FormBorderStyle.None;
//form.TopLevel = false;
linePan.Controls.Add(form);
form.Dock = DockStyle.Fill;
linePan.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Show();
//tabPageList.Add(lineTabPage);
tabControl1.Controls.Add(lineTabPage);
tabControl1.TabPages.Add(lineTabPage);
}
private void 启用调试模式ToolStripMenuItem_Click(object sender, EventArgs e)
......@@ -236,9 +240,10 @@ namespace AutoScanAndLabel
RobotManage.LoadDebug();
}
else {
for (int i = tabControl1.TabPages.Count-1; i > 1; i--)
var tc = tabControl1.TabPages.Count;
for (int i = 1; i <= tabpagecount; i++)
{
tabControl1.TabPages[i].Parent = null;
tabControl1.TabPages[tc - i].Parent = null;
}
}
}
......
......@@ -14,6 +14,7 @@ using UserFromControl;
namespace AutoScanAndLabel
{
using crc = OnlineStore.CodeResourceControl;
public partial class IOControl : UserControl
{
readonly Timer t1 = new Timer();
......@@ -51,6 +52,7 @@ namespace AutoScanAndLabel
private void LoadIOList()
{
t1.Stop();
this.SuspendLayout();
DIControlList.Clear();
DOControlList.Clear();
......@@ -63,7 +65,7 @@ namespace AutoScanAndLabel
//if (ioValue.SubType.Equals(0))
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 26));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
......@@ -79,7 +81,7 @@ namespace AutoScanAndLabel
//if (ioValue.SubType.Equals(0))
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + crc.GetString(ioValue.ProName, ioValue.Explain), ioValue.ProName);
control.Click += Control_Click;
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
......
......@@ -37,9 +37,29 @@ namespace AutoScanAndLabel
void LoadPosList()
{
if (!this.Created)
return;
if (this.InvokeRequired)
{
this.Invoke((EventHandler)delegate
{
try
{
LoadPosList();
}
catch (Exception ee)
{
MessageBox.Show("LoadPosList:" + ee.ToString());
}
});
return;
}
tableLayoutPanel1.SuspendLayout();
int maxrow = tableLayoutPanel1.Height / 34;
this.tableLayoutPanel1.RowStyles.Clear();
tableLayoutPanel1.Controls.Clear();
this.tableLayoutPanel1.RowStyles.Clear();
//this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType., 26));
int r = 0;
int c = 0;
......@@ -62,30 +82,35 @@ namespace AutoScanAndLabel
color = Color.FromArgb(random.Next(30, 150), random.Next(30, 150), random.Next(30, 150));
}
var tests = Config.GetType().GetProperty(configBase.ProName + "_speed");
bool hasSpeed = tests != null;
//this.tableLayoutPanel1.RowCount++;
if (configBase.SubType < 20)
if (hasSpeed)//(configBase.SubType < 30)
{
Button button = new Button();
button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
button.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
button.Name = configBase.ProName;
button.Size = new System.Drawing.Size(225, 27);
button.Text = configBase.Explain;
button.Text = crc.GetString(configBase.ProName, configBase.Explain);
button.Click += Button_Click;
button.ForeColor = color;
button.Tag = configBase.SubType%10;
button.Tag = configBase.SubType - 10;
tableLayoutPanel1.Controls.Add(button, c, r);
}
else {
else
{
Label button = new Label();
button.Anchor = (AnchorStyles)(AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
button.Name = configBase.ProName;
button.Text = configBase.Explain;
button.Text = crc.GetString(configBase.ProName, configBase.Explain);
button.AutoSize = false;
button.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
button.ForeColor = color;
tableLayoutPanel1.Controls.Add(button, c, r);
}
TextBox textBox = new TextBox();
textBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -95,8 +120,6 @@ namespace AutoScanAndLabel
textBox.Text = configBase.ProValue;
textBox.KeyPress += TextBox_KeyPress;
textBox.TextChanged += TextBox_TextChanged;
textBox.Click += TextBox_Click;
tableLayoutPanel1.Controls.Add(textBox, c + 1, r);
......@@ -107,7 +130,7 @@ namespace AutoScanAndLabel
textBox.Tag = pi.PropertyType.Name;
}
if (configBase.SubType < 20)
if (hasSpeed)//(configBase.SubType < 30)
{
TextBox textBox2 = new TextBox();
textBox2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -122,7 +145,8 @@ namespace AutoScanAndLabel
textBox.Tag = "Int32";
}
else {
else
{
tableLayoutPanel1.SetColumnSpan(textBox, 2);
}
......@@ -133,10 +157,12 @@ namespace AutoScanAndLabel
c += 3;
}
}
if (r <= maxrow+1) {
if (r <= maxrow + 1)
{
Label button1 = new Label();
tableLayoutPanel1.Controls.Add(button1, c, r++);
}
tableLayoutPanel1.ResumeLayout(true);
}
private void TextBox_Click(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!