本文整理匯總了Golang中cn/agree/utils.Trace函數的典型用法代碼示例。如果您正苦於以下問題:Golang Trace函數的具體用法?Golang Trace怎麽用?Golang Trace使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Trace函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: 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
}
}
示例2: 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
}
示例3: SetTop
//單位:毫米.
//注:由於OKI並沒有設置頭部的指令。(僅有的一個也隻能設置在6.35毫米處).因此要在打印一頁紙前調用
//此指令用進紙指令代替
func (jst *OkiPrinter) SetTop(pos float32) error {
utils.Trace("OkiPrinter received SetTop request")
if pos < 6.35 {
return PR2TOPTOOSMALL
}
var reallen = pos - 6.35
utils.Trace("OkiPrinter not have settop instructon,advance line %f ", reallen)
return jst.SeekColPos(reallen, 6.35)
}
示例4: DoublePrintWidth
//設置倍寬打印
func (jst *OkiPrinter) DoublePrintWidth() error {
utils.Trace("OkiPrinter received DoublePrintWidth request")
s, _ := hex.DecodeString("1b55")
utils.Trace("OkiPrinter send DoublePrintWidth pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例5: CancelSBC_caseDouble_width
//取消全角漢字的雙倍水平擴展打印方式
func (jst *OkiPrinter) CancelSBC_caseDouble_width() error {
utils.Trace("OkiPrinter received CancelSBC_caseDouble_width request")
s, _ := hex.DecodeString("1C71")
utils.Trace("OkiPrinter send CancelSBC_caseDouble_width 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: Carriage
//回車
func (jst *OlevittePrinter) Carriage() error {
utils.Trace("OlevittePrinter received Carriage request")
s, _ := hex.DecodeString("0d20")
utils.Trace("OlevittePrinter send Carriage pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例8: HorizontalTab
//水平製表
func (js *OkiPrinter) HorizontalTab() error {
utils.Trace("OlevittePrinter received HorizontalTab request")
s, _ := hex.DecodeString("09")
utils.Trace("OlevittePrinter send HorizontalTab pi %x", s)
if jst.checkJobInPrint() {
return driverlayer.WriteData(jst.w, s)
} else {
return PR2NOTINJOB
}
}
示例9: ChangeToOKI
//改變仿真方式到oki
func (jst *OkiPrinter) ChangeToOKI() error {
utils.Trace("OlevittePrinter received ChangeToOKI request")
s, _ := hex.DecodeString("1B5E31")
utils.Trace("OlevittePrinter send ChangeToOKI 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: 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
}
}
示例12: 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
}
}
示例13: 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
}
}
示例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
}
}