ClockDateTimeProgram.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace HNWD.LatticeScreen.Server
  8. {
  9. internal class ClockDateTimeProgram : ProgramBase
  10. {
  11. public ClockDateTimeProgram(LedLatticeScreen ledLatticeScreen)
  12. : base()
  13. {
  14. this.ledLatticeScreen = ledLatticeScreen;
  15. }
  16. public override void PlayWithErase()
  17. {
  18. this.GetTextAlignMode(this.wd_ProgramInfo.PROGRAM_ALIGN);
  19. this.ledLatticeScreen.JHErase();
  20. /* 调用屏幕操作中的DrawText接口来立即显示一段文本 */
  21. this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), 0, Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), this.AlignMode, DateTime.Now.ToString("yyyy年MM月dd日"));
  22. this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), Convert.ToInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), this.AlignMode, DateTime.Now.ToString("HH:mm:ss"));
  23. this.ResponseMessage();
  24. }
  25. public override void PlayWithoutErase()
  26. {
  27. this.GetTextAlignMode(this.wd_ProgramInfo.PROGRAM_ALIGN);
  28. /* 调用屏幕操作中的DrawText接口来立即显示一段文本 */
  29. this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), 0, Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), this.AlignMode, DateTime.Now.ToString("yyyy年MM月dd日"));
  30. this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), Convert.ToInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT) / 2), this.AlignMode, DateTime.Now.ToString("HH:mm:ss"));
  31. this.ResponseMessage();
  32. }
  33. }
  34. }