⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 LED字幕显示屏
💻
📖 第 1 页 / 共 2 页
字号:
  SendGrid.AutoNumberCol(0);
  SendGrid.LockUpdate := False;
  LoadSendSign.enabled:=True;
  RadioButton1.SetFocus;
end;

procedure TfrmsignA.SendClick(Sender: TObject);
var
  j: integer;
  Tmp: string;
begin
  if DisplayDirct then
    Tmp := ''
  else
    Tmp := '~v;';
  SendString[1] := SendString[1] + Stringofchar(' ', 10 -  Length(SendString[1]));
  if SendLine = 2 then
    SendString[2] := SendString[2] + Stringofchar(' ', 10 -
      Length(SendString[2]));
  if Big5 then
  begin
    SendString[1]:=GBtoBIG5(SendString[1]);
    SendString[2]:=GBtoBIG5(SendString[2]);
  end;

  ByteLength := 0;
  Cls_Command;

  if SendLine = 1 then
  begin
    ClipWindows_Command(0, 0, 160, 15);
    Text_Command(3, 4, 2, Tmp + SendString[1]);
  end;
  if SendLine = 2 then
  begin
    ClipWindows_Command(0, 0, 160, (SignHeight div 2) - 1);
    Text_Command(3, 4, 2, Tmp + SendString[1]);
    ClipWindows_Command(0, (SignHeight div 2), 160, SignHeight - 1);
    Text_Command(3, 4, 2, Tmp + SendString[2]);
  end;
  Delay_Command();
  Delay_Command();

  //Send Data to Sign
  SendIDCode(0);
  CommPort.PutChar(char(lo(ByteLength)));
  CommPort.PutChar(char(hi(ByteLength)));
  for j := 0 to ByteLength - 1 do
    CommPort.PutChar(char(SendByte[j]));
  CommPort.PutChar(char(GetCheckSum));
	SendList.Items.Clear;
  for j := 1 to SendLine do
    if Big5 then
	    SendList.Items.Add(big5togb(SendString[j]))
    else
	    SendList.Items.Add(SendString[j]);
  SendGrid.SetFocus;
  SendMessage(frmsignA.SendGrid.Handle, WM_KEYDOWN, VK_DOWN, 0);
end;

procedure TfrmsignA.LMD3DEffectButton2Click(Sender: TObject);
begin
  if MessageDlg('是否结束程序?', mtInformation, [mbYes, mbNo], 0) = mrYes then
    close;
end;

procedure TfrmsignA.ClsClick(Sender: TObject);
begin
  SendCls();
  SendList.Items.Clear;
  SendGrid.SetFocus;
end;

procedure TfrmsignA.CheckSignSendClick(Sender: TObject);
begin
  GroupBox1.Enabled := False;
  CheckSignSend.Enabled := False;
  StopCheckSend.Enabled := True;
  Timer1.Interval := 1;
  Timer1.Enabled := True;
  SendGrid.SetFocus;
end;

procedure TfrmsignA.Timer1Timer(Sender: TObject);
begin
  Timer1.Interval := 1000 * Speed;
  SendClick(self);
end;

procedure TfrmsignA.StopCheckSendClick(Sender: TObject);
begin
  GroupBox1.Enabled := True;
  Timer1.Enabled := False;
  StopCheckSend.Enabled := False;
  CheckSignSend.Enabled := True;
  SendGrid.SetFocus;
end;

procedure TfrmsignA.SendCls;
var
  i, j: integer;
  SendByte: array of byte;
begin
  SetLength(SendByte, 4);
  for i := 0 to SendLine - 1 do
  begin
    SendByte[0] := $01; //DataLength Low
    SendByte[1] := $00; //DataLength High
    SendByte[2] := $01; // cls
    SendByte[3] := $01; //ChechSum
    SendIDCode(i);
    for j := 0 to 3 do
      CommPort.PutChar(char(SendByte[j]));
  end;
end;

procedure TfrmsignA.Text_Command(Color, Position, Style: byte; Send_Text:
  string);
var
  i: integer;
begin
  SetLength(Tmp, Length(Send_text) + 8);
  Tmp[0] := lo($03); // Display Text
  Tmp[1] := lo(Style); //Style
  Tmp[2] := lo($01); //GAP
  Tmp[3] := lo(Color); //Color
  Tmp[4] := lo(OutEffect.ItemIndex + 1); //Mode
  Tmp[5] := lo(OutSpeed.Value); //Speed
  Tmp[6] := lo(Position); //Position
  for i := 1 to Length(Send_Text) do
    Tmp[6 + i] := byte(Send_Text[i]);
  Tmp[6 + i] := byte($00);
  i := 0;
  while (i <= Length(Tmp) - 1) do
  begin
    SendByte[ByteLength + i] := Tmp[i];
    i := i + 1;
  end;
  ByteLength := ByteLength + Length(Tmp);
end;

procedure TfrmsignA.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if RadioButton1.Checked then
    case key of
      #13: SendClick(Self);
      ' ': ClsClick(Self);
    end;
end;

procedure TfrmsignA.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if RadioButton1.Checked then
    case key of
      40: DownItem;
      38: UpItem;
    end;
end;

procedure TfrmsignA.ClipWindows_Command(x, y, x1, y1: integer);
var
  i: integer;
