Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1057_XLC_Store
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a6c3be72
由
刘韬
编写于
2022-10-10 17:12:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
39717666
全部展开
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
236 行增加
和
55 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/InOutDevice.cs
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/SettingControl.Designer.cs
TheMachine/SettingControl.cs
TheMachine/SettingControl.resx
Common/Setting_Init.cs
查看文件 @
a6c3be7
...
@@ -38,7 +38,13 @@ namespace OnlineStore.Common
...
@@ -38,7 +38,13 @@ namespace OnlineStore.Common
[
MyConfigComment
(
"屏蔽进出轴伸出时的层信号检查"
)]
[
MyConfigComment
(
"屏蔽进出轴伸出时的层信号检查"
)]
public
static
MyConfig
<
bool
>
Device_DisableFloorCheck
=
false
;
public
static
MyConfig
<
bool
>
Device_DisableFloorCheck
=
false
;
[
MyConfigComment
(
"温湿度传感器端口"
)]
public
static
MyConfig
<
string
>
Device_Humiture_Port
=
"COM5"
;
[
MyConfigComment
(
"湿度超限吹气启动相对值=服务器设定湿度报警值-本相对值"
)]
public
static
MyConfig
<
int
>
Device_HumidityStartOffser
=
1
;
[
MyConfigComment
(
"湿度超限吹气停止相对值=服务器设定湿度报警值-本相对值"
)]
public
static
MyConfig
<
int
>
Device_HumidityEndOffser
=
10
;
[
MyConfigComment
(
"扫码识别类型"
)]
[
MyConfigComment
(
"扫码识别类型"
)]
public
static
MyConfig
<
string
[
]>
CodeScan_CodeType
=
new
string
[]
{
"QR Code"
};
public
static
MyConfig
<
string
[
]>
CodeScan_CodeType
=
new
string
[]
{
"QR Code"
};
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
a6c3be7
...
@@ -580,12 +580,12 @@ namespace DeviceLibrary
...
@@ -580,12 +580,12 @@ namespace DeviceLibrary
}
}
public
class
DoorInfo
{
public
class
DoorInfo
{
public
DoorInfo
(
doorIndexE
doorIndexE
)
{
public
DoorInfo
()
{
doorIndex
=
doorIndexE
;
status
=
doorStatusE
.
free
;
status
=
doorStatusE
.
free
;
hasContainer
=
false
;
hasContainer
=
false
;
hSerial
=
""
;
hSerial
=
""
;
}
}
public
string
doorType
;
public
doorIndexE
doorIndex
;
public
doorIndexE
doorIndex
;
public
doorStatusE
status
;
public
doorStatusE
status
;
public
bool
hasContainer
;
public
bool
hasContainer
;
...
@@ -593,12 +593,8 @@ namespace DeviceLibrary
...
@@ -593,12 +593,8 @@ namespace DeviceLibrary
}
}
public
enum
doorIndexE
{
public
enum
doorIndexE
{
LeftIn
=
2
,
XLC_2
=
2
,
LeftOut
=
1
,
XLC_1
=
1
,
RightIn
=
4
,
RightOut
=
3
,
}
}
public
enum
doorStatusE
public
enum
doorStatusE
{
{
...
@@ -608,4 +604,9 @@ namespace DeviceLibrary
...
@@ -608,4 +604,9 @@ namespace DeviceLibrary
needBox
=
4
,
needBox
=
4
,
fullBoxNeedLeave
=
5
fullBoxNeedLeave
=
5
}
}
public
class
DoorTypeE
{
public
const
string
IN
=
"IN"
;
public
const
string
OUT
=
"OUT"
;
public
const
string
BOTH
=
"BOTH"
;
}
}
}
DeviceLibrary/theMachine/InOutDevice.cs
查看文件 @
a6c3be7
...
@@ -56,7 +56,7 @@ namespace DeviceLibrary
...
@@ -56,7 +56,7 @@ namespace DeviceLibrary
Robot_Config
Config
;
Robot_Config
Config
;
MainMachine
mainMachine
;
MainMachine
mainMachine
;
public
string
Name
;
public
string
Name
;
public
DoorInfo
DoorInfo
=
new
DoorInfo
(
doorIndexE
.
LeftIn
);
public
DoorInfo
DoorInfo
=
new
DoorInfo
();
public
InOutDevice
(
InOutSideE
inOutSide
,
InOutModeE
inOutMode
,
Robot_Config
_Config
,
MainMachine
_mainMachine
)
public
InOutDevice
(
InOutSideE
inOutSide
,
InOutModeE
inOutMode
,
Robot_Config
_Config
,
MainMachine
_mainMachine
)
{
{
AxisBean
Lift_Moto
;
AxisBean
Lift_Moto
;
...
@@ -116,6 +116,19 @@ namespace DeviceLibrary
...
@@ -116,6 +116,19 @@ namespace DeviceLibrary
Line
=
new
LineRunMonitor
(
Name
,
Config
.
DOList
[
DO_Moto_Run
].
GetIOAddr
(),
Config
.
DOList
[
DO_Moto_Rev
].
GetIOAddr
());
Line
=
new
LineRunMonitor
(
Name
,
Config
.
DOList
[
DO_Moto_Run
].
GetIOAddr
(),
Config
.
DOList
[
DO_Moto_Rev
].
GetIOAddr
());
InOutDeviceList
.
Add
(
inOutSide
,
this
);
InOutDeviceList
.
Add
(
inOutSide
,
this
);
if
(
InOutSide
==
InOutSideE
.
Left
)
DoorInfo
.
doorIndex
=
doorIndexE
.
XLC_1
;
else
if
(
InOutSide
==
InOutSideE
.
Right
)
DoorInfo
.
doorIndex
=
doorIndexE
.
XLC_2
;
if
(
InOutMode
==
InOutModeE
.
Both
)
DoorInfo
.
doorType
=
DoorTypeE
.
BOTH
;
else
if
(
InOutMode
==
InOutModeE
.
OnlyIN
)
DoorInfo
.
doorType
=
DoorTypeE
.
IN
;
else
if
(
InOutMode
==
InOutModeE
.
OnlyOUT
)
DoorInfo
.
doorType
=
DoorTypeE
.
OUT
;
}
}
bool
SafeCheck
()
bool
SafeCheck
()
{
{
...
@@ -158,9 +171,10 @@ namespace DeviceLibrary
...
@@ -158,9 +171,10 @@ namespace DeviceLibrary
if
(
MoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
if
(
MoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
{
DoorInfo
.
status
=
doorStatusE
.
free
;
DoorInfo
.
hasContainer
=
false
;
if
(
CanIn
(
out
string
msg
))
if
(
CanIn
(
out
string
msg
))
{
{
if
(
IOValue
(
IO_AgvIn_Req
).
Equals
(
IO_VALUE
.
HIGH
)
||
(
IOValue
(
IO_F_Stop_In
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Entry_SafetyGrating
).
Equals
(
IO_VALUE
.
LOW
)))
if
(
IOValue
(
IO_AgvIn_Req
).
Equals
(
IO_VALUE
.
HIGH
)
||
(
IOValue
(
IO_F_Stop_In
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Entry_SafetyGrating
).
Equals
(
IO_VALUE
.
LOW
)))
{
{
MoveInfo
.
NewMove
(
MoveStep
.
AgvIn01
);
MoveInfo
.
NewMove
(
MoveStep
.
AgvIn01
);
...
@@ -184,21 +198,12 @@ namespace DeviceLibrary
...
@@ -184,21 +198,12 @@ namespace DeviceLibrary
if
(
CurrnetDirection
==
InOutDirectionE
.
IN
)
if
(
CurrnetDirection
==
InOutDirectionE
.
IN
)
{
{
if
(
InOutSide
==
InOutSideE
.
Left
)
DoorInfo
.
doorIndex
=
doorIndexE
.
LeftIn
;
else
if
(
InOutSide
==
InOutSideE
.
Right
)
DoorInfo
.
doorIndex
=
doorIndexE
.
RightIn
;
DoorInfo
.
hSerial
=
MoveInfo
.
MoveParam
.
hSerial
;
DoorInfo
.
hSerial
=
MoveInfo
.
MoveParam
.
hSerial
;
DoorInfo
.
status
=
doorStatusE
.
inStore
;
DoorInfo
.
status
=
doorStatusE
.
inStore
;
DoorInfo
.
hasContainer
=
false
;
DoorInfo
.
hasContainer
=
false
;
}
}
else
if
(
CurrnetDirection
==
InOutDirectionE
.
OUT
)
else
if
(
CurrnetDirection
==
InOutDirectionE
.
OUT
)
{
{
if
(
InOutSide
==
InOutSideE
.
Left
)
DoorInfo
.
doorIndex
=
doorIndexE
.
LeftOut
;
else
if
(
InOutSide
==
InOutSideE
.
Right
)
DoorInfo
.
doorIndex
=
doorIndexE
.
RightOut
;
DoorInfo
.
hSerial
=
MoveInfo
.
MoveParam
.
hSerial
;
DoorInfo
.
hSerial
=
MoveInfo
.
MoveParam
.
hSerial
;
DoorInfo
.
status
=
doorStatusE
.
outStore
;
DoorInfo
.
status
=
doorStatusE
.
outStore
;
DoorInfo
.
hasContainer
=
true
;
DoorInfo
.
hasContainer
=
true
;
...
@@ -208,19 +213,8 @@ namespace DeviceLibrary
...
@@ -208,19 +213,8 @@ namespace DeviceLibrary
DoorInfo
.
status
=
doorStatusE
.
fullBoxNeedLeave
;
DoorInfo
.
status
=
doorStatusE
.
fullBoxNeedLeave
;
}
}
}
}
else
{
if
(
CanIn
(
out
string
msg
))
{
if
(
InOutSide
==
InOutSideE
.
Left
)
DoorInfo
.
doorIndex
=
doorIndexE
.
LeftIn
;
else
if
(
InOutSide
==
InOutSideE
.
Right
)
DoorInfo
.
doorIndex
=
doorIndexE
.
RightIn
;
DoorInfo
.
status
=
doorStatusE
.
needBox
;
DoorInfo
.
hasContainer
=
false
;
}
}
}
}
...
...
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
查看文件 @
a6c3be7
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
BtnActionE
BtnAction
=
BtnActionE
.
None
;
BtnActionE
BtnAction
=
BtnActionE
.
None
;
void
ioMonitor
()
void
ioMonitor
()
{
{
airprocess
();
var
btnUP_L
=
IOValue
(
IO_Type
.
Mid_Up_Btn1
).
Equals
(
IO_VALUE
.
HIGH
);
var
btnUP_L
=
IOValue
(
IO_Type
.
Mid_Up_Btn1
).
Equals
(
IO_VALUE
.
HIGH
);
var
btnUP_R
=
IOValue
(
IO_Type
.
Mid_Up_Btn2
).
Equals
(
IO_VALUE
.
HIGH
);
var
btnUP_R
=
IOValue
(
IO_Type
.
Mid_Up_Btn2
).
Equals
(
IO_VALUE
.
HIGH
);
var
btnDown_L
=
IOValue
(
IO_Type
.
Mid_Down_Btn1
).
Equals
(
IO_VALUE
.
HIGH
);
var
btnDown_L
=
IOValue
(
IO_Type
.
Mid_Down_Btn1
).
Equals
(
IO_VALUE
.
HIGH
);
...
@@ -103,6 +104,63 @@ namespace DeviceLibrary
...
@@ -103,6 +104,63 @@ namespace DeviceLibrary
}
}
public
double
Current_Humidity
=
0
;
public
double
Current_Temperate
=
0
;
bool
airisopen
=
false
;
DateTime
lastAirprocesstime
=
DateTime
.
Now
;
void
airprocess
()
{
if
((
DateTime
.
Now
-
lastAirprocesstime
).
TotalSeconds
<
5
)
return
;
lastAirprocesstime
=
DateTime
.
Now
;
//var temp = HumitureController.QueryData();
var
temp
=
HumitureController
.
LastData
;
Current_Humidity
=
temp
.
Humidity
;
Current_Temperate
=
temp
.
Temperate
;
//var tempIsOK = Current_Temperate < ServerCM.Max_Temperature;
var
humiNeedStart
=
Current_Humidity
>
ServerCM
.
Max_Humidity
-
Setting_Init
.
Device_HumidityStartOffser
;
var
humiNeedStop
=
Current_Humidity
<
ServerCM
.
Max_Humidity
-
Setting_Init
.
Device_HumidityEndOffser
;
if
(
humiNeedStart
&&
!
airisopen
)
{
IOMove
(
IO_Type
.
AirValue
,
IO_VALUE
.
HIGH
);
airisopen
=
true
;
LogUtil
.
info
(
$
"开始吹气,当前最大湿度:{Current_Humidity} > {ServerCM.Max_Humidity}-{Setting_Init.Device_HumidityStartOffser}."
);
}
else
if
(
humiNeedStop
&&
airisopen
)
{
IOMove
(
IO_Type
.
AirValue
,
IO_VALUE
.
LOW
);
airisopen
=
false
;
LogUtil
.
info
(
$
"关闭吹气,当前最大湿度:{Current_Humidity} < {ServerCM.Max_Humidity}-{Setting_Init.Device_HumidityEndOffser}."
);
}
}
bool
lastTHoutRangeStatus
=
false
;
DateTime
lastTHoutRangeTime
=
DateTime
.
MaxValue
;
bool
IsTHoutRange
()
{
if
(
HumitureController
.
LastData
.
Humidity
>
ServerCM
.
Max_Humidity
// || HumitureController.LastData.Humidity < ServerCM.Min_Humidity
||
HumitureController
.
LastData
.
Temperate
>
ServerCM
.
Max_Temperature
)
{
if
(!
lastTHoutRangeStatus
)
lastTHoutRangeTime
=
DateTime
.
Now
;
lastTHoutRangeStatus
=
true
;
return
true
;
}
else
{
if
(
lastTHoutRangeStatus
)
lastTHoutRangeTime
=
DateTime
.
MaxValue
;
lastTHoutRangeStatus
=
false
;
return
false
;
}
}
bool
IsTHoutRangeOver30m
()
{
return
(
DateTime
.
Now
-
lastTHoutRangeTime
).
TotalMinutes
>
30
;
}
enum
BtnActionE
enum
BtnActionE
{
{
None
,
None
,
...
...
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
a6c3be7
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
a6c3be7
...
@@ -78,9 +78,9 @@ namespace DeviceLibrary
...
@@ -78,9 +78,9 @@ namespace DeviceLibrary
AIOTMoveInfo
=
new
MoveInfo
(
"出入库测试"
);
AIOTMoveInfo
=
new
MoveInfo
(
"出入库测试"
);
#
region
初始化
led
灯
#
region
初始化
led
灯
AlarmLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Alarm_Led
].
GetIOAddr
());
AlarmLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Alarm_Led
].
GetIOAddr
()
,
LedColor
.
red
);
StandbyLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Standby_Led
].
GetIOAddr
());
StandbyLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Standby_Led
].
GetIOAddr
()
,
LedColor
.
yellow
);
RunningLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Run_Led
].
GetIOAddr
());
RunningLed
=
new
Led
(
Config
.
DOList
[
IO_Type
.
Run_Led
].
GetIOAddr
()
,
LedColor
.
green
);
#
endregion
#
endregion
#
region
初始化伺服轴
#
region
初始化伺服轴
XAxis
=
new
AxisBean
(
Config
.
XAxis
,
Name
);
XAxis
=
new
AxisBean
(
Config
.
XAxis
,
Name
);
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
a6c3be7
...
@@ -61,14 +61,21 @@ namespace DeviceLibrary
...
@@ -61,14 +61,21 @@ namespace DeviceLibrary
IsLoadOk
=
false
;
IsLoadOk
=
false
;
msg
+=
"IO板卡初始化失败\n"
;
msg
+=
"IO板卡初始化失败\n"
;
}
}
if
(
StoreType
==
StoreType
.
TypeA
)
{
if
(!
HumitureController
.
Init
(
Setting_Init
.
Device_Humiture_Port
))
if
(!
OKLEController
.
Init
(
Config
.
WeightSensorPort
))
{
{
IsLoadOk
=
false
;
IsLoadOk
=
false
;
msg
+=
$
"称重传感器初始化失败 Port:{Config.WeightSensorPort}\n"
;
msg
+=
"温湿度传感器初始化失败,端口:"
+
$
"{Setting_Init.Device_Humiture_Port}\n"
;
}
}
}
//if (StoreType == StoreType.TypeA)
//{
// if (!OKLEController.Init(Config.WeightSensorPort))
// {
// IsLoadOk = false;
// msg += $"称重传感器初始化失败 Port:{Config.WeightSensorPort}\n";
// }
//}
if
(!
CameraA
.
LoadCameraConfig
(
"CameraA"
,
out
string
errmsg
))
if
(!
CameraA
.
LoadCameraConfig
(
"CameraA"
,
out
string
errmsg
))
{
{
IsLoadOk
=
false
;
IsLoadOk
=
false
;
...
...
TheMachine/Form1.Designer.cs
查看文件 @
a6c3be7
...
@@ -87,6 +87,7 @@ namespace TheMachine
...
@@ -87,6 +87,7 @@ namespace TheMachine
//
//
// 启用调试模式ToolStripMenuItem
// 启用调试模式ToolStripMenuItem
//
//
this
.
启用调试模式
ToolStripMenuItem
.
Enabled
=
false
;
this
.
启用调试模式
ToolStripMenuItem
.
Name
=
"启用调试模式ToolStripMenuItem"
;
this
.
启用调试模式
ToolStripMenuItem
.
Name
=
"启用调试模式ToolStripMenuItem"
;
this
.
启用调试模式
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
启用调试模式
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
192
,
26
);
this
.
启用调试模式
ToolStripMenuItem
.
Text
=
"启用配置模式"
;
this
.
启用调试模式
ToolStripMenuItem
.
Text
=
"启用配置模式"
;
...
@@ -229,7 +230,6 @@ namespace TheMachine
...
@@ -229,7 +230,6 @@ namespace TheMachine
// cb_IgnoreSafecheck
// cb_IgnoreSafecheck
//
//
this
.
cb_IgnoreSafecheck
.
AutoSize
=
true
;
this
.
cb_IgnoreSafecheck
.
AutoSize
=
true
;
this
.
cb_IgnoreSafecheck
.
Enabled
=
true
;
this
.
cb_IgnoreSafecheck
.
Location
=
new
System
.
Drawing
.
Point
(
657
,
47
);
this
.
cb_IgnoreSafecheck
.
Location
=
new
System
.
Drawing
.
Point
(
657
,
47
);
this
.
cb_IgnoreSafecheck
.
Name
=
"cb_IgnoreSafecheck"
;
this
.
cb_IgnoreSafecheck
.
Name
=
"cb_IgnoreSafecheck"
;
this
.
cb_IgnoreSafecheck
.
Size
=
new
System
.
Drawing
.
Size
(
215
,
25
);
this
.
cb_IgnoreSafecheck
.
Size
=
new
System
.
Drawing
.
Size
(
215
,
25
);
...
...
TheMachine/Form1.cs
查看文件 @
a6c3be7
...
@@ -232,7 +232,7 @@ namespace TheMachine
...
@@ -232,7 +232,7 @@ namespace TheMachine
});
});
return
;
return
;
}
}
启用调试模式
ToolStripMenuItem
.
Enabled
=
true
;
if
(
state
)
if
(
state
)
{
{
btn_run
.
Enabled
=
true
;
btn_run
.
Enabled
=
true
;
...
...
TheMachine/SettingControl.Designer.cs
查看文件 @
a6c3be7
...
@@ -29,7 +29,7 @@ namespace TheMachine
...
@@ -29,7 +29,7 @@ namespace TheMachine
/// </summary>
/// </summary>
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
c
hbAutoRun
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
c
omponents
=
new
System
.
ComponentModel
.
Container
();
this
.
cb_leftmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cb_leftmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cb_rightmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
cb_rightmode
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
...
@@ -37,19 +37,16 @@ namespace TheMachine
...
@@ -37,19 +37,16 @@ namespace TheMachine
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tp
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
label_tempsensor
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
cb_tempsensorport
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
lbl_hmdstate
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
chbAutoRun
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
tp
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// chbAutoRun
//
this
.
chbAutoRun
.
AutoSize
=
true
;
this
.
chbAutoRun
.
Location
=
new
System
.
Drawing
.
Point
(
20
,
22
);
this
.
chbAutoRun
.
Name
=
"chbAutoRun"
;
this
.
chbAutoRun
.
Size
=
new
System
.
Drawing
.
Size
(
107
,
20
);
this
.
chbAutoRun
.
TabIndex
=
1
;
this
.
chbAutoRun
.
Text
=
"开机自启动"
;
this
.
chbAutoRun
.
UseVisualStyleBackColor
=
true
;
//
// cb_leftmode
// cb_leftmode
//
//
this
.
cb_leftmode
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cb_leftmode
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
...
@@ -94,7 +91,7 @@ namespace TheMachine
...
@@ -94,7 +91,7 @@ namespace TheMachine
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_leftmode
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_leftmode
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label1
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label1
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_rightmode
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cb_rightmode
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
20
,
77
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
135
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
363
,
204
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
363
,
204
);
this
.
groupBox1
.
TabIndex
=
4
;
this
.
groupBox1
.
TabIndex
=
4
;
...
@@ -120,24 +117,105 @@ namespace TheMachine
...
@@ -120,24 +117,105 @@ namespace TheMachine
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
button1
.
UseVisualStyleBackColor
=
true
;
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
this
.
button1
.
Click
+=
new
System
.
EventHandler
(
this
.
button1_Click
);
//
//
// tp
//
this
.
tp
.
AutoSize
=
true
;
this
.
tp
.
AutoSizeMode
=
System
.
Windows
.
Forms
.
AutoSizeMode
.
GrowAndShrink
;
this
.
tp
.
ColumnCount
=
2
;
this
.
tp
.
ColumnStyles
.
Add
(
new
System
.
Windows
.
Forms
.
ColumnStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tp
.
ColumnStyles
.
Add
(
new
System
.
Windows
.
Forms
.
ColumnStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tp
.
Controls
.
Add
(
this
.
label_tempsensor
,
0
,
0
);
this
.
tp
.
Controls
.
Add
(
this
.
cb_tempsensorport
,
1
,
0
);
this
.
tp
.
Controls
.
Add
(
this
.
lbl_hmdstate
,
0
,
4
);
this
.
tp
.
Controls
.
Add
(
this
.
chbAutoRun
,
0
,
7
);
this
.
tp
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
tp
.
Name
=
"tp"
;
this
.
tp
.
RowCount
=
9
;
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
Size
=
new
System
.
Drawing
.
Size
(
328
,
112
);
this
.
tp
.
TabIndex
=
7
;
//
// label_tempsensor
//
this
.
label_tempsensor
.
AutoSize
=
true
;
this
.
label_tempsensor
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
label_tempsensor
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
10
);
this
.
label_tempsensor
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
label_tempsensor
.
Name
=
"label_tempsensor"
;
this
.
label_tempsensor
.
Size
=
new
System
.
Drawing
.
Size
(
144
,
16
);
this
.
label_tempsensor
.
TabIndex
=
3
;
this
.
label_tempsensor
.
Text
=
"温湿度控制器端口:"
;
this
.
label_tempsensor
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
TopRight
;
//
// cb_tempsensorport
//
this
.
cb_tempsensorport
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cb_tempsensorport
.
FormattingEnabled
=
true
;
this
.
cb_tempsensorport
.
Location
=
new
System
.
Drawing
.
Point
(
170
,
6
);
this
.
cb_tempsensorport
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
6
);
this
.
cb_tempsensorport
.
Name
=
"cb_tempsensorport"
;
this
.
cb_tempsensorport
.
Size
=
new
System
.
Drawing
.
Size
(
121
,
24
);
this
.
cb_tempsensorport
.
TabIndex
=
2
;
this
.
cb_tempsensorport
.
Tag
=
"not"
;
this
.
cb_tempsensorport
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cb_tempsensorport_SelectedIndexChanged
);
//
// lbl_hmdstate
//
this
.
lbl_hmdstate
.
AutoSize
=
true
;
this
.
tp
.
SetColumnSpan
(
this
.
lbl_hmdstate
,
2
);
this
.
lbl_hmdstate
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
46
);
this
.
lbl_hmdstate
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
lbl_hmdstate
.
Name
=
"lbl_hmdstate"
;
this
.
lbl_hmdstate
.
Size
=
new
System
.
Drawing
.
Size
(
72
,
16
);
this
.
lbl_hmdstate
.
TabIndex
=
5
;
this
.
lbl_hmdstate
.
Tag
=
"not"
;
this
.
lbl_hmdstate
.
Text
=
"当前状态"
;
//
// chbAutoRun
//
this
.
chbAutoRun
.
AutoSize
=
true
;
this
.
tp
.
SetColumnSpan
(
this
.
chbAutoRun
,
2
);
this
.
chbAutoRun
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
82
);
this
.
chbAutoRun
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
chbAutoRun
.
Name
=
"chbAutoRun"
;
this
.
chbAutoRun
.
Size
=
new
System
.
Drawing
.
Size
(
107
,
20
);
this
.
chbAutoRun
.
TabIndex
=
7
;
this
.
chbAutoRun
.
Text
=
"开机自启动"
;
this
.
chbAutoRun
.
UseVisualStyleBackColor
=
true
;
//
// timer1
//
this
.
timer1
.
Enabled
=
true
;
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// SettingControl
// SettingControl
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
Controls
.
Add
(
this
.
tp
);
this
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
Controls
.
Add
(
this
.
chbAutoRun
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
Name
=
"SettingControl"
;
this
.
Name
=
"SettingControl"
;
this
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
740
);
this
.
Size
=
new
System
.
Drawing
.
Size
(
1024
,
740
);
this
.
Load
+=
new
System
.
EventHandler
(
this
.
SettingControl_Load
);
this
.
Load
+=
new
System
.
EventHandler
(
this
.
SettingControl_Load
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
ResumeLayout
(
false
);
this
.
groupBox1
.
PerformLayout
();
this
.
groupBox1
.
PerformLayout
();
this
.
tp
.
ResumeLayout
(
false
);
this
.
tp
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
this
.
PerformLayout
();
}
}
#
endregion
#
endregion
private
System
.
Windows
.
Forms
.
CheckBox
chbAutoRun
;
private
System
.
Windows
.
Forms
.
ComboBox
cb_leftmode
;
private
System
.
Windows
.
Forms
.
ComboBox
cb_leftmode
;
private
System
.
Windows
.
Forms
.
ComboBox
cb_rightmode
;
private
System
.
Windows
.
Forms
.
ComboBox
cb_rightmode
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Label
label1
;
...
@@ -145,5 +223,11 @@ namespace TheMachine
...
@@ -145,5 +223,11 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tp
;
private
System
.
Windows
.
Forms
.
Label
label_tempsensor
;
private
System
.
Windows
.
Forms
.
ComboBox
cb_tempsensorport
;
private
System
.
Windows
.
Forms
.
Label
lbl_hmdstate
;
private
System
.
Windows
.
Forms
.
CheckBox
chbAutoRun
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
}
}
}
}
TheMachine/SettingControl.cs
查看文件 @
a6c3be7
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
DeviceLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
@@ -26,6 +27,11 @@ namespace TheMachine
...
@@ -26,6 +27,11 @@ namespace TheMachine
chbAutoRun
.
Checked
=
Setting_Init
.
App_AutoRun
;
chbAutoRun
.
Checked
=
Setting_Init
.
App_AutoRun
;
this
.
chbAutoRun
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbAutoRun_CheckedChanged
);
this
.
chbAutoRun
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbAutoRun_CheckedChanged
);
//chbAutoRun.Enabled = true;
//chbAutoRun.Enabled = true;
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
cb_tempsensorport
.
Items
.
Add
(
"COM"
+
i
);
}
}
}
private
void
RobotManage_LoadFinishEvent
(
bool
state
,
string
msg
)
private
void
RobotManage_LoadFinishEvent
(
bool
state
,
string
msg
)
...
@@ -42,6 +48,8 @@ namespace TheMachine
...
@@ -42,6 +48,8 @@ namespace TheMachine
cb_rightmode
.
Items
.
AddRange
(
InOutModeItem
.
Items
);
cb_rightmode
.
Items
.
AddRange
(
InOutModeItem
.
Items
);
cb_rightmode
.
SelectedIndex
=
(
int
)((
InOutModeE
)
Setting_Init
.
Device_RightInoutMode
);
cb_rightmode
.
SelectedIndex
=
(
int
)((
InOutModeE
)
Setting_Init
.
Device_RightInoutMode
);
Config
.
PropertyBind
(
Setting_Init
.
Device_Humiture_Port
.
Key
,
cb_tempsensorport
,
"SelectedItem"
,
"SelectedIndexChanged"
);
}
}
...
@@ -104,5 +112,25 @@ namespace TheMachine
...
@@ -104,5 +112,25 @@ namespace TheMachine
Setting_Init
.
Device_LeftInoutMode
=
((
InOutModeItem
)
cb_leftmode
.
SelectedItem
).
inOutModeItem
;
Setting_Init
.
Device_LeftInoutMode
=
((
InOutModeItem
)
cb_leftmode
.
SelectedItem
).
inOutModeItem
;
Setting_Init
.
Device_RightInoutMode
=
((
InOutModeItem
)
cb_rightmode
.
SelectedItem
).
inOutModeItem
;
Setting_Init
.
Device_RightInoutMode
=
((
InOutModeItem
)
cb_rightmode
.
SelectedItem
).
inOutModeItem
;
}
}
private
void
cb_tempsensorport_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
HumitureController
.
Init
(
Setting_Init
.
Device_Humiture_Port
);
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(!
Visible
)
return
;
lbl_hmdstate
.
Text
=
"当前状态:"
;
if
(!
HumitureController
.
IsRun
)
{
lbl_hmdstate
.
Text
+=
"未成功连接"
;
return
;
}
var
t
=
HumitureController
.
LastData
;
lbl_hmdstate
.
Text
+=
"温度"
+
$
":{t.Temperate}℃, "
+
"湿度"
+
$
":{t.Humidity}%"
;
}
}
}
}
}
TheMachine/SettingControl.resx
查看文件 @
a6c3be7
...
@@ -117,4 +117,7 @@
...
@@ -117,4 +117,7 @@
<resheader name="writer">
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论