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

📄 declare.pas

📁 《管状换热器计算机辅助设计系统ExhCAD绘图系统(版本:1.01a Final)》为自由软件
💻 PAS
字号:
unit Declare;

interface

uses SysUtils;

type AirPhysicsData=record
      t:real;
      p:real;
      cp:real;
      r: real;
      u: real;
      v: real;
      pr:real;
end;

type FumePhysicsData=record
      t:real;
      p:real;
      cp:real;
      r: real;
      u: real;
      v: real;
      pr:real;
end;

type PipLenData=record
      ld:real;
      cl:real;
end;

type PipRowData=record
      rn:integer;
      cn:array[1..2] of Real; 
end;


var AirPhysicsElement:AirPhysicsData;
    FumePhysicsElement:FumePhysicsData;
    PipLenElement:PipLenData;
    PipRowElement:PipRowData;



procedure WriteAirPhysicsFile(filename:string);
procedure ReadAirPhysicsFile(filename:string);
procedure WritefumePhysicsFile(filename:string);
procedure ReadfumePhysicsFile(filename:string);
procedure WritepiplenFile(filename:string);
procedure ReadpiplenFile(filename:string);
procedure WritepiprowFile(filename:string);
procedure ReadpiprowFile(filename:string);
procedure InitialDataManager;


implementation

uses DataManager;

procedure WritepiprowFile(filename:string);
var fileno:file;
var  i:integer;
begin
   
   AssignFile(fileno, filename);
   Rewrite(fileno,1);
   for i:= 1 to piprownum-1 do
   begin

     piprowElement.rn  :=strtoint(DataManagerForm.piprowstringgrid.Cells[1,i]);
     piprowElement.cn[1] :=strtofloat(DataManagerForm.piprowstringgrid.Cells[2,i]);
     piprowElement.cn[2] :=strtofloat(DataManagerForm.piprowstringgrid.Cells[3,i]);

     BlockWrite(fileno, piprowElement, SizeOf(piprowData));

   end;
   CloseFile(fileno);
end;

procedure ReadpiprowFile(filename:string);
var fileno:file; i:integer;
begin
   AssignFile(fileno, filename);
   Reset(fileno,1);
   for i:= 1 to piprownum-1  do
   begin
       BlockRead(fileno, piprowElement, SizeOf(piprowData));
       DataManagerForm.piprowstringgrid.Cells[0,i]:=inttostr(i);

       DataManagerForm.piprowstringgrid.Cells[1,i]:=inttostr(piprowElement.rn  );
       DataManagerForm.piprowstringgrid.Cells[2,i]:=floattostr(piprowElement.cn[1]);
       DataManagerForm.piprowstringgrid.Cells[3,i]:=floattostr(piprowElement.cn[2]);
    end;
   CloseFile(fileno);
end;



procedure WritepiplenFile(filename:string);
var fileno:file;
var  i:integer;
begin
   AssignFile(fileno, filename);
   Rewrite(fileno,1);
   for i:= 1 to piplennum-1 do
   begin

     piplenElement.ld :=strtofloat(DataManagerForm.piplenstringgrid.Cells[1,i]);
     piplenElement.cl :=strtofloat(DataManagerForm.piplenstringgrid.Cells[2,i]);

     BlockWrite(fileno, piplenElement, SizeOf(piplenData));

   end;
   CloseFile(fileno);
end;

procedure ReadpiplenFile(filename:string);
var fileno:file; i:integer;
begin
   AssignFile(fileno, filename);
   Reset(fileno,1);
   for i:= 1 to piplennum-1  do
   begin
       BlockRead(fileno, piplenElement, SizeOf(piplenData));
       DataManagerForm.piplenstringgrid.Cells[0,i]:=inttostr(i);

       DataManagerForm.piplenstringgrid.Cells[1,i]:=floattostr(piplenElement.ld );
       DataManagerForm.piplenstringgrid.Cells[2,i]:=floattostr(piplenElement.cl);
    end;
   CloseFile(fileno);
end;



procedure WriteAirPhysicsFile(filename:string);
var fileno:file;
var  i:integer;
begin
   AssignFile(fileno, filename);
   Rewrite(fileno,1);
   for i:= 1 to  airphynum-1 do
   begin

     airphysicsElement.t:=strtofloat(DataManagerForm.airphystringgrid.Cells[1,i]);
     airphysicsElement.p:=strtofloat(DataManagerForm.airphystringgrid.Cells[2,i]);
     airphysicsElement.cp:=strtofloat(DataManagerForm.airphystringgrid.Cells[3,i]);
     airphysicsElement.r:=strtofloat(DataManagerForm.airphystringgrid.Cells[4,i]);

     airphysicsElement.u:=strtofloat(DataManagerForm.airphystringgrid.Cells[5,i]);
     airphysicsElement.v:=strtofloat(DataManagerForm.airphystringgrid.Cells[6,i]);
     airphysicsElement.pr:=strtofloat(DataManagerForm.airphystringgrid.Cells[7,i]);

     BlockWrite(fileno, AirPhysicsElement, SizeOf(AirPhysicsData));

   end;
   CloseFile(fileno);
end;

