📄 unregrobjects.pas
字号:
unit unRegrObjects;
//{$define GTA3000}
interface
uses SysUtils, DbTables, DB, BDE, Dialogs, Classes,Inifiles, Controls,
Variants;
const maxCoeffCount = 36;
const maxMaterTypes = 32; //0 - 黚er alle sorten
const maxPeakCount = 56;
const maxCalibrSubstCount = 50;
const maxErrorCount = 8;
const maxCompareRecCount = 30;
const prefRegForm = 'RegForm';
const prefCalibrTable = 'Calibration';
const ConfigFileName = 'OXEA_Calibr.ini';
const prefRegrField = 'Regr_';
prefLabField = 'Labor_';
prefUseField = 'Used_';
prefLOOCVfield = 'LOOCV_';
const UserDef = 'UserDef';
DefSamplTableName = 'CalibrData.db';
DefLabTableName = 'LabValues.db';
const FormRefTabName = 'FormRef.db';
const PeaksTableName = 'Peaks.db';
const MaterTypesTabName = 'Types.db';
const maxIterationsCount : Byte = 100;
const ConcAcuracy : Double = 1E-10; //rel %
//data operation types 15.07.2005
Calib = 0;
LOOCV = 1;
ExVal = 2;
Predt = 3;
const //language
Germ = 0;
Engl = 1;
Russ = 2;
const
AddUserValuesCount = 11;
AddUserValueNames : array[0..AddUserValuesCount - 1] of string =
( 'Ash',
'Moist',
'CV',
'SO2',
'PRB',
'Volatile',
'UserDef1',
'UserDef2',
'UserDef3',
'UserDef4',
'UserDef5');
ComToRel : string = 'ACTR'; // asche compton to rel.
ElmSum : string = 'ElmSum';
type
TUserData = record //class for calculation of user concentrations for OXEA Analysis
CalibTableName : string; //depend on type 'Calibration0.db'
IterationsCount : Byte; //count of iterations by using concentrations in the formula
IterationsCountC : Byte; //count of iterations by using concentrations in the formula
IterationsCountLOOCV : Byte; //count of iterations by using concentrations in the formula
IterationsCountV : Byte; //count of iterations by using concentrations in the formula
IterationsCountCV : Byte; //count of iterations by using concentrations in the formula
//all user values
AvalableElemCount : Byte; //Elementen anzahl aus Peaks.db, die theoretisch kalibriert werden k鰊nen
AvalableElemSymbol : array[0..maxCalibrSubstCount-1] of string; //Alle Elements aus Peaks.db : Si, Fe ..
AvalableElemName : array[0..maxCalibrSubstCount-1] of string; //Alle Elements aus Peaks.db : Silicon
//user values, Calibrated
CalibrSubstCount : Byte; //count of calibrated !!! concentrations /subst.
CalibrSubstName : array[0..maxCalibrSubstCount - 1] of string; //names such Si or Moist
CalibrSubstLabel : array[0..maxCalibrSubstCount - 1] of string; //labels such Silicon
Concentration : array[0..maxCalibrSubstCount - 1] of Double; //array for concentrations
ConcentrSave : array[0..maxCalibrSubstCount - 1] of Double; //array for concentrations save
CalibrStdDev : array[0..maxCalibrSubstCount - 1] of Double; //Std. Dev. of calibration
CalibrSubstAtomN : array[0..maxCalibrSubstCount - 1] of Byte; //Atomic number for show
CalibrSubstPeakE : array[0..maxCalibrSubstCount - 1] of Double; //Peak energy for show
//Error, Status
Error : array[1..maxErrorCount] of Boolean; //Register f黵 Fehlersituationen, Modbus
Status : array[1..maxErrorCount] of Boolean;
//All measured peaks and values such mwphase...
PeakCount : integer; //anzahl von verwendeten Peaks/Rohwerte incl Mikrowelle und Sum, Bksc alle!!!
PeakFieldName : array[0..maxPeakCount - 1] of string; //names of row values incl. peaks and add. values such phase or atten.
PeakLabel : array[0..maxPeakCount - 1] of string; //labels of row values with '-' symbol instead '_' one
PeakValue : array[0..maxPeakCount - 1] of Double; //row values
PeakEnergy : array[0..maxPeakCount - 1] of Double;
//Fe: Ka+Kb+esc...
FullAreaFieldName : array[0..maxCalibrSubstCount-1] of string; //names of row values incl. peaks and add. values such phase or atten.
FullAreaLabel : array[0..maxCalibrSubstCount-1] of string; //labels of row values with '-' symbol instead '_' one
FullAreaValue : array[0..maxCalibrSubstCount-1] of Double; //row values
//selected values for calculations, similar to TRegression
// FormulaValue1 : array[0..maxCoeffCount - 1] of Double;// Concentration[I] := FormulaArray[I].Coeff.* FormulaValue1 * FormulaValue2
// FormulaValue2 : array[0..maxCoeffCount - 1] of Double;
//OUT
MeasNum : LongInt;
MeasDateTime : TDateTime;
MeasIsValid : Boolean;
AR_Values : Boolean; //As received or dry bases values calculated
//measurement values
MeasStartDate : TDate;
MeasStartTime : TTime;
LiveTime : Double; //s
RealTime : Double; //s
DeadTime : Double;
FitStdDev : Double;
CountRate : Double; //count rate [cps]
IntCounts : LongInt; //integral count of spectrum [cts]
ErrorCode : LongInt; //error code (bits, see dBase definition)
AreaCorrectActive : Boolean; //ob Fl鋍henkorrektur stattfinden sollte; die anderen parameter sind in TAreaCorrect class
ProbusWarn : array[1..32] of Boolean; //warnungen f黵 Profibus Telegramm
//17.10.05
DetTemp : Single; //detector t
TubeTemp : Single; //x-ray tube t
SBoxTemp : Single; //sensor box t
TubekV : Single; //U tube, kV
TubemA : Single; //I tube mA
TubeFil : Single;
Flow3 : Single; //He l/h
Flow1 : Single; //nitrogen for sensorbox
Flow2 : Single; //Nitrogen for window
TubeHours : Word; //tube work hours
TubeMinuts : LongWord; //tube work minuts
MeasCounter : Word;
//added by Ma to record the User defined peak in calibration files.
elename : array[0..16] of string; //remember the userdefined peak; added by ma;
elenamearea : array[0..16] of single;
userpeakcount : word;
end;
TConfig = record
CurrentAlias : string; //current DB
UseAlias : Boolean;
//Current Fields coresponds to Substance
RegrFieldName : string;
LOOCVFieldName : string;
LabFieldName : string;
UseFieldName : string;
//Names, Tables
SamplTableName : string;
LaborTableName : string;
TypesTableName : string;
RowDataTableName : string;
ChartTitle : string;
//Material type
CurrentTypeNo : Byte; //laufende Typ Nr
MaterTypeNames : array[0..maxMaterTypes] of string; ///nicht -1
MaterTypeName : string;
//
LifeShowSpr : Boolean;
Language : Byte;
//Project
ProjectName : string; //mit verzeichniss
ProgramLocation : string; //program location
SPrgName : string; //ohne verzeichniss
XRFTablesPath : string; //Verzeichnis mit den Paradox Tabellen
XRFSprPath : string;
DataProjDir : string;
SubstCount : Byte;
SubstName : array[0..maxPeakCount - 1] of string; //namen wie Si
SubstLabel : array[0..maxPeakCount - 1] of string; //labels wie Silizium
SubstNo : Byte; //laufend
FloatPrec : Byte;
PreparedCalc : Boolean;
//29.06.05 fitting range
LoChan : Word; //ROI for spectrum if X is a spectrum
HiChan : Word;
//13.07.2005
AlteredFields : Word;
end;
function PeakLabelToSQLName(PeakLabel : string) : string;
implementation
function PeakLabelToSQLName(PeakLabel : string) : string;
var I : Byte;
begin
Result := PeakLabel;
for I := 1 to Length(Result) do
if Result[I] = '-' then
Result[I] := '_';
end;
//----------------------------------------------------------------------------
// User data class
//----------------------------------------------------------------------------
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -