Statistiques
| Révision:

root / UFRapBesLactT.pas @ 3

Historique | Voir | Annoter | Télécharger (7,684 ko)

1
unit UFRapBesLactT ;
2

    
3
interface
4

    
5
uses
6
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7
  Dialogs, OleCtrls, StdCtrls, ComCtrls, DB, DBClient, ExtCtrls, Math, QRCtrls,
8
  QuickRpt, QRPrntr, MidasLib, UVariables, gnugettext;
9

    
10
type
11
  TFRapBesLactT = class(TForm)
12
    QRRapport: TQuickRep;
13
    PHBRapport: TQRBand;
14
    DBRapport: TQRBand;
15
    QRLTitre: TQRLabel;
16
    CDSRapport: TClientDataSet;
17
    IFPortee: TIntegerField;
18
    FFGMQPort: TFloatField;
19
    FFPdsMB: TFloatField;
20
    FFP2MB: TFloatField;
21
    IFDureeLact: TIntegerField;
22
    FFBesEMEnt: TFloatField;
23
    FFBesEMLait: TFloatField;
24
    FFBesEMTot: TFloatField;
25
    FFAppED: TFloatField;
26
    FFAppEM: TFloatField;
27
    FFAppEN: TFloatField;
28
    FFBesAli: TFloatField;
29
    FFLys: TFloatField;
30
    FFMet: TFloatField;
31
    FFMetCys: TFloatField;
32
    FFTrp: TFloatField;
33
    FFThr: TFloatField;
34
    FFPhe: TFloatField;
35
    FFPheTyr: TFloatField;
36
    FFLeu: TFloatField;
37
    FFIle: TFloatField;
38
    FFVal: TFloatField;
39
    FFHis: TFloatField;
40
    FFArg: TFloatField;
41
    QREBesENTot: TQRExpr;
42
    QRLBesENTot: TQRLabel;
43
    QREPctPort: TQRExpr;
44
    QREPctEnt: TQRExpr;
45
    QRDBText3: TQRDBText;
46
    QRDBText2: TQRDBText;
47
    QRDBText1: TQRDBText;
48
    QRLPoids: TQRLabel;
49
    QRLCaract: TQRLabel;
50
    QRLMiseBas: TQRLabel;
51
    QRLP2: TQRLabel;
52
    QRLAge: TQRLabel;
53
    QRLPortee: TQRLabel;
54
    QRLSevres: TQRLabel;
55
    QRLPdsPt: TQRLabel;
56
    QRDBTPdsMB: TQRDBText;
57
    QRDBTP2MB: TQRDBText;
58
    QRDBTAgeMB: TQRDBText;
59
    QRLNRJ: TQRLabel;
60
    QRLAA: TQRLabel;
61
    QRLNRJEnt: TQRLabel;
62
    QRLNRJPort: TQRLabel;
63
    QRLNRJTot: TQRLabel;
64
    QRDBTEMEnt: TQRDBText;
65
    QRLEMEnt: TQRLabel;
66
    QRLPctEnt: TQRLabel;
67
    QRDBTEMPort: TQRDBText;
68
    QRLEMPort: TQRLabel;
69
    QRLPctPort: TQRLabel;
70
    QRDBTBesEMTot: TQRDBText;
71
    QRLBesEMTot: TQRLabel;
72
    QREArgPctLys: TQRExpr;
73
    QREHisPctLys: TQRExpr;
74
    QREValPctLys: TQRExpr;
75
    QREIlePctLys: TQRExpr;
76
    QRELeuPctLys: TQRExpr;
77
    QREPheTyrPctLys: TQRExpr;
78
    QREPhePctLys: TQRExpr;
79
    QREThrPctLys: TQRExpr;
80
    QRETrpPctLys: TQRExpr;
81
    QREMetCysPctLys: TQRExpr;
82
    QREMetPctLys: TQRExpr;
83
    QRELysPctLys: TQRExpr;
84
    QREArgAli: TQRExpr;
85
    QREHisAli: TQRExpr;
86
    QREValAli: TQRExpr;
87
    QREIleAli: TQRExpr;
88
    QRELeuAli: TQRExpr;
89
    QREPheTyrAli: TQRExpr;
90
    QREPheAli: TQRExpr;
91
    QREThrAli: TQRExpr;
92
    QRETrpAli: TQRExpr;
93
    QREMetCysAli: TQRExpr;
