Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e405596c
由
LN
编写于
2024-08-07 09:06:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加压力值上传
1 个父辈
cb5f948c
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
102 行增加
和
38 行删除
Common/bean/Bean.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/DeviceLibrary/weightSensor/OKLE_WeightSensor.cs
TheMachine/AxisControl.Designer.cs
TheMachine/AxisControl.cs
TheMachineNView/SettingControl.cs
Common/bean/Bean.cs
查看文件 @
e405596
...
...
@@ -314,5 +314,8 @@ namespace OnlineStore.Common
/// 忽略料叉报警
/// </summary>
public
static
string
ignoreFixtureAlarm
=
"ignoreFixtureAlarm"
;
public
const
string
yaliValue
=
"yaliValue"
;
public
const
string
yaliMaxValue
=
"yaliMaxValue"
;
public
const
string
yaliAlarmValue
=
"yaliAlarmValue"
;
}
}
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
e405596
...
...
@@ -243,7 +243,15 @@ namespace DeviceLibrary
//状态
boxStatus
.
status
=
(
int
)
storeStatus
;
if
(
Setting_Init
.
Device_WeightSensor_PortName
==
""
||
RobotManage
.
oKLE_WeightSensor
==
null
||
(!
RobotManage
.
oKLE_WeightSensor
.
IsPortOpen
))
{
}
else
{
lineOperation
.
data
.
Add
(
ParamDefine
.
yaliValue
,
RobotManage
.
oKLE_WeightSensor
.
GetSWeight
().
ToString
());
lineOperation
.
data
.
Add
(
ParamDefine
.
yaliMaxValue
,
RobotManage
.
oKLE_WeightSensor
.
GetSPeakWeight
().
ToString
());
lineOperation
.
data
.
Add
(
ParamDefine
.
yaliAlarmValue
,
Setting_Init
.
Device_WeightSensor_MaxValue
.
ToString
());
}
string
sendmsg
=
""
;
if
(
commandResultMsg
.
Count
()
>
0
)
...
...
DeviceLibrary/DeviceLibrary/weightSensor/OKLE_WeightSensor.cs
查看文件 @
e405596
...
...
@@ -315,13 +315,33 @@ namespace DeviceLibrary
double
fanwei
=
ReadShort
(
Addr
.
手动置零范围
);
loge
.
Info
(
$
"读取到手动置零范围:{fanwei}"
);
}
private
ShowDataInfo
lastWeight
=
new
ShowDataInfo
();
private
ShowDataInfo
lastPeakWeight
=
new
ShowDataInfo
();
public
double
GetSWeight
()
{
if
(!
lastWeight
.
IsTimeout
())
{
return
lastWeight
.
lastValue
;
}
return
ReadInt32
(
Addr
.
毛重
);
}
public
double
GetSPeakWeight
()
{
if
(!
lastPeakWeight
.
IsTimeout
())
{
return
lastPeakWeight
.
lastValue
;
}
return
PeakWeight
();
}
/// <summary>
/// 获取重量值
/// </summary>
/// <returns></returns>
public
double
GetWeight
()
{
return
ReadInt32
(
Addr
.
毛重
);
double
v
=
ReadInt32
(
Addr
.
毛重
);
lastWeight
.
UpdateV
(
v
);
return
v
;
}
/// <summary>
/// 重置尖峰重量值
...
...
@@ -337,7 +357,9 @@ namespace DeviceLibrary
/// <returns></returns>
public
double
PeakWeight
()
{
return
ReadInt32
(
Addr
.
峰值
);
double
v
=
ReadInt32
(
Addr
.
峰值
);
lastPeakWeight
.
UpdateV
(
v
);
return
v
;
}
/// <summary>
/// 归零
...
...
@@ -394,4 +416,34 @@ namespace DeviceLibrary
Console
.
WriteLine
(
msg
);
}
}
public
class
ShowDataInfo
{
private
int
type
=
0
;
public
double
lastValue
=
0
;
private
DateTime
lastTime
=
DateTime
.
Now
;
public
void
UpdateV
(
double
lastV
)
{
this
.
lastValue
=
lastV
;
lastTime
=
DateTime
.
Now
;
}
public
bool
IsTimeout
()
{
if
(
lastValue
<=
0
)
{
return
true
;
}
else
{
TimeSpan
span
=
DateTime
.
Now
-
lastTime
;
if
(
span
.
TotalSeconds
>
2
)
{
return
true
;
}
}
return
false
;
}
}
}
TheMachine/AxisControl.Designer.cs
查看文件 @
e405596
...
...
@@ -40,8 +40,8 @@ namespace TheMachine
this
.
lblSensor
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnAxisRStop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnAxisRTest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
axisMoveControl1
=
new
AxisMoveControl
();
this
.
configControl1
=
new
ConfigControl
();
this
.
axisMoveControl1
=
new
TheMachine
.
AxisMoveControl
();
this
.
configControl1
=
new
TheMachine
.
ConfigControl
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
colorDialog1
=
new
System
.
Windows
.
Forms
.
ColorDialog
();
this
.
panel1
.
SuspendLayout
();
...
...
@@ -140,7 +140,7 @@ namespace TheMachine
this
.
btnAxisRStop
.
Name
=
"btnAxisRStop"
;
this
.
btnAxisRStop
.
Size
=
new
System
.
Drawing
.
Size
(
155
,
31
);
this
.
btnAxisRStop
.
TabIndex
=
13
;
this
.
btnAxisRStop
.
Text
=
"
旋转轴
停止"
;
this
.
btnAxisRStop
.
Text
=
"
轴循环
停止"
;
this
.
btnAxisRStop
.
UseVisualStyleBackColor
=
true
;
this
.
btnAxisRStop
.
Click
+=
new
System
.
EventHandler
(
this
.
button3_Click
);
//
...
...
@@ -150,7 +150,7 @@ namespace TheMachine
this
.
btnAxisRTest
.
Name
=
"btnAxisRTest"
;
this
.
btnAxisRTest
.
Size
=
new
System
.
Drawing
.
Size
(
155
,
31
);
this
.
btnAxisRTest
.
TabIndex
=
12
;
this
.
btnAxisRTest
.
Text
=
"
旋转轴循环
"
;
this
.
btnAxisRTest
.
Text
=
"
轴循环开始
"
;
this
.
btnAxisRTest
.
UseVisualStyleBackColor
=
true
;
this
.
btnAxisRTest
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click
);
//
...
...
TheMachine/AxisControl.cs
查看文件 @
e405596
...
...
@@ -91,10 +91,38 @@ namespace TheMachine
volatile
bool
roateloop
=
false
;
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
Task
.
Run
(()
=>
{
var
p1
=
RobotManage
.
mainMachine
.
Config
.
UpDown_P1
;
var
p1_speed
=
RobotManage
.
mainMachine
.
Config
.
UpDown_P1_speed
;
var
axis
=
RobotManage
.
mainMachine
.
UpDown_Axis
;
roateloop
=
true
;
while
(
roateloop
)
{
axis
.
AbsMove
(
null
,
p1
,
p1_speed
);
Task
.
Delay
(
200
).
Wait
();
while
(
axis
.
IsBusy
)
{
Task
.
Delay
(
100
).
Wait
();
}
if
(!
roateloop
)
break
;
Task
.
Delay
(
500
).
Wait
();
axis
.
AbsMove
(
null
,
1
,
p1_speed
);
Task
.
Delay
(
200
).
Wait
();
while
(
axis
.
IsBusy
)
{
Task
.
Delay
(
100
).
Wait
();
}
Task
.
Delay
(
500
).
Wait
();
}
});
//Task.Run(() => {
// var p1 = RobotManage.mainMachine.Config.
UpDown
_P1;
// var p1_speed = RobotManage.mainMachine.Config.
UpDown
_P1_speed;
// var axis = RobotManage.mainMachine.
UpDown
_Axis;
// var p1 = RobotManage.mainMachine.Config.
Middle
_P1;
// var p1_speed = RobotManage.mainMachine.Config.
Middle
_P1_speed;
// var axis = RobotManage.mainMachine.
Middle
_Axis;
// roateloop = true;
// while (roateloop)
// {
...
...
@@ -117,33 +145,6 @@ namespace TheMachine
// }
//});
Task
.
Run
(()
=>
{
var
p1
=
RobotManage
.
mainMachine
.
Config
.
Middle_P1
;
var
p1_speed
=
RobotManage
.
mainMachine
.
Config
.
Middle_P1_speed
;
var
axis
=
RobotManage
.
mainMachine
.
Middle_Axis
;
roateloop
=
true
;
while
(
roateloop
)
{
axis
.
AbsMove
(
null
,
p1
,
p1_speed
);
Task
.
Delay
(
200
).
Wait
();
while
(
axis
.
IsBusy
)
{
Task
.
Delay
(
100
).
Wait
();
}
if
(!
roateloop
)
break
;
Task
.
Delay
(
500
).
Wait
();
axis
.
AbsMove
(
null
,
1
,
p1_speed
);
Task
.
Delay
(
200
).
Wait
();
while
(
axis
.
IsBusy
)
{
Task
.
Delay
(
100
).
Wait
();
}
Task
.
Delay
(
500
).
Wait
();
}
});
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
...
...
TheMachineNView/SettingControl.cs
查看文件 @
e405596
...
...
@@ -143,8 +143,8 @@ namespace TheMachineNView
}
else
{
lblYa
.
Text
=
Math
.
Round
(
RobotManage
.
oKLE_WeightSensor
.
GetWeight
(),
2
).
ToString
();
lblMaxY
.
Text
=
Math
.
Round
(
RobotManage
.
oKLE_WeightSensor
.
PeakWeight
(),
2
).
ToString
();
lblYa
.
Text
=
Math
.
Round
(
RobotManage
.
oKLE_WeightSensor
.
Get
S
Weight
(),
2
).
ToString
();
lblMaxY
.
Text
=
Math
.
Round
(
RobotManage
.
oKLE_WeightSensor
.
GetS
PeakWeight
(),
2
).
ToString
();
lblMaxSet
.
Text
=
Setting_Init
.
Device_WeightSensor_MaxValue
.
ToString
();
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论