You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
284 lines
6.6 KiB
C#
284 lines
6.6 KiB
C#
using Newtonsoft.Json;
|
|
using POSV.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace POSV.Bean
|
|
{
|
|
[Serializable]
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
public class GuestShowItem : IEquatable<GuestShowItem>
|
|
{
|
|
/// <summary>
|
|
/// 客显名称
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "name")]
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客显端口
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "port")]
|
|
public string Port { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客显参数
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "parameter")]
|
|
public GuestShowParameter Parameter { get; set; }
|
|
|
|
public bool Equals(GuestShowItem other)
|
|
{
|
|
if (other == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return JsonUtils.Serialize(this).Equals(JsonUtils.Serialize(other));
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
public class GuestShowParameter
|
|
{
|
|
/// <summary>
|
|
/// 名称
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "name")]
|
|
public string Name { get; set; }
|
|
|
|
private int _baud = 2400;
|
|
|
|
/// <summary>
|
|
/// 波特率
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "baud")]
|
|
public int Baud
|
|
{
|
|
get
|
|
{
|
|
return _baud;
|
|
}
|
|
set
|
|
{
|
|
this._baud = value;
|
|
}
|
|
}
|
|
|
|
private SerialPortCheckType _checkNum = SerialPortCheckType.无校验;
|
|
|
|
/// <summary>
|
|
/// 校验位
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "checkNum")]
|
|
public SerialPortCheckType CheckNum
|
|
{
|
|
get
|
|
{
|
|
return _checkNum;
|
|
}
|
|
set
|
|
{
|
|
_checkNum = value;
|
|
}
|
|
}
|
|
|
|
private int _dataNum = 8;
|
|
/// <summary>
|
|
/// 数据位
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "dataNum")]
|
|
public int DataNum
|
|
{
|
|
get
|
|
{
|
|
return _dataNum;
|
|
}
|
|
set
|
|
{
|
|
this._dataNum = DataNum;
|
|
}
|
|
}
|
|
|
|
private int _stopNum = 1;
|
|
|
|
/// <summary>
|
|
/// 停止位
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "stopNum")]
|
|
public int StopNum
|
|
{
|
|
get
|
|
{
|
|
return _stopNum;
|
|
}
|
|
set
|
|
{
|
|
_stopNum = value;
|
|
}
|
|
}
|
|
|
|
private string _displayType = "数字客显";
|
|
/// <summary>
|
|
/// 客显类型
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "displayType")]
|
|
public string DisplayType
|
|
{
|
|
get
|
|
{
|
|
return _displayType;
|
|
}
|
|
set
|
|
{
|
|
_displayType = value;
|
|
}
|
|
}
|
|
|
|
private int _columnNum = 12;
|
|
/// <summary>
|
|
/// 每行显示字符数
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "columnNum")]
|
|
public int ColumnNum
|
|
{
|
|
get
|
|
{
|
|
return _columnNum;
|
|
}
|
|
set
|
|
{
|
|
_columnNum = value;
|
|
}
|
|
}
|
|
|
|
private int _rowNum = 1;
|
|
/// <summary>
|
|
/// 行数
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "rowNum")]
|
|
public int RowNum
|
|
{
|
|
get
|
|
{
|
|
return _rowNum;
|
|
}
|
|
set
|
|
{
|
|
_rowNum = value;
|
|
}
|
|
}
|
|
|
|
private string _initCmd = string.Empty;
|
|
/// <summary>
|
|
/// 初始化指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "initCmd")]
|
|
public string InitCmd
|
|
{
|
|
get
|
|
{
|
|
return _initCmd;
|
|
}
|
|
set
|
|
{
|
|
_initCmd = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 第一行显示准备
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r1ReadyCmd")]
|
|
public string R1ReadyCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 第一行送显指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r1DisplayCmd")]
|
|
public string R1DisplayCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 第一行显示结束指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r1EndCmd")]
|
|
public string R1EndCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 第二行显示准备
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r2ReadyCmd")]
|
|
public string R2ReadyCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 第二行送显指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r2DisplayCmd")]
|
|
public string R2DisplayCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 第二行显示结束指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "r2EndCmd")]
|
|
public string R2EndCmd { get; set; }
|
|
|
|
private bool _oneRowExistLight = false;
|
|
/// <summary>
|
|
/// 单行且有状态灯
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "oneRowExistLight")]
|
|
public bool OneRowExistLight
|
|
{
|
|
get
|
|
{
|
|
return _oneRowExistLight;
|
|
}
|
|
set
|
|
{
|
|
_oneRowExistLight = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 熄灯指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "offLightCmd")]
|
|
public string OffLightCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 单价状态灯指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "priceLightCmd")]
|
|
public string PriceLightCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 应付(合计)状态灯指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "totalLightCmd")]
|
|
public string TotalLightCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 已付状态灯指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "paidLightCmd")]
|
|
public string PaidLightCmd { get; set; }
|
|
|
|
/// <summary>
|
|
/// 找零状态灯指令
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "changeLightCmd")]
|
|
public string ChangeLightCmd { get; set; }
|
|
|
|
|
|
}
|
|
public enum SerialPortCheckType
|
|
{
|
|
无校验,
|
|
奇校验,
|
|
偶校验
|
|
}
|
|
}
|