94
    QREMetAli: TQRExpr;
95
    QRELysAli: TQRExpr;
96
    QRLAATot: TQRLabel;
97
    QRLAAAli: TQRLabel;
98
    QRLPctLys: TQRLabel;
99
    QRLLys: TQRLabel;
100
    QRLMet: TQRLabel;
101
    QRLMetCys: TQRLabel;
102
    QRLTrp: TQRLabel;
103
    QRLThr: TQRLabel;
104
    QRLPhe: TQRLabel;
105
    QRLPheTyr: TQRLabel;
106
    QRLLeu: TQRLabel;
107
    QRLIle: TQRLabel;
108
    QRLVal: TQRLabel;
109
    QRLHis: TQRLabel;
110
    QRLArg: TQRLabel;
111
    QRDBTLysTot: TQRDBText;
112
    QRDBTMetTot: TQRDBText;
113
    QRDBTMetCysTot: TQRDBText;
114
    QRDBTTrpTot: TQRDBText;
115
    QRDBTThrTot: TQRDBText;
116
    QRDBTPheTot: TQRDBText;
117
    QRDBTPheTyrTot: TQRDBText;
118
    QRDBTLeuTot: TQRDBText;
119
    QRDBTIleTot: TQRDBText;
120
    QRDBTValTot: TQRDBText;
121
    QRDBTHisTot: TQRDBText;
122
    QRDBTArgTot: TQRDBText;
123
    QRShape1: TQRShape;
124
    QRLDeficit: TQRLabel;
125
    QRDBTBesAli: TQRDBText;
126
    QRLBesAli: TQRLabel;
127
    QREDefEN: TQRExpr;
128
    QRLDefEN: TQRLabel;
129
    QRDBTDefEM: TQRDBText;
130
    QRLDefEM: TQRLabel;
131
    QRDBTDefAli: TQRDBText;
132
    QRLDefAli: TQRLabel;
133
    FFDefEM: TFloatField;
134
    FFDefAli: TFloatField;
135
    QRLMin: TQRLabel;
136
    QRECaAli: TQRExpr;
137
    QREPAli: TQRExpr;
138
    QRLabel2: TQRLabel;
139
    QRLabel3: TQRLabel;
140
    QRLP: TQRLabel;
141
    QRLCa: TQRLabel;
142
    QRDBTPTot: TQRDBText;
143
    QRDBTCaTot: TQRDBText;
144
    FFP: TFloatField;
145
    FFCa: TFloatField;
146
    FFSevres: TFloatField;
147
    PFBRapport: TQRBand;
148
    QRLUser: TQRLabel;
149
    QRLWarning: TQRLabel;
150
    QRLabel1: TQRLabel;
151
    QRLabel4: TQRLabel;
152
    QRLabel5: TQRLabel;
153
    QRLabel6: TQRLabel;
154
    QREAppEM: TQRExpr;
155
    QREAppEN: TQRExpr;
156
    QREAppAli: TQRExpr;
157
    QRSDDate: TQRSysData;
158
    QRIInraPorc: TQRImage;
159
    QRLInraPorc: TQRLabel;
160
    procedure FormCreate(Sender: TObject);
161
  private
162
    { D?clarations priv?es }
163
  public
164
    { D?clarations publiques }
165
  end;
166

    
167
var
168
  FRapBesLactT: TFRapBesLactT;
169

    
170
implementation
171

    
172
uses
173
  UStrings, UUtil, UFBesLactT, UFPrevRap ;
174

    
175
{$R *.dfm}
176

    
177
{ TFRapBesLactT }
178

    
179
procedure TFRapBesLactT.FormCreate(Sender: TObject);
180
begin
181
  if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1
182
  then
183
    Font.Name := 'Arial Unicode MS';
184
  TranslateComponent(Self);
185
  // Licence
186
  if IsEducation and (Length (Course) > 0)
187
  then
188
    QRLUSer.Caption := Format('%s (%s)', [Course, Company])
189
  else
190
  if IsComplete or IsEducation
191
  then
192
    QRLUSer.Caption := Format('%s %s (%s)', [FirstName, LastName, Company])
193
  else
194
  if IsEvaluation
195
  then
196
    QRLUSer.Caption := StrEvaluation
197
  else
198
  begin
199
    QRLUSer.Caption := StrReadOnly;
200
    QRLUser.Font.Color := clRed;
201
  end;
202
  with CDSRapport do
203
  begin
