Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar
import kotlin.contracts.contract

/** AnotherBrotherPlugin */
class AnotherBrotherPlugin : FlutterPlugin, MethodCallHandler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fun printerInfofromMap(context:Context, flutterAssets: FlutterPlugin.FlutterAsse
mirrorPrint = map["mirrorPrint"] as Boolean
paperPosition = alignFromMap(map["paperPosition"] as Map<String, Any>)
isAutoCut = map["isAutoCut"] as Boolean
numberOfAutoCutPages = map["autoCutForEachPageCount"] as Int
isCutAtEnd = map["isCutAtEnd"] as Boolean
mode9 = map["mode9"] as Boolean
skipStatusCheck = map["skipStatusCheck"] as Boolean
Expand Down
13 changes: 4 additions & 9 deletions ios/Classes/Method/BrotherUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -729,17 +729,10 @@ + (BRLMQLPrintSettings *) qlPrintSettingsFromMapWithValue:(NSDictionary<NSString

printerSettings.labelSize = [BrotherUtils qlLabelSizeWithName:labelName];
printerSettings.autoCut = [[map objectForKey:@"isAutoCut"] isEqual:@(YES)];
printerSettings.autoCutForEachPageCount = (UInt8)[(NSNumber *)[map objectForKey:@"autoCutForEachPageCount"] integerValue];
printerSettings.cutAtEnd = [[map objectForKey:@"isEndCut"] isEqual:@(YES)];
printerSettings.resolution = [BrotherUtils printResolutionFromMapWithValue:dartPrintQuality];

// TODO Extract info from map.
//[x]labelSize
//autoCutForEachPageCount
//[x]autoCut
//[x]cutAtEnd
//[x]resolution


NSDictionary<NSString*, NSObject*> * dartPrintMode = (NSDictionary<NSString*, NSObject*> *)[map objectForKey:@"printMode"];

printerSettings.scaleMode = [BrotherUtils printModeFromMapWithValue:dartPrintMode];
Expand Down Expand Up @@ -1315,6 +1308,7 @@ + (BRLMPTPrintSettings *)ptPrintSettingsFromMapWithValue:(NSDictionary<NSString

bool cutmarkPrint = [[map objectForKey:@"isCutMark"] isEqual:@(YES)];
bool autoCut = [[map objectForKey:@"isAutoCut"] isEqual:@(YES)];
UInt8 autoCutForEachPageCount = [(NSNumber *)[map objectForKey:@"autoCutForEachPageCount"] integerValue];
bool halfCut = [[map objectForKey:@"isHalfCut"] isEqual:@(YES)];
bool specialTapePrint = [[map objectForKey:@"isSpecialTape"] isEqual:@(YES)];

Expand All @@ -1329,6 +1323,7 @@ + (BRLMPTPrintSettings *)ptPrintSettingsFromMapWithValue:(NSDictionary<NSString
printerSettings.labelSize = [BrotherUtils ptLabelSizeWithName:labelName];
printerSettings.cutmarkPrint = cutmarkPrint;
printerSettings.autoCut = autoCut;
printerSettings.autoCutForEachPageCount = autoCutForEachPageCount;
printerSettings.halfCut = halfCut;
printerSettings.specialTapePrint = specialTapePrint;
printerSettings.resolution = [BrotherUtils printResolutionFromMapWithValue:dartResolution];
Expand All @@ -1338,7 +1333,6 @@ + (BRLMPTPrintSettings *)ptPrintSettingsFromMapWithValue:(NSDictionary<NSString

// chainPrint @"???"
// highResolutionPrint @"???"
// autoCutForEachPageCount @"???"
//

return printerSettings;
Expand Down Expand Up @@ -2283,6 +2277,7 @@ + (NSString *) colorTypeToNameWithValue:(ColorType) colorType {
NSDictionary<NSString*, NSObject *> * dartLabelInfoStatus = @{
@"labelNameIndex": [BrotherUtils labelIdTypeToNumberWithValue: [status labelID ]],
@"isAutoCut": @FALSE, // TODO
@"autoCutForEachPageCount": @1, // TODO
@"isEndCut": @FALSE, // TODO
@"isHalfCut": @FALSE, // TODO
@"isSpecialTape": @FALSE, // TODO
Expand Down
4 changes: 4 additions & 0 deletions lib/printer_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,7 @@ class PrinterInfo {
bool rotate180;
bool peelMode;
bool isAutoCut;
int autoCutForEachPageCount;
bool isCutAtEnd;
bool isSpecialTape;
bool isHalfCut;
Expand Down Expand Up @@ -1515,6 +1516,7 @@ class PrinterInfo {
this.mirrorPrint = false,
this.paperPosition = Align.CENTER,
this.isAutoCut = true,
this.autoCutForEachPageCount = 1,
this.isCutAtEnd = true,
this.mode9 = true,
this.skipStatusCheck = false,
Expand Down Expand Up @@ -1601,6 +1603,7 @@ class PrinterInfo {
mirrorPrint: map["mirrorPrint"],
paperPosition: Align.fromMap(map["paperPosition"]),
isAutoCut: map["isAutoCut"],
autoCutForEachPageCount: map["autoCutForEachPageCount"],
isCutAtEnd: map["isCutAtEnd"],
mode9: map["mode9"],
skipStatusCheck: map["skipStatusCheck"],
Expand Down Expand Up @@ -1664,6 +1667,7 @@ class PrinterInfo {
"mirrorPrint": mirrorPrint,
"paperPosition": paperPosition.toMap(),
"isAutoCut": isAutoCut,
"autoCutForEachPageCount": autoCutForEachPageCount,
"isCutAtEnd": isCutAtEnd,
"mode9": mode9,
"skipStatusCheck": skipStatusCheck,
Expand Down