Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hemei
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
hemei
Commits
0769412b
Commit
0769412b
authored
Dec 30, 2018
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 有bug FlyData_Mix TryParse 有问题
parent
00caf7e5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
15 deletions
+77
-15
Page_MixTable.xaml.cs
...ect.FLY.Weight/FLY.Weight.UI.Client/Page_MixTable.xaml.cs
+1
-1
FlyData_Mix.cs
Project.FLY.Weight/FLY.Weight/Common/FlyData_Mix.cs
+8
-1
WeightSystem.cs
Project.FLY.Weight/FLY.Weight/Server/WeightSystem.cs
+62
-7
446.MCE
Resource/称重/设备连接变量表_446/446.MCE
+0
-0
Page_Main.xaml.cs
WpfApplication1/Page_Main.xaml.cs
+6
-6
No files found.
Project.FLY.Weight/FLY.Weight.UI.Client/Page_MixTable.xaml.cs
View file @
0769412b
...
...
@@ -96,7 +96,7 @@ namespace FLY.Weight.UI.Client
// %
DataGridTextColumn
dgtc2
=
new
DataGridTextColumn
()
{
Binding
=
new
Binding
()
{
Path
=
new
PropertyPath
(
$"Items[
{
i
}
].PDisp"
),
StringFormat
=
"{0:F
1
}"
}
Binding
=
new
Binding
()
{
Path
=
new
PropertyPath
(
$"Items[
{
i
}
].PDisp"
),
StringFormat
=
"{0:F
3
}"
}
};
StackPanel
sp2
=
new
StackPanel
()
{
Orientation
=
Orientation
.
Horizontal
};
sp2
.
Children
.
Add
(
...
...
Project.FLY.Weight/FLY.Weight/Common/FlyData_Mix.cs
View file @
0769412b
...
...
@@ -62,6 +62,9 @@ namespace FLY.Weight.Common
if
(
items
.
Length
<
(
2
+
2
*
4
))
return
false
;
int
idx
=
0
;
DateTime
t
;
float
f
;
...
...
@@ -78,6 +81,10 @@ namespace FLY.Weight.Common
Total
=
f
;
idx
++;
//翻译
//header += "," + n + "#";
//header += "," + n + "#%";
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
if
(!
float
.
TryParse
(
items
[
idx
],
out
f
))
//?#重量
...
...
Project.FLY.Weight/FLY.Weight/Server/WeightSystem.cs
View file @
0769412b
...
...
@@ -31,6 +31,12 @@ namespace FLY.Weight.Server
public
ObservableCollection
<
WeighterC
>
Items
{
get
;
}
=
new
ObservableCollection
<
WeighterC
>();
/// <summary>
/// 每1秒保存一次配料数据, 一共10秒。
/// 当卸料时,提起3秒前的数据保存
/// </summary>
List
<
Dictionary
<
WeighterC
,
FlyData_Mix
>>
mix10
=
new
List
<
Dictionary
<
WeighterC
,
FlyData_Mix
>>();
public
WeighterAccessory
Accessory
{
get
;
}
=
new
WeighterAccessory
();
private
PLCProxySystem
plcos
=
new
PLCProxySystem
();
...
...
@@ -111,7 +117,7 @@ namespace FLY.Weight.Server
{
"BucketValveIsOpen"
,
"MixDisp"
,
"IsMixSave"
,
//
"IsMixSave",
"ClearProduction"
,
"CumulativeProduction"
,
"CurrentFlow"
,
...
...
@@ -166,8 +172,8 @@ namespace FLY.Weight.Server
{
//LastCumulativeProductions.Add(w, w.CumulativeProduction);
w
.
PropertyChanged
+=
WeightSystem_MBServer_PropertyChanged
;
MixBuffer
.
Add
(
w
,
new
BufferStorage
<
FlyData_Mix
>(
w
.
Number
+
"
_mixbuffer.csv"
,
5
,
2000
));
RollMixBuffer
.
Add
(
w
,
new
BufferStorage
<
FlyData_Mix
>(
w
.
Number
+
"
_rollmixbuffer.csv"
,
1
,
400
));
MixBuffer
.
Add
(
w
,
new
BufferStorage
<
FlyData_Mix
>(
$"
{
w
.
Number
}
_mixbuffer.csv"
,
5
,
2000
));
RollMixBuffer
.
Add
(
w
,
new
BufferStorage
<
FlyData_Mix
>(
$"
{
w
.
Number
}
_rollmixbuffer.csv"
,
1
,
400
));
}
//--------------------------------------------------------------------------------
//Test();
...
...
@@ -175,8 +181,35 @@ namespace FLY.Weight.Server
plcos
.
Init
();
this
.
PropertyChanged
+=
WeightSystem_PropertyChanged
;
}
FObjBase
.
PollModule
.
Current
.
Poll_Config
(
PollModule
.
POLL_CONFIG
.
ADD
,
OnPoll_SaveMix
,
TimeSpan
.
FromSeconds
(
1
));
}
void
OnPoll_SaveMix
()
{
Dictionary
<
WeighterC
,
FlyData_Mix
>
mix
=
new
Dictionary
<
WeighterC
,
FlyData_Mix
>();
foreach
(
WeighterC
w
in
Items
)
{
//记录
FlyData_Mix
f
=
new
FlyData_Mix
{
Time
=
DateTime
.
Now
,
Total
=
w
.
MixDisp
};
for
(
int
i
=
0
;
i
<
w
.
Ingredients
.
Count
;
i
++)
{
FlyData_MixItem
item
=
new
FlyData_MixItem
()
{
Disp
=
w
.
Ingredients
[
i
].
MixDisp
,
PDisp
=
w
.
Ingredients
[
i
].
MixPDisp
};
f
.
Items
.
Add
(
item
);
}
mix
.
Add
(
w
,
f
);
}
mix10
.
Add
(
mix
);
if
(
mix10
.
Count
>
10
)
mix10
.
RemoveAt
(
0
);
}
private
void
WeightSystem_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
if
(
GetSavePropertyNames
().
Contains
(
e
.
PropertyName
))
...
...
@@ -184,14 +217,25 @@ namespace FLY.Weight.Server
Save
();
}
}
//每隔1秒记录,w.MixDisp, Ingredients[i].(MixDisp,MixPDisp) 这些的最大值
//每隔1秒记录,w.MixDisp, Ingredients[i].(MixDisp,MixPDisp),保存10s
//当卸料时,提取2s前的数据保存!!!!
private
void
WeightSystem_MBServer_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
{
WeighterC
w
=
sender
as
WeighterC
;
if
(
e
.
PropertyName
==
"IsMixSave"
)
if
(
e
.
PropertyName
==
"BucketValveIsOpen"
)
{
if
(
w
.
BucketValveIsOpen
)
{
if
(
w
.
IsMixSave
)
FlyData_Mix
f_last
=
null
;
//提取之前的记录
if
(
mix10
.
Count
>
3
)
{
f_last
=
mix10
[
mix10
.
Count
-
3
][
w
];
}
//记录
FlyData_Mix
f
=
new
FlyData_Mix
{
...
...
@@ -209,6 +253,17 @@ namespace FLY.Weight.Server
f
.
Items
.
Add
(
item
);
}
if
(
f_last
!=
null
&&
f_last
.
Total
>
f
.
Total
)
{
//没错,用以前的是对的!!!!
f
.
Total
=
f_last
.
Total
;
for
(
int
i
=
0
;
i
<
w
.
Ingredients
.
Count
;
i
++)
{
f
.
Items
[
i
].
Disp
=
f_last
.
Items
[
i
].
Disp
;
f
.
Items
[
i
].
PDisp
=
f_last
.
Items
[
i
].
PDisp
;
}
}
MixBuffer
[
w
].
Add
(
f
);
}
}
...
...
Resource/称重/设备连接变量表_446/446.MCE
View file @
0769412b
No preview for this file type
WpfApplication1/Page_Main.xaml.cs
View file @
0769412b
...
...
@@ -26,24 +26,24 @@ namespace WpfApplication1
//FLY.FeedbackRenZiJia.UI.Client.UIModule.Page_DynArea dynArea = new FLY.FeedbackRenZiJia.UI.Client.UIModule.Page_DynArea();
//FLY.IBC.UI.Client.UIModule.Page_DynArea dynArea = new FLY.IBC.UI.Client.UIModule.Page_DynArea();
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
Page_DynArea
dynArea
=
new
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
Page_DynArea
();
//
FLY.Weight.UI.Client.UIModule.Page_DynArea dynArea = new FLY.Weight.UI.Client.UIModule.Page_DynArea();
//
FLY.Winder.UI.Client.UIModule.Page_DynArea dynArea = new FLY.Winder.UI.Client.UIModule.Page_DynArea();
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
Page_DynArea
dynArea
=
new
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
Page_DynArea
();
dynArea
.
Init
(
0
);
Frame
f
=
new
Frame
();
f
.
Content
=
dynArea
;
stackpanel_dynarea
.
Children
.
Add
(
f
);
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
MenuSelect
menu
=
new
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
MenuSelect
();
//
FLY.Weight.UI.Client.UIModule.MenuSelect menu = new FLY.Weight.UI.Client.UIModule.MenuSelect();
//
FLY.Winder.UI.Client.UIModule.MenuSelect menu = new FLY.Winder.UI.Client.UIModule.MenuSelect();
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
MenuSelect
menu
=
new
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
MenuSelect
();
menu
.
Init
(
0
);
stackpanel_toolbox
.
Children
.
Add
(
menu
);
//FLY.IBC.UI.Client.UIModule.Page_Main p = new FLY.IBC.UI.Client.UIModule.Page_Main();
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
Page_Main
p
=
new
FLY
.
Winder
.
UI
.
Client
.
UIModule
.
Page_Main
();
//
FLY.Weight.UI.Client.UIModule.Page_Main p = new FLY.Weight.UI.Client.UIModule.Page_Main();
//
FLY.Winder.UI.Client.UIModule.Page_Main p = new FLY.Winder.UI.Client.UIModule.Page_Main();
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
Page_Main
p
=
new
FLY
.
Weight
.
UI
.
Client
.
UIModule
.
Page_Main
();
//FLY.Weight.UI.Client.UIModule.FlowGraph p = new FLY.Weight.UI.Client.UIModule.FlowGraph();
p
.
Init
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment