Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ca9ca76c
由
LN
编写于
2019-12-19 19:12:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
料架位置分开配置
1 个父辈
4793a6f7
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
63 行增加
和
28 行删除
source/ACPackingStore/FrmBox.Designer.cs
source/ACPackingStore/FrmBox.cs
source/DeviceLibrary/ACPackingStore/StoreManager.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/StoreConfig/shelfPosition.csv → source/DeviceLibrary/StoreConfig/shelfPosition_1.csv
source/DeviceLibrary/StoreConfig/shelfPosition_2.csv
source/LoadCVSLibrary/CSVAttribute.cs
source/LoadCVSLibrary/CSVReaderBase.cs
source/LoadCVSLibrary/position/ACBoxPosition.cs
source/LoadCVSLibrary/position/CSVPositionReader.cs
source/LoadCVSLibrary/position/PostionBase.cs
source/LoadCVSLibrary/position/ShelfPosition.cs
source/ACPackingStore/FrmBox.Designer.cs
查看文件 @
ca9ca76
此文件的差异太大,无法显示。
source/ACPackingStore/FrmBox.cs
查看文件 @
ca9ca76
...
@@ -786,7 +786,11 @@ namespace OnlineStore.ACPackingStore
...
@@ -786,7 +786,11 @@ namespace OnlineStore.ACPackingStore
}
}
//位置配置
//位置配置
string
positionConfigFile
=
Application
.
StartupPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Shelf_Position_Config
);
string
positionConfigFile
=
Application
.
StartupPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Shelf_Position_Config
);
if
(!
File
.
Exists
(
positionConfigFile
))
{
string
nameStr
=
BoxBean
.
DeviceID
.
ToString
();
positionConfigFile
=
positionConfigFile
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
}
bool
result
=
CSVPositionReader
<
ShelfPosition
>.
SavePostion
(
positionConfigFile
,
pso
);
bool
result
=
CSVPositionReader
<
ShelfPosition
>.
SavePostion
(
positionConfigFile
,
pso
);
if
(!
result
)
if
(!
result
)
{
{
...
...
source/DeviceLibrary/ACPackingStore/StoreManager.cs
查看文件 @
ca9ca76
...
@@ -98,8 +98,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -98,8 +98,8 @@ namespace OnlineStore.DeviceLibrary
for
(
int
i
=
1
;
i
<=
count
;
i
++)
for
(
int
i
=
1
;
i
<=
count
;
i
++)
{
{
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
fileN
=
positionConfigFile
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
string
fileN
=
positionConfigFile
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
fileN
);
CSVPositionReader
<
ACBoxPosition
>.
AddCSVFile
(
fileN
,
i
);
}
}
}
}
else
else
...
@@ -111,11 +111,23 @@ namespace OnlineStore.DeviceLibrary
...
@@ -111,11 +111,23 @@ namespace OnlineStore.DeviceLibrary
}
}
string
shelfConfig
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Shelf_Position_Config
);
string
shelfConfig
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Shelf_Position_Config
);
if
(
File
.
Exists
(
shelfConfig
))
//if (File.Exists(shelfConfig))
//{
// CSVPositionReader<ShelfPosition>.AddCSVFile(shelfConfig);
//}
if
(
count
>
1
||
(!
File
.
Exists
(
shelfConfig
)))
{
for
(
int
i
=
1
;
i
<=
count
;
i
++)
{
string
nameStr
=
i
.
ToString
().
PadLeft
(
1
,
'0'
);
string
fileN
=
shelfConfig
.
Replace
(
".csv"
,
"_"
+
nameStr
+
".csv"
);
CSVPositionReader
<
ShelfPosition
>.
AddCSVFile
(
fileN
,
i
);
}
}
else
{
{
CSVPositionReader
<
ShelfPosition
>.
AddCSVFile
(
shelfConfig
);
CSVPositionReader
<
ShelfPosition
>.
AddCSVFile
(
shelfConfig
);
}
}
Store
=
new
PackingStoreBean
(
Config
,
storeConfig
);
Store
=
new
PackingStoreBean
(
Config
,
storeConfig
);
}
}
}
}
...
@@ -123,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -123,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
{
{
LOGGER
.
Error
(
"出错:"
,
ex
);
LOGGER
.
Error
(
"出错:"
,
ex
);
MessageBox
.
Show
(
ex
.
ToString
(),
"加载配置错误(请检查配置)"
);
MessageBox
.
Show
(
ex
.
ToString
(),
"加载配置错误(请检查配置)"
);
Application
.
Exit
();
}
}
return
Store
;
return
Store
;
}
}
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
ca9ca76
...
@@ -122,7 +122,10 @@
...
@@ -122,7 +122,10 @@
<None Include="StoreConfig\linePositions_1.csv">
<None Include="StoreConfig\linePositions_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="StoreConfig\shelfPosition.csv">
<None Include="StoreConfig\shelfPosition_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="StoreConfig\shelfPosition_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="StoreConfig\StoreConfig.csv">
<None Include="StoreConfig\StoreConfig.csv">
...
...
source/DeviceLibrary/StoreConfig/shelfPosition.csv
→
source/DeviceLibrary/StoreConfig/shelfPosition
_1
.csv
查看文件 @
ca9ca76
文件被删除
source/DeviceLibrary/StoreConfig/shelfPosition_2.csv
0 → 100644
查看文件 @
ca9ca76
位置,优先级,高度,宽度,料仓ID,旋转轴位置P101,升降轴低点P101,升降轴高点P102,进出轴位置P101
2#S_1_1,1,8,7,2,211783,51884,55245,81000
2#S_1_2,2,8,7,2,211783,67807,71168,81000
2#S_1_3,3,8,7,2,211783,83730,87091,81000
2#S_1_4,4,8,7,2,211783,99653,103014,81000
2#S_1_5,5,8,7,2,211783,115576,118937,81000
2#S_1_6,6,8,7,2,211783,131499,134860,81000
2#S_1_7,7,8,7,2,211783,147422,150783,81000
2#S_1_8,8,8,7,2,211783,163345,166706,81000
2#S_1_9,9,8,7,2,211783,179268,182629,81000
source/LoadCVSLibrary/CSVAttribute.cs
查看文件 @
ca9ca76
...
@@ -10,9 +10,11 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -10,9 +10,11 @@ namespace OnlineStore.LoadCSVLibrary
[
AttributeUsage
(
AttributeTargets
.
Property
|
AttributeTargets
.
Class
|
AttributeTargets
.
Method
,
AllowMultiple
=
true
)]
[
AttributeUsage
(
AttributeTargets
.
Property
|
AttributeTargets
.
Class
|
AttributeTargets
.
Method
,
AllowMultiple
=
true
)]
public
class
CSVAttribute
:
Attribute
public
class
CSVAttribute
:
Attribute
{
{
public
CSVAttribute
(
string
fieldName
)
public
CSVAttribute
(
string
fieldName
,
bool
ismust
=
true
)
{
{
FieldName
=
fieldName
;
FieldName
=
fieldName
;
IsMust
=
ismust
;
}
}
private
string
fieldName
;
private
string
fieldName
;
...
@@ -21,7 +23,10 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -21,7 +23,10 @@ namespace OnlineStore.LoadCSVLibrary
get
{
return
fieldName
;
}
get
{
return
fieldName
;
}
set
{
fieldName
=
value
;
}
set
{
fieldName
=
value
;
}
}
}
/// <summary>
/// 是否必须的
/// </summary>
public
bool
IsMust
{
get
;
set
;
}
}
}
}
}
source/LoadCVSLibrary/CSVReaderBase.cs
查看文件 @
ca9ca76
...
@@ -132,14 +132,14 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -132,14 +132,14 @@ namespace OnlineStore.LoadCSVLibrary
}
}
return
titleIndex
;
return
titleIndex
;
}
}
protected
static
Dictionary
<
string
,
int
>
GetTitleIndex
(
string
lineValue
,
List
<
string
>
cvsTitleList
)
protected
static
Dictionary
<
string
,
int
>
GetTitleIndex
(
string
filename
,
string
lineValue
,
List
<
string
>
cvsTitleList
)
{
{
Dictionary
<
string
,
int
>
titleIndex
=
new
Dictionary
<
string
,
int
>();
Dictionary
<
string
,
int
>
titleIndex
=
new
Dictionary
<
string
,
int
>();
var
array
=
lineValue
.
Split
(
','
);
var
array
=
lineValue
.
Split
(
','
);
//验证列
//验证列
for
(
int
i
=
0
;
i
<
array
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
array
.
Length
;
i
++)
{
{
string
title
=
array
[
i
];
string
title
=
array
[
i
]
.
Trim
()
;
if
(
cvsTitleList
.
Contains
(
title
))
if
(
cvsTitleList
.
Contains
(
title
))
{
{
titleIndex
.
Add
(
title
,
i
);
titleIndex
.
Add
(
title
,
i
);
...
@@ -151,8 +151,8 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -151,8 +151,8 @@ namespace OnlineStore.LoadCSVLibrary
{
{
if
(!
titleIndex
.
ContainsKey
(
str
))
if
(!
titleIndex
.
ContainsKey
(
str
))
{
{
LOGGER
.
Error
(
"
未找到必须列:"
+
str
+
",加载数据失败!"
);
LOGGER
.
Error
(
filename
+
":
未找到必须列:"
+
str
+
",加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
"
未找到必须列:"
+
str
+
",加载数据失败!"
);
throw
new
CVSFieldNotMatchingExection
(
filename
+
":
未找到必须列:"
+
str
+
",加载数据失败!"
);
}
}
}
}
}
}
...
...
source/LoadCVSLibrary/position/ACBoxPosition.cs
查看文件 @
ca9ca76
...
@@ -11,11 +11,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -11,11 +11,7 @@ namespace OnlineStore.LoadCSVLibrary
/// 松下伺服485控制,单台料仓
/// 松下伺服485控制,单台料仓
/// </summary>
/// </summary>
public
class
ACBoxPosition
:
PostionBase
public
class
ACBoxPosition
:
PostionBase
{
/// <summary>
{
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
[
CSVAttribute
(
"料仓ID"
)]
public
int
StoreId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 中轴位置(旋转轴库位点)P2
/// 中轴位置(旋转轴库位点)P2
...
...
source/LoadCVSLibrary/position/CSVPositionReader.cs
查看文件 @
ca9ca76
...
@@ -54,7 +54,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -54,7 +54,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
/// <param name="filePath">cvs文件路径+文件名</param>
/// <param name="filePath">cvs文件路径+文件名</param>
/// <returns></returns>
/// <returns></returns>
public
static
Dictionary
<
String
,
T
>
AddCSVFile
(
string
filePath
)
public
static
Dictionary
<
String
,
T
>
AddCSVFile
(
string
filePath
,
int
storeId
=
0
)
{
{
if
(
hasReadFileList
.
Contains
(
filePath
))
if
(
hasReadFileList
.
Contains
(
filePath
))
{
{
...
@@ -81,7 +81,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -81,7 +81,7 @@ namespace OnlineStore.LoadCSVLibrary
var
array
=
line
.
Split
(
Spilt_Char
);
var
array
=
line
.
Split
(
Spilt_Char
);
if
(
index
==
0
)
if
(
index
==
0
)
{
{
titleIndex
=
GetTitleIndex
(
line
,
cvsTitleList
);
titleIndex
=
GetTitleIndex
(
filePath
,
line
,
cvsTitleList
);
}
}
else
else
{
{
...
@@ -116,7 +116,10 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -116,7 +116,10 @@ namespace OnlineStore.LoadCSVLibrary
listIndex
++;
listIndex
++;
}
}
result
.
Add
(
PositionNum
,
(
T
)
bllIns
);
result
.
Add
(
PositionNum
,
(
T
)
bllIns
);
if
(
storeId
>
0
&&
((
T
)
bllIns
).
StoreId
<=
0
)
{
((
T
)
bllIns
).
StoreId
=
storeId
;
}
if
(!
AllPositionMap
.
ContainsKey
(
tname
))
if
(!
AllPositionMap
.
ContainsKey
(
tname
))
{
{
AllPositionMap
.
Add
(
tname
,
new
Dictionary
<
string
,
T
>());
AllPositionMap
.
Add
(
tname
,
new
Dictionary
<
string
,
T
>());
...
@@ -125,6 +128,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -125,6 +128,7 @@ namespace OnlineStore.LoadCSVLibrary
{
{
throw
new
PositionAlreadyExistingExection
(
"仓位:"
+
PositionNum
+
"已存在!"
);
throw
new
PositionAlreadyExistingExection
(
"仓位:"
+
PositionNum
+
"已存在!"
);
}
}
AllPositionMap
[
tname
].
Add
(
PositionNum
,
(
T
)
bllIns
);
AllPositionMap
[
tname
].
Add
(
PositionNum
,
(
T
)
bllIns
);
}
}
else
else
...
@@ -187,7 +191,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -187,7 +191,7 @@ namespace OnlineStore.LoadCSVLibrary
var
array
=
line
.
Split
(
','
);
var
array
=
line
.
Split
(
','
);
if
(
index
==
0
)
if
(
index
==
0
)
{
{
titleIndex
=
GetTitleIndex
(
line
,
cvsTitleList
);
titleIndex
=
GetTitleIndex
(
filePath
,
line
,
cvsTitleList
);
}
}
else
else
{
{
...
...
source/LoadCVSLibrary/position/PostionBase.cs
查看文件 @
ca9ca76
...
@@ -28,5 +28,11 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -28,5 +28,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
[
CSVAttribute
(
"宽度"
)]
[
CSVAttribute
(
"宽度"
)]
public
int
BagWidth
{
get
;
set
;
}
public
int
BagWidth
{
get
;
set
;
}
/// <summary>
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
[
CSVAttribute
(
"料仓ID"
)]
public
int
StoreId
{
get
;
set
;
}
}
}
}
}
source/LoadCVSLibrary/position/ShelfPosition.cs
查看文件 @
ca9ca76
...
@@ -7,12 +7,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -7,12 +7,7 @@ namespace OnlineStore.LoadCSVLibrary
{
{
public
class
ShelfPosition
:
PostionBase
public
class
ShelfPosition
:
PostionBase
{
{
/// <summary>
/// 对应的料仓ID(流水线料仓需要用此字段区分哪个BOX)
/// </summary>
[
CSVAttribute
(
"料仓ID"
)]
public
int
StoreId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 旋转轴位置P101
/// 旋转轴位置P101
/// </summary>
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论