204
    CreateDataSet;
205
    Append;
206
    FieldValues['_Portee_'] := FBesLactT.PBPortee.AsInteger ;
207
    FieldValues['_DureeLact_'] := FBesLactT.DureeLact ;
208
    FieldValues['_Sevres_'] := FBesLactT.PBSevres.AsFloat ;
209
    FieldValues['_GMQPort_'] := FBesLactT.PBGMQ.AsFloat ;
210
    FieldValues['_PdsMB_'] := FBesLactT.PBPdsApMB.AsFloat ;
211
    FieldValues['_P2MB_'] := FBesLactT.PBP2MB.AsFloat ;
212
    FieldValues['_BesEMEnt_'] := FBesLactT.BesEMEntTot ;
213
    FieldValues['_BesEMLait_'] := FBesLactT.BesEMLaitTot ;
214
    FieldValues['_BesEMTot_'] := FBesLactT.BesEMTot ;
215
    FieldValues['_AppED_'] := FBesLactT.AppEDTot ;
216
    FieldValues['_AppEM_'] := FBesLactT.AppEMTot ;
217
    FieldValues['_AppEN_'] := FBesLactT.AppENTot ;
218
    if (FBesLactT.AppEMTot = 0)
219
    then
220
      FieldValues['_BesAli_'] := 0
221
    else
222
      FieldValues['_BesAli_'] := FBesLactT.BesEMTot * FBesLactT.AppAliTot / FBesLactT.AppEMTot ;
223
    if (FBesLactT.BesEMTot > FBesLactT.AppEMTot / PProfilT.DureeLact)
224
    then // D?ficit
225
    begin
226
      FieldValues['_DefEM_'] := FBesLactT.BesEMTot - FBesLactT.AppEMTot / PProfilT.DureeLact ;
227
      FieldValues['_DefAli_'] := FBesLactT.BesEMTot * FBesLactT.AppAliTot / FBesLactT.AppEMTot - FBesLactT.AppAliTot / PProfilT.DureeLact ;
228
    end
229
    else // Exc?s
230
    begin
231
      FieldValues['_DefEM_'] := 0 ;
232
      FieldValues['_DefAli_'] := 0 ;
233
    end ;
234
    FieldValues['_Lys_'] := Mean (Slice (FBesLactT.BesAA[1], FBesLactT.DureeLact)) ;
235
    FieldValues['_Met_'] := Mean (Slice (FBesLactT.BesAA[2], FBesLactT.DureeLact)) ;
236
    FieldValues['_MetCys_'] := Mean (Slice (FBesLactT.BesAA[13], FBesLactT.DureeLact)) ;
237
    FieldValues['_Trp_'] := Mean (Slice (FBesLactT.BesAA[4], FBesLactT.DureeLact)) ;
238
    FieldValues['_Thr_'] := Mean (Slice (FBesLactT.BesAA[5], FBesLactT.DureeLact)) ;
239
    FieldValues['_Phe_'] := Mean (Slice (FBesLactT.BesAA[6], FBesLactT.DureeLact)) ;
240
    FieldValues['_PheTyr_'] := Mean (Slice (FBesLactT.BesAA[14], FBesLactT.DureeLact)) ;
241
    FieldValues['_Leu_'] := Mean (Slice (FBesLactT.BesAA[8], FBesLactT.DureeLact)) ;
242
    FieldValues['_Ile_'] := Mean (Slice (FBesLactT.BesAA[9], FBesLactT.DureeLact)) ;
243
    FieldValues['_Val_'] := Mean (Slice (FBesLactT.BesAA[10], FBesLactT.DureeLact)) ;
244
    FieldValues['_His_'] := Mean (Slice (FBesLactT.BesAA[11], FBesLactT.DureeLact)) ;
245
    FieldValues['_Arg_'] := Mean (Slice (FBesLactT.BesAA[12], FBesLactT.DureeLact)) ;
246
    FieldValues['_P_'] := Mean (Slice (FBesLactT.BesP, FBesLactT.DureeLact)) ;
247
    FieldValues['_Ca_'] := Mean (Slice (FBesLactT.BesCa, FBesLactT.DureeLact)) ;
248
    Post;
249
  end ;
250
  RegisterPreviewClass(TQRPrevRapInterface);
251
//  QRRapport.PreviewModal;
252
//  RegisterPreviewClass(TQRStandardPreviewInterface);
253
end;
254

    
255
end.