using System; using Newtonsoft.Json; namespace POSV.Printer { [Serializable] [JsonObject(MemberSerialization.OptIn)] public class EscPosCommand { public EscPosCommand() { this.InitCommand = "27,64"; this.NormalCommand = "27,33,2,28,33,2"; this.DoubleWidthCommand = "27,33,32,28,33,4"; this.DoubleHeightCommand = "27,33,16,28,33,8"; this.DoubleWidthHeightCommand = "27,33,48,28,33,12"; this.CutPageCommand = "29,86,66"; //this.CashboxCommand = "27,112,0,100,100"; //this.CashboxCommand = "27,112,7"; //this.CashboxCommand = "27,112,0,60,255"; this.CashboxCommand = "27,112,0,48,192"; this.AlignLeftCommand = "27,97,48"; this.AlignCenterCommand = "27,97,49"; this.AlignRightCommand = "27,97,50"; this.FeedBackCommand = "27,101,n"; this.BeepCommand = "27,66"; } /// /// 回退行数 /// [JsonProperty(PropertyName = "back")] public string FeedBackCommand { get; set; } /// /// 蜂鸣 /// [JsonProperty(PropertyName = "beep")] public string BeepCommand { get; set; } = "27,66"; /// /// 左对齐 /// [JsonProperty(PropertyName = "left")] public string AlignLeftCommand { get; set; } /// /// 右对齐 /// [JsonProperty(PropertyName = "center")] public string AlignCenterCommand { get; set; } /// /// 右对齐 /// [JsonProperty(PropertyName = "right")] public string AlignRightCommand { get; set; } /** * 初始化指令 */ [JsonProperty(PropertyName = "init")] public string InitCommand { get; set; } /** * 倍宽字体指令 */ [JsonProperty(PropertyName = "doublew")] public string DoubleWidthCommand { get; set; } /** * 切纸指令 */ [JsonProperty(PropertyName = "cut")] public string CutPageCommand { get; set; } /** * 字体倍高指令 */ [JsonProperty(PropertyName = "doubleh")] public string DoubleHeightCommand { get; set; } /** * 普通字体指令 */ [JsonProperty(PropertyName = "normal")] public string NormalCommand { get; set; } /** * 倍宽倍高指令 */ [JsonProperty(PropertyName = "double")] public string DoubleWidthHeightCommand { get; set; } /** * 钱箱指令 */ [JsonProperty(PropertyName = "cashbox")] public string CashboxCommand { get; set; } } }