Beispiel #1
0
        protected override void OnAfterActivate()
        {
            // подключение
            USBPDLib.OpenUSBpd();

            // очистка дисплея
            USBPDLib.WritePD(new byte[] { 0x0C }, 1);

            // установка яркости
            USBPDLib.WritePD(new byte[] { 0x1F, 0x58, 0x04 }, 3);

            // выбираем кодовую страницу для символов 0x80-0xFF
            USBPDLib.WritePD(new byte[] { 0x1B, 0x74, 0x06 }, 3);

            base.OnAfterActivate();
        }
Beispiel #2
0
        public override string this[int lineNumber]
        {
            set
            {
                ErrorCode = new ServerErrorCode(this, GeneralError.Success);
                if (value.Length == 0)
                {
                    return;
                }

                try
                {
                    if (lineNumber < 0)
                    {
                        throw new ArgumentException();
                    }

                    if (lineNumber > 1)
                    {
                        return;
                    }

                    // дополняем строку пробелами
                    string output = value.PadRight(DISPLAY_WIDTH, ' ');

                    // обрезаем до необходимой длины
                    output = output.Substring(0, DISPLAY_WIDTH);

                    // выбираем номер строки
                    USBPDLib.WritePD(new byte[] { 0x1F, 0x24, 0x01, (byte)(lineNumber + 1) }, 4);

                    // вывод текста
                    var data = Encoding.GetEncoding(866).GetBytes(output);
                    USBPDLib.WritePD(data, data.Length);
                }
                catch (Exception E)
                {
                    ErrorCode = new ServerErrorCode(this, E);
                }
            }
        }
Beispiel #3
0
 protected override void OnBeforeDeactivate()
 {
     USBPDLib.CloseUSBpd();
     base.OnBeforeDeactivate();
 }