renamed printInstruction
This commit is contained in:
parent
486459a107
commit
2e9909129b
@ -41,8 +41,8 @@ public class PrinterController : Controller
|
|||||||
|
|
||||||
switch (instruction.GetProperty("type").GetString())
|
switch (instruction.GetProperty("type").GetString())
|
||||||
{
|
{
|
||||||
case "print":
|
case "text":
|
||||||
parsedInstruction = instruction.Deserialize<PrintInstruction>();
|
parsedInstruction = instruction.Deserialize<TextInstruction>();
|
||||||
break;
|
break;
|
||||||
case "barcode":
|
case "barcode":
|
||||||
parsedInstruction = instruction.Deserialize<BarcodeInstruction>();
|
parsedInstruction = instruction.Deserialize<BarcodeInstruction>();
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using ESCPOS_NET.Emitters;
|
using ESCPOS_NET.Emitters;
|
||||||
using ESCPOS_NET.Utilities;
|
|
||||||
|
|
||||||
public class PrintInstruction : BaseInstruction
|
public class TextInstruction : BaseInstruction
|
||||||
{
|
{
|
||||||
[DataMember(IsRequired = true)]
|
[DataMember(IsRequired = true)]
|
||||||
public string? text { get; set; }
|
public string? text { get; set; }
|
||||||
|
|
||||||
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||||
|
public Alignment alignment {get; set; } = Alignment.Left;
|
||||||
|
|
||||||
public bool newLine { get; set; } = true;
|
public bool newLine { get; set; } = true;
|
||||||
public override List<byte[]> GetInstructions()
|
public override List<byte[]> GetInstructions()
|
||||||
{
|
{
|
||||||
var e = new EPSON();
|
var e = new EPSON();
|
||||||
var commands = new List<byte[]>();
|
var commands = new List<byte[]>();
|
||||||
|
|
||||||
|
commands.Add(alignmentCommand(alignment));
|
||||||
|
|
||||||
if (newLine)
|
if (newLine)
|
||||||
{
|
{
|
||||||
commands.Add(e.PrintLine(text));
|
commands.Add(e.PrintLine(text));
|
Loading…
Reference in New Issue
Block a user