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

📄 tp800_delphi.pas

📁 数据采集器TP850数据通讯程序!用者下载
💻 PAS
📖 第 1 页 / 共 2 页
字号:
   if opendialog1.execute then
     BEGIN
    edit3.text:=opendialog1.FileName;
     END;
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
    progressbar1.Position:=0;
    //messagedlg(inttostr(nport),mtinformation,[mbok],0);
    //messagedlg(inttostr(nbaud),mtinformation,[mbok],0);
   if (edit3.Text='')  then
   begin
       messagedlg('无可用文件!!!',mtInformation,[mbok],0);
       exit;
   end;

nresult3:= thrdSendMifToHc(nport,nbaud,edit3.Text,1,ncover);
//messagedlg(inttostr(nresult),mtInformation,[mbok],0);

           repeat
           progressbar1.Position:=thrdQueryPercent();
           //percent:=progressbar1.Position;
           //until percent=100 ;
           n:=thrdQueryStatus();
           until (n=0) or (n=32768) ;

          //messagedlg('PPPPPPP!',mtinformation,[mbok],0);

     //repeat
     //n:=thrdQueryStatus();
     //until n=0 or 32768 ;

      if (n=0) then
   //if (nresult3=0) then
       begin

            messagedlg('恭喜您!文件发送成功!',mtinformation,[mbok],0);
       end;

       if (n=32768) then
          begin
            messagedlg('很遗憾,发送失败!!!',mtinformation,[mbok],0);
       end;

  if (nresult3<>0) then
    begin
      GetErrorMsg(errorcode,lpszerrormsg);
      messagedlg(trim(lpszerrormsg),mtInformation,[mbok],0);
    end;
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
  if (edit4.text='') then
     begin
         messagedlg('很遗憾,文件不存在!!!',mtInformation,[mbok],0);
         exit;
     end;
  nresult1:=DelHcFile(nPort,nBaud,edit4.text,2);
  messagedlg(inttostr(nresult1),mtInformation,[mbok],0);
   if nresult1=0 then
      begin
      messagedlg('成功!',mtInformation,[mbok],0);
      end
   else
      begin
      messagedlg('失败!',mtInformation,[mbok],0);
      end;

end;

procedure TForm1.Button9Click(Sender: TObject);
begin
      if (edit5.text='') then
     begin
         messagedlg('很遗憾,文件不存在!!!',mtInformation,[mbok],0);
         exit;
     end;
  nresult1:=DelHcMif(nPort,nBaud,edit5.text,2);
  messagedlg(inttostr(nresult1),mtInformation,[mbok],0);
     if nresult1=0 then
        begin
          messagedlg('成功!',mtinformation,[mbok],0);
        end
     else
        begin
          messagedlg('失败!',mtinformation,[mbok],0);
        end;

end;

