12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace HNWD.LatticeScreen.Server
- {
- internal class ClockCustomizedProgram : ProgramBase
- {
- private string displayText = string.Empty;
- public ClockCustomizedProgram(LedLatticeScreen ledLatticeScreen)
- : base()
- {
- this.ledLatticeScreen = ledLatticeScreen;
- }
- public override void PlayWithErase()
- {
- this.GetTextAlignMode(this.wd_ProgramInfo.PROGRAM_ALIGN);
- this.ledLatticeScreen.JHErase();
- /* 调用屏幕操作中的DrawText接口来立即显示一段文本 */
- this.ValidateDateTime();
- this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_Y), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT), this.AlignMode, this.displayText);
- this.ResponseMessage();
- }
- public override void PlayWithoutErase()
- {
- this.GetTextAlignMode(this.wd_ProgramInfo.PROGRAM_ALIGN);
- /* 调用屏幕操作中的DrawText接口来立即显示一段文本 */
- this.ValidateDateTime();
- this.responseByLedCommand = LedControl.JHDrawText(this.ledLatticeScreen.hdl, Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_X), Convert.ToInt16(this.wd_ProgramInfo.PROGRAM_Y), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_WIDTH), Convert.ToUInt16(this.wd_ProgramInfo.PROGRAM_HEIGHT), this.AlignMode, this.displayText);
- this.ResponseMessage();
- }
- private void ValidateDateTime()
- {
- try
- {
- this.displayText = DateTime.Now.ToString(this.wd_ProgramInfo.PROGRAM_FORMAT.Trim());
- }
- catch
- {
- this.displayText = string.Empty;
- }
- }
- }
- }
|