// Printer Status Unsolicited interrupt arrived void HP_Unsolicited(HitachiPrinter p, HPEventArgs e) { if (e.Message.StartsWith(HitachiPrinter.sSTX) && e.Message.EndsWith(HitachiPrinter.sETX)) { switch (e.Message.Substring(1, 1)) { case HitachiPrinter.sBEL: PrintStart(p, e); break; case HitachiPrinter.sDLE: PrintEnd(p, e); break; case "1": // It is a status break; default: // Who knows break; } } else { // Who knows } }
// Print End Unsolicited interrupt arrived void PrintEnd(HitachiPrinter p, HPEventArgs e) { // Send message to printer }
// Print Start Unsolicited interrupt arrived void PrintStart(HitachiPrinter p, HPEventArgs e) { // Add message build here }
// Requested operation has completed void HP_Complete(HitachiPrinter p, HPEventArgs e) { switch (e.Op) { case PrinterOps.Nop: break; case PrinterOps.Connect: break; case PrinterOps.Disconnect: break; case PrinterOps.IssueControl: break; case PrinterOps.ColumnSetup: break; case PrinterOps.WriteSpecification: break; case PrinterOps.WriteFormat: break; case PrinterOps.WriteText: break; case PrinterOps.WriteCalendarOffset: break; case PrinterOps.WriteCalendarSubZS: break; case PrinterOps.WriteCountCondition: break; case PrinterOps.WritePattern: break; case PrinterOps.Message: break; case PrinterOps.Fetch: if ((FetchOps)e.SubOp == FetchOps.Status) { HPStatus status = HP.GetStatus(); } break; case PrinterOps.Retrieve: break; case PrinterOps.RetrievePattern: break; case PrinterOps.SetClock: break; case PrinterOps.Idle: break; case PrinterOps.PassThru: break; case PrinterOps.ENQ: break; case PrinterOps.SOP16ClearBuffer: break; case PrinterOps.SOP16RestartPrinting: break; case PrinterOps.ChangeInkDropRule: break; case PrinterOps.ChangeMessageFormat: break; case PrinterOps.PositionItem: break; case PrinterOps.WriteCalendarZS: break; case PrinterOps.WriteCalendarSub: break; case PrinterOps.WriteCalendarSubRule: break; case PrinterOps.TimedDelay: break; case PrinterOps.CreateMessage: break; case PrinterOps.SendMessage: break; case PrinterOps.SetNozzle: break; case PrinterOps.ShutDown: break; default: break; } SetButtonEnables(); }
// Hitachi printer object has something noteworthy to say public void HP_Log(HitachiPrinter p, HPEventArgs e) { lbTraffic.Items.Add(HP.Translate(e.Message)); }