procedure TForm1.Button11Click(Sender: TObject);
begin
   if (edit6.text='') or (edit6.text='\') then
      begin
         messagedlg('接收文件不存在!!!',mtinformation,[mbok],0);
         exit;
      end;

nresult2:=GetHcFile(nPort, nBaud, edit6.text,edit7.text,ncover);

messagedlg(inttostr(nresult2),mtInformation,[mbok],0);
    if nresult2=0 then
       begin
          messagedlg('成功!',mtinformation,[mbok],0);
       end
    else
       begin
          messagedlg('失败!',mtinformation,[mbok],0);
       end;
end;

procedure TForm1.Button12Click(Sender: TObject);
begin
  opendialog1.Filter := '文件(*.*)|*.*';
  pcfile:=opendialog1.Execute;
    if pcfile then
       begin
          edit7.Text:=opendialog1.FileName;
       end;
end;

procedure TForm1.Button10Click(Sender: TObject);
var
  ndir:integer;

begin
if edit9.text='' then
   begin
   messagedlg('请指定文件路径!',mtInformation,[mbok],0);
   exit;
   end;
ndir:=GetHcSysInfo(nport, nbaud, edit9.Text, 0);

messagedlg(inttostr(ndir),mtInformation,[mbok],0);
if ndir=0  then
   begin
      messagedlg('成功!!!',mtInformation,[mbok],0);
      
   end

else 
    begin
      messagedlg('失败!!!',mtInformation,[mbok],0);
    end;

//Begin

//  with Application do
//  begin
//    //NormalizeTopMosts;
//    MessageBox('test!!!', 'Look', MB_OK);
//    //RestoreTopMosts;
//  end;
//end;

//messagedlg(mingzi,mtInformation,[mbok],0);

end;

procedure TForm1.Button14Click(Sender: TObject);
var
make:string;
mdir:integer;

begin
mdir:= HcMakeDir(nport,nbaud, edit8.text);
   if mdir=0 then
     begin
      messagedlg('finishi!!!',mtInformation,[mbok],0);
     end
   else
     begin
       messagedlg('fail!!!',mtInformation,[mbok],0);
     end;
end;

procedure TForm1.Button13Click(Sender: TObject);
var
  gmif:integer;

begin
   progressbar2.Position:=0;
   if (edit10.Text='') or (edit10.text='\') then
      begin
      messagedlg('请指定文件!',mtInformation,[mbok],0);
      exit;
      end;

   gmif:=thrdGetHcMif(nport,nbaud, edit10.Text,2);

           repeat
           progressbar2.Position:=thrdQueryPercent();
           //percent:=progressbar1.Position;
           n:=thrdQueryStatus();
           until (n=0) or (n=32768) ;

     if n=0  then
        begin
         messagedlg('成功!!!',mtInformation,[mbok],0);
        end

    else 
        begin
          messagedlg('失败!!!',mtInformation,[mbok],0);
        end;
end;

procedure TForm1.Button15Click(Sender: TObject);
var
 ddir:integer;
begin
ddir:=HcDelDir(nport, nbaud, edit8.Text);
messagedlg(inttostr(ddir),mtinformation,[mbok],0);
    if ddir=0 then
       begin
         messagedlg('成功!',mtinformation,[mbok],0);
       end
    else
       begin
         messagedlg('失败!',mtinformation,[mbok],0);
       end;


end;

procedure TForm1.Button16Click(Sender: TObject);
begin
   progressbar2.Position:=0;
   if (edit6.text='') or (edit6.Text='\') then
      begin
         messagedlg('接收文件不存在!!!',mtinformation,[mbok],0);
         exit;
      end;

nresult2:=thrdGetHcFile(nPort, nBaud, edit6.text,edit7.text,ncover);
           repeat
           progressbar2.Position:=thrdQueryPercent();
           //percent:=progressbar1.Position;
           n:=thrdQueryStatus();
           until (n=0) or (n=32768) ;

messagedlg(inttostr(n),mtInformation,[mbok],0);
    if n=0 then
       begin
          messagedlg('成功!',mtinformation,[mbok],0);
       end
    else
       begin
          messagedlg('失败!',mtinformation,[mbok],0);
       end;
end;

procedure TForm1.Button17Click(Sender: TObject);

begin
hcnum:='          ';
num:=99;

num:=thrdGetHcNum(nport,nbaud,hcnum);
if num=0 then
   begin
       messagedlg(hcnum,mtinformation,[mbok],0);

   end
else
   begin
       messagedlg('失败!',mtinformation,[mbok],0);

   end;

end;

procedure TForm1.Button18Click(Sender: TObject);


begin
verdll:=99;
verdll:=GetDllVer() ;

if verdll<>-1 then
   begin
     dllver:=verdll;
   end;

messagedlg(inttostr(dllver),mtinformation,[mbok],0);
end;

procedure TForm1.Button19Click(Sender: TObject);
var
save:integer;

begin
save:=99;

//progressbar3.Position:=0;
   if (edit11.Text='拯救映像路径(*.map)') or (edit11.Text='') then
       begin
       messagedlg('无效路径!',mtinformation,[mbok],0);
       exit;
       end;

       n:=99;

  save:=HcRescue(nport, nbaud, edit11.Text);
           repeat
         // progressbar3.Position:=thrdQueryPercent();
           n:=thrdQueryStatus();
           until (n=0) or (n=1) or (n=32768);

           messagedlg('返回值:'+inttostr(save),mtinformation,[mbok],0);

   if save=0 then
      begin
      messagedlg('成功!',mtinformation,[mbok],0);
      end
   else
      begin
       messagedlg('失败!',mtinformation,[mbok],0);
      end;

end;



end.

⌨️ 快捷键说明

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