Exemple #1
0
        public void ChangeInkDropRule(string Rule)
        {
            HPRequest mReq = GetRequest(PrinterOps.ChangeInkDropRule);

            mReq.Data1 = Rule;
            IssueRequest(mReq);
        }
Exemple #2
0
        public void Idle(string Marker)
        {
            HPRequest mReq = GetRequest(PrinterOps.Idle);

            mReq.Data1 = Marker;
            IssueRequest(mReq);
        }
Exemple #3
0
        public void WritePattern(string Font, int RegNumber, string PatternData)
        {
            HPRequest mReq = GetRequest(PrinterOps.WritePattern, RegNumber);

            mReq.Data1 = GetFont(Font);
            mReq.Data2 = PatternData;
            IssueRequest(mReq);
        }
Exemple #4
0
        public void PassThru(string Data, bool ExpectTextResponse)
        {
            HPRequest mReq = GetRequest(PrinterOps.PassThru);

            mReq.Data1 = Data;
            mReq.ExpectTextResponse = ExpectTextResponse;
            IssueRequest(mReq);
        }
Exemple #5
0
        public void WriteText(int Item, string Data)
        {
            HPRequest mReq = GetRequest(PrinterOps.WriteText);

            mReq.Item  = Item;
            mReq.Data1 = Data;
            IssueRequest(mReq);
        }
Exemple #6
0
        public void Delay(int delay)
        {
            HPRequest mReq = GetRequest(PrinterOps.TimedDelay);

            mReq.TimedDelay = delay;
            mReq.Data1      = delay.ToString();
            IssueRequest(mReq);
        }
Exemple #7
0
        public void PositionItem(PositionOps How, int Item, int xCoord, int yCoord)
        {
            HPRequest mReq = GetRequest(PrinterOps.PositionItem, (int)How);

            mReq.Item   = Item;
            mReq.xCoord = xCoord;
            mReq.yCoord = yCoord;
            IssueRequest(mReq);
        }
        private string FakeRetrievePatternPXR(HPRequest mReq)
        {
            string result = "0203";

            if (mReq.CharSize == 5 && mReq.Page == 1)
            {
                result = "021B30303000000000000000000002000000060000000E0000001E0000003E0000FE7A000010F2000010E2010010C20300FE82070000020F0000021E0022023C003E0278002202F0000002E0010002C0031C0280072202000F2A02001E2A06003C0E0E007800000000000000000000000000000000000000000000000000000000000000001B303031001E00F03E3E00E0087A007008F2003808E2011C3EC2030E0082070700028F030002DE012802FC00100278007C02F0001002E0012802C003000280070006000F000E000EFE1E0007403E8003307AC00140F2E000FEE2710000C23B000E821F0000000000000000000000000000000000000000000000000000000000000000001B30303214020F0024021E0014023C000E0278000002F0003E02E0012802C0012C02E0002A0270001002380000021C003E020E00080207001482030022C2010000E2000000720000003A0000001E0000000E000000060000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000003";
            }
            return(AsciiToRawData(result));
        }
Exemple #9
0
        public void Message(MessageOps SubOp, int MessageNumber, string MessageName)
        {
            //if (FakeResponse != null) {
            //   FakeResponse.LastLoadedMessage = MessageNumber;
            //}
            HPRequest mReq = GetRequest(PrinterOps.Message, (int)SubOp);

            mReq.Item  = MessageNumber;
            mReq.Data1 = MessageName;
            IssueRequest(mReq);
        }
Exemple #10
0
        public void WriteSpecification(SpecificationOps SubOp, int Data1, int Data2)
        {
            // Get the length right
            int[]     pad  = new int[] { 2, 3, 1, 4, 5, 4, 4, 3, 1, 4, 1, 1, 3, 2, 1, 4, 1, 1, 2, 1 };
            HPRequest mReq = GetRequest(PrinterOps.WriteSpecification, (int)SubOp);

            mReq.Data1 = PadLeftZeros(Data1, pad[(int)SubOp]);
            if (SubOp == SpecificationOps.LeadingCharWidthControlWidth)
            {
                mReq.Data2 = PadLeftZeros(Data1, pad[(int)SubOp]);
            }
            IssueRequest(mReq);
        }
Exemple #11
0
        public void WriteCalendarSubRule(int Item, int YearOffset, int MonthOffset, int DayOffset, int HourOffset, int MinuteOffset, int calBlockNo, string subRule)
        {
            HPRequest mReq = GetRequest(PrinterOps.WriteCalendarSubRule);

            mReq.Item    = Item;
            mReq.Data1   = PadLeftZeros(YearOffset, 4);
            mReq.Data2   = PadLeftZeros(MonthOffset, 4);
            mReq.Data3   = PadLeftZeros(DayOffset, 4);
            mReq.Data4   = PadLeftZeros(HourOffset, 4);
            mReq.Data5   = PadLeftZeros(MinuteOffset, 4);
            mReq.Data6   = PadLeftZeros(subRule, 2);
            mReq.BlockNo = calBlockNo;
            IssueRequest(mReq);
        }
Exemple #12
0
 public void ColumnSetup(string LineCount, string LineSpacing)
 {
     // If no data, assume single line
     if (LineCount.Length == 0)
     {
         LineCount   = "1";
         LineSpacing = "0";
     }
     if (LineCount.Length == LineSpacing.Length)
     {
         HPRequest mReq = GetRequest(PrinterOps.ColumnSetup);
         mReq.Data1 = LineCount;
         mReq.Data2 = LineSpacing;
         IssueRequest(mReq);
     }
 }
