Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6a612838
由
张东亮
编写于
2024-01-29 17:17:13 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
合并分支 'tab栏预加载' 到 'master'
tab栏加载一次 查看合并请求
!1
2 个父辈
1a885adb
3a0534d0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
66 行增加
和
31 行删除
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/Form1.cs
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
6a61283
...
...
@@ -92,6 +92,14 @@ namespace DeviceLibrary
CodeManager
.
LoadConfig
();
mainMachine
=
new
MainMachine
(
RobotManage
.
Config
);
//Thread.Sleep(5000);
if
(
string
.
IsNullOrEmpty
(
msg
))
{
DataInitEvent
?.
Invoke
(
true
,
""
);
}
else
{
DataInitEvent
?.
Invoke
(
false
,
msg
);
}
if
(!
IOManager
.
ConnectionIOList
(
new
List
<
string
>()))
{
IsLoadOk
=
false
;
...
...
TheMachine/Form1.cs
查看文件 @
6a61283
...
...
@@ -26,7 +26,7 @@ namespace TheMachine
crc
.
OpenResourceLog
=
true
;
InitializeComponent
();
this
.
FormClosing
+=
Form1_FormClosing
;
this
.
Text
=
Setting_Init
.
App_Title
+
" "
+
Setting_Init
.
App_CID
;
this
.
Text
=
Setting_Init
.
App_Title
+
" "
+
Setting_Init
.
App_CID
;
crc
.
GetLanguageEvent
+=
Crc_GetLanguageEvent
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
crc
.
CurrLanguage
=
Crc_GetLanguageEvent
();
...
...
@@ -38,8 +38,13 @@ namespace TheMachine
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
{
if
(
tabc
.
TabCount
>
tabpagecount
)
addTablePage
();
if
(
RobotManage
.
IsConfigMode
)
{
showDebugTabPages
(
true
);
}
//if (tabc.TabCount > tabpagecount)
// addTablePage();
LanguageProcess
();
...
...
@@ -173,10 +178,13 @@ namespace TheMachine
const
int
tabpagecount
=
4
;
void
addTablePage
()
{
this
.
SuspendLayout
();
AddForm
(
"tab_io"
,
crc
.
GetString
(
L
.
tab_io
,
"IO调试"
),
ioc
);
AddForm
(
"tab_axis"
,
crc
.
GetString
(
L
.
tab_axis
,
"伺服调试"
),
ac
);
AddForm
(
"tab_store"
,
crc
.
GetString
(
L
.
tab_store
,
"库位调试"
),
bd
);
AddForm
(
"tab_setting"
,
crc
.
GetString
(
L
.
tab_setting
,
"相关设置"
),
sc
);
this
.
ResumeLayout
(
true
);
this
.
PerformLayout
();
crc
.
LanguageProcess
(
this
);
}
...
...
@@ -208,6 +216,32 @@ namespace TheMachine
this
.
ResumeLayout
(
true
);
}
List
<
TabPage
>
tabPages
=
new
List
<
TabPage
>();
void
showDebugTabPages
(
bool
show
)
{
if
(
this
.
InvokeRequired
)
{
this
.
Invoke
((
EventHandler
)
delegate
{
showDebugTabPages
(
show
);
});
return
;
}
foreach
(
var
item
in
tabPages
)
{
if
(
show
)
{
item
.
Parent
=
tabc
;
}
else
{
item
.
Parent
=
null
;
}
}
crc
.
LanguageProcess
(
this
);
}
private
void
AddForm
(
string
id
,
string
text
,
UserControl
form
)
{
foreach
(
TabPage
tp
in
tabc
.
TabPages
)
...
...
@@ -229,6 +263,7 @@ namespace TheMachine
linePan
.
Anchor
=
((
AnchorStyles
)((
AnchorStyles
.
Top
|
AnchorStyles
.
Right
|
AnchorStyles
.
Bottom
|
AnchorStyles
.
Left
)));
form
.
Anchor
=
((
AnchorStyles
)((
AnchorStyles
.
Top
|
AnchorStyles
.
Right
|
AnchorStyles
.
Bottom
|
AnchorStyles
.
Left
)));
form
.
Show
();
tabPages
.
Add
(
lineTabPage
);
tabc
.
TabPages
.
Add
(
lineTabPage
);
}
...
...
@@ -240,22 +275,22 @@ namespace TheMachine
RobotManage
.
IsConfigMode
=
RobotManage
.
IsConfigMode
?
false
:
true
;
(
sender
as
ToolStripMenuItem
).
Text
=
!
RobotManage
.
IsConfigMode
?
crc
.
GetString
(
L
.
enable_config_mode
,
"启用配置模式"
)
:
crc
.
GetString
(
L
.
disable_config_mode
,
"停用配置模式"
);
showDebugTabPages
(
RobotManage
.
IsConfigMode
);
if
(
RobotManage
.
IsConfigMode
)
{
//RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
addTablePage
();
RobotManage
.
LoadDebug
();
}
else
{
var
tc
=
tabc
.
TabPages
.
Count
;
for
(
int
i
=
1
;
i
<=
tabpagecount
;
i
++)
{
tabc
.
TabPages
[
tc
-
i
].
Parent
=
null
;
}
}
//if (RobotManage.IsConfigMode)
//{
// //RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
// // addTablePage();
// //RobotManage.LoadDebug();
//}
//else
//{
// var tc = tabc.TabPages.Count;
// for (int i = 1; i <= tabpagecount; i++)
// {
// tabc.TabPages[tc - i].Parent = null;
// }
//}
}
public
delegate
void
setmsgdelegate
(
List
<
Msg
>
msgs
);
...
...
@@ -283,8 +318,10 @@ namespace TheMachine
});
return
;
}
ioc
.
Config
=
RobotManage
.
Config
;
bd
.
Config
=
RobotManage
.
Config
;
addTablePage
();
}
private
void
RobotManage_LoadFinishEvent
(
bool
state
,
string
msg
)
{
...
...
@@ -296,6 +333,7 @@ namespace TheMachine
});
return
;
}
showDebugTabPages
(
false
);
启用调试模式
ToolStripMenuItem
.
Enabled
=
true
;
pnl
.
Enabled
=
true
;
tabc
.
Enabled
=
true
;
...
...
@@ -320,9 +358,6 @@ namespace TheMachine
//btn_stop.Enabled = true;
RobotManage
.
mainMachine
.
ProcessMsgEvent
+=
MainMachine_ProcessMsgEvent
;
}
ioc
.
Config
=
RobotManage
.
Config
;
bd
.
Config
=
RobotManage
.
Config
;
var
lm
=
new
List
<
Msg
>();
foreach
(
string
ms
in
msg
.
Split
(
new
char
[]
{
'\n'
},
StringSplitOptions
.
RemoveEmptyEntries
))
{
...
...
@@ -338,14 +373,6 @@ namespace TheMachine
object
showMsgLoc
=
new
object
();
void
SetMsg
(
List
<
Msg
>
msgs
)
{
//if (this.InvokeRequired)
//{
// this.Invoke((EventHandler)delegate
// {
// SetMsg(msgs);
// });
// return;
//}
if
(
Monitor
.
TryEnter
(
showMsgLoc
))
{
try
...
...
@@ -548,7 +575,7 @@ namespace TheMachine
private
void
cb_EnableBuzzer_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
Setting_Init
.
Enable_Buzzer
=
cb_EnableBuzzer
.
Checked
;
Setting_Init
.
Enable_Buzzer
=
cb_EnableBuzzer
.
Checked
;
AlarmBuzzer
.
Enable
=
cb_EnableBuzzer
.
Checked
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论