Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1053_SBSH
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6a65fcff
由
刘韬
编写于
2023-02-28 21:47:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
稳定版
1 个父辈
52ae7858
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
285 行增加
和
193 行删除
Common/util/HumitureController.cs
Common/util/TcpServer.cs
Common/util/UdpServer.cs
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/JobList.cs
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_Store.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/userControl/AxisMoveControl.Designer.cs
DeviceLibrary/userControl/AxisMoveControl.cs
DeviceLibrary/userControl/AxisTipControl.cs
DeviceLibrary/userControl/FixtureSizeConfigControl.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/Program.cs
TheMachine/SettingControl.Designer.cs
TheMachine/SettingControl.cs
TheMachine/TheMachine.csproj
TheMachine/UC/FrmPassCheck.cs
TheMachine/UC/IOControl.cs
TheMachine/UC/UC_LedConfig.cs
TheMachine/UC/UC_SetUserPassword.cs
TheMachine/UC/uc_boxdebug1.cs
TheMachine/packages.config
TheMachine/positionTool/FrmPositionTool.cs
Common/util/HumitureController.cs
查看文件 @
6a65fcf
using
OnlineStore
;
using
log4net
;
using
log4net
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -38,7 +39,7 @@ namespace OnlineStore.Common
...
@@ -38,7 +39,7 @@ namespace OnlineStore.Common
{
{
Release
();
Release
();
}
}
LogName
=
"温湿度传感器["
+
port
+
"]"
;
LogName
=
crc
.
GetString
(
"Res0001"
,
"温湿度传感器["
)
+
port
+
"]"
;
if
(
sb
==
null
)
if
(
sb
==
null
)
{
{
...
@@ -325,4 +326,4 @@ namespace OnlineStore.Common
...
@@ -325,4 +326,4 @@ namespace OnlineStore.Common
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
Common/util/TcpServer.cs
查看文件 @
6a65fcf
using
System
;
using
OnlineStore
;
using
System
;
using
System.Text
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
...
@@ -33,7 +34,7 @@ namespace OnlineStore.Common
...
@@ -33,7 +34,7 @@ namespace OnlineStore.Common
private
void
logLocalIp
()
private
void
logLocalIp
()
{
{
string
[]
addresses
=
GetLocalAddresses
();
string
[]
addresses
=
GetLocalAddresses
();
string
iplist
=
"本机IP:["
;
string
iplist
=
crc
.
GetString
(
"Res0002"
,
"本机IP:["
)
;
if
(
addresses
.
Length
>
0
)
if
(
addresses
.
Length
>
0
)
{
{
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
...
@@ -263,4 +264,4 @@ namespace OnlineStore.Common
...
@@ -263,4 +264,4 @@ namespace OnlineStore.Common
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
Common/util/UdpServer.cs
查看文件 @
6a65fcf
using
OnlineStore
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -26,7 +27,7 @@ namespace OnlineStore.Common
...
@@ -26,7 +27,7 @@ namespace OnlineStore.Common
private
void
logLocalIp
()
private
void
logLocalIp
()
{
{
string
[]
addresses
=
GetLocalAddresses
();
string
[]
addresses
=
GetLocalAddresses
();
string
iplist
=
"本机IP:["
;
string
iplist
=
crc
.
GetString
(
"Res0002"
,
"本机IP:["
)
;
if
(
addresses
.
Length
>
0
)
if
(
addresses
.
Length
>
0
)
{
{
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
...
@@ -156,4 +157,4 @@ namespace OnlineStore.Common
...
@@ -156,4 +157,4 @@ namespace OnlineStore.Common
return
retval
;
return
retval
;
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
6a65fcf
using
OnlineStore.Common
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -52,7 +53,7 @@ namespace DeviceLibrary
...
@@ -52,7 +53,7 @@ namespace DeviceLibrary
{
{
if
(
moveInfo
==
null
)
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0003"
,
"界面"
)
,
false
);
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
moveInfo
.
log
(
$
"急停未解除"
);
moveInfo
.
log
(
$
"急停未解除"
);
...
@@ -127,7 +128,7 @@ namespace DeviceLibrary
...
@@ -127,7 +128,7 @@ namespace DeviceLibrary
public
void
LiftDown
(
MoveInfo
moveInfo
)
public
void
LiftDown
(
MoveInfo
moveInfo
)
{
{
if
(
moveInfo
==
null
)
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0003"
,
"界面"
)
,
false
);
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
moveInfo
.
log
(
$
"急停未解除"
);
moveInfo
.
log
(
$
"急停未解除"
);
...
@@ -217,4 +218,4 @@ namespace DeviceLibrary
...
@@ -217,4 +218,4 @@ namespace DeviceLibrary
//throw new NotImplementedException();
//throw new NotImplementedException();
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
6a65fcf
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
@@ -218,7 +218,7 @@ namespace DeviceLibrary
...
@@ -218,7 +218,7 @@ namespace DeviceLibrary
sendmsg
=
string
.
Join
(
","
,
new
string
[]
{
WarnMsg
});
sendmsg
=
string
.
Join
(
","
,
new
string
[]
{
WarnMsg
});
}
}
else
if
(!
RobotManage
.
isRunning
){
else
if
(!
RobotManage
.
isRunning
){
sendmsg
=
"设备未启动"
;
sendmsg
=
crc
.
GetString
(
"Res0004"
,
"设备未启动"
)
;
}
}
lineOperation
.
msg
=
sendmsg
;
lineOperation
.
msg
=
sendmsg
;
...
@@ -648,4 +648,4 @@ namespace DeviceLibrary
...
@@ -648,4 +648,4 @@ namespace DeviceLibrary
InStoreError
=
14
,
InStoreError
=
14
,
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/JobList.cs
查看文件 @
6a65fcf
...
@@ -49,6 +49,26 @@ namespace DeviceLibrary
...
@@ -49,6 +49,26 @@ namespace DeviceLibrary
public
void
ClearLastPosid
(
string
posid
)
{
public
void
ClearLastPosid
(
string
posid
)
{
if
(
lastoutpos
==
posid
)
if
(
lastoutpos
==
posid
)
lastoutpos
=
""
;
lastoutpos
=
""
;
lock
(
jobInfos
)
{
List
<
JobInfo
>
tempList
=
new
List
<
JobInfo
>();
JobInfo
item
;
while
(
jobInfos
.
TryDequeue
(
out
item
))
{
if
(
item
.
PosId
!=
posid
)
{
tempList
.
Add
(
item
);
}
}
// 重新将剩余的元素加入队列中
foreach
(
JobInfo
i
in
tempList
)
{
jobInfos
.
Enqueue
(
i
);
}
}
}
}
}
}
...
...
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
查看文件 @
6a65fcf
...
@@ -40,6 +40,24 @@ namespace DeviceLibrary
...
@@ -40,6 +40,24 @@ namespace DeviceLibrary
RobotManage
.
UserPause
(
"Reset_BTN"
,
false
);
RobotManage
.
UserPause
(
"Reset_BTN"
,
false
);
}
}
}
}
void
HomeReset_BTN
()
{
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
crc
.
GetString
(
L
.
reset_press
,
"按下复位按钮."
),
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
}
else
{
Msg
.
add
(
crc
.
GetString
(
L
.
reset_press_with_sudden
,
"急停未解除,按下复位按钮尝试复位安全继电器."
),
MsgLevel
.
info
,
ErrInfo
.
SuddenStop
);
}
if
(
mstart
)
{
LogUtil
.
info
(
"长按下复位按钮,系统正在运行,开始复位"
);
BeginHomeReset
();
}
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
void
Run_BTN
()
{
void
Run_BTN
()
{
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
...
...
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
查看文件 @
6a65fcf
...
@@ -16,8 +16,36 @@ namespace DeviceLibrary
...
@@ -16,8 +16,36 @@ namespace DeviceLibrary
{
{
void
ioMonitor
()
void
ioMonitor
()
{
{
airprocess
();
}
}
DateTime
LastHumiCheckTime
=
DateTime
.
Now
.
AddHours
(
2
);
void
airprocess
()
{
//var temp = HumitureController.QueryData();
var
temp
=
HumitureController
.
LastData
;
var
Current_Humidity
=
temp
.
Humidity
;
var
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
(
Current_Humidity
<=
ServerCM
.
Max_Humidity
)
LastHumiCheckTime
=
DateTime
.
Now
;
//else if ((DateTime.Now - LastHumiCheckTime).TotalSeconds > 30)
//{
// Msg.add("温湿度超限", MsgLevel.alarm);
//}
if
(
humiNeedStart
&&
IOValue
(
IO_Type
.
StartOrStopBlow
).
Equals
(
IO_VALUE
.
LOW
))
{
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
LogUtil
.
info
(
$
"开始吹气,当前最大湿度:{Current_Humidity} > {ServerCM.Max_Humidity}-{Setting_Init.Device_HumidityStartOffser}."
);
}
else
if
(
humiNeedStop
&&
IOValue
(
IO_Type
.
StartOrStopBlow
).
Equals
(
IO_VALUE
.
HIGH
))
{
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
$
"关闭吹气,当前最大湿度:{Current_Humidity} < {ServerCM.Max_Humidity}-{Setting_Init.Device_HumidityEndOffser}."
);
}
}
}
}
}
}
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
6a65fcf
using
CodeLibrary
;
using
OnlineStore
;
using
CodeLibrary
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -67,22 +68,25 @@ namespace DeviceLibrary
...
@@ -67,22 +68,25 @@ namespace DeviceLibrary
{
{
MachineLedState
.
Clear
();
MachineLedState
.
Clear
();
//系统报警并停止,红亮
//系统报警并停止,红亮
MachineLedStateName
[
MachineLedStateE
.
AlarmStop
]
=
"停机报警"
;
MachineLedStateName
[
MachineLedStateE
.
AlarmStop
]
=
crc
.
GetString
(
"Res0005"
,
"停机报警"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
AlarmStop
,
nls
(
LedState
.
on
,
LedState
.
off
,
LedState
.
off
));
MachineLedState
.
Add
(
MachineLedStateE
.
AlarmStop
,
nls
(
LedState
.
on
,
LedState
.
off
,
LedState
.
off
));
//系统运行时报警, 绿亮,红闪
//系统运行时报警, 绿亮,红闪
MachineLedStateName
[
MachineLedStateE
.
Alarm
]
=
"报警"
;
MachineLedStateName
[
MachineLedStateE
.
Alarm
]
=
crc
.
GetString
(
"Res0006"
,
"报警"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
Alarm
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
on
));
MachineLedState
.
Add
(
MachineLedStateE
.
Alarm
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
on
));
//系统复位中 绿闪
//系统复位中 绿闪
MachineLedStateName
[
MachineLedStateE
.
HomeReset
]
=
"复位"
;
MachineLedStateName
[
MachineLedStateE
.
HomeReset
]
=
crc
.
GetString
(
"Res0007"
,
"复位"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
HomeReset
,
nls
(
LedState
.
off
,
LedState
.
off
,
LedState
.
blink
));
MachineLedState
.
Add
(
MachineLedStateE
.
HomeReset
,
nls
(
LedState
.
off
,
LedState
.
off
,
LedState
.
blink
));
//系统正常运行
//系统正常运行
MachineLedStateName
[
MachineLedStateE
.
Running
]
=
"运行"
;
MachineLedStateName
[
MachineLedStateE
.
Running
]
=
crc
.
GetString
(
"Res0008"
,
"运行"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
Running
,
nls
(
LedState
.
none
,
LedState
.
none
,
LedState
.
on
));
MachineLedState
.
Add
(
MachineLedStateE
.
Running
,
nls
(
LedState
.
none
,
LedState
.
none
,
LedState
.
on
));
//系统暂停, 绿闪,红闪
//系统暂停, 绿闪,红闪
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
"暂停"
;
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
crc
.
GetString
(
"Res0009"
,
"暂停"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
SystemPause
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
blink
));
MachineLedState
.
Add
(
MachineLedStateE
.
SystemPause
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
blink
));
//温湿度超限 绿闪黄闪
//MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = "温湿度超限";
//MachineLedState.Add(MachineLedStateE.THoutRangeOver30m, nls(LedState.none, LedState.blink, LedState.blink));
//进出库, 绿亮,黄闪
//进出库, 绿亮,黄闪
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
"出入库中"
;
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
crc
.
GetString
(
"Res0010"
,
"出入库中"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
InOut
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
on
));
MachineLedState
.
Add
(
MachineLedStateE
.
InOut
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
on
));
}
}
Dictionary
<
LedColor
,
LedState
>
nls
(
LedState
AlarmLedstate
,
LedState
StandbyLedstate
,
LedState
RunningLedstate
)
{
Dictionary
<
LedColor
,
LedState
>
nls
(
LedState
AlarmLedstate
,
LedState
StandbyLedstate
,
LedState
RunningLedstate
)
{
...
@@ -139,6 +143,10 @@ namespace DeviceLibrary
...
@@ -139,6 +143,10 @@ namespace DeviceLibrary
//AlarmLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
SystemPause
);
ProcessLefCfg
(
MachineLedStateE
.
SystemPause
);
}
}
if
((
DateTime
.
Now
-
LastHumiCheckTime
).
TotalSeconds
>
30
)
{
//ProcessLefCfg(MachineLedStateE.THoutRangeOver30m);
}
}
}
else
if
(
runStatus
==
RunStatus
.
Stop
)
else
if
(
runStatus
==
RunStatus
.
Stop
)
{
{
...
@@ -223,8 +231,8 @@ namespace DeviceLibrary
...
@@ -223,8 +231,8 @@ namespace DeviceLibrary
HomeReset
,
HomeReset
,
Running
,
Running
,
SystemPause
,
SystemPause
,
THoutRangeOver30m
,
//
THoutRangeOver30m,
THoutRange
,
//
THoutRange,
InOut
,
InOut
,
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
6a65fcf
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -73,10 +73,10 @@ namespace DeviceLibrary
...
@@ -73,10 +73,10 @@ namespace DeviceLibrary
public
MainMachine
(
Robot_Config
_config
)
{
public
MainMachine
(
Robot_Config
_config
)
{
Config
=
_config
;
Config
=
_config
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
StoreMoveInfo
=
new
MoveInfo
(
"进出库调度"
);
StoreMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0011"
,
"进出库调度"
)
);
StoreMoveInfo
.
SetStateDelegate
(
StoreState
);
StoreMoveInfo
.
SetStateDelegate
(
StoreState
);
ResetMoveInfo
=
new
MoveInfo
(
"重置"
);
ResetMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0012"
,
"重置"
)
);
AIOTMoveInfo
=
new
MoveInfo
(
"出入库测试"
);
AIOTMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0013"
,
"出入库测试"
)
);
Remote
=
new
RemoteClient
(
CID
,
Setting_Init
.
Device_MT_Server
);
Remote
=
new
RemoteClient
(
CID
,
Setting_Init
.
Device_MT_Server
);
Remote
.
AddAction
(
"DoorRelease"
,
(
requestLoadInfo
)
=>
Remote
.
AddAction
(
"DoorRelease"
,
(
requestLoadInfo
)
=>
...
@@ -119,7 +119,7 @@ namespace DeviceLibrary
...
@@ -119,7 +119,7 @@ namespace DeviceLibrary
AlarmBuzzer
.
SetOnOffAction
(()
=>{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
AlarmBuzzer
.
SetOnOffAction
(()
=>{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
Reset_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
Reset_BTN
,
2500
,
100
);
//IOMonitor.RegisterIO(IO_Type., Config, IO_VALUE.HIGH, Run_BTN, 2500,1
00);
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
HomeReset_BTN
,
2500
,
30
00
);
LedProcessInit
();
LedProcessInit
();
}
}
...
@@ -201,7 +201,7 @@ namespace DeviceLibrary
...
@@ -201,7 +201,7 @@ namespace DeviceLibrary
var
isupdownindoor
=
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P1
)
||
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P2
)
||
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P3
);
var
isupdownindoor
=
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P1
)
||
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P2
)
||
UpDown_Axis
.
IsInPosition
(
Config
.
UpDown_P3
);
if
(!
isupdownindoor
)
{
if
(!
isupdownindoor
)
{
return
(
true
,
"升降轴不在单料口,进出轴不可运动"
);
return
(
true
,
crc
.
GetString
(
"Res0014"
,
"升降轴不在单料口,进出轴不可运动"
)
);
}
}
return
(
false
,
""
);
return
(
false
,
""
);
...
@@ -489,7 +489,7 @@ namespace DeviceLibrary
...
@@ -489,7 +489,7 @@ namespace DeviceLibrary
ok
=
false
;
ok
=
false
;
DeviceSuddenStop
();
DeviceSuddenStop
();
}
}
Msg
.
add
(
"后侧防护门没有关闭"
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0015"
,
"后侧防护门没有关闭"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
}
}
if
(!
lastSafeCheckStatus
&&
ok
)
if
(!
lastSafeCheckStatus
&&
ok
)
{
{
...
@@ -532,7 +532,8 @@ namespace DeviceLibrary
...
@@ -532,7 +532,8 @@ namespace DeviceLibrary
else
if
(
isInSuddenDown
)
else
if
(
isInSuddenDown
)
{
{
//Alarm(AlarmType.SuddenStop);
//Alarm(AlarmType.SuddenStop);
Msg
.
add
(
crc
.
GetString
(
L
.
in_suddenstop
,
"急停中"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
L
.
in_suddenstop
,
"急停中"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
SuddenStop
);
lastSafeCheckStatus
=
false
;
lastSafeCheckStatus
=
false
;
ok
=
false
;
ok
=
false
;
}
}
...
@@ -574,7 +575,7 @@ namespace DeviceLibrary
...
@@ -574,7 +575,7 @@ namespace DeviceLibrary
{
{
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
+
crc
.
GetString
(
L
.
motion_alarm
,
"运动报警"
),
MsgLevel
.
alarm
);
+
crc
.
GetString
(
L
.
motion_alarm
,
"运动报警"
),
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"压紧轴报警"
,
true
);
RobotManage
.
UserPause
(
crc
.
GetString
(
"Res0016"
,
"压紧轴报警"
)
,
true
);
AxisManager
.
AlarmClear
(
configMoveAxis
.
DeviceName
,
configMoveAxis
.
GetAxisValue
());
AxisManager
.
AlarmClear
(
configMoveAxis
.
DeviceName
,
configMoveAxis
.
GetAxisValue
());
Thread
.
Sleep
(
2000
);
Thread
.
Sleep
(
2000
);
SingleDoor
.
LiftUp
(
null
);
SingleDoor
.
LiftUp
(
null
);
...
@@ -601,4 +602,4 @@ namespace DeviceLibrary
...
@@ -601,4 +602,4 @@ namespace DeviceLibrary
LogUtil
.
info
(
"按下X09忽略"
);
LogUtil
.
info
(
"按下X09忽略"
);
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
6a65fcf
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -123,7 +123,7 @@ namespace DeviceLibrary
...
@@ -123,7 +123,7 @@ namespace DeviceLibrary
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
NGOUT_08
);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
NGOUT_08
);
SingleDoor
.
ToHigh
(
ClampMoveInfo
);
SingleDoor
.
ToHigh
(
ClampMoveInfo
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
alarm
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"未检测到盘"
,
true
);
RobotManage
.
UserPause
(
crc
.
GetString
(
"Res0017"
,
"未检测到盘"
)
,
true
);
}
}
else
else
{
{
...
@@ -468,4 +468,4 @@ namespace DeviceLibrary
...
@@ -468,4 +468,4 @@ namespace DeviceLibrary
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine_Store.cs
查看文件 @
6a65fcf
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
RemoteSheardObject
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing
;
...
@@ -57,6 +58,7 @@ namespace DeviceLibrary
...
@@ -57,6 +58,7 @@ namespace DeviceLibrary
if
(
s
.
Equals
(
IO_VALUE
.
LOW
))
if
(
s
.
Equals
(
IO_VALUE
.
LOW
))
{
{
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
WaitInStore
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
WaitInStore
);
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
LogUtil
.
info
(
"锁定料仓等待入库"
);
LogUtil
.
info
(
"锁定料仓等待入库"
);
return
true
;
return
true
;
}
}
...
@@ -85,6 +87,17 @@ namespace DeviceLibrary
...
@@ -85,6 +87,17 @@ namespace DeviceLibrary
//常规上料扫码流程
//常规上料扫码流程
switch
(
StoreMoveInfo
.
MoveStep
)
switch
(
StoreMoveInfo
.
MoveStep
)
{
{
case
MoveStep
.
WaitInStore
:
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
WaitInStore
);
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
if
(
IsLineFree
()
==
RemoteResult
.
True
)
{
StoreMoveInfo
.
log
(
$
"MT已经不在入库模式"
);
StoreMoveInfo
.
EndMove
();
}
else
Msg
.
add
(
crc
.
GetString
(
"Res0072"
,
"等待入库物料"
),
MsgLevel
.
info
);
break
;
case
MoveStep
.
Wait
:
case
MoveStep
.
Wait
:
//判断有没有出库任务, 需要入库空闲, 出口空闲
//判断有没有出库任务, 需要入库空闲, 出口空闲
...
@@ -132,7 +145,7 @@ namespace DeviceLibrary
...
@@ -132,7 +145,7 @@ namespace DeviceLibrary
{
{
StoreMoveInfo
.
log
(
"入口料盘,获取库位失败"
);
StoreMoveInfo
.
log
(
"入口料盘,获取库位失败"
);
StoreMoveInfo
.
MoveParam
.
IsNg
=
true
;
StoreMoveInfo
.
MoveParam
.
IsNg
=
true
;
StoreMoveInfo
.
MoveParam
.
NgMsg
=
$
"[{CID}]"
+
"无信息物料"
;
StoreMoveInfo
.
MoveParam
.
NgMsg
=
$
"[{CID}]"
+
crc
.
GetString
(
"Res0018"
,
"无信息物料"
)
;
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
}
}
break
;
break
;
...
@@ -142,7 +155,7 @@ namespace DeviceLibrary
...
@@ -142,7 +155,7 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
SRec
.
info
(
CID
,
""
,
"开始入库"
,
StoreMoveInfo
.
MoveParam
.
PosID
);
SRec
.
info
(
CID
,
""
,
crc
.
GetString
(
"Res0019"
,
"开始入库"
)
,
StoreMoveInfo
.
MoveParam
.
PosID
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn02
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn02
);
break
;
break
;
...
@@ -186,7 +199,7 @@ namespace DeviceLibrary
...
@@ -186,7 +199,7 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn05
:
case
MoveStep
.
StoreIn05
:
if
(
boxTransport
.
IsComplateOrFree
)
if
(
boxTransport
.
IsComplateOrFree
)
{
{
SRec
.
info
(
CID
,
""
,
"完成入库"
,
StoreMoveInfo
.
MoveParam
.
PosID
);
SRec
.
info
(
CID
,
""
,
crc
.
GetString
(
"Res0020"
,
"完成入库"
)
,
StoreMoveInfo
.
MoveParam
.
PosID
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
EndMove
();
StoreMoveInfo
.
EndMove
();
...
@@ -204,7 +217,7 @@ namespace DeviceLibrary
...
@@ -204,7 +217,7 @@ namespace DeviceLibrary
BoxStorePosition
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
);
BoxStorePosition
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
);
boxTransport
.
Start
(
outFrom
==
null
?
null
:
new
BoxStorePosition
(
Config
,
outFrom
,
StoreMoveInfo
.
MoveParam
),
outTo
,
StoreMoveType
.
OutStore
);
boxTransport
.
Start
(
outFrom
==
null
?
null
:
new
BoxStorePosition
(
Config
,
outFrom
,
StoreMoveInfo
.
MoveParam
),
outTo
,
StoreMoveType
.
OutStore
);
StoreMoveInfo
.
log
(
$
"开始转运料盘"
);
StoreMoveInfo
.
log
(
$
"开始转运料盘"
);
SRec
.
info
(
CID
,
""
,
"开始出库"
,
StoreMoveInfo
.
MoveParam
.
PosID
);
SRec
.
info
(
CID
,
""
,
crc
.
GetString
(
"Res0021"
,
"开始出库"
)
,
StoreMoveInfo
.
MoveParam
.
PosID
);
break
;
break
;
case
MoveStep
.
StoreOut11
:
case
MoveStep
.
StoreOut11
:
...
@@ -241,6 +254,7 @@ namespace DeviceLibrary
...
@@ -241,6 +254,7 @@ namespace DeviceLibrary
}
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
TheLine
.
UpdateLocInfo
(
""
,
StoreMoveInfo
.
MoveParam
.
WareCode
,
TheLine
.
LineStatusE
.
BOXDOOR
,
CID
);
OutStoreJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
OutStoreJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
}
}
break
;
break
;
...
@@ -248,18 +262,18 @@ namespace DeviceLibrary
...
@@ -248,18 +262,18 @@ namespace DeviceLibrary
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut_WaitMT
);
if
(
SendTrayRequest
(
"MTP2"
,
StoreMoveInfo
.
MoveParam
)
>
RemoteResult
.
Timeout
)
if
(
SendTrayRequest
(
"MTP2"
,
StoreMoveInfo
.
MoveParam
)
>
RemoteResult
.
Timeout
)
{
{
SRec
.
info
(
CID
,
""
,
"完成出库"
,
StoreMoveInfo
.
MoveParam
.
PosID
);
SRec
.
info
(
CID
,
""
,
crc
.
GetString
(
"Res0022"
,
"完成出库"
)
,
StoreMoveInfo
.
MoveParam
.
PosID
);
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0161"
,
"等待单料门料盘被取走"
),
MsgLevel
.
warning
));
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0161"
,
"等待单料门料盘被取走"
),
MsgLevel
.
warning
));
}
}
else
else
{
{
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
"请求环形线空托盘失败"
,
MsgLevel
.
warning
));
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0023"
,
"请求环形线空托盘失败"
)
,
MsgLevel
.
warning
));
}
}
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
StoreMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
break
;
break
;
case
MoveStep
.
StoreOut14
:
case
MoveStep
.
StoreOut14
:
Msg
.
add
(
"等待环形线取走料盘"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0024"
,
"等待环形线取走料盘"
)
,
MsgLevel
.
warning
);
if
(
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
{
if
(
IsLineFree
()
==
RemoteResult
.
True
)
if
(
IsLineFree
()
==
RemoteResult
.
True
)
...
@@ -277,7 +291,11 @@ namespace DeviceLibrary
...
@@ -277,7 +291,11 @@ namespace DeviceLibrary
string
StoreState
()
string
StoreState
()
{
{
string
state
=
crc
.
GetString
(
"Res0162"
,
"空闲中"
);
string
state
=
crc
.
GetString
(
"Res0162"
,
"空闲中"
);
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
if
(
StoreMoveInfo
.
MoveStep
==
MoveStep
.
WaitInStore
)
{
state
=
crc
.
GetString
(
"Res0072"
,
"等待入库物料"
)
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
}
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
{
{
state
=
crc
.
GetString
(
"Res0163"
,
"出库中"
)
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
state
=
crc
.
GetString
(
"Res0163"
,
"出库中"
)
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
}
}
...
@@ -298,4 +316,4 @@ namespace DeviceLibrary
...
@@ -298,4 +316,4 @@ namespace DeviceLibrary
return
Remote
.
SendAndWait
(
remoteLoad
);
return
Remote
.
SendAndWait
(
remoteLoad
);
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
6a65fcf
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -90,9 +90,9 @@ namespace DeviceLibrary
...
@@ -90,9 +90,9 @@ namespace DeviceLibrary
CylinderMove
(
StringMoveInfo
,
IO_Type
.
BatchDoor_Close
,
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
BatchDoor_Close
,
IO_Type
.
BatchDoor_Open
,
IO_VALUE
.
LOW
);
StringMoveInfo
.
log
(
$
"开始批量入库"
);
StringMoveInfo
.
log
(
$
"开始批量入库"
);
StringState
=
StringStateE
.
InStore
;
StringState
=
StringStateE
.
InStore
;
return
"开始批量入库"
;
return
crc
.
GetString
(
"Res0025"
,
"开始批量入库"
)
;
}
}
return
"系统忙碌,无法批量入库"
;
return
crc
.
GetString
(
"Res0026"
,
"系统忙碌,无法批量入库"
)
;
}
}
bool
IsBatchDoorClosed
=>
IOValue
(
IO_Type
.
DoorClose_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
BatchDoor_Close
).
Equals
(
IO_VALUE
.
HIGH
);
bool
IsBatchDoorClosed
=>
IOValue
(
IO_Type
.
DoorClose_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
BatchDoor_Close
).
Equals
(
IO_VALUE
.
HIGH
);
//StringStateE LastStringState { get => ConfigHelper.Config.Get("Status_LastStringState", StringStateE.None); set => ConfigHelper.Config.Set("Status_LastStringState", value); }
//StringStateE LastStringState { get => ConfigHelper.Config.Get("Status_LastStringState", StringStateE.None); set => ConfigHelper.Config.Set("Status_LastStringState", value); }
...
@@ -173,7 +173,7 @@ namespace DeviceLibrary
...
@@ -173,7 +173,7 @@ namespace DeviceLibrary
else
{
else
{
TestHeightTask
=
TestReelHeight
();
TestHeightTask
=
TestReelHeight
();
}
}
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
"料串正在上升"
,
MsgLevel
.
warning
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0027"
,
"料串正在上升"
)
,
MsgLevel
.
warning
));
break
;
break
;
case
MoveStep
.
StringLoad_04
:
case
MoveStep
.
StringLoad_04
:
if
(
oldtestheight
)
if
(
oldtestheight
)
...
@@ -218,7 +218,7 @@ namespace DeviceLibrary
...
@@ -218,7 +218,7 @@ namespace DeviceLibrary
}
}
}
}
else
else
Msg
.
add
(
"扫码等待夹爪空闲"
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0028"
,
"扫码等待夹爪空闲"
)
,
MsgLevel
.
info
);
}
}
else
if
(
StringState
==
StringStateE
.
OutStore
)
else
if
(
StringState
==
StringStateE
.
OutStore
)
{
{
...
@@ -365,8 +365,8 @@ namespace DeviceLibrary
...
@@ -365,8 +365,8 @@ namespace DeviceLibrary
var
heightcheck
=
(
LastOutDownPosition
-
Batch_Axis
.
GetAclPosition
())
/
Config
.
Batch_PoToMM
;
var
heightcheck
=
(
LastOutDownPosition
-
Batch_Axis
.
GetAclPosition
())
/
Config
.
Batch_PoToMM
;
StringMoveInfo
.
log
(
$
"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}"
);
StringMoveInfo
.
log
(
$
"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}"
);
if
(
heightcheck
<=
5
)
{
if
(
heightcheck
<=
5
)
{
Msg
.
add
(
"出库时料盘未成功放入料串,请检查"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0029"
,
"出库时料盘未成功放入料串,请检查"
)
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时料盘未成功放入料串,请检查"
);
RobotManage
.
UserPause
(
crc
.
GetString
(
"Res0029"
,
"出库时料盘未成功放入料串,请检查"
)
);
}
}
break
;
break
;
case
MoveStep
.
StringReelPut_04
:
case
MoveStep
.
StringReelPut_04
:
...
@@ -391,7 +391,7 @@ namespace DeviceLibrary
...
@@ -391,7 +391,7 @@ namespace DeviceLibrary
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_Released
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_Released
);
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
"料串正在下降"
,
MsgLevel
.
warning
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0030"
,
"料串正在下降"
)
,
MsgLevel
.
warning
));
break
;
break
;
case
MoveStep
.
StringOut_02
:
case
MoveStep
.
StringOut_02
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_Released
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_Released
);
...
@@ -578,9 +578,9 @@ namespace DeviceLibrary
...
@@ -578,9 +578,9 @@ namespace DeviceLibrary
}
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
//string code = CodeManager.ProcessCode(LastCodeList);
//string code = CodeManager.ProcessCode(LastCodeList);
string
msg
=
Name
+
" 计算盘高:上升前 ["
+
StartMovePosition
+
"]实时[ "
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
LastCode
+
"】"
;
string
msg
=
Name
+
crc
.
GetString
(
"Res0031"
,
" 计算盘高:上升前 ["
)
+
StartMovePosition
+
crc
.
GetString
(
"Res0032"
,
"]实时[ "
)
+
EndMovePosition
+
crc
.
GetString
(
"Res0033"
,
"]差值["
)
+
(
EndMovePosition
-
StartMovePosition
)
+
crc
.
GetString
(
"Res0034"
,
"]系数["
)
+
AxisChangeValue
+
crc
.
GetString
(
"Res0035"
,
"] 计算后"
)
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
LastCode
+
"】"
;
LogUtil
.
info
(
msg
);
LogUtil
.
info
(
msg
);
return
LastHeight
;
return
LastHeight
;
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/userControl/AxisMoveControl.Designer.cs
查看文件 @
6a65fcf
此文件的差异被折叠,
点击展开。
DeviceLibrary/userControl/AxisMoveControl.cs
查看文件 @
6a65fcf
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Drawing
;
...
@@ -53,7 +53,7 @@ namespace DeviceLibrary
...
@@ -53,7 +53,7 @@ namespace DeviceLibrary
currentAxis
=
axisList
[
0
];
currentAxis
=
axisList
[
0
];
PortName
=
axisList
[
0
].
Config
.
DeviceName
;
PortName
=
axisList
[
0
].
Config
.
DeviceName
;
SlvAddr
=
axisList
[
0
].
Config
.
GetAxisValue
();
SlvAddr
=
axisList
[
0
].
Config
.
GetAxisValue
();
txtAxisDeviceName
.
Text
=
PortName
;
//
txtAxisDeviceName.Text = PortName;
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
}
}
btnAddMove
.
BackColor
=
Color
.
White
;
btnAddMove
.
BackColor
=
Color
.
White
;
...
@@ -78,7 +78,7 @@ namespace DeviceLibrary
...
@@ -78,7 +78,7 @@ namespace DeviceLibrary
{
{
if
(
axis
==
null
)
if
(
axis
==
null
)
{
{
MessageBox
.
Show
(
"请先选择运动轴"
,
"警告 "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0036"
,
"请先选择运动轴"
),
crc
.
GetString
(
"Res0037"
,
"警告 "
)
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
return
false
;
return
false
;
}
}
...
@@ -224,7 +224,7 @@ namespace DeviceLibrary
...
@@ -224,7 +224,7 @@ namespace DeviceLibrary
axis
=
axisList
[
cmbAxis
.
SelectedIndex
].
Config
;
axis
=
axisList
[
cmbAxis
.
SelectedIndex
].
Config
;
PortName
=
axis
.
DeviceName
;
PortName
=
axis
.
DeviceName
;
SlvAddr
=
axis
.
GetAxisValue
();
SlvAddr
=
axis
.
GetAxisValue
();
txtAxisDeviceName
.
Text
=
PortName
;
//
txtAxisDeviceName.Text = PortName;
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
Color
color
=
Color
.
Black
;
Color
color
=
Color
.
Black
;
...
@@ -291,7 +291,7 @@ namespace DeviceLibrary
...
@@ -291,7 +291,7 @@ namespace DeviceLibrary
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0038"
,
"提示"
),
crc
.
GetString
(
"Res0039"
,
"请先输入正确的速度"
)
);
return
;
return
;
}
}
btnAddMove
.
BackColor
=
Color
.
Green
;
btnAddMove
.
BackColor
=
Color
.
Green
;
...
@@ -320,7 +320,7 @@ namespace DeviceLibrary
...
@@ -320,7 +320,7 @@ namespace DeviceLibrary
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0038"
,
"提示"
),
crc
.
GetString
(
"Res0039"
,
"请先输入正确的速度"
)
);
return
;
return
;
}
}
btnDelMove
.
BackColor
=
Color
.
Green
;
btnDelMove
.
BackColor
=
Color
.
Green
;
...
@@ -393,9 +393,9 @@ namespace DeviceLibrary
...
@@ -393,9 +393,9 @@ namespace DeviceLibrary
{
{
return
;
return
;
}
}
ShowlbSts
(
lblPEL
,
sts
.
PEL
);
//正限位信号
//
ShowlbSts(lblPEL, sts.PEL); //正限位信号
ShowlbSts
(
lblORG
,
sts
.
ORG
);
//原点信号
ShowlbSts
(
lblORG
,
sts
.
ORG
);
//原点信号
ShowlbSts
(
lblNEL
,
sts
.
NEL
);
//负限位信号
//
ShowlbSts(lblNEL, sts.NEL); //负限位信号
//label59.Text = ConvertDecimalToBinary(nTimerAxSts[0]); //轴状态是按bit进行解读,因此这里将AxSts转换为二进制bit进行显示
//label59.Text = ConvertDecimalToBinary(nTimerAxSts[0]); //轴状态是按bit进行解读,因此这里将AxSts转换为二进制bit进行显示
lblAxPrfPos
.
Text
=
HCBoardManager
.
GetAxisPrfPos
(
axisNo
).
ToString
();
lblAxPrfPos
.
Text
=
HCBoardManager
.
GetAxisPrfPos
(
axisNo
).
ToString
();
...
@@ -424,7 +424,7 @@ namespace DeviceLibrary
...
@@ -424,7 +424,7 @@ namespace DeviceLibrary
lbl
.
BackColor
=
Color
.
Red
;
lbl
.
BackColor
=
Color
.
Red
;
lblAlarmcode
.
Visible
=
true
;
lblAlarmcode
.
Visible
=
true
;
lblAlarmcode
.
ForeColor
=
Color
.
Red
;
lblAlarmcode
.
ForeColor
=
Color
.
Red
;
lblAlarmcode
.
Text
=
"错误码:"
+
HCBoardManager
.
GetAxErrCode
(
SlvAddr
);
lblAlarmcode
.
Text
=
crc
.
GetString
(
"Res0040"
,
"错误码:"
)
+
HCBoardManager
.
GetAxErrCode
(
SlvAddr
);
}
}
else
else
{
{
...
@@ -445,4 +445,4 @@ namespace DeviceLibrary
...
@@ -445,4 +445,4 @@ namespace DeviceLibrary
}
}
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/userControl/AxisTipControl.cs
查看文件 @
6a65fcf
using
DeviceLibrary
;
using
DeviceLibrary
;
using
HuichuanLibrary
;
using
HuichuanLibrary
;
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
...
@@ -75,11 +75,11 @@ public partial class AxisTipControl : Form
...
@@ -75,11 +75,11 @@ public partial class AxisTipControl : Form
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
if
(
sts
.
ServoOn
<
0
)
if
(
sts
.
ServoOn
<
0
)
{
{
showToolTip
(
"伺服尚未使能"
,
c
);
showToolTip
(
crc
.
GetString
(
"Res0041"
,
"伺服尚未使能"
)
,
c
);
return
;
return
;
}
}
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
{
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
{
showToolTip
(
"伺服警报状态中"
,
c
);
showToolTip
(
crc
.
GetString
(
"Res0042"
,
"伺服警报状态中"
)
,
c
);
return
;
return
;
}
}
readPosition
();
readPosition
();
...
@@ -137,7 +137,7 @@ public partial class AxisTipControl : Form
...
@@ -137,7 +137,7 @@ public partial class AxisTipControl : Form
void
showToolTip
(
string
txt
,
Control
control
)
{
void
showToolTip
(
string
txt
,
Control
control
)
{
var
m_ToolTip
=
new
ToolTip
();
var
m_ToolTip
=
new
ToolTip
();
m_ToolTip
.
ToolTipIcon
=
ToolTipIcon
.
Warning
;
m_ToolTip
.
ToolTipIcon
=
ToolTipIcon
.
Warning
;
m_ToolTip
.
ToolTipTitle
=
"无法操作"
;
m_ToolTip
.
ToolTipTitle
=
crc
.
GetString
(
"Res0043"
,
"无法操作"
)
;
m_ToolTip
.
AutoPopDelay
=
0
;
m_ToolTip
.
AutoPopDelay
=
0
;
m_ToolTip
.
AutomaticDelay
=
0
;
m_ToolTip
.
AutomaticDelay
=
0
;
m_ToolTip
.
InitialDelay
=
0
;
m_ToolTip
.
InitialDelay
=
0
;
...
@@ -167,7 +167,7 @@ public partial class AxisTipControl : Form
...
@@ -167,7 +167,7 @@ public partial class AxisTipControl : Form
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0038"
,
"提示"
),
crc
.
GetString
(
"Res0039"
,
"请先输入正确的速度"
)
);
return
;
return
;
}
}
btnAddMove
.
BackColor
=
Color
.
Green
;
btnAddMove
.
BackColor
=
Color
.
Green
;
...
@@ -200,7 +200,7 @@ public partial class AxisTipControl : Form
...
@@ -200,7 +200,7 @@ public partial class AxisTipControl : Form
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
if
(
speed
<=
0
)
{
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0038"
,
"提示"
),
crc
.
GetString
(
"Res0039"
,
"请先输入正确的速度"
)
);
return
;
return
;
}
}
btnDelMove
.
BackColor
=
Color
.
Green
;
btnDelMove
.
BackColor
=
Color
.
Green
;
...
@@ -222,12 +222,12 @@ public partial class AxisTipControl : Form
...
@@ -222,12 +222,12 @@ public partial class AxisTipControl : Form
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
if
(
sts
.
ServoOn
<
0
)
if
(
sts
.
ServoOn
<
0
)
{
{
showToolTip
(
"伺服尚未使能"
,
(
Control
)
sender
);
showToolTip
(
crc
.
GetString
(
"Res0041"
,
"伺服尚未使能"
)
,
(
Control
)
sender
);
return
false
;
return
false
;
}
}
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
{
{
showToolTip
(
"伺服警报状态中"
,
(
Control
)
sender
);
showToolTip
(
crc
.
GetString
(
"Res0042"
,
"伺服警报状态中"
)
,
(
Control
)
sender
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -257,4 +257,3 @@ public partial class AxisTipControl : Form
...
@@ -257,4 +257,3 @@ public partial class AxisTipControl : Form
SetRelList
((
int
)
comjSpeed
.
SelectedItem
);
SetRelList
((
int
)
comjSpeed
.
SelectedItem
);
}
}
}
}
DeviceLibrary/userControl/FixtureSizeConfigControl.cs
查看文件 @
6a65fcf
using
Newtonsoft.Json
;
using
OnlineStore
;
using
Newtonsoft.Json
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
...
@@ -37,7 +38,7 @@ namespace DeviceLibrary
...
@@ -37,7 +38,7 @@ namespace DeviceLibrary
if
(
string
.
IsNullOrWhiteSpace
(
textBox_startcode
.
Text
))
if
(
string
.
IsNullOrWhiteSpace
(
textBox_startcode
.
Text
))
{
{
MessageBox
.
Show
(
"条码首字母不能为空"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0044"
,
"条码首字母不能为空"
)
);
return
;
return
;
}
}
FixtureConfig
fixtureConfig
=
new
FixtureConfig
();
FixtureConfig
fixtureConfig
=
new
FixtureConfig
();
...
@@ -94,7 +95,7 @@ namespace DeviceLibrary
...
@@ -94,7 +95,7 @@ namespace DeviceLibrary
public
override
string
ToString
()
public
override
string
ToString
()
{
{
return
$
"[{StartCode}]={Width}x{Height}"
+
(
UseActualHeight
?
$
", "
+
"物理厚度"
+
$
":{ActualHeight}"
:
""
)
+
(
AbandonCode
?
", "
+
"自动弃用"
:
""
);
return
$
"[{StartCode}]={Width}x{Height}"
+
(
UseActualHeight
?
$
", "
+
crc
.
GetString
(
"Res0045"
,
"物理厚度"
)+
$
":{ActualHeight}"
:
""
)
+
(
AbandonCode
?
", "
+
crc
.
GetString
(
"Res0046"
,
"自动弃用"
)
:
""
);
}
}
public
static
bool
GetCodeSize
(
string
code
,
out
int
FixtureHeight
,
out
int
FixtureWidth
,
out
bool
isAbandonCode
)
public
static
bool
GetCodeSize
(
string
code
,
out
int
FixtureHeight
,
out
int
FixtureWidth
,
out
bool
isAbandonCode
)
{
{
...
@@ -157,4 +158,4 @@ namespace DeviceLibrary
...
@@ -157,4 +158,4 @@ namespace DeviceLibrary
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/Form1.Designer.cs
查看文件 @
6a65fcf
此文件的差异被折叠,
点击展开。
TheMachine/Form1.cs
查看文件 @
6a65fcf
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
DeviceLibrary
;
using
OnlineStore
;
using
OnlineStore
;
...
@@ -57,7 +57,14 @@ namespace TheMachine
...
@@ -57,7 +57,14 @@ namespace TheMachine
{
{
e
.
Cancel
=
true
;
e
.
Cancel
=
true
;
this
.
WindowState
=
FormWindowState
.
Minimized
;
this
.
WindowState
=
FormWindowState
.
Minimized
;
return
;
}
}
LogUtil
.
info
(
"系统强制退出应用 step1"
);
btn_stop_Click
(
sender
,
EventArgs
.
Empty
);
Thread
.
Sleep
(
2000
);
LogUtil
.
info
(
"系统强制退出应用 step2"
);
Application
.
Exit
();
LogUtil
.
info
(
"系统强制退出应用 step3"
);
}
}
LogControl
lc
=
new
LogControl
();
LogControl
lc
=
new
LogControl
();
...
@@ -90,10 +97,10 @@ namespace TheMachine
...
@@ -90,10 +97,10 @@ namespace TheMachine
emptycol
.
Text
=
""
;
emptycol
.
Text
=
""
;
emptycol
.
Width
=
0
;
emptycol
.
Width
=
0
;
ColumnHeader
msgcol
=
new
ColumnHeader
();
ColumnHeader
msgcol
=
new
ColumnHeader
();
msgcol
.
Text
=
"信息"
;
msgcol
.
Text
=
crc
.
GetString
(
"Res0047"
,
"信息"
)
;
msgcol
.
Width
=
530
;
msgcol
.
Width
=
530
;
ColumnHeader
timecol
=
new
ColumnHeader
();
ColumnHeader
timecol
=
new
ColumnHeader
();
timecol
.
Text
=
"时间"
;
timecol
.
Text
=
crc
.
GetString
(
"Res0048"
,
"时间"
)
;
timecol
.
Width
=
150
;
timecol
.
Width
=
150
;
listView1
.
Columns
.
Add
(
emptycol
);
listView1
.
Columns
.
Add
(
emptycol
);
listView1
.
Columns
.
Add
(
timecol
);
listView1
.
Columns
.
Add
(
timecol
);
...
@@ -107,14 +114,14 @@ namespace TheMachine
...
@@ -107,14 +114,14 @@ namespace TheMachine
c1
.
Text
=
""
;
c1
.
Text
=
""
;
c1
.
Width
=
0
;
c1
.
Width
=
0
;
ColumnHeader
c2
=
new
ColumnHeader
();
ColumnHeader
c2
=
new
ColumnHeader
();
c2
.
Text
=
"模块"
;
c2
.
Text
=
crc
.
GetString
(
"Res0049"
,
"模块"
)
;
c2
.
Width
=
12
0
;
c2
.
Width
=
20
0
;
ColumnHeader
c3
=
new
ColumnHeader
();
ColumnHeader
c3
=
new
ColumnHeader
();
c3
.
Text
=
"步骤"
;
c3
.
Text
=
crc
.
GetString
(
"Res0050"
,
"步骤"
)
;
c3
.
Width
=
12
0
;
c3
.
Width
=
20
0
;
ColumnHeader
c4
=
new
ColumnHeader
();
ColumnHeader
c4
=
new
ColumnHeader
();
c4
.
Text
=
"信息"
;
c4
.
Text
=
crc
.
GetString
(
"Res0047"
,
"信息"
)
;
c4
.
Width
=
37
0
;
c4
.
Width
=
50
0
;
stateView
.
Columns
.
Add
(
c1
);
stateView
.
Columns
.
Add
(
c1
);
stateView
.
Columns
.
Add
(
c2
);
stateView
.
Columns
.
Add
(
c2
);
...
@@ -124,7 +131,6 @@ namespace TheMachine
...
@@ -124,7 +131,6 @@ namespace TheMachine
#
endregion
#
endregion
LogUtil
.
info
(
"开始初始化"
);
LogUtil
.
info
(
"开始初始化"
);
cb_EnableBuzzer
.
Checked
=
Setting_Init
.
Device_EnableBuzzer
;
AlarmBuzzer
.
BuzzerStateChange
+=
AlarmBuzzer_BuzzerStateChange
;
AlarmBuzzer
.
BuzzerStateChange
+=
AlarmBuzzer_BuzzerStateChange
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
if
(!
Setting_Init
.
Device_DisableLogWindow
)
if
(!
Setting_Init
.
Device_DisableLogWindow
)
...
@@ -210,7 +216,7 @@ namespace TheMachine
...
@@ -210,7 +216,7 @@ namespace TheMachine
}
}
var
stateinfo
=
moveInfo
.
GetStateStr
();
var
stateinfo
=
moveInfo
.
GetStateStr
();
if
(!
RobotManage
.
isRunning
)
if
(!
RobotManage
.
isRunning
)
stateinfo
=
"未启动"
;
stateinfo
=
crc
.
GetString
(
"Res0051"
,
"未启动"
)
;
ListViewItem
lvi
=
new
ListViewItem
(
new
string
[]
{
""
,
moveInfo
.
Name
,
moveInfo
.
MoveStep
.
ToString
(),
stateinfo
});
ListViewItem
lvi
=
new
ListViewItem
(
new
string
[]
{
""
,
moveInfo
.
Name
,
moveInfo
.
MoveStep
.
ToString
(),
stateinfo
});
stateView
.
Items
.
Add
(
lvi
);
stateView
.
Items
.
Add
(
lvi
);
}
}
...
@@ -491,18 +497,12 @@ namespace TheMachine
...
@@ -491,18 +497,12 @@ namespace TheMachine
{
{
RobotManage
.
IgnoreGratingSignal
((
sender
as
CheckBox
).
Checked
);
RobotManage
.
IgnoreGratingSignal
((
sender
as
CheckBox
).
Checked
);
}
}
private
void
关于
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
关于
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
AboutBox1
aboutBox1
=
new
AboutBox1
();
AboutBox1
aboutBox1
=
new
AboutBox1
();
aboutBox1
.
ShowDialog
();
aboutBox1
.
ShowDialog
();
}
}
private
void
cb_EnableBuzzer_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
Setting_Init
.
Device_EnableBuzzer
=
cb_EnableBuzzer
.
Checked
;
AlarmBuzzer
.
Enable
=
cb_EnableBuzzer
.
Checked
;
}
private
void
btn_PauseBuzzer_Click
(
object
sender
,
EventArgs
e
)
private
void
btn_PauseBuzzer_Click
(
object
sender
,
EventArgs
e
)
{
{
AlarmBuzzer
.
MuteOnce
();
AlarmBuzzer
.
MuteOnce
();
...
@@ -613,12 +613,12 @@ namespace TheMachine
...
@@ -613,12 +613,12 @@ namespace TheMachine
AlarmBuzzer
.
Enable
=
!
AlarmBuzzer
.
Enable
;
AlarmBuzzer
.
Enable
=
!
AlarmBuzzer
.
Enable
;
if
(
AlarmBuzzer
.
Enable
)
if
(
AlarmBuzzer
.
Enable
)
{
{
禁用蜂鸣器
ToolStripMenuItem
.
Text
=
"禁用蜂鸣器"
;
禁用蜂鸣器
ToolStripMenuItem
.
Text
=
crc
.
GetString
(
"Res0052"
,
"禁用蜂鸣器"
)
;
}
}
else
else
禁用蜂鸣器
ToolStripMenuItem
.
Text
=
"起用蜂鸣器"
;
禁用蜂鸣器
ToolStripMenuItem
.
Text
=
crc
.
GetString
(
"Res0053"
,
"起用蜂鸣器"
)
;
Setting_Init
.
Device_EnableBuzzer
=
AlarmBuzzer
.
Enable
;
Setting_Init
.
Device_EnableBuzzer
=
AlarmBuzzer
.
Enable
;
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/Program.cs
查看文件 @
6a65fcf
using
ConfigHelper
;
using
ConfigHelper
;
using
log4net.Config
;
using
log4net.Config
;
using
Microsoft.Win32.TaskScheduler
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -47,9 +48,7 @@ namespace TheMachine
...
@@ -47,9 +48,7 @@ namespace TheMachine
}
}
}
}
AddOrUpdateStartupTask
();
Microsoft
.
Win32
.
Registry
.
LocalMachine
.
OpenSubKey
(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
,
true
).
SetValue
(
Application
.
ProductName
,
Application
.
ExecutablePath
);
Config
.
LoadMyConfig
(
new
Setting_Init
().
GetType
());
Config
.
LoadMyConfig
(
new
Setting_Init
().
GetType
());
Application
.
ThreadException
+=
Application_ThreadException
;
Application
.
ThreadException
+=
Application_ThreadException
;
Application
.
SetUnhandledExceptionMode
(
UnhandledExceptionMode
.
CatchException
);
Application
.
SetUnhandledExceptionMode
(
UnhandledExceptionMode
.
CatchException
);
...
@@ -105,6 +104,43 @@ namespace TheMachine
...
@@ -105,6 +104,43 @@ namespace TheMachine
public
const
int
SW_RESTORE
=
9
;
public
const
int
SW_RESTORE
=
9
;
#
endregion
#
endregion
public
static
void
AddOrUpdateStartupTask
()
{
// 获取当前程序的路径和名称
string
appPath
=
Process
.
GetCurrentProcess
().
MainModule
.
FileName
;
string
TaskName
=
"AutoStartup_"
+
Process
.
GetCurrentProcess
().
MainModule
.
ModuleName
;
// 创建或更新计划任务
using
(
TaskService
taskService
=
new
TaskService
())
{
// 获取任务定义,如果不存在则创建新的任务定义
TaskDefinition
taskDefinition
;
if
(
taskService
.
GetTask
(
TaskName
)
!=
null
)
{
taskDefinition
=
taskService
.
GetTask
(
TaskName
).
Definition
;
}
else
{
taskDefinition
=
taskService
.
NewTask
();
taskDefinition
.
RegistrationInfo
.
Description
=
TaskName
;
}
if
(
taskDefinition
.
Triggers
.
Count
==
0
||
taskDefinition
.
Triggers
[
0
].
TriggerType
!=
TaskTriggerType
.
Logon
)
{
// 设置触发器为用户登录后启动
LogonTrigger
logonTrigger
=
(
LogonTrigger
)
taskDefinition
.
Triggers
.
Add
(
new
LogonTrigger
());
logonTrigger
.
Delay
=
TimeSpan
.
FromSeconds
(
5
);
}
// 设置操作为启动应用程序
taskDefinition
.
Actions
.
Clear
();
taskDefinition
.
Actions
.
Add
(
new
ExecAction
(
appPath
,
null
,
System
.
IO
.
Path
.
GetDirectoryName
(
appPath
)));
// 设置任务的运行权限为管理员权限
taskDefinition
.
Principal
.
RunLevel
=
TaskRunLevel
.
Highest
;
// 保存任务
taskService
.
RootFolder
.
RegisterTaskDefinition
(
TaskName
,
taskDefinition
,
TaskCreation
.
CreateOrUpdate
,
null
,
null
,
TaskLogonType
.
InteractiveToken
,
null
);
}
}
}
}
}
}
TheMachine/SettingControl.Designer.cs
查看文件 @
6a65fcf
...
@@ -37,18 +37,12 @@ namespace TheMachine
...
@@ -37,18 +37,12 @@ namespace TheMachine
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
tp
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tp
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
cb_usefixpos
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cb_usefixpos
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
uC_LedConfig1
=
new
TheMachine
.
UC
.
UC_LedConfig
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage_set
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage_set
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
tabPage_ledtower
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
fixtureSizeConfigControl1
=
new
DeviceLibrary
.
FixtureSizeConfigControl
();
this
.
tp
.
SuspendLayout
();
this
.
tp
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage_set
.
SuspendLayout
();
this
.
tabPage_set
.
SuspendLayout
();
this
.
tabPage_ledtower
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
// cb_tempsensorport
// cb_tempsensorport
...
@@ -142,21 +136,9 @@ namespace TheMachine
...
@@ -142,21 +136,9 @@ namespace TheMachine
this
.
cb_usefixpos
.
Text
=
"启用校准库位"
;
this
.
cb_usefixpos
.
Text
=
"启用校准库位"
;
this
.
cb_usefixpos
.
UseVisualStyleBackColor
=
true
;
this
.
cb_usefixpos
.
UseVisualStyleBackColor
=
true
;
//
//
// uC_LedConfig1
//
this
.
uC_LedConfig1
.
Config
=
null
;
this
.
uC_LedConfig1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
uC_LedConfig1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
uC_LedConfig1
.
Name
=
"uC_LedConfig1"
;
this
.
uC_LedConfig1
.
Size
=
new
System
.
Drawing
.
Size
(
1010
,
708
);
this
.
uC_LedConfig1
.
TabIndex
=
7
;
this
.
uC_LedConfig1
.
Tag
=
"not"
;
//
// tabControl1
// tabControl1
//
//
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage_set
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage_set
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage_ledtower
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage1
);
this
.
tabControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
tabControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
Name
=
"tabControl1"
;
...
@@ -185,36 +167,6 @@ namespace TheMachine
...
@@ -185,36 +167,6 @@ namespace TheMachine
this
.
uC_SetUserPassword1
.
Size
=
new
System
.
Drawing
.
Size
(
533
,
596
);
this
.
uC_SetUserPassword1
.
Size
=
new
System
.
Drawing
.
Size
(
533
,
596
);
this
.
uC_SetUserPassword1
.
TabIndex
=
7
;
this
.
uC_SetUserPassword1
.
TabIndex
=
7
;
//
//
// tabPage_ledtower
//
this
.
tabPage_ledtower
.
Controls
.
Add
(
this
.
uC_LedConfig1
);
this
.
tabPage_ledtower
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
22
);
this
.
tabPage_ledtower
.
Name
=
"tabPage_ledtower"
;
this
.
tabPage_ledtower
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage_ledtower
.
Size
=
new
System
.
Drawing
.
Size
(
1016
,
714
);
this
.
tabPage_ledtower
.
TabIndex
=
1
;
this
.
tabPage_ledtower
.
Text
=
"灯塔设置"
;
this
.
tabPage_ledtower
.
UseVisualStyleBackColor
=
true
;
//
// tabPage1
//
this
.
tabPage1
.
Controls
.
Add
(
this
.
fixtureSizeConfigControl1
);
this
.
tabPage1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
22
);
this
.
tabPage1
.
Name
=
"tabPage1"
;
this
.
tabPage1
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage1
.
Size
=
new
System
.
Drawing
.
Size
(
1016
,
714
);
this
.
tabPage1
.
TabIndex
=
2
;
this
.
tabPage1
.
Text
=
"治具设置"
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
//
// fixtureSizeConfigControl1
//
this
.
fixtureSizeConfigControl1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
fixtureSizeConfigControl1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
fixtureSizeConfigControl1
.
Name
=
"fixtureSizeConfigControl1"
;
this
.
fixtureSizeConfigControl1
.
Size
=
new
System
.
Drawing
.
Size
(
1010
,
708
);
this
.
fixtureSizeConfigControl1
.
TabIndex
=
0
;
//
// SettingControl
// SettingControl
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
@@ -227,8 +179,6 @@ namespace TheMachine
...
@@ -227,8 +179,6 @@ namespace TheMachine
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
tabPage_set
.
ResumeLayout
(
false
);
this
.
tabPage_set
.
ResumeLayout
(
false
);
this
.
tabPage_set
.
PerformLayout
();
this
.
tabPage_set
.
PerformLayout
();
this
.
tabPage_ledtower
.
ResumeLayout
(
false
);
this
.
tabPage1
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
this
.
ResumeLayout
(
false
);
}
}
...
@@ -241,12 +191,8 @@ namespace TheMachine
...
@@ -241,12 +191,8 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tp
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tp
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_usefixpos
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_usefixpos
;
private
UC
.
UC_LedConfig
uC_LedConfig1
;
private
System
.
Windows
.
Forms
.
TabControl
tabControl1
;
private
System
.
Windows
.
Forms
.
TabControl
tabControl1
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage_set
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage_set
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage_ledtower
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage1
;
private
DeviceLibrary
.
FixtureSizeConfigControl
fixtureSizeConfigControl1
;
private
UC_SetUserPassword
uC_SetUserPassword1
;
private
UC_SetUserPassword
uC_SetUserPassword1
;
}
}
}
}
TheMachine/SettingControl.cs
查看文件 @
6a65fcf
...
@@ -40,7 +40,7 @@ namespace TheMachine
...
@@ -40,7 +40,7 @@ namespace TheMachine
if
(!
RobotManage
.
haveFixpos
)
if
(!
RobotManage
.
haveFixpos
)
cb_usefixpos
.
Visible
=
false
;
cb_usefixpos
.
Visible
=
false
;
uC_LedConfig1
.
Config
=
RobotManage
.
Config
;
//
uC_LedConfig1.Config = RobotManage.Config;
}
}
...
...
TheMachine/TheMachine.csproj
查看文件 @
6a65fcf
...
@@ -56,11 +56,15 @@
...
@@ -56,11 +56,15 @@
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
</Reference>
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.10.1.0, Culture=neutral, PublicKeyToken=e25603a88b3aa7da, processorArchitecture=MSIL">
<HintPath>..\packages\TaskScheduler.2.10.1\lib\net452\Microsoft.Win32.TaskScheduler.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis">
<Reference Include="Neotel.Rmaxis">
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\Neotel.Rmaxis.dll</HintPath>
</Reference>
</Reference>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.CSharp" />
...
@@ -218,6 +222,7 @@
...
@@ -218,6 +222,7 @@
<DependentUpon>UC_SetUserPassword.cs</DependentUpon>
<DependentUpon>UC_SetUserPassword.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
...
...
TheMachine/UC/FrmPassCheck.cs
查看文件 @
6a65fcf
using
OnlineStore.Common
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
...
@@ -44,7 +45,7 @@ namespace TheMachine
...
@@ -44,7 +45,7 @@ namespace TheMachine
this
.
Close
();
this
.
Close
();
}
}
else
else
MessageBox
.
Show
(
"密码不正确请重新输入!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0057"
,
"密码不正确请重新输入!"
)
);
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/UC/IOControl.cs
查看文件 @
6a65fcf
...
@@ -104,7 +104,7 @@ namespace TheMachine
...
@@ -104,7 +104,7 @@ namespace TheMachine
//if (ioValue.SubType.Equals(0))
//if (ioValue.SubType.Equals(0))
{
{
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
26
));
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
26
));
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
crc
.
GetString
(
ioValue
.
ProName
,
ioValue
.
Explain
),
ioValue
.
ProName
);
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
crc
.
GetString
(
ioValue
.
Pro
Type
+
"_"
+
ioValue
.
Pro
Name
,
ioValue
.
Explain
),
ioValue
.
ProName
);
this
.
tableLayoutPanel1
.
Controls
.
Add
(
control
,
0
,
roleindex
);
this
.
tableLayoutPanel1
.
Controls
.
Add
(
control
,
0
,
roleindex
);
roleindex
++;
roleindex
++;
...
@@ -120,7 +120,7 @@ namespace TheMachine
...
@@ -120,7 +120,7 @@ namespace TheMachine
//if (ioValue.SubType.Equals(0))
//if (ioValue.SubType.Equals(0))
{
{
this
.
tableLayoutPanel2
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
28
));
this
.
tableLayoutPanel2
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
28
));
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
crc
.
GetString
(
ioValue
.
ProName
,
ioValue
.
Explain
),
ioValue
.
ProName
);
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
crc
.
GetString
(
ioValue
.
Pro
Type
+
"_"
+
ioValue
.
Pro
Name
,
ioValue
.
Explain
),
ioValue
.
ProName
);
control
.
Click
+=
Control_Click
;
control
.
Click
+=
Control_Click
;
this
.
tableLayoutPanel2
.
Controls
.
Add
(
control
,
0
,
roleindex
);
this
.
tableLayoutPanel2
.
Controls
.
Add
(
control
,
0
,
roleindex
);
roleindex
++;
roleindex
++;
...
...
TheMachine/UC/UC_LedConfig.cs
查看文件 @
6a65fcf
using
DeviceLibrary
;
using
OnlineStore
;
using
DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -71,28 +72,28 @@ namespace TheMachine.UC
...
@@ -71,28 +72,28 @@ namespace TheMachine.UC
Label
label_s
=
new
Label
()
Label
label_s
=
new
Label
()
{
{
Size
=
new
Size
(
200
,
34
),
Size
=
new
Size
(
200
,
34
),
Text
=
"状态,优先级从大到小"
,
Text
=
crc
.
GetString
(
"Res0058"
,
"状态,优先级从大到小"
)
,
TextAlign
=
ContentAlignment
.
MiddleLeft
TextAlign
=
ContentAlignment
.
MiddleLeft
};
};
tableLayoutPanel1
.
Controls
.
Add
(
label_s
,
0
,
0
);
tableLayoutPanel1
.
Controls
.
Add
(
label_s
,
0
,
0
);
Label
label_g
=
new
Label
()
Label
label_g
=
new
Label
()
{
{
Size
=
new
Size
(
120
,
34
),
Size
=
new
Size
(
120
,
34
),
Text
=
"绿灯"
,
Text
=
crc
.
GetString
(
"Res0059"
,
"绿灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
TextAlign
=
ContentAlignment
.
MiddleCenter
};
};
tableLayoutPanel1
.
Controls
.
Add
(
label_g
,
1
,
0
);
tableLayoutPanel1
.
Controls
.
Add
(
label_g
,
1
,
0
);
Label
label_y
=
new
Label
()
Label
label_y
=
new
Label
()
{
{
Size
=
new
Size
(
120
,
34
),
Size
=
new
Size
(
120
,
34
),
Text
=
"黄灯"
,
Text
=
crc
.
GetString
(
"Res0060"
,
"黄灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
TextAlign
=
ContentAlignment
.
MiddleCenter
};
};
tableLayoutPanel1
.
Controls
.
Add
(
label_y
,
2
,
0
);
tableLayoutPanel1
.
Controls
.
Add
(
label_y
,
2
,
0
);
Label
label_r
=
new
Label
()
Label
label_r
=
new
Label
()
{
{
Size
=
new
Size
(
120
,
34
),
Size
=
new
Size
(
120
,
34
),
Text
=
"红灯"
,
Text
=
crc
.
GetString
(
"Res0061"
,
"红灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
TextAlign
=
ContentAlignment
.
MiddleCenter
};
};
tableLayoutPanel1
.
Controls
.
Add
(
label_r
,
3
,
0
);
tableLayoutPanel1
.
Controls
.
Add
(
label_r
,
3
,
0
);
...
@@ -114,10 +115,10 @@ namespace TheMachine.UC
...
@@ -114,10 +115,10 @@ namespace TheMachine.UC
foreach
(
var
led
in
Led
.
LedColors
.
Keys
)
foreach
(
var
led
in
Led
.
LedColors
.
Keys
)
{
{
List
<
lightitem
>
lightitems
=
new
List
<
lightitem
>();
List
<
lightitem
>
lightitems
=
new
List
<
lightitem
>();
lightitems
.
Add
(
new
lightitem
(
"无动作"
,
LedState
.
none
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0062"
,
"无动作"
)
,
LedState
.
none
));
lightitems
.
Add
(
new
lightitem
(
"关"
,
LedState
.
off
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0063"
,
"关"
)
,
LedState
.
off
));
lightitems
.
Add
(
new
lightitem
(
"开"
,
LedState
.
on
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0064"
,
"开"
)
,
LedState
.
on
));
lightitems
.
Add
(
new
lightitem
(
"闪烁"
,
LedState
.
blink
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0065"
,
"闪烁"
)
,
LedState
.
blink
));
var
selit
=
lightitems
.
FindIndex
(
x
=>
x
.
value
==
RobotManage
.
mainMachine
.
MachineLedState
[
key
][
led
]);
var
selit
=
lightitems
.
FindIndex
(
x
=>
x
.
value
==
RobotManage
.
mainMachine
.
MachineLedState
[
key
][
led
]);
ComboBox
comboBox
=
new
ComboBox
();
ComboBox
comboBox
=
new
ComboBox
();
...
@@ -171,9 +172,9 @@ namespace TheMachine.UC
...
@@ -171,9 +172,9 @@ namespace TheMachine.UC
}
}
if
(
RobotManage
.
mainMachine
.
SaveLedCfg
())
if
(
RobotManage
.
mainMachine
.
SaveLedCfg
())
MessageBox
.
Show
(
"保存成功!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0066"
,
"保存成功!"
)
);
else
else
MessageBox
.
Show
(
"保存失败!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0067"
,
"保存失败!"
)
);
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/UC/UC_SetUserPassword.cs
查看文件 @
6a65fcf
using
OnlineStore.Common
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.ComponentModel
;
...
@@ -22,20 +23,20 @@ namespace TheMachine
...
@@ -22,20 +23,20 @@ namespace TheMachine
{
{
if
(
textBox_oldpwd
.
Text
!=
Setting_Init
.
User_AdminPassword
)
if
(
textBox_oldpwd
.
Text
!=
Setting_Init
.
User_AdminPassword
)
{
{
MessageBox
.
Show
(
"旧密码不正确!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0068"
,
"旧密码不正确!"
)
);
textBox_oldpwd
.
Text
=
""
;
textBox_oldpwd
.
Text
=
""
;
return
;
return
;
}
}
if
(
textBox_newpwd
.
Text
!=
textBox_newpwd2
.
Text
)
{
if
(
textBox_newpwd
.
Text
!=
textBox_newpwd2
.
Text
)
{
MessageBox
.
Show
(
"两次输入的新密码不一致,请确认!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0069"
,
"两次输入的新密码不一致,请确认!"
)
);
//textBox_oldpwd.Text = "";
//textBox_oldpwd.Text = "";
return
;
return
;
}
}
if
(
string
.
IsNullOrWhiteSpace
(
textBox_newpwd
.
Text
))
if
(
string
.
IsNullOrWhiteSpace
(
textBox_newpwd
.
Text
))
{
{
MessageBox
.
Show
(
"新密码不能为空!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0070"
,
"新密码不能为空!"
)
);
return
;
return
;
}
}
...
@@ -43,7 +44,7 @@ namespace TheMachine
...
@@ -43,7 +44,7 @@ namespace TheMachine
textBox_oldpwd
.
Text
=
""
;
textBox_oldpwd
.
Text
=
""
;
textBox_newpwd
.
Text
=
""
;
textBox_newpwd
.
Text
=
""
;
textBox_newpwd2
.
Text
=
""
;
textBox_newpwd2
.
Text
=
""
;
MessageBox
.
Show
(
"密码修改成功!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0071"
,
"密码修改成功!"
)
);
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/UC/uc_boxdebug1.cs
查看文件 @
6a65fcf
using
DeviceLibrary
;
using
DeviceLibrary
;
using
log4net
;
using
log4net
;
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
...
@@ -443,7 +443,7 @@ namespace TheMachine
...
@@ -443,7 +443,7 @@ namespace TheMachine
if
(!
RobotManage
.
mainMachine
.
IsInStoreReady
)
if
(!
RobotManage
.
mainMachine
.
IsInStoreReady
)
{
{
MessageBox
.
Show
(
"入库料盘没有准备好,请先点击[上料准备],无法启动"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0217"
,
"入库料盘没有准备好,请先点击[上料准备],无法启动"
)
);
return
;
return
;
}
}
...
@@ -482,4 +482,4 @@ namespace TheMachine
...
@@ -482,4 +482,4 @@ namespace TheMachine
RobotManage
.
mainMachine
.
StartBatchIn
();
RobotManage
.
mainMachine
.
StartBatchIn
();
}
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TheMachine/packages.config
0 → 100644
查看文件 @
6a65fcf
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"TaskScheduler"
version
=
"2.10.1"
targetFramework
=
"net461"
/>
</
packages
>
\ No newline at end of file
\ No newline at end of file
TheMachine/positionTool/FrmPositionTool.cs
查看文件 @
6a65fcf
using
DeviceLibrary
;
using
OnlineStore
;
using
DeviceLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
@@ -19,7 +20,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -19,7 +20,7 @@ namespace OnlineStore.ACSingleStore
{
{
public
partial
class
FrmPositionTool
:
Form
public
partial
class
FrmPositionTool
:
Form
{
{
private
string
LogName
=
"升降轴位置调试:"
;
private
string
LogName
=
crc
.
GetString
(
"Res0054"
,
"升降轴位置调试:"
)
;
AxisBean
UpDown_Axis
;
AxisBean
UpDown_Axis
;
string
iotype
=
""
;
string
iotype
=
""
;
...
@@ -148,7 +149,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -148,7 +149,7 @@ namespace OnlineStore.ACSingleStore
if
(
speed
<=
(
0
))
if
(
speed
<=
(
0
))
{
{
MessageBox
.
Show
(
"请输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0055"
,
"请输入正确的速度"
)
);
txtSpeed
.
Focus
();
txtSpeed
.
Focus
();
return
;
return
;
}
}
...
@@ -262,7 +263,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -262,7 +263,7 @@ namespace OnlineStore.ACSingleStore
}
}
LogUtil
.
info
(
LogName
+
"伺服已停止运动,停止定时器,记录数据"
);
LogUtil
.
info
(
LogName
+
"伺服已停止运动,停止定时器,记录数据"
);
List
<
string
>
strList
=
new
List
<
string
>();
List
<
string
>
strList
=
new
List
<
string
>();
strList
.
Add
(
"编号,标准位置,升降轴库位入料高点P3,升降轴库位入料低点P4"
);
strList
.
Add
(
crc
.
GetString
(
"Res0056"
,
"编号,标准位置,升降轴库位入料高点P3,升降轴库位入料低点P4"
)
);
int
index
=
1
;
int
index
=
1
;
foreach
(
int
p
in
PositionList
)
foreach
(
int
p
in
PositionList
)
{
{
...
@@ -332,4 +333,4 @@ namespace OnlineStore.ACSingleStore
...
@@ -332,4 +333,4 @@ namespace OnlineStore.ACSingleStore
}
}
}
}
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论