Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
PrintLabel
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1c56f4e5
由
刘韬
编写于
2023-12-01 13:17:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
9a23782e
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
17 行删除
PrintLabel/PrintLabel.cs
PrintLabel/PrintLabel.cs
查看文件 @
1c56f4e
...
...
@@ -310,13 +310,13 @@ namespace Asa
/// <returns>是否打印成功</returns>
public
bool
PrintToTsc1
(
Dictionary
<
string
,
string
>
key
,
TscConfig
tscConfig
,
out
TscStauts
tscStauts
)
{
//
tscStauts = CheckTscStatus();
//
if (tscStauts != 0)
//
{
//
var err = (TscStauts)tscStauts;
//
Console.WriteLine($"Error: {err}");
//
return false;
//
}
tscStauts
=
CheckTscStatus
();
if
(
tscStauts
!=
0
)
{
var
err
=
(
TscStauts
)
tscStauts
;
Console
.
WriteLine
(
$
"Error: {err}"
);
return
false
;
}
var
t
=
Task
.
Run
(()
=>
{
Bitmap
bmp
=
null
;
...
...
@@ -328,16 +328,6 @@ namespace Asa
TSCSDK
.
driver
TSCLIB_DLL
=
new
TSCSDK
.
driver
();
TSCLIB_DLL
.
openport
(
tscConfig
.
PrinterName
);
//TSCLIB_DLL.sendcommand("GETSENSOR(\"PEEL\")");
//TSCLIB_DLL.sendcommand("\0x27!?");
//Task.Delay(1000).Wait();
///IntPtr aaa = Marshal.AllocHGlobal(256);
//byte[] b = new byte[256];
//IntPtr aaa = System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(b, 0);
//TSCSDK.driver.ReadPrinter(TSCLIB_DLL.hPrinter, aaa, 255, out int reby);
//Marshal.Copy(aaa, b, 0, 256);
//Marshal.FreeHGlobal(aaa);
//var bbbb = Encoding.Unicode.GetString(b);
TSCLIB_DLL
.
sendcommand
(
$
"SIZE {mm:0.00} mm, {nn:0.00} mm"
);
TSCLIB_DLL
.
sendcommand
(
$
"GAP {tscConfig.Gap} mm,{tscConfig.GapOffset} mm"
);
TSCLIB_DLL
.
sendcommand
(
"SET CUTTER ON"
);
...
...
@@ -378,7 +368,18 @@ namespace Asa
TscStauts
s
=
TscStauts
.
None
;
var
t
=
Task
.
Run
(()
=>
{
Console
.
WriteLine
(
"TID:"
+
GetCurrentThreadId
().
ToString
(
"X"
));
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
try
{
s
=
(
TscStauts
)
TSCLIB_DLL
.
usbportqueryprinter
();
break
;
}
catch
{
s
=
TscStauts
.
其它错误
;
}
}
});
if
(!
t
.
Wait
(
1000
))
Console
.
WriteLine
(
"usbportqueryprinter time out"
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论