Exemple #13
0
        public void WriteCountCondition(int Item, int CountSize, string InitialValue, string Range1, string Range2, string JumpFrom, string JumpTo, string Reset, string UpdateInProgress, string UpdateUnit, string Direction, string ExternalSignal, string ResetSignal, string Increment, int countBlockNo)
        {
            HPRequest mReq = GetRequest(PrinterOps.WriteCountCondition);

            mReq.Item    = Item;
            mReq.Data1   = PadLeftZeros(InitialValue, CountSize);
            mReq.Data2   = PadLeftZeros(Range1, CountSize);
            mReq.Data3   = PadLeftZeros(Range2, CountSize);
            mReq.Data4   = JumpFrom;
            mReq.Data5   = JumpTo;
            mReq.Data6   = PadLeftZeros(Reset, CountSize);
            mReq.Data7   = PadLeftZeros(UpdateInProgress, 6);
            mReq.Data8   = PadLeftZeros(UpdateUnit, 6);
            mReq.Data9   = PadLeftZeros(Direction, 1);
            mReq.Data10  = PadLeftZeros(ExternalSignal, 1);
            mReq.Data11  = PadLeftZeros(ResetSignal, 1);
            mReq.Data12  = PadLeftZeros(Increment, 2);
            mReq.BlockNo = countBlockNo;
            IssueRequest(mReq);
        }
Exemple #14
0
        public void SetClock(SetClockOps SubOp, object ClockData)
        {
            // Local Storage
            int intMode = 0;

            // Validate the input
            switch (SubOp)
            {
            case SetClockOps.CurrentDateTime:
            case SetClockOps.CalendarDateTime:
                HPRequest mReq = GetRequest(PrinterOps.SetClock, (int)SubOp);
                mReq.Data1 = ClockData.ToString();
                IssueRequest(mReq);
                break;

            case SetClockOps.CalendarTimeControl:
            case SetClockOps.TwelveTwentyFour:
                if (int.TryParse(ClockData.ToString(), out intMode))
                {
                    if (intMode == 1 | intMode == 2)
                    {
                        mReq       = GetRequest(PrinterOps.SetClock, (int)SubOp);
                        mReq.Data1 = PadLeftZeros(intMode, 1);
                        IssueRequest(mReq);
                    }
                    else
                    {
                        NotifyClient?.Invoke(this, new HPEventArgs("Invalid Set Clock Mode!"));
                    }
                }
                else
                {
                    NotifyClient?.Invoke(this, new HPEventArgs("Invalid Set Clock Mode!"));
                }
                break;

            default:
                NotifyClient?.Invoke(this, new HPEventArgs("Invalid Set Clock Sub-type!"));
                break;
            }
        }
Exemple #15
0
        public void WriteFormat(int Item, string Font, int InterCharacterSpace, int IncreasedWidth, string BarcodeType = "(None)", string EANPrefix = "00", string HumanReadable = "(None)")
        {
            string ics;

            if (rxClass)
            {
                ics = PadLeftZeros(InterCharacterSpace, 2);
            }
            else
            {
                ics = PadLeftZeros(InterCharacterSpace, 1);
            }
            HPRequest mReq = GetRequest(PrinterOps.WriteFormat);

            mReq.Item  = Item;
            mReq.Data1 = GetFont(Font);
            mReq.Data2 = ics;
            mReq.Data3 = PadLeftZeros(IncreasedWidth, 1);
            mReq.Data5 = BarcodeType;
            mReq.Data8 = EANPrefix;
            mReq.Data9 = HumanReadable;
            IssueRequest(mReq);
        }