procedure ReadAirPhysicsFile(filename:string);
var fileno:file; i:integer;
begin
   AssignFile(fileno, filename);
   Reset(fileno,1);
   for i:= 1 to airphynum-1  do
   begin
       BlockRead(fileno, AirPhysicsElement, SizeOf(AirPhysicsData));
       DataManagerForm.airphystringgrid.Cells[0,i]:=inttostr(i);

       DataManagerForm.airphystringgrid.Cells[1,i]:=floattostr(airphysicsElement.t);
       DataManagerForm.airphystringgrid.Cells[2,i]:=floattostr(airphysicsElement.p);
       DataManagerForm.airphystringgrid.Cells[3,i]:=floattostr(airphysicsElement.cp);
       DataManagerForm.airphystringgrid.Cells[4,i]:=floattostr(airphysicsElement.r);

       DataManagerForm.airphystringgrid.Cells[5,i]:=floattostr(airphysicsElement.u);
       DataManagerForm.airphystringgrid.Cells[6,i]:=floattostr(airphysicsElement.v);
       DataManagerForm.airphystringgrid.Cells[7,i]:=floattostr(airphysicsElement.pr);
    end;
   CloseFile(fileno);
end;

procedure WritefumePhysicsFile(filename:string);
var fileno:file;
var  i:integer;
begin
   AssignFile(fileno, filename);
   Rewrite(fileno,1);
   for i:= 1 to fumephynum-1 do
   begin

     fumephysicsElement.t:=strtofloat(DataManagerForm.fumephystringgrid.Cells[1,i]);
     fumephysicsElement.p:=strtofloat(DataManagerForm.fumephystringgrid.Cells[2,i]);
     fumephysicsElement.cp:=strtofloat(DataManagerForm.fumephystringgrid.Cells[3,i]);
     fumephysicsElement.r:=strtofloat(DataManagerForm.fumephystringgrid.Cells[4,i]);

     fumephysicsElement.u:=strtofloat(DataManagerForm.fumephystringgrid.Cells[5,i]);
     fumephysicsElement.v:=strtofloat(DataManagerForm.fumephystringgrid.Cells[6,i]);
     fumephysicsElement.pr:=strtofloat(DataManagerForm.fumephystringgrid.Cells[7,i]);

     BlockWrite(fileno, fumePhysicsElement, SizeOf(fumePhysicsData));

   end;
   CloseFile(fileno);
end;

procedure ReadFumePhysicsFile(filename:string);
var fileno:file; i:integer;
begin
   AssignFile(fileno, filename);
   Reset(fileno,1);
   for i:= 1 to fumephynum-1  do
   begin
       BlockRead(fileno, FumePhysicsElement, SizeOf(fumePhysicsData));
       DataManagerForm.fumephystringgrid.Cells[0,i]:=inttostr(i);

       DataManagerForm.fumephystringgrid.Cells[1,i]:=floattostr(fumephysicsElement.t);
       DataManagerForm.fumephystringgrid.Cells[2,i]:=floattostr(fumephysicsElement.p);
       DataManagerForm.fumephystringgrid.Cells[3,i]:=floattostr(fumephysicsElement.cp);
       DataManagerForm.fumephystringgrid.Cells[4,i]:=floattostr(fumephysicsElement.r);

       DataManagerForm.fumephystringgrid.Cells[5,i]:=floattostr(fumephysicsElement.u);
       DataManagerForm.fumephystringgrid.Cells[6,i]:=floattostr(fumephysicsElement.v);
       DataManagerForm.fumephystringgrid.Cells[7,i]:=floattostr(fumephysicsElement.pr);
    end;
   CloseFile(fileno);
end;

procedure InitialDataManager;
begin
     DataManagerForm.airphystringgrid.ColCount :=8;
     DataManagerForm.airphystringgrid.RowCount :=AirphyNum;
     DataManagerForm.airphystringgrid.Cells[0,0]:='序号';
     DataManagerForm.airphystringgrid.Cells[1,0]:='温度';
     DataManagerForm.airphystringgrid.Cells[2,0]:='密度';
     DataManagerForm.airphystringgrid.Cells[3,0]:='比热';
     DataManagerForm.airphystringgrid.Cells[4,0]:='导热系数';
     DataManagerForm.airphystringgrid.Cells[5,0]:='运动粘度';
     DataManagerForm.airphystringgrid.Cells[6,0]:='动力粘度';
     DataManagerForm.airphystringgrid.Cells[7,0]:='普朗特数';

     DataManagerForm.fumephystringgrid.ColCount :=8;
     DataManagerForm.fumephystringgrid.RowCount :=Fumephynum;
     DataManagerForm.fumephystringgrid.Cells[0,0]:='序号';
     DataManagerForm.fumephystringgrid.Cells[1,0]:='温度';
     DataManagerForm.fumephystringgrid.Cells[2,0]:='密度';
     DataManagerForm.fumephystringgrid.Cells[3,0]:='比热';
     DataManagerForm.fumephystringgrid.Cells[4,0]:='导热系数';
     DataManagerForm.fumephystringgrid.Cells[5,0]:='运动粘度';
     DataManagerForm.fumephystringgrid.Cells[6,0]:='动力粘度';
     DataManagerForm.fumephystringgrid.Cells[7,0]:='普朗特数';

     DataManagerForm.piplenstringgrid.ColCount :=3;
     DataManagerForm.piplenstringgrid.RowCount :=piplennum;
     DataManagerForm.piplenstringgrid.Cells[0,0]:='序号';
     DataManagerForm.piplenstringgrid.Cells[1,0]:='管长与管径的比值';
     DataManagerForm.piplenstringgrid.Cells[2,0]:='修正值';

     DataManagerForm.piprowstringgrid.ColCount :=4;
     DataManagerForm.piprowstringgrid.RowCount :=piprownum;
     DataManagerForm. piprowstringgrid.Cells[0,0]:='序号';
     DataManagerForm. piprowstringgrid.Cells[1,0]:='管排数';
     DataManagerForm. piprowstringgrid.Cells[2,0]:='错排修正值';
     DataManagerForm. piprowstringgrid.Cells[3,0]:='顺排修正值';

end;





end.

⌨️ 快捷键说明

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