begin
  SetLength(Tmp, 10);
  Tmp[0] := lo($02); // Display Clip
  Tmp[1] := lo(X); //StartX Low
  Tmp[2] := hi(X); //StartX Height
  Tmp[3] := lo(Y); //StartY Low
  Tmp[4] := hi(Y); //StartY Height
  Tmp[5] := lo(x1); //EndX Low
  Tmp[6] := hi(X1); //EndX Height
  Tmp[7] := lo(Y1); //EndY Low
  Tmp[8] := hi(Y1); //EndY Height
  Tmp[9] := $00; // Clear Mode 00H-----Areaside in;01H -----Area outside
  i := 0;
  while (i <= Length(Tmp) - 1) do
  begin
    SendByte[ByteLength + i] := Tmp[i];
    i := i + 1;
  end;
  ByteLength := ByteLength + Length(Tmp);
end;

function TfrmsignA.GetCheckSum: integer;
var
  k: integer;
  CheckSum: integer;
begin
  CheckSum := 0;
  for k := 0 to ByteLength - 1 do
    CheckSum := CheckSum + SendByte[k];
  Result := lo(CheckSum);
end;

procedure TfrmsignA.Cls_Command;
var
  i: integer;
begin
  SetLength(Tmp, 2);
  Tmp[0] := $01;
  Tmp[1] := $01;
  i := 0;
  while (i <= Length(Tmp) - 1) do
  begin
    SendByte[ByteLength + i] := Tmp[i];
    i := i + 1;
  end;
  ByteLength := ByteLength + Length(Tmp);
end;

procedure TfrmsignA.Delay_Command;
var
  i: integer;
begin
  SetLength(Tmp, 3);
  Tmp[0] := $07;
  Tmp[1] := lo($FFFD);
  Tmp[2] := hi($FFFD);
  i := 0;
  while (i <= Length(Tmp) - 1) do
  begin
    SendByte[ByteLength + i] := Tmp[i];
    i := i + 1;
  end;
  ByteLength := ByteLength + Length(Tmp);
end;

procedure TfrmsignA.RadioButton3Click(Sender: TObject);
begin
  DisplayDirct := RadioButton3.checked;
  SendList.Font.Name := '宋体';
end;

procedure TfrmsignA.RadioButton4Click(Sender: TObject);
begin
  if RadioButton4.Checked then
    DisplayDirct := False;
  SendList.Font.Name := '@宋体';
end;

procedure TfrmsignA.SendGridSelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
var
  i, j: integer;
  tt: integer;
begin
  for i := 0 to SendGrid.RowCount - 1 do
  begin
    if SendGrid.RowSelectCount <> 0 then
      SendGrid.RowSelect[i] := False
    else
      Break;
  end;
  SendString[1] := '';
  SendString[2] := '';
  j := 1;
  if SendLine = 2 then
    tt := Arow + 1
  else
    tt := ARow;
  for i := ARow to tt do
  begin
    CanSelect := False;
    SendGrid.RowSelect[i] := True;
    SendString[j] := SendGrid.Cells[1, i];
    j := j + 1;
  end;
  if SendLine = 2 then
    if Arow > 2 then
      SendMessage(SendGrid.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
    else
      SendMessage(SendGrid.Handle, WM_VSCROLL, SB_LINEDOWN, 0);
  CanSelect := True;
end;

procedure TfrmsignA.FileListBox1DblClick(Sender: TObject);
begin
  Edit1.Text := FileListBox1.FileName;
end;

procedure TfrmsignA.DownItem;
begin
  if (CurrentLine + 1) = SendGrid.RowCount then
    exit;
  if (SendGrid.row + 4) <= Sendgrid.RowCount then
    if SendLine = 2 then
      Sendgrid.row := Sendgrid.row + 1;
end;

procedure TfrmsignA.UpItem;
begin
  if (SendGrid.row - 1) < 0 then
    SendGrid.row := 0
  else
    if SendLine = 2 then
    Sendgrid.row := Sendgrid.row - 1;

end;

procedure TfrmsignA.ZMTOTXT(FileName: string);
var
  CFile: TextFile;
  i: integer;
  s: string;
begin
  MeMo1.Clear;
  AssignFile(CFile, FileName);
  Reset(CFile);
  i := 0;
  while not eof(Cfile) do
  begin
    Application.ProcessMessages;
    Readln(CFile, S);
    if Trim(s) = '' then
    begin
      if i = 2 then
      begin
	i := 0;
	Continue;
      end
      else
      begin
	i := 0;
	Memo1.Lines.Add('');
      end;
    end
    else
    begin
      Memo1.Lines.Add(s);
      i := i + 1;
    end;
  end;
  CloseFile(CFile);
end;

procedure TfrmsignA.RzBitBtn1Click(Sender: TObject);
begin
  if Trim(Edit1.Text) = '' then
  begin
    showmessage('请输入要转换的文件名');
    exit;
  end;
  RzBitBtn1.Enabled:=False;
  ZMTOTXT(Edit1.text);
  RzBitBtn1.Enabled:=True;
end;

procedure TfrmsignA.RadioButton6Click(Sender: TObject);
begin
if RadioButton6.Checked then
	Big5:=True
else
	Big5:=False;

end;

procedure TfrmsignA.RadioButton5Click(Sender: TObject);
begin
if RadioButton5.Checked then
	Big5:=False
else
	Big5:=True;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -