-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b6272b
commit cb8b70e
Showing
7 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace BinaryKits.Zpl.Label.Elements | ||
{ | ||
/// <summary> | ||
/// ^FW - Field Orientation | ||
/// </summary> | ||
public class ZplFieldOrientation : ZplElementBase | ||
{ | ||
public FieldOrientation FieldOrientation { get; private set; } | ||
|
||
public ZplFieldOrientation(FieldOrientation fieldOrientation) | ||
{ | ||
this.FieldOrientation = fieldOrientation; | ||
} | ||
|
||
///<inheritdoc/> | ||
public override IEnumerable<string> Render(ZplRenderOptions context) | ||
{ | ||
return new[] { $"^FW{RenderFieldOrientation(this.FieldOrientation)}" }; | ||
} | ||
|
||
} | ||
} |
15 changes: 8 additions & 7 deletions
15
src/BinaryKits.Zpl.Viewer.WebApi/Labels/Test/FieldDataText2-102x152.zpl2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/BinaryKits.Zpl.Viewer/CommandAnalyzers/FieldOrientationZplCommandAnalyzer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using BinaryKits.Zpl.Label.Elements; | ||
|
||
namespace BinaryKits.Zpl.Viewer.CommandAnalyzers | ||
{ | ||
public class FieldOrientationZplCommandAnalyzer : ZplCommandAnalyzerBase | ||
{ | ||
public FieldOrientationZplCommandAnalyzer(VirtualPrinter virtualPrinter) : base("^FW", virtualPrinter) { } | ||
|
||
///<inheritdoc/> | ||
public override ZplElementBase Analyze(string zplCommand) | ||
{ | ||
var zplDataParts = this.SplitCommand(zplCommand); | ||
if (zplDataParts.Length > 0) | ||
{ | ||
var fieldOrientation = ConvertFieldOrientation(zplDataParts[0]); | ||
this.VirtualPrinter.SetFieldOrientation(fieldOrientation); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters