本文整理匯總了Golang中cn/agree/driverlayer.WriteData函數的典型用法代碼示例。如果您正苦於以下問題:Golang WriteData函數的具體用法?Golang WriteData怎麽用?Golang WriteData使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了WriteData函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SeekColPos
//直接進紙n/120英寸。1B-25-35-n(01 =< n <= FF)
func (jst *OkiPrinter) SeekColPos(pos float32, currpos float32) error {
if pos == 0 {
utils.Trace("pos is zero ,skip")
return nil
}
inch := int(utils.ConvertFrommmToInch(pos) * float32(120))
remain := inch
for {
//oki的最大位移為255/120 inch
if remain > 255 {
s, _ := hex.DecodeString("1b2535ff")
utils.Trace("OkiPrinter send AdvanceLine pi %x", s)
if jst.checkJobInPrint() {
driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
remain -= 255
} else {
var d uint8 = uint8(remain) & 0xff
s, _ := hex.DecodeString("1b2535" + utils.FormatInt(int(d), 2, "0", 16) + "20")
utils.Trace("OkiPrinter send AdvanceLine pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
break
}
}
return nil
}
示例2: SetChineseTypeface
//設置漢字字體。0、1、2、3分別是:宋、仿、楷、繁。
func (jst *OkiPrinter) SetChineseTypeface(font int) error {
utils.Trace("OkiPrinter received SetChineseTypeface request")
switch font {
case 0:
s, _ := hex.DecodeString("1C7630")
break
case 1:
s, _ := hex.DecodeString("1C7631")
break
case 2:
s, _ := hex.DecodeString("1C7632")
break
case 3:
s, _ := hex.DecodeString("1C7633")
break
default:
s, _ := hex.DecodeString("1C7630")
break
}
utils.Trace("OkiPrinter send SetChineseTypeface pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例3: OutputByte
func (jst *OkiPrinter) OutputByte(s []byte) error {
utils.Trace("OkiPrinter received OutputByte request")
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例4: Diabolo
//響鈴
func (jst *OkiPrinter) Diabolo() error {
utils.Trace("OlevittePrinter received Diabolo request")
s, _ := hex.DecodeString("07")
utils.Trace("OlevittePrinter send Diabolo pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例5: ChanageToIBM
func (jst *OkiPrinter) ChanageToIBM() error {
utils.Debug("OlevittePrinter received ChanageToIBM request")
s, _ := hex.DecodeString("1B5E30")
utils.Debug("OlevittePrinter send ChanageToIBM pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例6: OutPaperBackward
//設置單頁紙出紙方向(30:向前出紙;31:向後出紙)
func (jst *OkiPrinter) OutPaperBackward() error {
utils.Trace("OkiPrinter received OutPaperDirection request")
s, _ := hex.DecodeString("1B5431")
utils.Trace("OkiPrinter send OutPaperDirection pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例7: SetDBC_caseCompose
//設置半角字合成方式。當在漢字豎向書寫方式下接收到此碼後,打印機將在此碼後的兩半角字字符合成起來作為合成字符。不持續有效
func (jst *OkiPrinter) SetDBC_caseCompose() error {
utils.Trace("OkiPrinter received SetDBC_caseCompose request")
s, _ := hex.DecodeString("1C5F")
utils.Trace("OkiPrinter send SetDBC_caseCompose pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例8: CancelSuper_Sub_Script
//取消上下標打印
func (jst *OkiPrinter) CancelSuper_Sub_Script() error {
utils.Trace("OkiPrinter received CancelSuper_Sub_Script request")
s, _ := hex.DecodeString("1C53")
utils.Trace("OkiPrinter send CancelSuper_Sub_Script pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例9: SetDiprosopyOrientation
//設置雙向打印方式
func (jst *OkiPrinter) SetDiprosopyOrientation() error {
utils.Trace("OkiPrinter received SetDiprosopyOrientation request")
s, _ := hex.DecodeString("1b2542")
utils.Trace("OkiPrinter send SetDiprosopyOrientation pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例10: OutputString
func (jst *OkiPrinter) OutputString(s string) error {
utils.Trace("OkiPrinter received OutputString request")
ds, _ := utils.TransGBKFromUTF8(s)
utils.Trace("OkiPrinter send OutputString pi %x", ds)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, ds)
} else {
return PR2NOTINJOB
}
}
示例11: CancelBold
func (jst *OlevittePrinter) CancelBold() error {
utils.Debug("OlevittePrinter received CancelBold request")
s, _ := hex.DecodeString("1b29")
utils.Debug("OlevittePrinter send CancelBold pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例12: PrinterManualControl
//賦予手動操作
func (jst *OkiPrinter) PrinterManualControl() error {
utils.Trace("OlevittePrinter received PrinterManualControl request")
s, _ := hex.DecodeString("1B5F")
utils.Trace("OlevittePrinter send PrinterManualControl pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例13: ChooseOlivettiProcess
//選擇Olivetti對話進程 控製的數據交換進程(僅在 OLIVETTI 仿真方式時才接受)
func (jst *OkiPrinter) ChooseOlivettiProcess() error {
utils.Trace("OlevittePrinter received ChooseOlivettiProcess request")
s, _ := hex.DecodeString("1B6E")
utils.Trace("OlevittePrinter send ChooseOlivettiProcess pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例14: SER_UP_ConfiguerRequest
//SET-UP 配置請求。 由主機發出,要求打印機回答它自身的 SET-UP 配置
func (jst *OkiPrinter) SER_UP_ConfiguerRequest() error {
utils.Trace("OlevittePrinter received SER_UP_ConfiguerRequest request")
s, _ := hex.DecodeString("1B2061")
utils.Trace("OlevittePrinter send SER_UP_ConfiguerRequest pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例15: PrinterPaperStateRequest
//打印介質請求狀態。 由主機發出,要求打印機回答關於打印介質當前所處位置的狀態。
func (jst *OkiPrinter) PrinterPaperStateRequest() error {
utils.Trace("OlevittePrinter received PrinterPaperStateRequest request")
s, _ := hex.DecodeString("1B2042")
utils.Trace("OlevittePrinter send PrinterPaperStateRequest pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}