Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
esc_pos_print_plus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dio Maulana
esc_pos_print_plus
Commits
bb37fa2d
Commit
bb37fa2d
authored
Jan 16, 2020
by
Andrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
missing file
parent
6b00dea5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
30 deletions
+26
-30
ticket.dart
lib/src/ticket.dart
+26
-30
No files found.
lib/src/ticket.dart
View file @
bb37fa2d
...
...
@@ -257,24 +257,22 @@ class Ticket {
/// Beeps [n] times
///
/// Beep [duration] could be between 50 and 450 ms.
//
void beep({int n = 3, PosBeepDuration duration = PosBeepDuration.beep450ms}) {
//
if (n <= 0) {
//
return;
//
}
void
beep
({
int
n
=
3
,
PosBeepDuration
duration
=
PosBeepDuration
.
beep450ms
})
{
if
(
n
<=
0
)
{
return
;
}
//
int beepCount = n;
//
if (beepCount > 9) {
//
beepCount = 9;
//
}
int
beepCount
=
n
;
if
(
beepCount
>
9
)
{
beepCount
=
9
;
}
// _socket.add(
// Uint8List.fromList(
// List.from(cBeep.codeUnits)..addAll([beepCount, duration.value]),
// ),
// );
bytes
+=
Uint8List
.
fromList
(
List
.
from
(
cBeep
.
codeUnits
)..
addAll
([
beepCount
,
duration
.
value
]),
);
//
beep(n: n - 9, duration: duration);
//
}
beep
(
n:
n
-
9
,
duration:
duration
);
}
/// Clear the buffer and reset text styles
void
reset
()
{
...
...
@@ -303,25 +301,23 @@ class Ticket {
}
/// Reverse feed for [n] lines (if supported by the priner)
// void reverseFeed(int n) {
// _socket.add(
// Uint8List.fromList(
// List.from(cReverseFeedN.codeUnits)..add(n),
// ),
// );
// }
void
reverseFeed
(
int
n
)
{
bytes
+=
Uint8List
.
fromList
(
List
.
from
(
cReverseFeedN
.
codeUnits
)..
add
(
n
),
);
}
/// Cut the paper
///
/// [mode] is used to define the full or partial cut (if supported by the priner)
//
void cut({PosCutMode mode = PosCutMode.full}) {
// _socket.write('\n\n\n\n\n'
);
//
if (mode == PosCutMode.partial) {
// _socket.write(cCutPart)
;
//
} else {
// _socket.write(cCutFull)
;
//
}
//
}
void
cut
({
PosCutMode
mode
=
PosCutMode
.
full
})
{
emptyLines
(
5
);
if
(
mode
==
PosCutMode
.
partial
)
{
bytes
+=
cCutPart
.
codeUnits
;
}
else
{
bytes
+=
cCutFull
.
codeUnits
;
}
}
/// Generate multiple bytes for a number: In lower and higher parts, or more parts as needed.
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment