这是DLL:
library BFMatRevLib;
uses
SysUtils,
BFMatRevInt,
Classes;
{$R *.res}
function BFOreRev(OreComponentTest
OreComponentTest;OreComponentRev
OreComponentRev):boolean;stdcall;
var
TFe_Test,P_Test,S_Test,FeO_Test,CaO_Test,MgO_Test,SiO2_Test,Al2O3_Test,
MnO_Test,K2O_Test,Na2O_Test,TiO2_Test,Lost_Test,Proportion_Test : Double
//检测成分
Name_Test : string;
TFe_Rev,P2O5_Rev,FeS2_Rev,FeO_Rev,Fe2O3_Rev,CaO_Rev,MgO_Rev,SiO2_Rev,
Al2O3_Rev,MnO2_Rev,K2O_Rev,Na2O_Rev,TiO2_Rev,Lost_Rev,Proportion_Rev : Double
//校正成分
Name_Rev : string;
Total_Component : Double;
iscomplete : boolean;
begin
{ //检测误差 P5 table 1-2
TFe_error := 0.5;
P_error := 0.005;
P2O5_error := P_error*142/62;
S_error := 0.005;
FeS2_error := S_error * 120 / 64;
FeO_error := 0.25
//待定
Fe2O3_error := (TFe_error - FeO_error*56/72 - FeS2_error*56/120)*160/112;
CaO_error := 0.4;
MgO_error := 0.25;
SiO2_error := 0.3;
Al2O3_error := 0.25;
MnO_error := 0.05;
MnO2_error := MnO_error*87/71;
Lost_error := 0.25;
Total_error := P2O5_error + FeS2_error + FeO_error + Fe2O3_error +
CaO_error + MgO_error + SiO2_error + Al2O3_error +
MnO2_error + Lost_error;
}
with OreComponentTest^ do
begin
TFe_Test := TFe;
P_Test := P;
S_Test := S;
FeO_Test := FeO;
CaO_Test := CaO;
MgO_Test := MgO;
SiO2_Test := SiO2;
Al2O3_Test := Al2O3;
MnO_Test := MnO;
K2O_Test := K2O;
Na2O_Test := Na2O;
TiO2_Test := TiO2;
Lost_Test := Lost;
Name_Test := OreName;
Proportion_Test := Proportion;
end;
TFe_Rev := TFe_Test;
P2O5_Rev := P_Test * 142 / 62;
FeS2_Rev := S_Test * 120 / 64;
FeO_Rev := FeO_Test - FeS2_Rev*72/120;
Fe2O3_Rev := (TFe_Rev - FeO_Rev*56/72 - FeS2_Rev*56/120)*160/112;
CaO_Rev := CaO_Test;
MgO_Rev := MgO_Test;
SiO2_Rev := SiO2_Test;
Al2O3_Rev := Al2O3_Test;
MnO2_Rev := MnO_Test*87/71;
K2O_Rev := K2O_Test;
Na2O_Rev := Na2O_Test;
TiO2_Rev := TiO2_Test;
Lost_Rev := Lost_Test;
Name_Rev := Name_Test;
Proportion_Rev := Proportion_Test;
with OreComponentRev^ do
begin
TFe := TFe_Rev;
P2O5 := P2O5_Rev;
FeS2 := FeS2_Rev;
FeO := FeO_Rev;
Fe2O3 := Fe2O3_Rev;
CaO := CaO_Rev;
MgO := MgO_Rev;
SiO2 := SiO2_Rev;
Al2O3 := Al2O3_Rev;
MnO2 := MnO2_Rev;
K2O := K2O_Rev;
Na2O := Na2O_Rev;
TiO2 := TiO2_Rev;
Lost := Lost_Rev;
Total_Component := P2O5 + FeS2 + FeO + Fe2O3 +
CaO + MgO + SiO2 + Al2O3 + MnO2 +
K2O + Na2O + TiO2 + Lost;
MeO := 100 - Total_Component;
OreName := Name_Rev;
Proportion := Proportion_Rev;
end;
if abs(100 - Total_Component)>3 then
iscomplete := false
else
iscomplete := true;
Result := iscomplete;
end;
exports
BFOreRev;
begin
end.