Exemple #16
0
 public void WriteCalendarSubZS(int Item, CalendarSubTypes SubOp, int SubZS, bool Sub, bool ZS, int calBlockNo)
 {
     if (SubZS == 0)
     {
         if (printerType != HitachiPrinterType.PH)
         {
             HPRequest mReq = GetRequest(PrinterOps.WriteCalendarZS, (int)SubOp);
             mReq.Item    = Item;
             mReq.Data1   = PadLeftZeros(Sub, 1);
             mReq.Data2   = PadLeftZeros(ZS, 1);
             mReq.BlockNo = calBlockNo;
             IssueRequest(mReq);
         }
     }
     else
     {
         HPRequest mReq = GetRequest(PrinterOps.WriteCalendarSub, (int)SubOp);
         mReq.Item    = Item;
         mReq.Data1   = PadLeftZeros(Sub, 1);
         mReq.Data2   = PadLeftZeros(ZS, 1);
         mReq.BlockNo = calBlockNo;
         IssueRequest(mReq);
     }
 }
        private string FakeRetrieveRX(HPRequest mReq)
        {
            //
            // Just <cSOH><cETX> if not in yet
            string strResult = "0203";

            switch ((RetrieveOps)mReq.SubOp)
            {
            case RetrieveOps.LineSetting:
                strResult = "021F311F31311F473103";
                break;

            case RetrieveOps.PrintContentsAttributes:
                strResult = "0210310000410000420000430000310000320000330000201032C18C8EC18C8E00002FC193FAC193FA00002FC1944EC1944E0000201033C28262C28262C28262C28262103400F14000F14100F14203";
                break;

            case RetrieveOps.PrintContentsNoAttributes:
                strResult = "021031F1BDF1BEF1BF1032363030382D31204747201033414E4320454E50343531103435454420555350233531103533393131342031323334103635363703";
                break;

            case RetrieveOps.CalendarCondition:
                strResult = "0210321F30303030303030303030303030301F30303030301F30303030301F303003";
                break;

            case RetrieveOps.CountCondition:
                strResult = "0210331F00300030003000300020002000200020002000201F00300030003000300020002000200020002000201F00390039003900390020002000200020002000201F3030303030301F3030303030311F30311F311F00390039003900390020002000200020002000201F00300030003000300020002000200020002000201F00300030003000300020002000200020002000201F301F301F3003";
                break;

            case RetrieveOps.PrintFormat:
                strResult = "0210311F301F321F30311F311F301F301F30311F3010321F301F341F30311F311F301F301F30311F3010331F301F341F30311F311F301F301F30311F3010341F301F381F30301F311F301F301F30311F3010351F301F321F30311F311F301F301F30311F3010361F301F321F30311F311F301F301F30311F3010371F301F321F30311F311F301F301F30311F3010381F301F321F30311F311F301F301F30311F3010391F301F321F30311F311F301F301F30311F30103A1F301F321F30311F311F301F301F30311F30103B1F301F321F30311F311F301F301F30311F30103C1F301F321F30311F311F301F301F30311F30103D1F301F321F30311F311F301F301F30311F30103E1F301F321F30311F311F301F301F30311F30103F1F301F321F30311F311F301F301F30311F3010401F301F321F30311F311F301F301F30311F3010411F301F321F30311F311F301F301F30311F3010421F301F321F30311F311F301F301F30311F3010431F301F321F30311F311F301F301F30311F3010441F301F321F30311F311F301F301F30311F3010451F301F321F30311F311F301F301F30311F3010461F301F321F30311F311F301F301F30311F3010471F301F321F30311F311F301F301F30311F3010481F301F321F30311F311F301F301F30311F3003";
                break;

            case RetrieveOps.PrintSpecifications:
                strResult = "021F3039391F30331F301F303034301F331F311F303034311F303034311F301F30303030301F3030311F303030301F303030301F301F303030301F30301F311F303030301F30303030301F3030301F301F303030301F3003";
                break;

            case RetrieveOps.PrintData:
                strResult = "021F30303031303000530041004D0050004C00450020003100200020002000201F30303032303000530041004D0050004C004500200032002000200020002003";
                break;

            case RetrieveOps.UserEnvironmentSetup:
                strResult = "021F321F301F301F311F311F311F311F311F311F301F311F311F30301F301F311F301F311F301F301F303030301F3030303003";
                break;

            case RetrieveOps.DateTimeSetup:
                strResult = "021F32303134303431363137323835391F311F32303134303431363137323835391F3103";
                break;

            case RetrieveOps.CommunicationsSetup:
                strResult = "021F301F301F391F321F301F311F361F321F301F311F361F321F301F311F321F301F321F321F301F301F303030311F301F301F301F301F321F311F311F3030311F3032341F301F311F301F301F301F301F3030301F301F301F301F301F3030303030303030303030301F3030303030303030303030301F3030303030303030303030301F30303030301F301F3030303030303030303030301F3030303030303030303030301F3030303030303030303030301F30303030301F30303030303030303030303030303030303030303030303030303030303030301F30303030303030303030303030303030303030303030303030303030303030301F303030303030303030303030303030303030303030303030303030303030303003";
                break;

            case RetrieveOps.TouchScreenSetup:
                strResult = "021F331F311F311F311F301F301F301F301F3003";
                break;

            case RetrieveOps.OperationManagement:
                strResult = "021F303037321F353030301F3030303037321F3030303030313938361F3031381F3030301F302E3030301F3033311F302E301F30391F3037352E341F301F3033311F30323503";
                break;

            case RetrieveOps.AlarmHistory:
                strResult = "021F3230313430343135323032393131311F3230313430343135323032373132301F3230313430343135323032373039391F3230313430343135323032363131361F3230313430343135323032363132301F3230313430343135323032363039391F3230313430343135323031393039371F3230313430343135323031393131381F3230313430343135323031393130311F3230313430343135323031393131381F3230313430343135323031393039371F3230313430343135323031383131381F3230313430343135323031383039371F3230313430343135323031383131381F3230313430343135323031383039371F3230313430343135323031383131381F3230313430343135323031383039371F3230313430343135323031383130351F3230313430343135323031383039371F3230313430343135323031383130311F3230313430343135323031383130351F3230313430343135323031383131381F3230313430343135323031383039371F3230313430343135323031383131381F3230313430343135323031383039371F3230313430343135323031383131381F3230313430343135323031373130311F3230313430343135323031373131371F3230313430343135323031373131381F3230313430343135313132313131311F3230313430343135313131383131361F3230313430343134313635323039371F3230313430343134313635323130351F3230313430343134313635323039371F3230313430343134313635323130311F3230313430343134313635323131381F3230313430343134313635323039371F3230313430343134313635323131381F3230313430343134313635323039371F3230313430343134313635323131381F3230313430343134313635323130311F3230313430343134313635323131371F3230313430343134313635323131381F3230313430343134313635313131371F3230313430343134313635313131381F3230313430343134313634373131311F3230313430343134313634353132301F3230313430343134313634353039391F3230313430343134313634343130321F3230313430343134313634333132301F3230313430343134313634333039391F3230313430343134313633363039371F3230313430343134313633363130351F3230313430343134313633363039371F3230313430343134313633363130311F3230313430343134313633363130351F3230313430343134313633363131381F3230313430343134313633363039371F3230313430343134313633363131381F3230313430343134313633363039371F3230313430343134313633363131381F3230313430343134313633363130311F3230313430343134313633363131371F3230313430343134313633353131381F3230313430343134313633353131311F3230313430343134313633353131361F3230313430343134313633353039391F3230313430343134313633353131361F3230313430343134313633343039391F3230313430343134313135393035361F3230313430343132313035363035361F3230313430343132313035333035361F3230313430343132313035313035361F3230313430343131303935303131311F3230313430343131303934383132301F3230313430343131303934373039391F3230313430343037313235393132301F3230313430343037313235383039391F3230313430343037313235383131311F3230313430343037313235373132301F3230313430343037313235363039391F3230313430343037303933303130321F3230313430343037303932343132301F3230313430343037303932343039391F3230313430343037303932343131311F3230313430343036313234323131311F3230313430343036303932363039371F3230313430343036303932363131311F3230313430343036303932343039371F32303134303430363039323132303103";
                break;

            case RetrieveOps.PartsUsageTime:
                strResult = "021F30303037321F30303037321F30303037321F30303030301F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303037321F30303030301F3030303030311F3030303433331F3030303030313938361F32303133313130353136333603";
                break;

            case RetrieveOps.SoftwareVersion:
                strResult = "021F3031303030392E30391F3032303030372E30321F3033303030382E30321F3034303030342E31301F3035303230352E30361F3037303030312E32301F3131303030312E303003";
                break;

            case RetrieveOps.StirrerTest:
                strResult = "0203";
                break;

            case RetrieveOps.MonthSubstituteRule:
                strResult = "0203";
                break;

            case RetrieveOps.ShiftCodeSetup:
                strResult = "021F30303030323335390030003003";
                break;

            case RetrieveOps.TimeCountCondition:
                strResult = "0203";
                break;

            case RetrieveOps.UnitInformation:
                strResult = "021F52582D5344313630571F30383739303331311F3235383303";
                break;

            case RetrieveOps.ViscometerCalibration:
                strResult = "0203";
                break;

            case RetrieveOps.SystemEnvironmentSetup:
                strResult = "0203";
                break;

            case RetrieveOps.AdjustmentOperationalCheckout:
                strResult = "021F303735341F31391F301F311F301F301F3033311F3033311F3003";
                break;

            case RetrieveOps.SolenoidValvePumpTest:
                strResult = "021F311F311F311F311F311F311F311F311F311F311F311F311F311F302E30303003";
                break;

            case RetrieveOps.SubstitutionRule:
                //strResult = "021F30301F000000001F000000001F000000001F000000001F000000001F000000001F000000001F000000001F30301F000000001F000000001F000000001F000000001F000000001F000000001F000000001F0000000003";
                strResult = "021F30301F000000001F000000001F000000001F000000001F000000001F000000001F000000001F0000000003";
                break;

            case RetrieveOps.SubstitutionRuleData:
                //strResult = "021F30310052004500500030003100200020002000200020002000201F30320052004500500030003200200020002000200020002000201F30330052004500500030003300200020002000200020002000201F30340052004500500030003400200020002000200020002000201F30350052004500500030003500200020002000200020002000201F30360052004500500030003600200020002000200020002000201F30370052004500500030003700200020002000200020002000201F30380052004500500030003800200020002000200020002000201F30390052004500500030003900200020002000200020002000201F31300052004500500031003000200020002000200020002000201F31310052004500500031003100200020002000200020002000201F31320052004500500031003200200020002000200020002000201F31330052004500500031003300200020002000200020002000201F31340052004500500031003400200020002000200020002000201F31350052004500500031003500200020002000200020002000201F31360052004500500031003600200020002000200020002000201F31370052004500500031003700200020002000200020002000201F31380052004500500031003800200020002000200020002000201F31390052004500500031003900200020002000200020002000201F32300052004500500032003000200020002000200020002000201F32310052004500500032003100200020002000200020002000201F32320052004500500032003200200020002000200020002000201F32330052004500500032003300200020002000200020002000201F32340052004500500032003400200020002000200020002000201F32350052004500500032003500200020002000200020002000201F32360052004500500032003600200020002000200020002000201F32370052004500500032003700200020002000200020002000201F32380052004500500032003800200020002000200020002000201F32390052004500500032003900200020002000200020002000201F33300052004500500033003000200020002000200020002000201F33310052004500500033003100200020002000200020002000201F33320052004500500033003200200020002000200020002000201F33330052004500500033003300200020002000200020002000201F33340052004500500033003400200020002000200020002000201F33350052004500500033003500200020002000200020002000201F33360052004500500033003600200020002000200020002000201F33370052004500500033003700200020002000200020002000201F33380052004500500033003800200020002000200020002000201F33390052004500500033003900200020002000200020002000201F34300052004500500034003000200020002000200020002000201F34310052004500500034003100200020002000200020002000201F34320052004500500034003200200020002000200020002000201F34330052004500500034003300200020002000200020002000201F34340052004500500034003400200020002000200020002000201F34350052004500500034003500200020002000200020002000201F34360052004500500034003600200020002000200020002000201F34370052004500500034003700200020002000200020002000201F34380052004500500034003800200020002000200020002000201F34390052004500500034003900200020002000200020002000201F35300052004500500035003000200020002000200020002000201F35310052004500500035003100200020002000200020002000201F35320052004500500035003200200020002000200020002000201F35330052004500500035003300200020002000200020002000201F35340052004500500035003400200020002000200020002000201F35350052004500500035003500200020002000200020002000201F35360052004500500035003600200020002000200020002000201F35370052004500500035003700200020002000200020002000201F35380052004500500035003800200020002000200020002000201F35390052004500500035003900200020002000200020002000201F36300052004500500036003000200020002000200020002000201F36310052004500500036003100200020002000200020002000201F36320052004500500036003200200020002000200020002000201F36330052004500500036003300200020002000200020002000201F36340052004500500036003400200020002000200020002000201F36350052004500500036003500200020002000200020002000201F36360052004500500036003600200020002000200020002000201F36370052004500500036003700200020002000200020002000201F36380052004500500036003800200020002000200020002000201F36390052004500500036003900200020002000200020002000201F37300052004500500037003000200020002000200020002000201F37310052004500500037003100200020002000200020002000201F37320052004500500037003200200020002000200020002000201F37330052004500500037003300200020002000200020002000201F37340052004500500037003400200020002000200020002000201F37350052004500500037003500200020002000200020002000201F37360052004500500037003600200020002000200020002000201F37370052004500500037003700200020002000200020002000201F37380052004500500037003800200020002000200020002000201F37390052004500500037003900200020002000200020002000201F38300052004500500038003000200020002000200020002000201F38310052004500500038003100200020002000200020002000201F38320052004500500038003200200020002000200020002000201F38330052004500500038003300200020002000200020002000201F38340052004500500038003400200020002000200020002000201F38350052004500500038003500200020002000200020002000201F38360052004500500038003600200020002000200020002000201F38370052004500500038003700200020002000200020002000201F38380052004500500038003800200020002000200020002000201F38390052004500500038003900200020002000200020002000201F39300052004500500039003000200020002000200020002000201F39310052004500500039003100200020002000200020002000201F39320052004500500039003200200020002000200020002000201F39330052004500500039003300200020002000200020002000201F39340052004500500039003400200020002000200020002000201F39350052004500500039003500200020002000200020002000201F39360052004500500039003600200020002000200020002000201F39370052004500500039003700200020002000200020002000201F39380052004500500039003800200020002000200020002000201F393900520045005000390039002000200020002000200020002003";
                strResult = "021F30310052004500500030003100200020002000200020002000201F30320052004500500030003200200020002000200020002000201F30330052004500500030003300200020002000200020002000201F30340052004500500030003400200020002000200020002000201F30350052004500500030003500200020002000200020002000201F30360052004500500030003600200020002000200020002000201F30370052004500500030003700200020002000200020002000201F30380052004500500030003800200020002000200020002000201F30390052004500500030003900200020002000200020002000201F31300052004500500031003000200020002000200020002000201F31310052004500500031003100200020002000200020002000201F31320052004500500031003200200020002000200020002000201F31330052004500500031003300200020002000200020002000201F31340052004500500031003400200020002000200020002000201F31350052004500500031003500200020002000200020002000201F31360052004500500031003600200020002000200020002000201F31370052004500500031003700200020002000200020002000201F31380052004500500031003800200020002000200020002000201F31390052004500500031003900200020002000200020002000201F32300052004500500032003000200020002000200020002000201F32310052004500500032003100200020002000200020002000201F32320052004500500032003200200020002000200020002000201F32330052004500500032003300200020002000200020002000201F32340052004500500032003400200020002000200020002000201F32350052004500500032003500200020002000200020002000201F32360052004500500032003600200020002000200020002000201F32370052004500500032003700200020002000200020002000201F32380052004500500032003800200020002000200020002000201F32390052004500500032003900200020002000200020002000201F33300052004500500033003000200020002000200020002000201F33310052004500500033003100200020002000200020002000201F33320052004500500033003200200020002000200020002000201F33330052004500500033003300200020002000200020002000201F33340052004500500033003400200020002000200020002000201F33350052004500500033003500200020002000200020002000201F33360052004500500033003600200020002000200020002000201F33370052004500500033003700200020002000200020002000201F33380052004500500033003800200020002000200020002000201F33390052004500500033003900200020002000200020002000201F34300052004500500034003000200020002000200020002000201F34310052004500500034003100200020002000200020002000201F34320052004500500034003200200020002000200020002000201F34330052004500500034003300200020002000200020002000201F34340052004500500034003400200020002000200020002000201F34350052004500500034003500200020002000200020002000201F34360052004500500034003600200020002000200020002000201F34370052004500500034003700200020002000200020002000201F34380052004500500034003800200020002000200020002000201F34390052004500500034003900200020002000200020002000201F35300052004500500035003000200020002000200020002000201F35310052004500500035003100200020002000200020002000201F35320052004500500035003200200020002000200020002000201F35330052004500500035003300200020002000200020002000201F35340052004500500035003400200020002000200020002000201F35350052004500500035003500200020002000200020002000201F35360052004500500035003600200020002000200020002000201F35370052004500500035003700200020002000200020002000201F35380052004500500035003800200020002000200020002000201F35390052004500500035003900200020002000200020002000201F36300052004500500036003000200020002000200020002000201F36310052004500500036003100200020002000200020002000201F36320052004500500036003200200020002000200020002000201F36330052004500500036003300200020002000200020002000201F36340052004500500036003400200020002000200020002000201F36350052004500500036003500200020002000200020002000201F36360052004500500036003600200020002000200020002000201F36370052004500500036003700200020002000200020002000201F36380052004500500036003800200020002000200020002000201F36390052004500500036003900200020002000200020002000201F37300052004500500037003000200020002000200020002000201F37310052004500500037003100200020002000200020002000201F37320052004500500037003200200020002000200020002000201F37330052004500500037003300200020002000200020002000201F37340052004500500037003400200020002000200020002000201F37350052004500500037003500200020002000200020002000201F37360052004500500037003600200020002000200020002000201F37370052004500500037003700200020002000200020002000201F37380052004500500037003800200020002000200020002000201F37390052004500500037003900200020002000200020002000201F38300052004500500038003000200020002000200020002000201F38310052004500500038003100200020002000200020002000201F38320052004500500038003200200020002000200020002000201F38330052004500500038003300200020002000200020002000201F38340052004500500038003400200020002000200020002000201F38350052004500500038003500200020002000200020002000201F38360052004500500038003600200020002000200020002000201F38370052004500500038003700200020002000200020002000201F38380052004500500038003800200020002000200020002000201F38390052004500500038003900200020002000200020002000201F39300052004500500039003000200020002000200020002000201F39310052004500500039003100200020002000200020002000201F39320052004500500039003200200020002000200020002000201F39330052004500500039003300200020002000200020002000201F39340052004500500039003400200020002000200020002000201F39350052004500500039003500200020002000200020002000201F39360052004500500039003600200020002000200020002000201F39370052004500500039003700200020002000200020002000201F39380052004500500039003800200020002000200020002000201F393900520045005000390039002000200020002000200020002003";
                break;

            case RetrieveOps.AdjustICS:
                strResult = "0210313232323232323232323210323131313131313131313110333131313131313131103431313131313131313131103531313131103631313110373131103831103931103A3103";
                break;

            case RetrieveOps.VariousPrintSetup:
                strResult = "021F311F301F311F311F3103";
                break;

            case RetrieveOps.CirculationSystemSetup:
                strResult = "021F3031381F311F311F301F301F311F303030301F3030303003";
                break;

            case RetrieveOps.FreeLayoutCoordinates:
                strResult = "0210311F30303030301F303010321F30303030301F303010331F30303030301F303010341F30303030301F303010351F30303030301F303010361F30303030301F303010371F30303030301F303010381F30303030301F303010391F30303030301F3030103A1F30303030301F3030103B1F30303030301F3030103C1F30303030301F3030103D1F30303030301F3030103E1F30303030301F3030103F1F30303030301F303010401F30303030301F303010411F30303030301F303010421F30303030301F303010431F30303030301F303010441F30303030301F303010451F30303030301F303010461F30303030301F303010471F30303030301F303010481F30303030301F303010491F30303030301F3030104A1F30303030301F3030104B1F30303030301F3030104C1F30303030301F3030104D1F30303030301F3030104E1F30303030301F3030104F1F30303030301F303010501F30303030301F303010511F30303030301F303010521F30303030301F303010531F30303030301F303010541F30303030301F303010551F30303030301F303010561F30303030301F303010571F30303030301F303010581F30303030301F303010591F30303030301F3030105A1F30303030301F3030105B1F30303030301F3030105C1F30303030301F3030105D1F30303030301F3030105E1F30303030301F3030105F1F30303030301F303010601F30303030301F303010611F30303030301F303010621F30303030301F303010631F30303030301F303010641F30303030301F303010651F30303030301F303010661F30303030301F303010671F30303030301F303010681F30303030301F303010691F30303030301F3030106A1F30303030301F3030106B1F30303030301F3030106C1F30303030301F3030106D1F30303030301F3030106E1F30303030301F3030106F1F30303030301F303010701F30303030301F303010711F30303030301F303010721F30303030301F303010731F30303030301F303010741F30303030301F303010751F30303030301F303010761F30303030301F303010771F30303030301F303010781F30303030301F303010791F30303030301F3030107A1F30303030301F3030107B1F30303030301F3030107C1F30303030301F3030107D1F30303030301F3030107E1F30303030301F3030107F1F30303030301F303010801F30303030301F303010811F30303030301F303010821F30303030301F303010831F30303030301F303010841F30303030301F303010851F30303030301F303010861F30303030301F303010871F30303030301F303010881F30303030301F303010891F30303030301F3030108A1F30303030301F3030108B1F30303030301F3030108C1F30303030301F3030108D1F30303030301F3030108E1F30303030301F3030108F1F30303030301F303010901F30303030301F303010911F30303030301F303010921F30303030301F303010931F30303030301F303010941F30303030301F303003";
                break;

            case RetrieveOps.MessageGroupNames:
                strResult = "0203";
                break;

            default:
                strResult = "0203";
                break;
            }
            // Convert data
            return(AsciiToRawData(strResult));
        }
        private string FakeRetrievePXR(HPRequest mReq)
        {
            //
            // Just <cSOH><cETX> if not in yet
            string strResult = "0203";

            // See who is calling
            switch ((RetrieveOps)mReq.SubOp)
            {
            case RetrieveOps.LineSetting: //  0
                strResult = "021B31311B473103";
                break;

            case RetrieveOps.PrintContentsAttributes: //  1
                strResult = "0210310000410000420000430000310000320000330000201032C18C8EC18C8E00002FC193FAC193FA00002FC1944EC1944E0000201033C28262C28262C28262C28262103400F14000F14100F14203";
                break;

            case RetrieveOps.PrintContentsNoAttributes: //  2
                strResult = "021031F1BDF1BEF1BF1032363030382D31204747201033414E4320454E50343531103435454420555350233531103533393131342031323334103635363703";
                break;

            case RetrieveOps.CalendarCondition: //  3
                strResult = "0210321B30303030303030303030303030301B30303030301B30303030301B303003";
                break;

            case RetrieveOps.SubstitutionRule: //  4
                strResult = "0203";
                break;

            case RetrieveOps.CountCondition: //  5
                strResult = "0210331B00300030003000300020002000200020002000201B00300030003000300020002000200020002000201B00390039003900390020002000200020002000201B3030303030301B3030303030311B30311B311B00390039003900390020002000200020002000201B00300030003000300020002000200020002000201B00300030003000300020002000200020002000201B301B301B3003";
                break;

            case RetrieveOps.PrintFormat: //  6
                strResult = "0210311B303231311B303030311B3010321B303331311B303030311B3010331B303331311B303030311B3010341B303630311B303030311B3010351B303331311B303030311B3010361B303331311B303030311B3010371B303331311B303030311B3010381B303331311B303030311B3010391B303331311B303030311B30103A1B303331311B303030311B30103B1B303331311B303030311B30103C1B303331311B303030311B30103D1B303331311B303030311B30103E1B303331311B303030311B30103F1B303331311B303030311B3010401B303331311B303030311B3010411B303331311B303030311B3010421B303331311B303030311B3010431B303331311B303030311B3010441B303331311B303030311B3010451B303331311B303030311B3010461B303331311B303030311B3010471B303331311B303030311B3010481B303331311B303030311B3003";
                break;

            case RetrieveOps.PrintSpecifications: //  7
                strResult = "021B3039301B3030321B331B301B303030301B303030301B303030301B303030301B3030301B301B303030301B301B3030311B30331B301B301B311B3003";
                break;

            case RetrieveOps.PrintData: //  8
                strResult = "021B30303100530041004D0050004C00450020003100200020002000201B30303200530041004D0050004C004500200032002000200020002003";
                break;

            case RetrieveOps.UserEnvironmentSetup: //  9
                strResult = "021B311B301B311B301B311B311B301B311B311B311B301B3103";
                break;

            case RetrieveOps.DateTimeSetup: // 10
                strResult = "021B32303134303332393036353734331B311B32303134303332393036353734331B3103";
                break;

            case RetrieveOps.CommunicationsSetup: // 11
                strResult = "021B311B391B321B301B311B321B301B321B321B301B301B301B301B311B301B311B301B301B301B301B3030301B301B301B3003";
                break;

            case RetrieveOps.TouchScreenSetup: // 12
                strResult = "021B311B301B3003";
                break;

            case RetrieveOps.OperationManagement: // 13
                strResult = "021B303030301B303630301B3030303030301B3030303030303030301B3030311B3030301B302E3030351B3032341B302E301B31311B3036322E351B301B3032331B30323603";
                break;

            case RetrieveOps.AlarmHistory: // 14
                strResult = "021B3230313430333239303630303130311B3230313430333239303535353130311B3230313430333239303535343130311B3230313430333239303534393130311B3230313430333239303534363130311B3230313430333239303534353130311B3230313430333239303534303130311B32303134303332393035333731303103";
                break;

            case RetrieveOps.PartsUsageTime: // 15
                strResult = "021B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B30303030301B3030303030301B3030303030301B3030303030303030301B32303134303332393035333303";
                break;

            case RetrieveOps.SoftwareVersion: // 16
                strResult = "021B3031303030382E30341B3032303030312E36351B3033303030332E35301B3034303030312E34351B3035303230312E34331B3037303030312E31321B3131303030312E303003";
                break;

            case RetrieveOps.StirrerTest: // 17
                strResult = "021B311B3103";
                break;

            case RetrieveOps.MonthSubstituteRule: // 18
                strResult = "021B004A0041004E004600450042004D00410052004100500052004D00410059004A0055004E004A0055004C004100550047005300450050004F00430054004E004F005600440045004303";
                break;

            case RetrieveOps.ShiftCodeSetup: // 19
                strResult = "0203";
                break;

            case RetrieveOps.TimeCountCondition: // 20
                strResult = "0203";
                break;

            case RetrieveOps.UnitInformation: // 21
                strResult = "021B5058522D50343630571B32313734383231311B3135303203";
                break;

            case RetrieveOps.ViscometerCalibration: // 22
                strResult = "021B30302E30301B30302E30301B30302E30301B30302E30301B30302E30301B30302E30301B3030301B302E3030301B303030301B3030301B30302E30301B30302E30301B30302E30301B30302E30301B30302E30301B30302E30301B3030301B302E3030301B303030301B30303030303030303030303003";
                break;

            case RetrieveOps.SystemEnvironmentSetup: // 23
                strResult = "021B3030311B311B321B311B3036322E351B30311B34301B30301B313903";
                break;

            case RetrieveOps.AdjustmentOperationalCheckout: // 24
                strResult = "021B303734301B34301B301B301B301B301B3032341B3032341B3003";
                break;

            case RetrieveOps.SolenoidValvePumpTest: // 25
                strResult = "021B311B311B311B311B311B311B311B311B311B311B311B311B311B302E30303503";
                break;

            case RetrieveOps.SubstitutionRuleData: // 27
                strResult = "0203";
                break;

            case RetrieveOps.AdjustICS: // 28
                strResult = "0203";
                break;

            case RetrieveOps.VariousPrintSetup: // 29
                strResult = "0203";
                break;

            case RetrieveOps.CirculationSystemSetup: // 30
                strResult = "0203";
                break;

            case RetrieveOps.FreeLayoutCoordinates: // 31
                strResult = "0203";
                break;

            case RetrieveOps.MessageGroupNames: // 32
                strResult = "0203";
                break;
            }

            // Convert data
            return(AsciiToRawData(strResult));
        }
        internal string BuildFakeCompletion(HPRequest mReq, HitachiPrinter pxr)
        {
            // Local Storage
            PrinterOps intOp;
            int        intSubOp;
            string     FakeResult;

            // Get the Op and SubOp at the next extract point
            intOp    = mReq.Op;
            intSubOp = mReq.SubOp;

            // See who wants the status
            switch (intOp)
            {
            case PrinterOps.Retrieve: // 14
                if ((RetrieveOps)intSubOp == RetrieveOps.PrintContentsNoAttributes)
                {
                    FakeResult = parent.LastMessageText;
                }
                else
                {
                    if (pxr.RXClass)
                    {
                        FakeResult = FakeRetrieveRX(mReq);
                    }
                    else
                    {
                        FakeResult = FakeRetrievePXR(mReq);
                    }
                }
                break;

            case PrinterOps.RetrievePattern: // 15
                if (pxr.RXClass)
                {
                    FakeResult = FakeRetrievePatternRX(mReq);
                }
                else
                {
                    FakeResult = FakeRetrievePatternPXR(mReq);
                }
                break;

            case PrinterOps.Fetch:
                FakeResult = sACK;
                switch ((FetchOps)intSubOp)
                {
                case FetchOps.Status:
                    FakeResult = pxr.StatusArea.Status;
                    break;

                case FetchOps.Time:
                    if (pxr.RXClass)
                    {
                        FakeResult = AsciiToRawData("021F7F") + DateTime.Now.ToString("yyyyMMddhhmmss" + "\x03");
                    }
                    else
                    {
                        FakeResult = AsciiToRawData("021B7C") + DateTime.Now.ToString("yyyyMMddhhmmss" + "\x03");
                    }
                    break;

                case FetchOps.PreviousMessage:
                    break;

                case FetchOps.Currentmessage:
                    break;

                default:
                    break;
                }
                break;

            default:
                FakeResult = sACK;
                break;
            }
            if (string.IsNullOrEmpty(FakeResult))
            {
                FakeResult = AsciiToRawData("0203");
            }
            return(FakeResult);
        }
