Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS100
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7e1caa74
由
张东亮
编写于
2023-04-26 09:30:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
共享变量变更位置
1 个父辈
003237dd
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
306 行增加
和
281 行删除
BLL/BLL.csproj
BLL/BLLCommon.cs
BLL/Config.cs
BLL/Extension/Item_General.cs
SmartScan/LightSource.cs → BLL/LightSource.cs
SmartScan/ServerCommunication.cs → BLL/ServerCommunication.cs
SmartScan/Common.cs
SmartScan/Form/FrmAbout.cs
SmartScan/Form/FrmCodeExtract.cs
SmartScan/Form/FrmCodeOCR.cs
SmartScan/Form/FrmFieldContent.cs
SmartScan/Form/FrmLoading.cs
SmartScan/Form/FrmMain.cs
SmartScan/Form/FrmRetrospect.cs
SmartScan/Form/FrmSet.cs
SmartScan/Form/FrmUsersLogin.cs
SmartScan/PlusSettingFrm/FrmSetPlus.cs
SmartScan/Program.cs
SmartScan/ScanWork.cs
SmartScan/SetControl/UsrCamera.cs
SmartScan/SetControl/UsrCodeExtractList.cs
SmartScan/SetControl/UsrDataSource.cs
SmartScan/SetControl/UsrExportData.cs
SmartScan/SetControl/UsrMacro.cs
SmartScan/SetControl/UsrMaterialTemplate.cs
SmartScan/SetControl/UsrPrintTemplate.cs
SmartScan/SetControl/UsrWorkMode.cs
SmartScan/SetControl/UsrWorkMode2.cs
SmartScan/SmartScan.csproj
SmartScan/UserLoginWindow.cs
SmartScan/WebCallWork.cs
SmartScan/WebService.cs
BLL/BLL.csproj
查看文件 @
7e1caa7
...
...
@@ -88,6 +88,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BLLCommon.cs" />
<Compile Include="Config.cs" />
<Compile Include="ConvertBarcode.cs" />
<Compile Include="Extension.cs" />
...
...
@@ -103,6 +104,7 @@
<Compile Include="IO\IO_Interface.cs" />
<Compile Include="IO\KND.cs" />
<Compile Include="IO\NiRenIO.cs" />
<Compile Include="LightSource.cs" />
<Compile Include="MatchAnalysis.cs" />
<Compile Include="MonitorMouseKeyboard.cs" />
<Compile Include="NamedPipeClient.cs" />
...
...
@@ -112,6 +114,7 @@
<Compile Include="MaterialEdit.cs" />
<Compile Include="PrintLabelShow.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerCommunication.cs" />
<Compile Include="Setting_Str.cs" />
<Compile Include="TextBlock.cs" />
<Compile Include="UsersLogin.cs" />
...
...
BLL/BLLCommon.cs
0 → 100644
查看文件 @
7e1caa7
using
Model
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
namespace
BLL
{
public
static
class
BLLCommon
{
public
static
BLL
.
Config
config
;
public
static
BLL
.
Extension
extension
;
public
static
BLL
.
PrintLabelEdit
labelEdit
;
public
static
BLL
.
MaterialEdit
mateEdit
;
public
static
Model
.
OCR
ocr
;
public
static
Asa
.
Camera
.
VisionLib
cameraVision
;
public
static
BLL
.
IO_Interface
ioModule
;
public
static
LightSource
lightSource
;
public
static
ServerCommunication
SCMM
;
public
static
List
<
string
>
macroKey
;
public
static
List
<
string
>
extraKey
=
new
List
<
string
>();
//public static Dictionary<string, Dictionary<string, string>> extraData = new Dictionary<string, Dictionary<string, string>>();
public
static
int
mateMaxCodeID
;
public
static
readonly
string
[]
CODE_SPLIT
=
new
string
[]
{
","
,
";"
,
":"
,
"@"
,
"#"
,
"$"
,
"%"
,
"&"
,
"-"
,
"_"
,
"+"
,
"|"
,
"!"
,
"^"
,
"*"
,
"?"
,
"/"
,
"\\"
,
"[Space]"
,
"[Tab]"
};
public
static
List
<
AutoGenRule
>
AutoGenRules
;
}
}
BLL/Config.cs
查看文件 @
7e1caa7
...
...
@@ -326,8 +326,6 @@ namespace BLL
public
static
MyConfig
<
bool
>
DataSource_Recursive
;
[
MyConfigComment
(
"是否启用OCR"
)]
public
static
MyConfig
<
bool
>
Func_EnabledOCR
=
true
;
[
MyConfigComment
(
"RI自动生成时是否添加编号"
)]
public
static
MyConfig
<
bool
>
AutoRIGenID
=
false
;
//[MyConfigComment("是否启用飞浆OCR识别")]
//public static MyConfig<bool> UsePaddleOCR = true;
...
...
BLL/Extension/Item_General.cs
查看文件 @
7e1caa7
...
...
@@ -207,13 +207,11 @@ namespace BLL
var
reelID
=
ReadReelID
();
//填充0
string
text
=
matchPrefix
+
matchID
;
if
(
Config
.
AutoRIGenID
)
{
if
(
matchFill
)
text
+=
string
.
Format
(
"{0:d"
+
matchPlace
+
"}"
,
reelID
);
else
text
+=
reelID
.
ToString
();
}
if
(
matchFill
)
text
+=
string
.
Format
(
"{0:d"
+
matchPlace
+
"}"
,
reelID
);
else
text
+=
reelID
.
ToString
();
text
+=
matchPostfix
;
return
text
;
}
...
...
SmartScan
/LightSource.cs
→
BLL
/LightSource.cs
查看文件 @
7e1caa7
...
...
@@ -2,7 +2,7 @@
using
System
;
using
System.IO.Ports
;
namespace
SmartScan
namespace
BLL
{
public
class
LightSource
{
...
...
@@ -12,12 +12,12 @@ namespace SmartScan
public
LightSource
()
{
sourceFromIO
=
Common
.
config
.
IOLight
>
-
1
;
sourceFromIO
=
BLL
Common
.
config
.
IOLight
>
-
1
;
//串口光源
if
(!
sourceFromIO
)
{
param
=
Common
.
config
.
LightSerialPort
.
Split
(
','
);
param
=
BLL
Common
.
config
.
LightSerialPort
.
Split
(
','
);
if
(
param
.
Length
!=
7
)
return
;
port
=
new
()
{
...
...
@@ -43,10 +43,10 @@ namespace SmartScan
{
if
(
sourceFromIO
)
{
if
(
Common
.
config
.
EnabledIO
)
if
(
BLL
Common
.
config
.
EnabledIO
)
{
var
r
=
Common
.
ioModule
?.
WriteDO
(
Common
.
config
.
IOLight
,
BLL
.
Status
.
On
);
LogNet
.
log
.
Info
(
"Light TurnOn,IsConn:"
+
Common
.
ioModule
?.
IsConn
+
",WriteDO:"
+
r
);
var
r
=
BLLCommon
.
ioModule
?.
WriteDO
(
BLL
Common
.
config
.
IOLight
,
BLL
.
Status
.
On
);
LogNet
.
log
.
Info
(
"Light TurnOn,IsConn:"
+
BLL
Common
.
ioModule
?.
IsConn
+
",WriteDO:"
+
r
);
}
}
else
...
...
@@ -60,8 +60,8 @@ namespace SmartScan
{
if
(
sourceFromIO
)
{
if
(
Common
.
config
.
EnabledIO
&&
Common
.
ioModule
.
IsConn
)
Common
.
ioModule
?.
WriteDO
(
Common
.
config
.
IOLight
,
BLL
.
Status
.
Off
);
if
(
BLLCommon
.
config
.
EnabledIO
&&
BLL
Common
.
ioModule
.
IsConn
)
BLLCommon
.
ioModule
?.
WriteDO
(
BLL
Common
.
config
.
IOLight
,
BLL
.
Status
.
Off
);
}
else
{
...
...
SmartScan
/ServerCommunication.cs
→
BLL
/ServerCommunication.cs
查看文件 @
7e1caa7
...
...
@@ -11,13 +11,13 @@ using System.Text;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
SmartScan
namespace
BLL
{
public
class
ServerCommunication
{
public
St
atus
status
=
Status
.
Online
;
static
string
server
=
Common
.
config
.
SmfServer
;
static
string
CID
=
Common
.
config
.
CID
;
public
St
oreStatus
status
=
Store
Status
.
Online
;
static
string
server
=
BLL
Common
.
config
.
SmfServer
;
static
string
CID
=
BLL
Common
.
config
.
CID
;
List
<
EquipMsg
>
msgList
=
new
List
<
EquipMsg
>();
int
StoreID
=
1
;
string
StoreName
=
""
;
...
...
@@ -29,8 +29,8 @@ namespace SmartScan
public
ServerCommunication
()
{
readLazyData
();
server
=
Common
.
config
.
SmfServer
;
CID
=
Common
.
config
.
CID
;
server
=
BLL
Common
.
config
.
SmfServer
;
CID
=
BLL
Common
.
config
.
CID
;
//Common.config.Save();
if
(
server
.
ToLower
().
StartsWith
(
"http"
))
{
...
...
@@ -210,7 +210,7 @@ namespace SmartScan
/// 6=入库执行中,7=入仓完成,8=入仓失败
/// 9=出库执行,10=出仓完成,11=出库失败
/// </summary>
public
enum
Status
public
enum
St
oreSt
atus
{
/// <summary>
/// 1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
...
...
@@ -251,7 +251,7 @@ namespace SmartScan
{
public
string
cid
;
public
string
type
=
"NEOSCAN"
;
//COUNTING
public
Status
status
;
public
St
oreSt
atus
status
;
public
int
seq
;
public
int
op
;
public
List
<
EquipMsg
>
msgList
=
new
List
<
EquipMsg
>();
...
...
SmartScan/Common.cs
查看文件 @
7e1caa7
...
...
@@ -9,23 +9,6 @@ namespace SmartScan
{
public
static
FrmMain
frmMain
;
public
static
FrmWaitting
frmWaitting
;
public
static
BLL
.
Config
config
;
public
static
BLL
.
Extension
extension
;
public
static
BLL
.
PrintLabelEdit
labelEdit
;
public
static
BLL
.
MaterialEdit
mateEdit
;
public
static
Model
.
OCR
ocr
;
public
static
Asa
.
Camera
.
VisionLib
cameraVision
;
public
static
BLL
.
IO_Interface
ioModule
;
public
static
LightSource
lightSource
;
public
static
ServerCommunication
SCMM
;
public
static
List
<
string
>
macroKey
;
public
static
List
<
string
>
extraKey
=
new
List
<
string
>();
//public static Dictionary<string, Dictionary<string, string>> extraData = new Dictionary<string, Dictionary<string, string>>();
public
static
int
mateMaxCodeID
;
public
static
readonly
string
[]
CODE_SPLIT
=
new
string
[]
{
","
,
";"
,
":"
,
"@"
,
"#"
,
"$"
,
"%"
,
"&"
,
"-"
,
"_"
,
"+"
,
"|"
,
"!"
,
"^"
,
"*"
,
"?"
,
"/"
,
"\\"
,
"[Space]"
,
"[Tab]"
};
public
static
List
<
AutoGenRule
>
AutoGenRules
;
}
}
SmartScan/Form/FrmAbout.cs
查看文件 @
7e1caa7
using
System
;
using
BLL
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
...
...
@@ -19,7 +20,7 @@ namespace SmartScan
private
void
FrmAbout_Load
(
object
sender
,
EventArgs
e
)
{
faceLabel2
.
Text
=
Common
.
config
.
SoftVersion
;
faceLabel2
.
Text
=
BLL
Common
.
config
.
SoftVersion
;
}
...
...
SmartScan/Form/FrmCodeExtract.cs
查看文件 @
7e1caa7
...
...
@@ -8,6 +8,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
Asa.FaceControl
;
using
BLL
;
using
Model
;
namespace
SmartScan
...
...
@@ -157,7 +158,7 @@ namespace SmartScan
keyTemp
.
Add
(
key
,
1
);
}
if
(
matchButton
.
Keys
.
Count
==
0
)
{
var
mateCopy
=
Common
.
mateEdit
.
ToCopy
();
var
mateCopy
=
BLL
Common
.
mateEdit
.
ToCopy
();
var
findocrm
=
mateCopy
.
Find
(
m
=>
m
.
Ocr
.
Find
(
o
=>
o
.
CodeID
==
this
.
codeID
)
!=
null
);
if
(
findocrm
!=
null
)
{
string
text
=
Language
.
Dialog
(
"ThisMatchHasOcrCantdelete"
);
...
...
SmartScan/Form/FrmCodeOCR.cs
查看文件 @
7e1caa7
...
...
@@ -185,7 +185,7 @@ namespace SmartScan
MaterialCodeOCR
ocr
=
new
()
{
CodeID
=
mateCode
.
ID
,
ID
=
++
Common
.
mateMaxCodeID
,
ID
=
++
BLL
Common
.
mateMaxCodeID
,
Text
=
s
.
Replace
(
";"
,
"\r\n"
)
};
ocr
.
OffsetX
=
ocrTemp
.
X
-
codeCenter
.
X
;
...
...
SmartScan/Form/FrmFieldContent.cs
查看文件 @
7e1caa7
using
System
;
using
BLL
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
...
...
@@ -16,10 +17,10 @@ namespace SmartScan
{
InitializeComponent
();
faceTextBox1
.
Text
=
content
;
faceListBox1
.
Items
.
AddRange
(
Common
.
macroKey
.
ToArray
());
Common
.
extraKey
.
ForEach
(
x
=>
faceListBox1
.
Items
.
AddRange
(
BLL
Common
.
macroKey
.
ToArray
());
BLL
Common
.
extraKey
.
ForEach
(
x
=>
{
var
has
=
Common
.
macroKey
.
Find
(
a
=>
a
==
x
);
var
has
=
BLL
Common
.
macroKey
.
Find
(
a
=>
a
==
x
);
if
(
string
.
IsNullOrEmpty
(
has
))
faceListBox1
.
Items
.
Add
(
x
);
...
...
SmartScan/Form/FrmLoading.cs
查看文件 @
7e1caa7
...
...
@@ -27,24 +27,24 @@ namespace SmartScan
string
version
=
$
"{dateTime.Year%10}.{dateTime.Month}.{dateTime.Day.ToString("
00
")}{dateTime.Hour.ToString("
00
")}"
;
LogNet
.
log
.
Info
(
$
"===== 程序开始 {version} ====="
);
Common
.
config
=
new
BLL
.
Config
();
Common
.
config
.
SoftVersion
=
version
;
BLL
Common
.
config
=
new
BLL
.
Config
();
BLL
Common
.
config
.
SoftVersion
=
version
;
//BLL.Config.Backgrounder = back;
ExtraFileData
.
Init
();
Common
.
extraKey
=
ExtraFileData
.
Titles
;
BLL
Common
.
extraKey
=
ExtraFileData
.
Titles
;
Asa
.
FaceControl
.
Language
.
LoadPath
(
FilePath
.
LANGUAGE_DIR
);
LogNet
.
log
.
Debug
(
"加载语言文件夹:"
+
FilePath
.
LANGUAGE_DIR
);
Asa
.
FaceControl
.
Language
.
LoadLanguage
(
Common
.
config
.
Language
);
Asa
.
FaceControl
.
Language
.
LoadLanguage
(
BLL
Common
.
config
.
Language
);
Common
.
cameraVision
=
new
Asa
.
Camera
.
VisionLib
(
FilePath
.
CONFIG_CAMERA
,
Common
.
config
.
EnabledCamera
);
LogNet
.
log
.
Info
(
"加载相机,数量:"
+
Common
.
cameraVision
.
Count
);
BLLCommon
.
cameraVision
=
new
Asa
.
Camera
.
VisionLib
(
FilePath
.
CONFIG_CAMERA
,
BLL
Common
.
config
.
EnabledCamera
);
LogNet
.
log
.
Info
(
"加载相机,数量:"
+
BLL
Common
.
cameraVision
.
Count
);
if
(
Common
.
config
.
EnabledIO
)
if
(
BLL
Common
.
config
.
EnabledIO
)
{
string
ip
=
Common
.
config
.
IOIPAddress
;
Common
.
ioModule
=
new
BLL
.
IOManage
(
ip
,
Common
.
config
.
iomodule
);
Common
.
ioModule
.
Connect
();
LogNet
.
log
.
Info
(
$
"加载IO模块,IP地址:{ip},iomodule:{Common.config.iomodule}"
);
string
ip
=
BLL
Common
.
config
.
IOIPAddress
;
BLLCommon
.
ioModule
=
new
BLL
.
IOManage
(
ip
,
BLL
Common
.
config
.
iomodule
);
BLL
Common
.
ioModule
.
Connect
();
LogNet
.
log
.
Info
(
$
"加载IO模块,IP地址:{ip},iomodule:{
BLL
Common.config.iomodule}"
);
}
if
(
Config
.
Func_EnabledOCR
)
...
...
@@ -52,10 +52,10 @@ namespace SmartScan
LogNet
.
log
.
Info
(
"启用OCR模块"
);
}
Common
.
lightSource
=
new
();
Common
.
extension
=
new
(
Common
.
config
);
Common
.
labelEdit
=
new
();
Common
.
mateEdit
=
new
();
BLL
Common
.
lightSource
=
new
();
BLLCommon
.
extension
=
new
(
BLL
Common
.
config
);
BLL
Common
.
labelEdit
=
new
();
BLL
Common
.
mateEdit
=
new
();
WebService
.
Open
();
ReadMacro
();
Shortcut
();
...
...
@@ -67,12 +67,12 @@ namespace SmartScan
{
LogNet
.
log
.
Info
(
"读取关键字文件"
);
LogNet
.
log
.
Debug
(
"关键字文件路径:"
+
FilePath
.
CONFIG_MACRO_KEY
);
Common
.
macroKey
=
new
();
BLL
Common
.
macroKey
=
new
();
if
(
System
.
IO
.
File
.
Exists
(
FilePath
.
CONFIG_MACRO_KEY
))
{
string
[]
lines
=
System
.
IO
.
File
.
ReadAllLines
(
FilePath
.
CONFIG_MACRO_KEY
);
Common
.
macroKey
.
AddRange
(
lines
);
BLL
Common
.
macroKey
.
AddRange
(
lines
);
LogNet
.
log
.
Debug
(
$
"添加关键字 {lines.Length} 行"
);
}
else
...
...
@@ -83,7 +83,7 @@ namespace SmartScan
private
void
Shortcut
()
{
if
(!
Common
.
config
.
CheckShortcut
)
return
;
if
(!
BLL
Common
.
config
.
CheckShortcut
)
return
;
string
name
=
System
.
IO
.
Path
.
GetFileNameWithoutExtension
(
Application
.
ExecutablePath
);
string
path
=
Environment
.
GetFolderPath
(
Environment
.
SpecialFolder
.
Desktop
)
+
string
.
Format
(
"\\{0}.lnk"
,
name
);
if
(
System
.
IO
.
File
.
Exists
(
path
))
return
;
...
...
SmartScan/Form/FrmMain.cs
查看文件 @
7e1caa7
...
...
@@ -28,9 +28,9 @@ namespace SmartScan
private
bool
CheckCamera
()
{
if
(
Common
.
config
.
EnabledCamera
)
if
(
BLL
Common
.
config
.
EnabledCamera
)
{
if
(
Common
.
cameraVision
.
Count
<=
0
)
if
(
BLL
Common
.
cameraVision
.
Count
<=
0
)
{
LogNet
.
log
.
Info
(
"相机数量为0"
);
LblCameraExist
.
BackColor
=
Color
.
Red
;
...
...
@@ -38,7 +38,7 @@ namespace SmartScan
}
else
{
LogNet
.
log
.
Info
(
"相机数量为"
+
Common
.
cameraVision
.
Count
);
LogNet
.
log
.
Info
(
"相机数量为"
+
BLL
Common
.
cameraVision
.
Count
);
LblCameraExist
.
ForeColor
=
Color
.
Lime
;
return
true
;
}
...
...
@@ -53,18 +53,18 @@ namespace SmartScan
private
bool
CheckIOModule
()
{
if
(
Common
.
config
.
EnabledIO
)
if
(
BLL
Common
.
config
.
EnabledIO
)
{
Common
.
ioModule
.
DI_Changed_Event
+=
IoModule_DI_Changed_Event
;
if
(
Common
.
ioModule
.
IsConn
)
BLL
Common
.
ioModule
.
DI_Changed_Event
+=
IoModule_DI_Changed_Event
;
if
(
BLL
Common
.
ioModule
.
IsConn
)
{
LogNet
.
log
.
Info
(
$
"IO模块 {Common.ioModule.IP} 连接成功"
);
LogNet
.
log
.
Info
(
$
"IO模块 {
BLL
Common.ioModule.IP} 连接成功"
);
LblIOExist
.
ForeColor
=
Color
.
Lime
;
return
true
;
}
else
{
LogNet
.
log
.
Info
(
$
"IO模块 {Common.ioModule.IP} 没有连接"
);
LogNet
.
log
.
Info
(
$
"IO模块 {
BLL
Common.ioModule.IP} 没有连接"
);
LblIOExist
.
BackColor
=
Color
.
Red
;
return
false
;
}
...
...
@@ -85,7 +85,7 @@ namespace SmartScan
System
.
IO
.
Directory
.
CreateDirectory
(
path
);
string
fileName
=
string
.
Format
(
"{0:HHmmssfff}"
,
DateTime
.
Now
);
switch
(
Common
.
config
.
HistoryImage
)
switch
(
BLL
Common
.
config
.
HistoryImage
)
{
case
HistoryImage
.
Original
:
if
(
PicShow
.
Image
!=
null
)
...
...
@@ -141,9 +141,9 @@ namespace SmartScan
{
if
(
sta
==
null
)
LogNet
.
log
.
Info
(
"Work IO Status = null"
);
else
if
(
sta
.
Length
<=
Common
.
config
.
IOTouch
)
LogNet
.
log
.
Info
(
$
"Work Status.Length({sta.Length}) <= {Common.config.IOTouch}"
);
else
if
(
sta
[
Common
.
config
.
IOTouch
]
==
BLL
.
Status
.
Off
)
else
if
(
sta
.
Length
<=
BLL
Common
.
config
.
IOTouch
)
LogNet
.
log
.
Info
(
$
"Work Status.Length({sta.Length}) <= {
BLL
Common.config.IOTouch}"
);
else
if
(
sta
[
BLL
Common
.
config
.
IOTouch
]
==
BLL
.
Status
.
Off
)
scanWork
.
TouchOff
();
else
{
...
...
@@ -160,8 +160,8 @@ namespace SmartScan
foreach
(
string
key
in
content
.
Keys
)
str
+=
string
.
Format
(
"({0}:{1})"
,
key
,
content
[
key
]);
LogNet
.
log
.
Info
(
str
);
Common
.
SCMM
.
SendData
(
content
);
Bitmap
labelBmp
=
Common
.
labelEdit
.
PrintImage
(
Common
.
config
.
DefaultPrintLabel
,
content
,
out
_
);
BLL
Common
.
SCMM
.
SendData
(
content
);
Bitmap
labelBmp
=
BLLCommon
.
labelEdit
.
PrintImage
(
BLL
Common
.
config
.
DefaultPrintLabel
,
content
,
out
_
);
//Common.labelEdit.PrintLast(Common.config.DefaultPrintLabel, Common.config.PrinterName, Common.config.PrintLandscape, content, out string[] barcode);
//LogNet.log.Info(string.Format("打印标签 Label[{0}] Printer[{1}]", Common.config.DefaultPrintLabel, Common.config.PrinterName));
var
barcode
=
content
.
Values
.
ToArray
();
...
...
@@ -212,12 +212,12 @@ namespace SmartScan
LogNet
.
log
.
Info
(
str
);
SaveResult
(
content
);
//Bitmap labelBmp = Common.labelEdit.PrintImage(Common.config.DefaultPrintLabel, content, out _);
Common
.
labelEdit
.
PrintLast
(
Common
.
config
.
DefaultPrintLabel
,
Common
.
config
.
PrinterName
,
Common
.
config
.
PrintLandscape
,
content
,
out
string
[]
barcode
);
LogNet
.
log
.
Info
(
string
.
Format
(
"打印标签 Label[{0}] Printer[{1}]"
,
Common
.
config
.
DefaultPrintLabel
,
Common
.
config
.
PrinterName
));
BLLCommon
.
labelEdit
.
PrintLast
(
BLLCommon
.
config
.
DefaultPrintLabel
,
BLLCommon
.
config
.
PrinterName
,
BLL
Common
.
config
.
PrintLandscape
,
content
,
out
string
[]
barcode
);
LogNet
.
log
.
Info
(
string
.
Format
(
"打印标签 Label[{0}] Printer[{1}]"
,
BLLCommon
.
config
.
DefaultPrintLabel
,
BLL
Common
.
config
.
PrinterName
));
//SaveRetrospect(labelBmp, barcode);
if
(
Common
.
config
.
PrintCompletedClear
)
Common
.
extension
.
Clear
();
if
(
BLL
Common
.
config
.
PrintCompletedClear
)
BLL
Common
.
extension
.
Clear
();
}
catch
(
Exception
ex
)
{
...
...
@@ -233,41 +233,41 @@ namespace SmartScan
Close
();
return
;
}
Common
.
SCMM
=
new
();
BLL
Common
.
SCMM
=
new
();
if
(!
BLL
.
Config
.
Backgrounder
)
{
monitor
=
new
();
Application
.
AddMessageFilter
(
monitor
);
monitor
.
Timeout
+=
Monitor_Timeout
;
monitor
.
Start
(
Common
.
config
.
OperateTimeout
);
monitor
.
Start
(
BLL
Common
.
config
.
OperateTimeout
);
}
scanWork
=
new
();
LblVersion
.
Text
=
Common
.
config
.
SoftVersion
;
LblUserName
.
Text
=
Common
.
config
.
UserName
;
LblVersion
.
Text
=
BLL
Common
.
config
.
SoftVersion
;
LblUserName
.
Text
=
BLL
Common
.
config
.
UserName
;
if
(
LblUserName
.
Text
==
"None user"
)
LblUserName
.
Visible
=
false
;
BtnSet
.
Enabled
=
Common
.
config
.
UserLevel
==
UserLevel
.
Admin
;
BtnSet
.
Enabled
=
BLL
Common
.
config
.
UserLevel
==
UserLevel
.
Admin
;
//扩展面板
PnlExtension
.
Width
=
Common
.
config
.
ExtensionWidth
;
PnlExtension
.
Width
=
BLL
Common
.
config
.
ExtensionWidth
;
PnlExtension
.
Left
=
Width
-
PnlExtension
.
Width
-
12
;
PicShow
.
Width
=
PnlExtension
.
Left
-
PicShow
.
Left
-
6
;
Common
.
extension
.
Printing
+=
Extension_Printing
;
Common
.
extension
.
SaveRetrospect
+=
Extension_SaveRetrospect
;
Common
.
extension
.
LoadPanel
(
PnlExtension
,
Common
.
macroKey
);
BLL
Common
.
extension
.
Printing
+=
Extension_Printing
;
BLL
Common
.
extension
.
SaveRetrospect
+=
Extension_SaveRetrospect
;
BLLCommon
.
extension
.
LoadPanel
(
PnlExtension
,
BLL
Common
.
macroKey
);
//语言
CboLanguage
.
Items
.
AddRange
(
Language
.
Name
);
CboLanguage
.
SelectedText
=
Common
.
config
.
Language
;
Common
.
AutoGenRules
=
AutoGenRule
.
LoadFile
();
if
(
Common
.
config
.
OpenMaximize
)
Maximize
();
CboLanguage
.
SelectedText
=
BLL
Common
.
config
.
Language
;
BLL
Common
.
AutoGenRules
=
AutoGenRule
.
LoadFile
();
if
(
BLL
Common
.
config
.
OpenMaximize
)
Maximize
();
if
(
CheckCamera
()
&&
CheckIOModule
())
{
BtnStart
.
Enabled
=
true
;
if
(
Common
.
config
.
OpenStartWork
)
if
(
BLL
Common
.
config
.
OpenStartWork
)
{
BtnStart
.
HoldPress
=
true
;
scanWork
.
Open
();
...
...
@@ -293,7 +293,7 @@ namespace SmartScan
if
(
rtn
)
{
Show
();
monitor
.
Start
(
Common
.
config
.
OperateTimeout
);
monitor
.
Start
(
BLL
Common
.
config
.
OperateTimeout
);
}
else
{
...
...
@@ -305,7 +305,7 @@ namespace SmartScan
private
void
FrmMain_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
monitor
?.
Stop
();
Common
.
extension
?.
Dispose
();
BLL
Common
.
extension
?.
Dispose
();
//if (Common.config.IOLight == -1)
// Common.SerialPort.Close();
}
...
...
@@ -317,11 +317,11 @@ namespace SmartScan
private
void
CboLanguage_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
if
(
Common
.
config
.
Language
!=
CboLanguage
.
Text
)
if
(
BLL
Common
.
config
.
Language
!=
CboLanguage
.
Text
)
{
Language
.
LoadLanguage
(
CboLanguage
.
Text
);
Common
.
config
.
Language
=
CboLanguage
.
Text
;
Common
.
config
.
Save
();
BLL
Common
.
config
.
Language
=
CboLanguage
.
Text
;
BLL
Common
.
config
.
Save
();
}
}
...
...
@@ -428,7 +428,7 @@ namespace SmartScan
});
return
;
}
Common
.
SCMM
.
ShowMsg
(
msg
,
3
,
msgType
.
INFO
);
BLL
Common
.
SCMM
.
ShowMsg
(
msg
,
3
,
msgType
.
INFO
);
Common
.
frmWaitting
.
SetMessage
(
msg
);
Application
.
DoEvents
();
}
...
...
SmartScan/Form/FrmRetrospect.cs
查看文件 @
7e1caa7
...
...
@@ -11,6 +11,7 @@ using System.Reflection;
using
System.Web.UI.WebControls
;
using
DocumentFormat.OpenXml.ExtendedProperties
;
using
DocumentFormat.OpenXml.Wordprocessing
;
using
BLL
;
namespace
SmartScan
{
...
...
@@ -262,7 +263,7 @@ namespace SmartScan
string
genLine
(
Dictionary
<
string
,
object
>
pairs
)
{
List
<
string
>
lines
=
new
List
<
string
>();
foreach
(
var
item
in
Common
.
macroKey
)
foreach
(
var
item
in
BLL
Common
.
macroKey
)
{
if
(
pairs
.
ContainsKey
(
item
))
{
...
...
@@ -287,13 +288,13 @@ namespace SmartScan
string
[]
pairs
=
item
.
Split
(
':'
);
if
(
pairs
!=
null
&&
pairs
.
Length
>
0
)
{
if
(
Common
.
macroKey
.
Contains
(
pairs
[
0
]))
if
(
BLL
Common
.
macroKey
.
Contains
(
pairs
[
0
]))
{
dic
[
pairs
[
0
]]
=
pairs
[
1
];
}
}
}
foreach
(
var
item
in
Common
.
macroKey
)
foreach
(
var
item
in
BLL
Common
.
macroKey
)
{
if
(
dic
.
ContainsKey
(
item
))
{
...
...
@@ -319,7 +320,7 @@ namespace SmartScan
{
if
(
i
>
0
)
return
true
;
else
if
(!
Common
.
macroKey
.
Contains
(
pairs
[
0
]))
{
return
false
;
}
else
if
(!
BLL
Common
.
macroKey
.
Contains
(
pairs
[
0
]))
{
return
false
;
}
}
}
...
...
@@ -329,11 +330,11 @@ namespace SmartScan
}
bool
checkHasMacroKey
(
Dictionary
<
string
,
object
>
content
)
{
for
(
int
i
=
0
;
i
<
Common
.
macroKey
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
BLL
Common
.
macroKey
.
Count
;
i
++)
{
if
(
i
>
0
)
return
true
;
else
if
(!
content
.
ContainsKey
(
Common
.
macroKey
[
i
]))
{
return
false
;
}
else
if
(!
content
.
ContainsKey
(
BLL
Common
.
macroKey
[
i
]))
{
return
false
;
}
}
return
true
;
}
...
...
@@ -342,7 +343,7 @@ namespace SmartScan
SaveFileDialog
dlg
=
new
()
{
Filter
=
"CSV文件|*.csv"
};
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
Cancel
)
return
;
StringBuilder
content
=
new
StringBuilder
();
content
.
AppendLine
(
string
.
Join
(
","
,
Common
.
macroKey
));
content
.
AppendLine
(
string
.
Join
(
","
,
BLL
Common
.
macroKey
));
var
path
=
fileFull
[
index
];
{
string
json
=
System
.
IO
.
File
.
ReadAllText
(
path
.
codePath
);
...
...
@@ -370,7 +371,7 @@ namespace SmartScan
SaveFileDialog
dlg
=
new
()
{
Filter
=
"CSV文件|*.csv"
};
if
(
dlg
.
ShowDialog
()
==
DialogResult
.
Cancel
)
return
;
StringBuilder
content
=
new
StringBuilder
();
content
.
AppendLine
(
string
.
Join
(
","
,
Common
.
macroKey
));
content
.
AppendLine
(
string
.
Join
(
","
,
BLL
Common
.
macroKey
));
foreach
(
var
path
in
fileFull
)
{
string
json
=
System
.
IO
.
File
.
ReadAllText
(
path
.
codePath
);
...
...
SmartScan/Form/FrmSet.cs
查看文件 @
7e1caa7
...
...
@@ -7,6 +7,7 @@ using System.Linq;
using
System.Text
;
using
Asa.FaceControl
;
using
System.Windows.Forms
;
using
BLL
;
namespace
SmartScan
{
...
...
@@ -59,7 +60,7 @@ namespace SmartScan
menu
[
button
].
Save
();
string
text
=
Language
.
Dialog
(
Model
.
LanguageDialogKey
.
SAVE_SUCCEED
);
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
Common
.
extension
.
Update
();
BLL
Common
.
extension
.
Update
();
DialogResult
=
DialogResult
.
OK
;
}
...
...
@@ -74,7 +75,7 @@ namespace SmartScan
menu
[
button
].
Save
();
string
text
=
Language
.
Dialog
(
Model
.
LanguageDialogKey
.
SAVE_SUCCEED
);
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
Common
.
extension
.
Update
();
BLL
Common
.
extension
.
Update
();
}
}
}
SmartScan/Form/FrmUsersLogin.cs
查看文件 @
7e1caa7
...
...
@@ -7,6 +7,7 @@ using System.Linq;
using
System.Text
;
using
Asa.FaceControl
;
using
System.Windows.Forms
;
using
BLL
;
namespace
SmartScan
{
...
...
@@ -25,8 +26,8 @@ namespace SmartScan
bool
rtn
=
usersLogin
.
Logion
(
user
,
pwd
,
out
Model
.
UserLevel
level
);
if
(
rtn
)
{
Common
.
config
.
UserName
=
user
;
Common
.
config
.
UserLevel
=
level
;
BLL
Common
.
config
.
UserName
=
user
;
BLL
Common
.
config
.
UserLevel
=
level
;
DialogResult
=
DialogResult
.
OK
;
Close
();
}
...
...
SmartScan/PlusSettingFrm/FrmSetPlus.cs
查看文件 @
7e1caa7
...
...
@@ -7,6 +7,7 @@ using System.Linq;
using
System.Text
;
using
Asa.FaceControl
;
using
System.Windows.Forms
;
using
BLL
;
namespace
SmartScan
{
...
...
@@ -74,7 +75,7 @@ namespace SmartScan
//语言
CboLanguage
.
Items
.
Clear
();
CboLanguage
.
Items
.
AddRange
(
Language
.
Name
);
CboLanguage
.
SelectedText
=
Common
.
config
.
Language
;
CboLanguage
.
SelectedText
=
BLL
Common
.
config
.
Language
;
}
private
void
BtnMenu_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -112,7 +113,7 @@ namespace SmartScan
menu
[
button
].
Save
();
string
text
=
Language
.
Dialog
(
Model
.
LanguageDialogKey
.
SAVE_SUCCEED
);
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
Common
.
extension
.
Update
();
BLL
Common
.
extension
.
Update
();
DialogResult
=
DialogResult
.
OK
;
WindowState
=
FormWindowState
.
Minimized
;
}
...
...
@@ -131,16 +132,16 @@ namespace SmartScan
menu
[
button
].
Save
();
string
text
=
Language
.
Dialog
(
Model
.
LanguageDialogKey
.
SAVE_SUCCEED
);
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
Common
.
extension
.
Update
();
BLL
Common
.
extension
.
Update
();
}
private
void
CboLanguage_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
if
(
Common
.
config
.
Language
!=
CboLanguage
.
Text
)
if
(
BLL
Common
.
config
.
Language
!=
CboLanguage
.
Text
)
{
Language
.
LoadLanguage
(
CboLanguage
.
Text
);
Common
.
config
.
Language
=
CboLanguage
.
Text
;
Common
.
config
.
Save
();
BLL
Common
.
config
.
Language
=
CboLanguage
.
Text
;
BLL
Common
.
config
.
Save
();
FrmSet_Load
(
this
,
EventArgs
.
Empty
);
}
}
...
...
SmartScan/Program.cs
查看文件 @
7e1caa7
...
...
@@ -161,9 +161,9 @@ namespace SmartScan
private
static
void
Exit
()
{
LogNet
.
log
.
Info
(
"=====准备退出...====="
);
Common
.
lightSource
.
Close
();
Common
.
ioModule
?.
Close
();
Common
.
cameraVision
?.
Dispose
();
BLL
Common
.
lightSource
.
Close
();
BLL
Common
.
ioModule
?.
Close
();
BLL
Common
.
cameraVision
?.
Dispose
();
WebService
.
Close
();
LogNet
.
log
.
Info
(
"=====程序结束=====\r\n"
);
}
...
...
SmartScan/ScanWork.cs
查看文件 @
7e1caa7
using
Asa.FaceControl
;
using
BLL
;
using
Model
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -37,13 +38,13 @@ namespace SmartScan
Common
.
frmMain
.
Controls
[
"BtnTriggerIO"
].
Visible
=
true
;
LogNet
.
log
.
Info
(
"Work Start"
);
if
(
Common
.
config
.
EnabledCamera
)
Common
.
cameraVision
?.
Open
();
if
(
BLL
Common
.
config
.
EnabledCamera
)
BLL
Common
.
cameraVision
?.
Open
();
if
(
Common
.
config
.
TriggerOpenLight
)
//触发时才打开光源
Common
.
lightSource
?.
TurnOff
();
if
(
BLL
Common
.
config
.
TriggerOpenLight
)
//触发时才打开光源
BLL
Common
.
lightSource
?.
TurnOff
();
else
Common
.
lightSource
?.
TurnOn
();
BLL
Common
.
lightSource
?.
TurnOn
();
}
public
void
Close
()
...
...
@@ -55,10 +56,10 @@ namespace SmartScan
Common
.
frmMain
.
Controls
[
"BtnTriggerIO"
].
Visible
=
false
;
LogNet
.
log
.
Info
(
"Work Stop"
);
if
(
Common
.
config
.
EnabledCamera
)
Common
.
cameraVision
?.
Close
();
if
(
BLL
Common
.
config
.
EnabledCamera
)
BLL
Common
.
cameraVision
?.
Close
();
Common
.
lightSource
?.
TurnOff
();
BLL
Common
.
lightSource
?.
TurnOff
();
}
public
void
TouchOff
()
...
...
@@ -74,7 +75,7 @@ namespace SmartScan
btnMatchedName
.
Invoke
(
delegate
()
{
if
(!
BLL
.
Config
.
Backgrounder
)
btnMatchedName
.
Visible
=
false
;
Common
.
extension
.
Clear
();
BLL
Common
.
extension
.
Clear
();
});
var
t
=
Task
.
Run
(()
=>
...
...
@@ -136,7 +137,7 @@ namespace SmartScan
if
(!
BLL
.
Config
.
Backgrounder
)
btnMatchedName
.
Visible
=
false
;
Common
.
extension
.
Clear
();
BLL
Common
.
extension
.
Clear
();
workCodeInfo
=
new
();
workCodeKeyword
=
new
(
StringComparer
.
OrdinalIgnoreCase
);
originalCodeText
=
code
;
...
...
@@ -214,20 +215,20 @@ namespace SmartScan
{
LogNet
.
log
.
Info
(
"Work GetCodeInfo"
);
if
(
Common
.
config
.
EnabledCamera
)
if
(
BLL
Common
.
config
.
EnabledCamera
)
{
if
(
Common
.
config
.
TriggerOpenLight
)
if
(
BLL
Common
.
config
.
TriggerOpenLight
)
{
Common
.
lightSource
.
TurnOn
();
BLL
Common
.
lightSource
.
TurnOn
();
System
.
Threading
.
Thread
.
Sleep
(
2000
);
//光源打开有一个由暗变亮的过程
}
workCodeInfo
=
Common
.
cameraVision
.
GetBarCode
(
out
List
<
Bitmap
>
image
);
workCodeInfo
=
BLL
Common
.
cameraVision
.
GetBarCode
(
out
List
<
Bitmap
>
image
);
if
(
image
.
Count
>
0
&&
!
BLL
.
Config
.
Backgrounder
)
picShow
.
Image
=
image
[
0
];
if
(
image
.
Count
>
0
)
Common
.
mateEdit
.
CurrntBitmap
=
image
[
0
];
BLL
Common
.
mateEdit
.
CurrntBitmap
=
image
[
0
];
if
(
Common
.
config
.
TriggerOpenLight
)
Common
.
lightSource
.
TurnOff
();
if
(
BLL
Common
.
config
.
TriggerOpenLight
)
BLL
Common
.
lightSource
.
TurnOff
();
return
true
;
}
else
...
...
@@ -244,12 +245,12 @@ namespace SmartScan
Bitmap
bmp
=
null
;
bmp
=
new
(
filename
);
workCodeInfo
=
Common
.
cameraVision
.
GetBarCode
(
bmp
);
workCodeInfo
=
BLL
Common
.
cameraVision
.
GetBarCode
(
bmp
);
Common
.
frmMain
.
Invoke
(
delegate
()
{
if
(!
BLL
.
Config
.
Backgrounder
)
picShow
.
Image
=
bmp
;
Common
.
mateEdit
.
CurrntBitmap
=
bmp
;
BLL
Common
.
mateEdit
.
CurrntBitmap
=
bmp
;
});
return
true
;
}
...
...
@@ -282,9 +283,9 @@ namespace SmartScan
{
LogNet
.
log
.
Info
(
"Work MatchingTemplate"
);
if
(
workCodeInfo
.
Count
==
0
)
return
false
;
originalCodeText
=
Common
.
cameraVision
.
GetBarCodeText
(
workCodeInfo
);
originalCodeText
=
BLL
Common
.
cameraVision
.
GetBarCodeText
(
workCodeInfo
);
bool
rtn
=
Common
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
Common
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
bool
rtn
=
BLLCommon
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
BLL
Common
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
BLL
.
MatchAnalysis
.
ShowResult
();
Common
.
frmMain
.
Invoke
(
delegate
()
{
...
...
@@ -315,10 +316,10 @@ namespace SmartScan
private
void
SetKey
(
bool
hasMatch
)
{
LogNet
.
log
.
Info
(
"Work SetKey hasMatch:"
+
hasMatch
);
Common
.
extension
.
SetKey
(
originalCodeText
,
workCodeKeyword
,
hasMatch
,
out
_
);
BLL
Common
.
extension
.
SetKey
(
originalCodeText
,
workCodeKeyword
,
hasMatch
,
out
_
);
if
(
workCodeKeyword
.
Count
==
0
)
return
;
if
(
Common
.
config
.
PromptAfterPrinting
&&
!
BLL
.
Config
.
Backgrounder
)
if
(
BLL
Common
.
config
.
PromptAfterPrinting
&&
!
BLL
.
Config
.
Backgrounder
)
{
string
text
=
Language
.
Dialog
(
"SelectPrintContent"
);
new
FaceMessageBox
(
""
,
text
,
MessageBoxButtons
.
OK
).
ShowDialog
();
...
...
SmartScan/SetControl/UsrCamera.cs
查看文件 @
7e1caa7
...
...
@@ -16,7 +16,7 @@ namespace SmartScan
{
InitializeComponent
();
Asa
.
FaceControl
.
Language
.
SetLanguage
(
this
);
BtnCameraImage
.
Enabled
=
Common
.
cameraVision
==
null
?
false
:
Common
.
cameraVision
.
Count
>
0
;
BtnCameraImage
.
Enabled
=
BLLCommon
.
cameraVision
==
null
?
false
:
BLL
Common
.
cameraVision
.
Count
>
0
;
}
public
Asa
.
FaceControl
.
FacePanel
GetPanel
()
...
...
@@ -30,19 +30,19 @@ namespace SmartScan
private
void
BtnOpenLight_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
lightSource
.
TurnOn
();
BLL
Common
.
lightSource
.
TurnOn
();
}
private
void
BtnCloseLight_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
lightSource
.
TurnOff
();
BLL
Common
.
lightSource
.
TurnOff
();
}
private
void
BtnCameraImage_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
cameraVision
.
Open
();
Bitmap
[]
result
=
Common
.
cameraVision
.
GetImage
();
Common
.
cameraVision
.
Close
();
BLL
Common
.
cameraVision
.
Open
();
Bitmap
[]
result
=
BLL
Common
.
cameraVision
.
GetImage
();
BLL
Common
.
cameraVision
.
Close
();
if
(
result
.
Length
==
0
)
return
;
bmp
=
result
[
0
];
LstCode
.
Items
.
Clear
();
...
...
@@ -64,7 +64,7 @@ namespace SmartScan
private
void
BtnScanCode_Click
(
object
sender
,
EventArgs
e
)
{
if
(
bmp
==
null
)
return
;
List
<
CameraVisionLib
.
Model
.
BarcodeInfo
>
info
=
Common
.
cameraVision
.
GetBarCode
(
bmp
);
List
<
CameraVisionLib
.
Model
.
BarcodeInfo
>
info
=
BLL
Common
.
cameraVision
.
GetBarCode
(
bmp
);
LstCode
.
Items
.
Clear
();
PicShow
.
CodeCenterClear
();
string
[]
arr
=
new
string
[
info
.
Count
];
...
...
SmartScan/SetControl/UsrCodeExtractList.cs
查看文件 @
7e1caa7
using
Asa.FaceControl
;
using
BLL
;
using
System
;
using
System.Windows.Forms
;
...
...
@@ -30,8 +31,8 @@ namespace SmartScan
this
.
codeText
=
codeText
;
this
.
codeType
=
codeType
;
CboKeyword
.
Items
.
AddRange
(
Common
.
macroKey
.
ToArray
());
CboMatchingSplit
.
Items
.
AddRange
(
Common
.
CODE_SPLIT
);
CboKeyword
.
Items
.
AddRange
(
BLL
Common
.
macroKey
.
ToArray
());
CboMatchingSplit
.
Items
.
AddRange
(
BLL
Common
.
CODE_SPLIT
);
NudStart
.
Maximum
=
codeLength
;
NudLength
.
Maximum
=
codeLength
;
ChkMatchingStart
.
Checked
=
match
.
MatchStart
;
...
...
SmartScan/SetControl/UsrDataSource.cs
查看文件 @
7e1caa7
...
...
@@ -84,7 +84,7 @@ namespace SmartScan
}
CboDataKey
.
Items
.
Clear
();
CboDataKey
.
Items
.
AddRange
(
Common
.
macroKey
.
ToArray
());
CboDataKey
.
Items
.
AddRange
(
BLL
Common
.
macroKey
.
ToArray
());
CboDataKey
.
SelectedIndex
=
0
;
if
(!
string
.
IsNullOrEmpty
(
Config
.
DataSource_DataKey
))
...
...
@@ -108,7 +108,7 @@ namespace SmartScan
Config
.
DataSource_DataTitle
=
CboDataTitle
.
Text
;
Config
.
DataSource_Recursive
=
ChkRecursive
.
Checked
;
ExtraFileData
.
Init
();
Common
.
extraKey
=
ExtraFileData
.
Titles
;
BLL
Common
.
extraKey
=
ExtraFileData
.
Titles
;
}
private
void
BtnSelectFile_Click
(
object
sender
,
EventArgs
e
)
...
...
SmartScan/SetControl/UsrExportData.cs
查看文件 @
7e1caa7
...
...
@@ -84,7 +84,7 @@ namespace SmartScan
}
CboDataKey
.
Items
.
Clear
();
CboDataKey
.
Items
.
AddRange
(
Common
.
macroKey
.
ToArray
());
CboDataKey
.
Items
.
AddRange
(
BLL
Common
.
macroKey
.
ToArray
());
CboDataKey
.
SelectedIndex
=
0
;
if
(!
string
.
IsNullOrEmpty
(
Config
.
DataSource_DataKey
))
...
...
@@ -108,7 +108,7 @@ namespace SmartScan
Config
.
DataSource_DataTitle
=
CboDataTitle
.
Text
;
Config
.
DataSource_Recursive
=
ChkRecursive
.
Checked
;
ExtraFileData
.
Init
();
Common
.
extraKey
=
ExtraFileData
.
Titles
;
BLL
Common
.
extraKey
=
ExtraFileData
.
Titles
;
}
private
void
BtnSelectFile_Click
(
object
sender
,
EventArgs
e
)
...
...
SmartScan/SetControl/UsrMacro.cs
查看文件 @
7e1caa7
using
System
;
using
System.Collections.Generic
;
using
System.Windows.Forms
;
using
BLL
;
using
Model
;
namespace
SmartScan
...
...
@@ -12,15 +13,15 @@ namespace SmartScan
public
UsrMacro
()
{
InitializeComponent
();
keyCopy
=
new
(
Common
.
macroKey
);
keyCopy
=
new
(
BLL
Common
.
macroKey
);
LstKey
.
Items
.
AddRange
(
keyCopy
.
ToArray
());
setRIkey
();
TxtReelIDMatch
.
Text
=
Common
.
config
.
ReelIDMatch
;
TxtPrefix
.
Text
=
Common
.
config
.
ReelIDPrefix
;
TxtPostfix
.
Text
=
Common
.
config
.
ReelIDPostfix
;
NumReelIDPlaces
.
Value
=
Common
.
config
.
ReelIDPlaces
;
ChkReelIDFillZero
.
Checked
=
Common
.
config
.
ReelIDFillZero
;
ChkResetidbydate
.
Checked
=
Common
.
config
.
ReelIDAutoResetByDate
;
TxtReelIDMatch
.
Text
=
BLL
Common
.
config
.
ReelIDMatch
;
TxtPrefix
.
Text
=
BLL
Common
.
config
.
ReelIDPrefix
;
TxtPostfix
.
Text
=
BLL
Common
.
config
.
ReelIDPostfix
;
NumReelIDPlaces
.
Value
=
BLL
Common
.
config
.
ReelIDPlaces
;
ChkReelIDFillZero
.
Checked
=
BLL
Common
.
config
.
ReelIDFillZero
;
ChkResetidbydate
.
Checked
=
BLL
Common
.
config
.
ReelIDAutoResetByDate
;
Asa
.
FaceControl
.
Language
.
SetLanguage
(
this
);
}
...
...
@@ -31,24 +32,24 @@ namespace SmartScan
public
void
Save
()
{
Common
.
macroKey
.
Clear
();
Common
.
macroKey
.
AddRange
(
keyCopy
);
System
.
IO
.
File
.
WriteAllLines
(
FilePath
.
CONFIG_MACRO_KEY
,
Common
.
macroKey
.
ToArray
());
Common
.
config
.
ReelIDMatch
=
TxtReelIDMatch
.
Text
;
Common
.
config
.
ReelIDPrefix
=
TxtPrefix
.
Text
;
Common
.
config
.
ReelIDPostfix
=
TxtPostfix
.
Text
;
Common
.
config
.
ReelIDPlaces
=
(
int
)
NumReelIDPlaces
.
Value
;
Common
.
config
.
ReelIDFillZero
=
ChkReelIDFillZero
.
Checked
;
Common
.
config
.
ReelIDAutoResetByDate
=
ChkResetidbydate
.
Checked
;
Common
.
config
.
Save
();
BLL
Common
.
macroKey
.
Clear
();
BLL
Common
.
macroKey
.
AddRange
(
keyCopy
);
System
.
IO
.
File
.
WriteAllLines
(
FilePath
.
CONFIG_MACRO_KEY
,
BLL
Common
.
macroKey
.
ToArray
());
BLL
Common
.
config
.
ReelIDMatch
=
TxtReelIDMatch
.
Text
;
BLL
Common
.
config
.
ReelIDPrefix
=
TxtPrefix
.
Text
;
BLL
Common
.
config
.
ReelIDPostfix
=
TxtPostfix
.
Text
;
BLL
Common
.
config
.
ReelIDPlaces
=
(
int
)
NumReelIDPlaces
.
Value
;
BLL
Common
.
config
.
ReelIDFillZero
=
ChkReelIDFillZero
.
Checked
;
BLL
Common
.
config
.
ReelIDAutoResetByDate
=
ChkResetidbydate
.
Checked
;
BLL
Common
.
config
.
Save
();
}
void
setRIkey
()
{
LstKey
.
Items
.
Clear
();
LstKey
.
Items
.
AddRange
(
keyCopy
.
ToArray
());
for
(
int
i
=
0
;
i
<
LstKey
.
Items
.
Count
;
i
++)
{
if
(
LstKey
.
Items
[
i
]
==
Common
.
config
.
ReelIDKeyWord
)
if
(
LstKey
.
Items
[
i
]
==
BLL
Common
.
config
.
ReelIDKeyWord
)
LstKey
.
Items
[
i
]
=
"[RI]"
+
LstKey
.
Items
[
i
];
}
}
...
...
@@ -135,10 +136,10 @@ namespace SmartScan
private
void
btn_setriid_Click
(
object
sender
,
EventArgs
e
)
{
if
(
LstKey
.
SelectedIndex
==
-
1
)
return
;
if
(
keyCopy
[
LstKey
.
SelectedIndex
]
==
Common
.
config
.
ReelIDKeyWord
)
Common
.
config
.
ReelIDKeyWord
=
""
;
if
(
keyCopy
[
LstKey
.
SelectedIndex
]
==
BLL
Common
.
config
.
ReelIDKeyWord
)
BLL
Common
.
config
.
ReelIDKeyWord
=
""
;
else
Common
.
config
.
ReelIDKeyWord
=
keyCopy
[
LstKey
.
SelectedIndex
];
BLL
Common
.
config
.
ReelIDKeyWord
=
keyCopy
[
LstKey
.
SelectedIndex
];
setRIkey
();
}
...
...
SmartScan/SetControl/UsrMaterialTemplate.cs
查看文件 @
7e1caa7
...
...
@@ -19,10 +19,10 @@ namespace SmartScan
{
InitializeComponent
();
//BtnOcrCode.Enabled = Config.Func_EnabledOCR;
LstMate
.
Items
.
AddRange
(
Common
.
mateEdit
.
Name
);
mateCopy
=
Common
.
mateEdit
.
ToCopy
();
LstMate
.
Items
.
AddRange
(
BLL
Common
.
mateEdit
.
Name
);
mateCopy
=
BLL
Common
.
mateEdit
.
ToCopy
();
Language
.
SetLanguage
(
this
);
BtnCameraImage
.
Enabled
=
Common
.
cameraVision
.
Count
>
0
;
BtnCameraImage
.
Enabled
=
BLL
Common
.
cameraVision
.
Count
>
0
;
LstMate
.
SelectedFirst
();
}
...
...
@@ -33,7 +33,7 @@ namespace SmartScan
public
void
Save
()
{
Common
.
mateEdit
.
Save
(
ref
mateCopy
);
BLL
Common
.
mateEdit
.
Save
(
ref
mateCopy
);
}
...
...
@@ -117,7 +117,7 @@ namespace SmartScan
{
if
(
LstMate
.
SelectedIndex
==
-
1
)
return
;
mateIndex
=
LstMate
.
SelectedIndex
;
Common
.
mateMaxCodeID
=
mateCopy
[
mateIndex
].
GetMaxID
();
BLL
Common
.
mateMaxCodeID
=
mateCopy
[
mateIndex
].
GetMaxID
();
ImgShow
.
Image
=
mateCopy
[
mateIndex
].
Image
;
ImgShow
.
CodeCenterClear
();
...
...
@@ -196,19 +196,19 @@ namespace SmartScan
private
void
BtnOpenLight_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
lightSource
.
TurnOn
();
BLL
Common
.
lightSource
.
TurnOn
();
}
private
void
BtnCloseLight_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
lightSource
.
TurnOff
();
BLL
Common
.
lightSource
.
TurnOff
();
}
private
void
BtnCameraImage_Click
(
object
sender
,
EventArgs
e
)
{
Common
.
cameraVision
.
Open
();
Bitmap
[]
result
=
Common
.
cameraVision
.
GetImage
();
Common
.
cameraVision
.
Close
();
BLL
Common
.
cameraVision
.
Open
();
Bitmap
[]
result
=
BLL
Common
.
cameraVision
.
GetImage
();
BLL
Common
.
cameraVision
.
Close
();
if
(
result
.
Length
==
0
)
return
;
bmp
=
result
[
0
];
...
...
@@ -247,7 +247,7 @@ namespace SmartScan
{
return
;
}
List
<
CameraVisionLib
.
Model
.
BarcodeInfo
>
info
=
Common
.
cameraVision
.
GetBarCode
(
bmp
);
List
<
CameraVisionLib
.
Model
.
BarcodeInfo
>
info
=
BLL
Common
.
cameraVision
.
GetBarCode
(
bmp
);
LstCode
.
Items
.
Clear
();
ImgShow
.
CodeCenterClear
();
mateCopy
[
mateIndex
].
Match
.
Clear
();
...
...
@@ -255,7 +255,7 @@ namespace SmartScan
mateCopy
[
mateIndex
].
Ocr
.
Clear
();
mateCopy
[
mateIndex
].
PrimaryCode
=
-
1
;
mateCopy
[
mateIndex
].
State
=
TemplateState
.
Unsaved
;
Common
.
mateMaxCodeID
=
info
.
Count
;
BLL
Common
.
mateMaxCodeID
=
info
.
Count
;
PointF
[]
lst
=
new
PointF
[
info
.
Count
];
for
(
int
i
=
0
;
i
<
info
.
Count
;
i
++)
...
...
@@ -282,7 +282,7 @@ namespace SmartScan
//保存需要识别ocr的区域
bmp
?.
Save
(
@"ocrt.jpg"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Jpeg
);
string
[]
regOcrCodes
=
PaddleOCRHelper
.
StartTest
(
"..\\ocrt.jpg"
).
Split
(
';'
);
int
startidx
=
Common
.
mateMaxCodeID
+
1
;
int
startidx
=
BLL
Common
.
mateMaxCodeID
+
1
;
foreach
(
var
ocr
in
regOcrCodes
)
{
if
(
string
.
IsNullOrEmpty
(
ocr
))
continue
;
...
...
SmartScan/SetControl/UsrPrintTemplate.cs
查看文件 @
7e1caa7
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Drawing
;
using
System.Windows.Forms
;
using
Asa.FaceControl
;
using
BLL
;
using
Model
;
namespace
SmartScan
...
...
@@ -27,9 +28,9 @@ namespace SmartScan
labelShow
.
LabelSizeShow
+=
LabelShow_LabelSizeShow
;
labelShow
.
FieldSizeChanged
+=
LabelShow_FieldSizeChanged
;
LstLabel
.
Items
.
AddRange
(
Common
.
labelEdit
.
Name
);
LstLabel
.
Items
.
AddRange
(
BLL
Common
.
labelEdit
.
Name
);
CboFieldType
.
Items
.
AddRange
(
Enum
.
GetNames
(
typeof
(
PrintLabelFieldType
)));
labelCopy
=
Common
.
labelEdit
.
ToCopy
();
labelCopy
=
BLL
Common
.
labelEdit
.
ToCopy
();
Language
.
SetLanguage
(
this
);
LstLabel
.
SelectedFirst
();
}
...
...
@@ -41,7 +42,7 @@ namespace SmartScan
public
void
Save
()
{
Common
.
labelEdit
.
Save
(
ref
labelCopy
);
BLL
Common
.
labelEdit
.
Save
(
ref
labelCopy
);
}
...
...
@@ -174,7 +175,7 @@ namespace SmartScan
private
void
BtnPrintTest_Click
(
object
sender
,
EventArgs
e
)
{
if
(
labelIndex
==
-
1
)
return
;
Common
.
labelEdit
.
PrintTest
(
labelCopy
[
labelIndex
]);
BLL
Common
.
labelEdit
.
PrintTest
(
labelCopy
[
labelIndex
]);
}
private
void
BtnAddField_Click
(
object
sender
,
EventArgs
e
)
...
...
SmartScan/SetControl/UsrWorkMode.cs
查看文件 @
7e1caa7
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Windows.Forms
;
using
Asa.FaceControl
;
using
BLL
;
using
Model
;
namespace
SmartScan
...
...
@@ -14,32 +15,32 @@ namespace SmartScan
//打印机
LstPrinter
.
Items
.
AddRange
(
Printer
.
AllName
);
LstPrinter
.
Text
=
Common
.
config
.
PrinterName
;
if
(
Common
.
config
.
PrintLandscape
)
LstPrinter
.
Text
=
BLL
Common
.
config
.
PrinterName
;
if
(
BLL
Common
.
config
.
PrintLandscape
)
RdoLandscape
.
Checked
=
true
;
else
RdoVertical
.
Checked
=
true
;
//图像保存
((
FaceRadioBox
)
facePanel1
.
Controls
[
"Rdo"
+
Common
.
config
.
HistoryImage
.
ToString
()]).
Checked
=
true
;
((
FaceRadioBox
)
facePanel1
.
Controls
[
"Rdo"
+
BLL
Common
.
config
.
HistoryImage
.
ToString
()]).
Checked
=
true
;
//6个复选框
ChkSelectPN
.
Checked
=
Common
.
config
.
SelectHttpPN
;
ChkLabelEmptyCheck
.
Checked
=
Common
.
config
.
LabelEmptyCheck
;
ChkOpenEnterWork
.
Checked
=
Common
.
config
.
OpenStartWork
;
ChkPrintCompletedClear
.
Checked
=
Common
.
config
.
PrintCompletedClear
;
ChkOpenMaximize
.
Checked
=
Common
.
config
.
OpenMaximize
;
ChkTriggerOpenLight
.
Checked
=
Common
.
config
.
TriggerOpenLight
;
ChkPromptAfterPrinting
.
Checked
=
Common
.
config
.
PromptAfterPrinting
;
ChkAutoPrint
.
Checked
=
Common
.
config
.
AutoPrint
;
ChkSelectPN
.
Checked
=
BLL
Common
.
config
.
SelectHttpPN
;
ChkLabelEmptyCheck
.
Checked
=
BLL
Common
.
config
.
LabelEmptyCheck
;
ChkOpenEnterWork
.
Checked
=
BLL
Common
.
config
.
OpenStartWork
;
ChkPrintCompletedClear
.
Checked
=
BLL
Common
.
config
.
PrintCompletedClear
;
ChkOpenMaximize
.
Checked
=
BLL
Common
.
config
.
OpenMaximize
;
ChkTriggerOpenLight
.
Checked
=
BLL
Common
.
config
.
TriggerOpenLight
;
ChkPromptAfterPrinting
.
Checked
=
BLL
Common
.
config
.
PromptAfterPrinting
;
ChkAutoPrint
.
Checked
=
BLL
Common
.
config
.
AutoPrint
;
//默认标签
LstLabel
.
Items
.
AddRange
(
Common
.
labelEdit
.
Name
);
LstLabel
.
Text
=
Common
.
config
.
DefaultPrintLabel
;
LstLabel
.
Items
.
AddRange
(
BLL
Common
.
labelEdit
.
Name
);
LstLabel
.
Text
=
BLL
Common
.
config
.
DefaultPrintLabel
;
//优先模板
LstMate
.
Items
.
AddRange
(
Common
.
mateEdit
.
Name
);
LstMate
.
Text
=
Common
.
config
.
DefaultMaterialName
;
LstMate
.
Items
.
AddRange
(
BLL
Common
.
mateEdit
.
Name
);
LstMate
.
Text
=
BLL
Common
.
config
.
DefaultMaterialName
;
Language
.
SetLanguage
(
this
);
}
...
...
@@ -52,58 +53,58 @@ namespace SmartScan
public
void
Save
()
{
//保存打印机
Common
.
config
.
PrintLandscape
=
RdoLandscape
.
Checked
;
BLL
Common
.
config
.
PrintLandscape
=
RdoLandscape
.
Checked
;
if
(
LstPrinter
.
SelectedIndex
==
-
1
)
{
if
(
LstPrinter
.
Items
.
Count
==
1
)
Common
.
config
.
PrinterName
=
LstPrinter
.
Items
[
0
];
BLL
Common
.
config
.
PrinterName
=
LstPrinter
.
Items
[
0
];
}
else
{
Common
.
config
.
PrinterName
=
LstPrinter
.
Text
;
BLL
Common
.
config
.
PrinterName
=
LstPrinter
.
Text
;
}
//追溯图像保存
if
(
RdoOriginal
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
Original
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
Original
;
else
if
(
RdoCondense
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
Condense
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
Condense
;
else
if
(
RdoNoImage
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
NoImage
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
NoImage
;
//默认打印标签
if
(
LstLabel
.
SelectedIndex
==
-
1
)
{
if
(
LstLabel
.
Items
.
Count
==
1
)
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Items
[
0
];
BLL
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Items
[
0
];
}
else
{
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Text
;
BLL
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Text
;
}
//优先匹配模板
if
(
LstMate
.
SelectedIndex
==
-
1
)
{
if
(
LstMate
.
Items
.
Count
==
1
)
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Items
[
0
];
BLL
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Items
[
0
];
}
else
{
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Text
;
BLL
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Text
;
}
//6个复选框
Common
.
config
.
SelectHttpPN
=
ChkSelectPN
.
Checked
;
Common
.
config
.
LabelEmptyCheck
=
ChkLabelEmptyCheck
.
Checked
;
Common
.
config
.
OpenStartWork
=
ChkOpenEnterWork
.
Checked
;
Common
.
config
.
OpenMaximize
=
ChkOpenMaximize
.
Checked
;
Common
.
config
.
PrintCompletedClear
=
ChkPrintCompletedClear
.
Checked
;
Common
.
config
.
TriggerOpenLight
=
ChkTriggerOpenLight
.
Checked
;
Common
.
config
.
PromptAfterPrinting
=
ChkPromptAfterPrinting
.
Checked
;
Common
.
config
.
AutoPrint
=
ChkAutoPrint
.
Checked
;
BLL
Common
.
config
.
SelectHttpPN
=
ChkSelectPN
.
Checked
;
BLL
Common
.
config
.
LabelEmptyCheck
=
ChkLabelEmptyCheck
.
Checked
;
BLL
Common
.
config
.
OpenStartWork
=
ChkOpenEnterWork
.
Checked
;
BLL
Common
.
config
.
OpenMaximize
=
ChkOpenMaximize
.
Checked
;
BLL
Common
.
config
.
PrintCompletedClear
=
ChkPrintCompletedClear
.
Checked
;
BLL
Common
.
config
.
TriggerOpenLight
=
ChkTriggerOpenLight
.
Checked
;
BLL
Common
.
config
.
PromptAfterPrinting
=
ChkPromptAfterPrinting
.
Checked
;
BLL
Common
.
config
.
AutoPrint
=
ChkAutoPrint
.
Checked
;
Common
.
config
.
Save
();
BLL
Common
.
config
.
Save
();
}
}
}
SmartScan/SetControl/UsrWorkMode2.cs
查看文件 @
7e1caa7
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Windows.Forms
;
using
Asa.FaceControl
;
using
BLL
;
using
Model
;
namespace
SmartScan
...
...
@@ -14,32 +15,32 @@ namespace SmartScan
//打印机
LstPrinter
.
Items
.
AddRange
(
Printer
.
AllName
);
LstPrinter
.
Text
=
Common
.
config
.
PrinterName
;
if
(
Common
.
config
.
PrintLandscape
)
LstPrinter
.
Text
=
BLL
Common
.
config
.
PrinterName
;
if
(
BLL
Common
.
config
.
PrintLandscape
)
RdoLandscape
.
Checked
=
true
;
else
RdoVertical
.
Checked
=
true
;
//图像保存
((
FaceRadioBox
)
facePanel1
.
Controls
[
"Rdo"
+
Common
.
config
.
HistoryImage
.
ToString
()]).
Checked
=
true
;
((
FaceRadioBox
)
facePanel1
.
Controls
[
"Rdo"
+
BLL
Common
.
config
.
HistoryImage
.
ToString
()]).
Checked
=
true
;
//6个复选框
ChkSelectPN
.
Checked
=
Common
.
config
.
SelectHttpPN
;
ChkLabelEmptyCheck
.
Checked
=
Common
.
config
.
LabelEmptyCheck
;
ChkOpenEnterWork
.
Checked
=
Common
.
config
.
OpenStartWork
;
ChkPrintCompletedClear
.
Checked
=
Common
.
config
.
PrintCompletedClear
;
ChkOpenMaximize
.
Checked
=
Common
.
config
.
OpenMaximize
;
ChkTriggerOpenLight
.
Checked
=
Common
.
config
.
TriggerOpenLight
;
ChkPromptAfterPrinting
.
Checked
=
Common
.
config
.
PromptAfterPrinting
;
ChkAutoPrint
.
Checked
=
Common
.
config
.
AutoPrint
;
ChkSelectPN
.
Checked
=
BLL
Common
.
config
.
SelectHttpPN
;
ChkLabelEmptyCheck
.
Checked
=
BLL
Common
.
config
.
LabelEmptyCheck
;
ChkOpenEnterWork
.
Checked
=
BLL
Common
.
config
.
OpenStartWork
;
ChkPrintCompletedClear
.
Checked
=
BLL
Common
.
config
.
PrintCompletedClear
;
ChkOpenMaximize
.
Checked
=
BLL
Common
.
config
.
OpenMaximize
;
ChkTriggerOpenLight
.
Checked
=
BLL
Common
.
config
.
TriggerOpenLight
;
ChkPromptAfterPrinting
.
Checked
=
BLL
Common
.
config
.
PromptAfterPrinting
;
ChkAutoPrint
.
Checked
=
BLL
Common
.
config
.
AutoPrint
;
//默认标签
LstLabel
.
Items
.
AddRange
(
Common
.
labelEdit
.
Name
);
LstLabel
.
Text
=
Common
.
config
.
DefaultPrintLabel
;
LstLabel
.
Items
.
AddRange
(
BLL
Common
.
labelEdit
.
Name
);
LstLabel
.
Text
=
BLL
Common
.
config
.
DefaultPrintLabel
;
//优先模板
LstMate
.
Items
.
AddRange
(
Common
.
mateEdit
.
Name
);
LstMate
.
Text
=
Common
.
config
.
DefaultMaterialName
;
LstMate
.
Items
.
AddRange
(
BLL
Common
.
mateEdit
.
Name
);
LstMate
.
Text
=
BLL
Common
.
config
.
DefaultMaterialName
;
Language
.
SetLanguage
(
this
);
}
...
...
@@ -52,58 +53,58 @@ namespace SmartScan
public
void
Save
()
{
//保存打印机
Common
.
config
.
PrintLandscape
=
RdoLandscape
.
Checked
;
BLL
Common
.
config
.
PrintLandscape
=
RdoLandscape
.
Checked
;
if
(
LstPrinter
.
SelectedIndex
==
-
1
)
{
if
(
LstPrinter
.
Items
.
Count
==
1
)
Common
.
config
.
PrinterName
=
LstPrinter
.
Items
[
0
];
BLL
Common
.
config
.
PrinterName
=
LstPrinter
.
Items
[
0
];
}
else
{
Common
.
config
.
PrinterName
=
LstPrinter
.
Text
;
BLL
Common
.
config
.
PrinterName
=
LstPrinter
.
Text
;
}
//追溯图像保存
if
(
RdoOriginal
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
Original
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
Original
;
else
if
(
RdoCondense
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
Condense
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
Condense
;
else
if
(
RdoNoImage
.
Checked
)
Common
.
config
.
HistoryImage
=
HistoryImage
.
NoImage
;
BLL
Common
.
config
.
HistoryImage
=
HistoryImage
.
NoImage
;
//默认打印标签
if
(
LstLabel
.
SelectedIndex
==
-
1
)
{
if
(
LstLabel
.
Items
.
Count
==
1
)
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Items
[
0
];
BLL
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Items
[
0
];
}
else
{
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Text
;
BLL
Common
.
config
.
DefaultPrintLabel
=
LstLabel
.
Text
;
}
//优先匹配模板
if
(
LstMate
.
SelectedIndex
==
-
1
)
{
if
(
LstMate
.
Items
.
Count
==
1
)
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Items
[
0
];
BLL
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Items
[
0
];
}
else
{
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Text
;
BLL
Common
.
config
.
DefaultMaterialName
=
LstMate
.
Text
;
}
//6个复选框
Common
.
config
.
SelectHttpPN
=
ChkSelectPN
.
Checked
;
Common
.
config
.
LabelEmptyCheck
=
ChkLabelEmptyCheck
.
Checked
;
Common
.
config
.
OpenStartWork
=
ChkOpenEnterWork
.
Checked
;
Common
.
config
.
OpenMaximize
=
ChkOpenMaximize
.
Checked
;
Common
.
config
.
PrintCompletedClear
=
ChkPrintCompletedClear
.
Checked
;
Common
.
config
.
TriggerOpenLight
=
ChkTriggerOpenLight
.
Checked
;
Common
.
config
.
PromptAfterPrinting
=
ChkPromptAfterPrinting
.
Checked
;
Common
.
config
.
AutoPrint
=
ChkAutoPrint
.
Checked
;
BLL
Common
.
config
.
SelectHttpPN
=
ChkSelectPN
.
Checked
;
BLL
Common
.
config
.
LabelEmptyCheck
=
ChkLabelEmptyCheck
.
Checked
;
BLL
Common
.
config
.
OpenStartWork
=
ChkOpenEnterWork
.
Checked
;
BLL
Common
.
config
.
OpenMaximize
=
ChkOpenMaximize
.
Checked
;
BLL
Common
.
config
.
PrintCompletedClear
=
ChkPrintCompletedClear
.
Checked
;
BLL
Common
.
config
.
TriggerOpenLight
=
ChkTriggerOpenLight
.
Checked
;
BLL
Common
.
config
.
PromptAfterPrinting
=
ChkPromptAfterPrinting
.
Checked
;
BLL
Common
.
config
.
AutoPrint
=
ChkAutoPrint
.
Checked
;
Common
.
config
.
Save
();
BLL
Common
.
config
.
Save
();
}
}
}
SmartScan/SmartScan.csproj
查看文件 @
7e1caa7
...
...
@@ -130,7 +130,6 @@
<DependentUpon>UsrLabeling.cs</DependentUpon>
</Compile>
<Compile Include="ScanWork.cs" />
<Compile Include="ServerCommunication.cs" />
<Compile Include="SetControl\FrmDataFilePreview.cs">
<SubType>Form</SubType>
</Compile>
...
...
@@ -254,7 +253,6 @@
<Compile Include="SetControl\UsrCodeExtractList.Designer.cs">
<DependentUpon>UsrCodeExtractList.cs</DependentUpon>
</Compile>
<Compile Include="LightSource.cs" />
<Compile Include="SetControl\UsrUserAccount.cs">
<SubType>UserControl</SubType>
</Compile>
...
...
SmartScan/UserLoginWindow.cs
查看文件 @
7e1caa7
using
System
;
using
BLL
;
using
System
;
using
System.Windows.Forms
;
namespace
SmartScan
...
...
@@ -10,7 +11,7 @@ namespace SmartScan
if
(
BLL
.
Config
.
Backgrounder
)
//后台模式不需要登录
return
true
;
if
(
Common
.
config
.
EnabledUserLogin
)
if
(
BLL
Common
.
config
.
EnabledUserLogin
)
{
FrmUsersLogin
frm
=
new
();
if
(
frm
.
ShowDialog
()
==
DialogResult
.
OK
)
...
...
@@ -25,8 +26,8 @@ namespace SmartScan
}
else
{
Common
.
config
.
UserName
=
"None user"
;
Common
.
config
.
UserLevel
=
Model
.
UserLevel
.
Admin
;
BLL
Common
.
config
.
UserName
=
"None user"
;
BLL
Common
.
config
.
UserLevel
=
Model
.
UserLevel
.
Admin
;
return
true
;
}
}
...
...
SmartScan/WebCallWork.cs
查看文件 @
7e1caa7
...
...
@@ -6,6 +6,7 @@ using Model;
using
System.Runtime.Serialization.Formatters.Binary
;
using
System.Drawing
;
using
System.Collections.Generic
;
using
BLL
;
namespace
SmartScan
{
...
...
@@ -60,17 +61,17 @@ namespace SmartScan
List
<
CameraVisionLib
.
Model
.
BarcodeInfo
>
workCodeInfo
=
new
();
Dictionary
<
string
,
string
>
workCodeKeyword
;
// = new(StringComparer.OrdinalIgnoreCase);
bool
[]
originalCodeIsUsed
=
null
;
workCodeInfo
=
Common
.
cameraVision
.
GetBarCode
(
bitmap
);
workCodeInfo
=
BLL
Common
.
cameraVision
.
GetBarCode
(
bitmap
);
if
(
workCodeInfo
.
Count
==
0
)
return
new
WebResultCode
()
{
ErrorCode
=
-
1
,
Msg
=
"扫码失败"
};
Common
.
mateEdit
.
CurrntBitmap
=
bitmap
;
bool
rtn
=
Common
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
Common
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
BLL
Common
.
mateEdit
.
CurrntBitmap
=
bitmap
;
bool
rtn
=
BLLCommon
.
mateEdit
.
MatchingTemplate
(
workCodeInfo
,
BLL
Common
.
config
.
DefaultMaterialName
,
false
,
out
string
mateName
,
out
workCodeKeyword
,
out
originalCodeIsUsed
);
LogNet
.
log
.
Info
(
"Work SetKey hasMatch:"
+
rtn
);
WebResultCode
webResultCode
=
null
;
if
(!
Common
.
extension
.
SetKey
(
null
,
workCodeKeyword
,
rtn
,
out
string
errmsg
))
if
(!
BLL
Common
.
extension
.
SetKey
(
null
,
workCodeKeyword
,
rtn
,
out
string
errmsg
))
{
webResultCode
=
new
WebResultCode
()
{
ErrorCode
=
-
2
,
Msg
=
errmsg
};
...
...
SmartScan/WebService.cs
查看文件 @
7e1caa7
using
System
;
using
BLL
;
using
System
;
using
System.ServiceModel.Web
;
namespace
SmartScan
...
...
@@ -13,7 +14,7 @@ namespace SmartScan
{
try
{
string
url
=
Common
.
config
.
WebService
;
string
url
=
BLL
Common
.
config
.
WebService
;
if
(
string
.
IsNullOrWhiteSpace
(
url
))
{
Model
.
LogNet
.
log
.
Info
(
"WebService没有配置,不开启"
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论