Browse Source

刷卡机调试

Lishi
xxe 2 years ago
parent
commit
6ee10d3311
4 changed files with 8 additions and 3 deletions
  1. +3
    -1
      HKCardOUT/ViewModels/RootViewModel.cs
  2. +1
    -1
      HKCardOUT/options.json
  3. +3
    -0
      HKLog/HKLogImport.cs
  4. +1
    -1
      UHFHelper/UHF_RS485_Helper.cs

+ 3
- 1
HKCardOUT/ViewModels/RootViewModel.cs View File

@@ -20,6 +20,7 @@ using UHFHelper;
using XExten.Advance.InternalFramework.Securities.Common;
using XExten.Advance.LinqFramework;
using XExten.Advance.StaticFramework;
using System.Diagnostics;

namespace HKCardOUT.ViewModels
{
@@ -84,9 +85,9 @@ namespace HKCardOUT.ViewModels
DataBus.StoreInfo.Devices.ForEach(item =>
{
var res = UHF_RS485_Helper.GetInstance().ReadCard(item.Address.AsInt());

if (res != null)
{
Debug.WriteLine($"卡号地址:{res.Address}----------卡号数据:{res.ResData}");
if (!res.ResData.IsMatch(new Regex("0{20}")))
ReadFunc?.Invoke(res);
}
@@ -203,6 +204,7 @@ namespace HKCardOUT.ViewModels
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
var win = new AdWindow("暂无广告");
var rectangle = System.Windows.Forms.Screen.AllScreens[0].WorkingArea;
win.Height = rectangle.Height;


+ 1
- 1
HKCardOUT/options.json View File

@@ -6,7 +6,7 @@
//定时任务时间表达式
"Cron": "0 0 0/1 * * ? ",
//店铺ID
"StoreId": "a19535e8-119f-4b10-a011-6288fd3ddb37",
"StoreId": "0c32b2e2-0dc9-4941-b73d-3dc91f7268ab",
"ConnectionStrings": {
"Sqlite": "HKSQL.db3"
},


+ 3
- 0
HKLog/HKLogImport.cs View File

@@ -1,4 +1,5 @@
using Serilog;
using System.Diagnostics;

namespace HKLog
{
@@ -15,10 +16,12 @@ namespace HKLog
public static void WriteInfo(string msg)
{
Log.Logger.Information(msg);
Debug.WriteLine(msg);
}
public static void WriteError(Exception ex)
{
Log.Logger.Error(ex, ex.Message);
Debug.WriteLine(ex.ToString());
}
}
}

+ 1
- 1
UHFHelper/UHF_RS485_Helper.cs View File

@@ -85,7 +85,7 @@ namespace UHFHelper
DKoutput dKoutput = new();
var readByte = ReadByte(adr);
_serialPort.Write(readByte, 0, readByte.Length);
var result = SendMessage(readByte, 2000, 18);
var result = SendMessage(readByte, 150, 18);
if (result == null)
{
return null;


Loading…
Cancel
Save