Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS200
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 09dfe401
由
LN
编写于
2024-06-21 22:44:08 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
1
2 个父辈
1e2af832
f660fd77
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
11 行删除
AutoScanAndLabel/Form1.cs
DeviceLibrary/DeviceLibrary/DataUploadUtil.cs
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
dll/IDHIKCamera.dll
AutoScanAndLabel/Form1.cs
查看文件 @
09dfe40
...
...
@@ -739,9 +739,9 @@ namespace AutoScanAndLabel
{
FileName
=
path
,
//WorkingDirectory = System.IO.Path.Combine(Application.StartupPath, "\\NeoScan"),
Verb
=
"runas"
// 这里设置为 "runas" 表示以管理员身份运行
//
Verb = "runas" // 这里设置为 "runas" 表示以管理员身份运行
};
proes
.
StartInfo
.
UseShellExecute
=
false
;
//
proes.StartInfo.UseShellExecute = false;
proes
.
Start
();
}
catch
(
Exception
ex
)
...
...
DeviceLibrary/DeviceLibrary/DataUploadUtil.cs
查看文件 @
09dfe40
...
...
@@ -86,7 +86,7 @@ namespace DeviceLibrary
try
{
if
(
fileContainer
==
null
)
if
(
fileContainer
==
null
)
{
}
...
...
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
查看文件 @
09dfe40
...
...
@@ -34,7 +34,14 @@ namespace DeviceLibrary
dpi
=
300
;
}
print
=
new
Asa
.
PrintLabel
(
Application
.
StartupPath
+
"\\Label"
,
dpi
);
print
.
PrintStatusChanged
+=
Print_PrintStatusChanged
;
}
private
void
Print_PrintStatusChanged
(
Asa
.
PrintLabel
.
PrinterStatus
sta
,
string
msg
)
{
LogUtil
.
info
(
$
"打印机状态:{sta}, msg:{msg}"
);
}
public
static
CustPrinterStatus
LastPrintStatus
=
CustPrinterStatus
.
Unknown
;
public
bool
Connection
(
string
port
)
{
...
...
@@ -74,35 +81,40 @@ namespace DeviceLibrary
public
bool
Print
(
string
labelname
,
Dictionary
<
string
,
string
>
data
,
out
string
msg
)
{
print
.
LoadLabel
(
labelname
);
if
(
printDevice
==
PrintDevice
.
TSC
)
if
(
printDevice
==
PrintDevice
.
TSC
)
{
LogUtil
.
error
(
$
"TSC_打印数据:{JsonHelper.SerializeObject(data)}"
);
LogUtil
.
error
(
$
"TSC_打印数据:{JsonHelper.SerializeObject(data)}"
);
TscConfig
tscConfig
=
new
TscConfig
();
tscConfig
.
Offset
=
ConfigHelper
.
Config
.
Get
(
"Tsc_Offset"
,
-
17D
);
tscConfig
.
Speed
=
ConfigHelper
.
Config
.
Get
(
"Tsc_Speed"
,
9
);
tscConfig
.
Density
=
ConfigHelper
.
Config
.
Get
(
"Tsc_Density"
,
12
);
tscConfig
.
GapOffset
=
ConfigHelper
.
Config
.
Get
(
"Tsc_GapOffset"
,
0
);
tscConfig
.
Gap
=
ConfigHelper
.
Config
.
Get
(
"Tsc_Gap"
,
3
);
if
(!
print
.
PrintToTsc_New
(
data
,
tscConfig
,
out
TscStauts
tscStauts
,
out
Bitmap
bmp
))
if
(!
print
.
PrintToTsc_New
(
data
,
tscConfig
,
out
TscStauts
tscStauts
,
out
Bitmap
bmp
))
{
msg
=
$
"打印失败:{tscStauts.ToString()}"
;
LogUtil
.
error
(
"打印失败原因:"
+
tscStauts
.
ToString
());
return
false
;
}
if
(
bmp
!=
null
)
if
(
bmp
!=
null
)
{
string
cid
=
ConfigHelper
.
Config
.
Get
(
"CID"
);
_
=
UnifiedDataHandler
.
PostSmfImageAsync
(
bmp
,
new
Dictionary
<
string
,
string
>
{
{
"cid"
,
cid
+
"_2"
}
},
bmp
.
Width
,
bmp
.
Height
);
}
_
=
UnifiedDataHandler
.
PostSmfImageAsync
(
bmp
,
new
Dictionary
<
string
,
string
>
{
{
"cid"
,
cid
+
"_2"
}
},
bmp
.
Width
,
bmp
.
Height
);
}
msg
=
$
"打印成功"
;
return
true
;
}
else
if
(
printDevice
==
PrintDevice
.
Windows
)
{
print
.
Print
(
data
);
msg
=
""
;
return
true
;
}
else
{
{
var
bmp
=
print
.
PrintPreview
(
data
);
if
(!
zebraManger
.
PrintImage
(
bmp
,
out
msg
))
{
if
(
msg
==
"上一个标签尚未移走"
)
if
(
msg
==
"上一个标签尚未移走"
)
{
msg
=
crc
.
GetString
(
"Res0224"
,
"上一个标签尚未移走"
);
}
...
...
dll/IDHIKCamera.dll
查看文件 @
09dfe40
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论