Beispiel #1
0
        /// <summary>
        /// Parse las partes comunes de todas las respuestas a comandos.
        /// </summary>
        ///
        /// <param name="cmd">El lector de comandos.</param>
        protected void ParseAnswerHeader(BinReader cmd)
        {
            cmd.Ptr       = 1;
            printerStatus = cmd.ReadNext() * 0x100 + cmd.ReadNext();

            SkipFieldSep(cmd);
            fiscalStatus = cmd.ReadNext() * 0x100 + cmd.ReadNext();

            SkipFieldSep(cmd);  // Reserved 1

            SkipFieldSep(cmd);
            errorCode = cmd.ReadNext() * 0x100 + cmd.ReadNext();

            if (errorCode != 0)
            {
                this.Error = "Codigo: 0x" + errorCode.ToString("X").PadLeft(4, '0');
            }

            SkipFieldSep(cmd);  // Reserved 1
        }
Beispiel #2
0
 /// <summary>
 /// Extrae un campo HORA
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="length"></param>
 /// <param name="optional"></param>
 /// <returns></returns>
 protected int Extract_T(BinReader cmd, int length, bool optional)
 {
     return(Extract_D(cmd, length, optional));
 }
Beispiel #3
0
        /// <summary>
        /// Extrae un campo FECHA
        /// </summary>
        /// <param name="cmd"></param>
        /// <param name="length"></param>
        /// <param name="optional"></param>
        /// <returns></returns>
        protected int Extract_D(BinReader cmd, int length, bool optional)
        {
            string text = Extract_RT(cmd, length, optional);

            return(int.Parse(text));
        }
Beispiel #4
0
 /// <summary>
 /// Extrae un campo ASCII
 /// </summary>
 /// <param name="cmd"></param>
 /// <param name="length"></param>
 /// <param name="optional"></param>
 /// <returns></returns>
 protected string Extract_A(BinReader cmd, int length, bool optional)
 {
     return(Extract_RT(cmd, length, optional));
 }