Exemple #20
0
        public void RetrievePattern(RetrievePatternOps SubOp, string Font, int Page, int KbType)
        {
            int[] SizeRX   = new int[] { 8, 8, 8, 16, 16, 32, 32, 72, 128, 32, 5, 5, 7, 200, 288 };
            int[] CountRX  = new int[] { 37, 37, 37, 37, 37, 15 };
            int[] HeaderRX = new int[] { 4, 3 };

            int[] SizePXR = new int[] { 8, 8, 16, 32, 72, 128, 16 };
            int[,] CountPXR = new int[, ] {
                { 45, 45, 38 }, { 46, 44, 0 }
            };
            int[] HeaderPXR = new int[] { 4, 2 };

            // Local Storage
            int intCharSize  = 0;
            int intRcvLength = 0;

            // Translate the font
            intCharSize = GetFont(Font, true)[0] - '0';

            // Was the font invalid
            if (intCharSize < 0)
            {
                NotifyClient?.Invoke(this, new HPEventArgs("Invalid font specified!"));
                return;
            }

            // Is the page number valid
            switch (SubOp)
            {
            case RetrievePatternOps.Standard:
                if (Page < 1 || Page > 3)
                {
                    Page = -1;
                }
                break;

            case RetrievePatternOps.User:
                if (rxClass)
                {
                    if (Page < 1 || Page > 6)
                    {
                        Page = -1;
                    }
                }
                else
                {
                    if (Page < 1 || Page > 3)
                    {
                        Page = -1;
                    }
                }
                break;
            }

            // Is the page number invalid
            if (Page < 0)
            {
                NotifyClient?.Invoke(this, new HPEventArgs("Invalid page number specified!"));
                return;
            }

            // Get the number of characters expected and issue operation
            if (rxClass)
            {
                if (SubOp == RetrievePatternOps.User)
                {
                    intRcvLength = (SizeRX[intCharSize] + HeaderRX[(int)SubOp]) * CountRX[Page - 1] + 2;
                }
                else
                {
                    if (KbType == 1)
                    {
                        if (Page == 2)
                        {
                            intRcvLength = 2;
                        }
                        else
                        {
                            intRcvLength = (SizeRX[intCharSize] + HeaderRX[(int)SubOp]) * 38 + 2;
                        }
                    }
                    else
                    {
                        intRcvLength = (SizeRX[intCharSize] + HeaderRX[(int)SubOp]) * 26 + 2;
                    }
                }
            }
            else
            {
                intRcvLength = (SizePXR[intCharSize] + HeaderPXR[(int)SubOp]) * CountPXR[(int)SubOp, Page - 1] + 2;
            }
            HPRequest mReq = GetRequest(PrinterOps.RetrievePattern, (int)SubOp);

            mReq.CharSize  = intCharSize;
            mReq.Page      = Page;
            mReq.RcvLength = RcvLength;
            mReq.KbType    = KbType;
            mReq.Retries   = 0;
            IssueRequest(mReq);
        }