Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO827-AutoScanAndLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 764f7297
由
刘韬
编写于
2022-09-15 16:06:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增补翻译
1 个父辈
461cbcca
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
62 行增加
和
29 行删除
AutoScanAndLabel/Form1.cs
AutoScanAndLabel/IOControl.cs
AutoScanAndLabel/UC/ConfigControl.cs
AutoScanAndLabel/resources/en-US.lngres
AutoScanAndLabel/resources/ja-JP.lngres
AutoScanAndLabel/resources/zh-CN.lngres
AutoScanAndLabel/Form1.cs
查看文件 @
764f729
...
...
@@ -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
;
}
}
}
...
...
AutoScanAndLabel/IOControl.cs
查看文件 @
764f729
...
...
@@ -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
++;
...
...
AutoScanAndLabel/UC/ConfigControl.cs
查看文件 @
764f729
...
...
@@ -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,25 +82,30 @@ 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
<
2
0
)
if
(
hasSpeed
)
//(configBase.SubType < 3
0)
{
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
=
c
onfigBase
.
Explain
;
button
.
Text
=
c
rc
.
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
=
c
onfigBase
.
Explain
;
button
.
Text
=
c
rc
.
GetString
(
configBase
.
ProName
,
configBase
.
Explain
)
;
button
.
AutoSize
=
false
;
button
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
button
.
ForeColor
=
color
;
...
...
@@ -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
<
2
0
)
if
(
hasSpeed
)
//(configBase.SubType < 3
0)
{
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
)
...
...
AutoScanAndLabel/resources/en-US.lngres
查看文件 @
764f729
此文件的差异被折叠,
点击展开。
AutoScanAndLabel/resources/ja-JP.lngres
查看文件 @
764f729
此文件的差异被折叠,
点击展开。
AutoScanAndLabel/resources/zh-CN.lngres
查看文件 @
764f729
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论