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

📄 新建 文本文档 (4).txt

📁 完成Linux下的串口程序,串口发送延时程序
💻 TXT
字号:
1  SendAgenda(objOnLineAddr, grdAgenda.DataSource.DataSet.FieldByName('CONTENT').AsString, grdAgenda.DataSource.DataSet.FieldByName('ORDER_NO').AsString + UpperCase('.TXT'));

//此函数完成写议程文稿
function TFrmSendMsg.SendAgenda(Addr: TStrings; Content, FileName: string): Boolean;
var
  i, intFileLineCount: integer;
  boolExisted, boolSuccess: Boolean;
begin
  Result := False;

  if Addr.Count < 1 then
  begin
    AppendOutMsg('请指定发送对象或者要指定发送的对象不在线!');
    Exit;
  end;
  if (Content = '') then
  begin
    AppendOutMsg('议程内容为空!,请先上传议程内容');
    Exit;
  end;


  try
    for i := Low(arrAgendaFileLines[0]) to High(arrAgendaFileLines[0]) do
    begin
      if arrAgendaFileLines[0, i] = FileName then
      begin
        intFileLineCount := StrToInt(arrAgendaFileLines[1, i]);
        break;
      end;
    end;

    for i := 0 to Addr.Count - 1 do
    begin
      if objOnlineAddr.IndexOf(Addr[i]) < 0 then
      begin
        AppendOutMsg('“' + Addr[i] + '”号桌牌不在线,没有上传“议程清单文件”!');
        continue;
      end;

      if FileExist(Addr[i], FileName, boolExisted, ComPort) then
      begin
        if boolExisted then
        begin
          boolSuccess := False;
          if(TempLocal<>SelChangeLine) then //假如已经改变了,选择的是否换行
          begin
            TempLocal := SelChangeLine;
            DelFile(Addr[i], FileName, boolSuccess, ComPort);//删除下位机中的文件
            AppendOutMsg('删除了“' + Addr[i] + '”号桌牌中的“议程文稿”!');
          end
          else
          if(TxtChange=true) then
          begin
            TxtChange := False;
            arrAgendaFileLines[0, i] := FileName;
            arrAgendaFileLines[1, i] := IntToStr(TxtFileLineCount(strCurConDir + FileName));
            arrAgendaFileLines[2, i] := RightStr('0000' + IntToStr(i), 4);;
            arrAgendaFileLines[3, i] := objName[objAddr.Indexof(Addr[i])];
            intFileLineCount := StrToInt(arrAgendaFileLines[1, i]);
            DelFile(Addr[i], FileName, boolSuccess, ComPort);//删除下位机中的文件
            AppendOutMsg('删除了“' + Addr[i] + '”号桌牌中的“议程文稿”!');
          end
          else
          begin
          if not cdsFileList.Locate('addr;file_name', VarArrayOf([Addr[i], FileName]), []) then
          begin
            DelFile(Addr[i], FileName, boolSuccess, ComPort);//删除下位机中的文件
            AppendOutMsg('删除了“' + Addr[i] + '”号桌牌中的“议程文稿”!');
          end
          else begin
            AppendOutMsg('“' + Addr[i] + '”号桌牌中的“议程文稿”已经存在,上传中断!');
            continue;
          end;
          end;
        end;
      end;

      boolSuccess := False;
      boolTimerEnabled := tmrAuto.Enabled;
      tmrAuto.Enabled := False;

      lblAlarm.Caption := '正在上传文件,请不要进行任何操作!,请稍等';
      lblAlarm.Repaint;

      //此函数完成创建议程文稿
      //写模式打开新文件(不能是系统文件)
      if (not OpenFile(Addr[i], FileName, boolSuccess, ComPort)) or (not boolSuccess) then//创建文件,文件名统一
      begin
        AppendOutMsg('创建“' + Addr[i] + '”号桌牌中的“议程文稿”时出错 或者是打开议程文件出错!');
        continue;
      end;


      //此函数完成向议程文稿中写入数据
      boolSuccess := False;
      if (not WriteFlie(Addr[i], strCurConDir + FileName, boolSuccess, ComPort)) or (not boolSuccess) then
      begin
        AppendOutMsg('向“' + Addr[i] + '”号桌牌中的“议程文稿”写入数据时出错,上传中断!');
        continue;
      end;

      boolSuccess := False;

      //此函数完成议程文稿的关闭
      if (not CloseFlie(Addr[i], boolSuccess, ComPort)) or (not boolSuccess) then
      begin
        AppendOutMsg('关闭“' + Addr[i] + '”号桌牌中的“议程文稿”时出错,上传中断!');
        continue;
      end;

      //此函数完成议程文稿的成功
      SaveToFileList(strCurConferenceID, Addr[i], FileName, intFileLineCount);
      AppendOutMsg('向“' + Addr[i] + '”号桌牌发送“议程文稿”成功!');

      lblAlarm.Caption := '';
      lblAlarm.Repaint;
    end;

    Result := True;
  finally
    tmrAuto.Enabled := boolTimerEnabled;
  end;
end;

  这个函数是完成上传文本信息


2  SetScrollSpeed(objTemp, intManuscriptScrollSpeed, boolSuccess, ComPort)

  这个函数是完成滚动速度情况

⌨️ 快捷键说明

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