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.
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using POSV.Utils;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace POSV.Bean
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 电子秤参数
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
|
|
|
public class SteelyardParam : IEquatable<SteelyardParam>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 电子秤型号
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonProperty(PropertyName = "name")]
|
|
|
|
|
public SteelyardBrandEnum Name { get; set; } = SteelyardBrandEnum.None;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 端口
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonProperty(PropertyName = "port")]
|
|
|
|
|
public string Port { get; set; } = "COM1";
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 波特率
|
|
|
|
|
/// </summary>
|
|
|
|
|
[JsonProperty(PropertyName = "baud")]
|
|
|
|
|
public int Baud { get; set; } = 9600;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool Equals(SteelyardParam other)
|
|
|
|
|
{
|
|
|
|
|
if (other == null)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return JsonUtils.Serialize(this).Equals(JsonUtils.Serialize(other)); ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|