Révision 5 UnitFeedsCharts.pas

Voir les différences:

UnitFeedsCharts.pas
130 130
  procedure AddBarValue;
131 131
  begin
132 132
    with DataModuleDeclaration do
133
    begin
133 134
      case ComboBoxType0.ItemIndex of
134 135
        0: // Analyse proximale
135 136
          case ComboBoxProximal0.ItemIndex of
......
499 500
              if not ClientDataSetFeedsPd.IsNull
500 501
              then SeriesBar.AddBar(ClientDataSetFeedsPd.Value, s, clTeeColor)
501 502
              else SeriesBar.AddNull(s);
503
            6: // Bilan ?lectrolytique
504
              if not ClientDataSetFeedsBE.IsNull
505
              then SeriesBar.AddBar(ClientDataSetFeedsBE.Value, s, clTeeColor)
506
              else SeriesBar.AddNull(s);
502 507
          end;
503 508
      end;
509
    end;
504 510
  end;
505 511

  
506 512
begin
......
551 557
    5: // Profils acides amin?s
552 558
      Chart0.SubTitle.Text.Add('%');
553 559
    6: // Min?raux
554
      with FormOptions do
555
        if Expression = 0
556
        then // sur frais
557
          Chart0.SubTitle.Text.Add(ComboBoxMinerals.Items[Minerals])
558
        else // sur mati?re s?che
559
          Chart0.SubTitle.Text.Add(Format('%s %s', [ComboBoxMinerals.Items[Minerals], _('DM')]));
560
      if ComboBoxMinerals0.ItemIndex = 6
561
      then // Bilan ?lectrolytique
562
        with FormOptions do
563
          if Expression = 0
564
          then // sur frais
565
            Chart0.SubTitle.Text.Add(_('mEq/kg'))
566
          else // sur mati?re s?che
567
            Chart0.SubTitle.Text.Add(Format('%s %s', [_('mEq/kg'), _('DM')]))
568
      else
569
        with FormOptions do
570
          if Expression = 0
571
          then // sur frais
572
            Chart0.SubTitle.Text.Add(ComboBoxMinerals.Items[Minerals])
573
          else // sur mati?re s?che
574
            Chart0.SubTitle.Text.Add(Format('%s %s', [ComboBoxMinerals.Items[Minerals], _('DM')]));
560 575
  end;
561 576
  case ComboBoxType0.ItemIndex of
562 577
    0: // Analyse proximale
......
570 585
    5: // Profils acides amin?s
571 586
      Chart0.LeftAxis.AxisValuesFormat := FormOptions.DecimalFormat(0);
572 587
    6: // Min?raux
573
      Chart0.LeftAxis.AxisValuesFormat := FormOptions.MineralsFormat;
588
      if ComboBoxMinerals0.ItemIndex = 6
589
      then // Bilan ?lectrolytique
590
        Chart0.LeftAxis.AxisValuesFormat := FormOptions.DecimalFormat(1)
591
      else
592
        Chart0.LeftAxis.AxisValuesFormat := FormOptions.MineralsFormat;
574 593
  end;
575 594
  SeriesBar.Clear;
576 595
  SeriesBar.ValueFormat := Chart0.LeftAxis.AxisValuesFormat;
......
811 830
              Cumul := ClientDataSetFeedsCl.Value;
812 831
            5: // Phosphore digestible
813 832
              Cumul := ClientDataSetFeedsPd.Value;
833
            6: // Bilan ?lectrolytique
834
              Cumul := ClientDataSetFeedsBE.Value;
814 835
            else
815 836
              Cumul := 0;
816 837
          end;
......
997 1018
                  Value := ClientDataSetIngredientsdPphy.Value / 100 * ClientDataSetIngredientsP.Value * Ratio
998 1019
                else // Granul?s (dP)
999 1020
                  Value := ClientDataSetIngredientsdP.Value / 100 * ClientDataSetIngredientsP.Value * Ratio;
1021
              6: // Bilan ?lectrolytique
1022
                Value := ClientDataSetIngredientsBE.Value * Ratio;
1000 1023
              else
1001 1024
                Value := 0;
1002 1025
            end;
......
1127 1150
          else // sur mati?re s?che
1128 1151
            ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.AADecimals, Total, FormOptions.ComboBoxAA.Items[FormOptions.AA], _('DM')]));
1129 1152
        4: // Min?raux
1130
          if FormOptions.Expression = 0
1131
          then // sur frais
1132
            ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
1133
          else // sur mati?re s?che
1134
            ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
1153
          if ComboBoxMinerals.ItemIndex = 6
1154
          then // Bilan ?lectrolytique
1155
            if FormOptions.Expression = 0
1156
            then // sur frais
1157
              ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), 1, Total, _('mEq/kg')]))
1158
            else // sur mati?re s?che
1159
              ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), 1, Total, _('mEq/kg'), _('DM')]));
1160
          else
1161
            if FormOptions.Expression = 0
1162
            then // sur frais
1163
              ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
1164
            else // sur mati?re s?che
1165
              ChartFeed1.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
1135 1166
      end;
1136 1167
      ClientDataSetComposition.Filtered := False;
1137 1168
      ClientDataSetComposition.Filter := '';
......
1319 1350
              Cumul := ClientDataSetFeedsCl.Value;
1320 1351
            5: // Phosphore digestible
1321 1352
              Cumul := ClientDataSetFeedsPd.Value;
1353
            6: // Bilan ?lectrolytique
1354
              Cumul := ClientDataSetFeedsBE.Value;
1322 1355
            else
1323 1356
              Cumul := 0;
1324 1357
          end;
......
1505 1538
                  Value := ClientDataSetIngredientsdPphy.Value / 100 * ClientDataSetIngredientsP.Value * Ratio
1506 1539
                else // Granul?s (dP)
1507 1540
                  Value := ClientDataSetIngredientsdP.Value / 100 * ClientDataSetIngredientsP.Value * Ratio;
1541
              6: // Bilan ?lectrolytique
1542
                Value := ClientDataSetIngredientsBE.Value * Ratio;
1508 1543
              else
1509 1544
                Value := 0;
1510 1545
            end;
......
1635 1670
          else // sur mati?re s?che
1636 1671
            ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.AADecimals, Total, FormOptions.ComboBoxAA.Items[FormOptions.AA], _('DM')]));
1637 1672
        4: // Min?raux
1638
          if FormOptions.Expression = 0
1639
          then // sur frais
1640
            ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
1641
          else // sur mati?re s?che
1642
            ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
1673
          if ComboBoxMinerals.ItemIndex = 6
1674
          then // Bilan ?lectrolytique
1675
            if FormOptions.Expression = 0
1676
            then // sur frais
1677
              ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), 1, Total, _('mEq/kg')]))
1678
            else // sur mati?re s?che
1679
              ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), 1, Total, _('mEq/kg'), _('DM')]));
1680
          else
1681
            if FormOptions.Expression = 0
1682
            then // sur frais
1683
              ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
1684
            else // sur mati?re s?che
1685
              ChartFeed2.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
1643 1686
      end;
1644 1687
      ClientDataSetComposition.Filtered := False;
1645 1688
      ClientDataSetComposition.Filter := '';
......
1827 1870
              Cumul := ClientDataSetFeedsCl.Value;
1828 1871
            5: // Phosphore digestible
1829 1872
              Cumul := ClientDataSetFeedsPd.Value;
1873
            6: // Bilan ?lectrolytique
1874
              Cumul := ClientDataSetFeedsBE.Value;
1830 1875
            else
1831 1876
              Cumul := 0;
1832 1877
          end;
......
2013 2058
                  Value := ClientDataSetIngredientsdPphy.Value / 100 * ClientDataSetIngredientsP.Value * Ratio
2014 2059
                else // Granul?s (dP)
2015 2060
                  Value := ClientDataSetIngredientsdP.Value / 100 * ClientDataSetIngredientsP.Value * Ratio;
2061
              6: // Bilan ?lectrolytique
2062
                Value := ClientDataSetIngredientsBE.Value * Ratio;
2016 2063
              else
2017 2064
                Value := 0;
2018 2065
            end;
......
2143 2190
          else // sur mati?re s?che
2144 2191
            ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.AADecimals, Total, FormOptions.ComboBoxAA.Items[FormOptions.AA], _('DM')]));
2145 2192
        4: // Min?raux
2146
          if FormOptions.Expression = 0
2147
          then // sur frais
2148
            ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
2149
          else // sur mati?re s?che
2150
            ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
2193
          if ComboBoxMinerals.ItemIndex = 6
2194
          then // Bilan ?lectrolytique
2195
            if FormOptions.Expression = 0
2196
            then // sur frais
2197
              ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), 1, Total, _('mEq/kg')]))
2198
            else // sur mati?re s?che
2199
              ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), 1, Total, _('mEq/kg'), _('DM')]));
2200
          else
2201
            if FormOptions.Expression = 0
2202
            then // sur frais
2203
              ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
2204
            else // sur mati?re s?che
2205
              ChartFeed3.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
2151 2206
      end;
2152 2207
      ClientDataSetComposition.Filtered := False;
2153 2208
      ClientDataSetComposition.Filter := '';
......
2335 2390
              Cumul := ClientDataSetFeedsCl.Value;
2336 2391
            5: // Phosphore digestible
2337 2392
              Cumul := ClientDataSetFeedsPd.Value;
2393
            6: // Bilan ?lectrolytique
2394
              Cumul := ClientDataSetFeedsBE.Value;
2338 2395
            else
2339 2396
              Cumul := 0;
2340 2397
          end;
......
2521 2578
                  Value := ClientDataSetIngredientsdPphy.Value / 100 * ClientDataSetIngredientsP.Value * Ratio
2522 2579
                else // Granul?s (dP)
2523 2580
                  Value := ClientDataSetIngredientsdP.Value / 100 * ClientDataSetIngredientsP.Value * Ratio;
2581
              6: // Bilan ?lectrolytique
2582
                Value := ClientDataSetIngredientsBE.Value * Ratio;
2524 2583
              else
2525 2584
                Value := 0;
2526 2585
            end;
......
2651 2710
          else // sur mati?re s?che
2652 2711
            ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.AADecimals, Total, FormOptions.ComboBoxAA.Items[FormOptions.AA], _('DM')]));
2653 2712
        4: // Min?raux
2654
          if FormOptions.Expression = 0
2655
          then // sur frais
2656
            ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
2657
          else // sur mati?re s?che
2658
            ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
2713
          if ComboBoxMinerals.ItemIndex = 6
2714
          then // Bilan ?lectrolytique
2715
            if FormOptions.Expression = 0
2716
            then // sur frais
2717
              ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), 1, Total, _('mEq/kg')]))
2718
            else // sur mati?re s?che
2719
              ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), 1, Total, _('mEq/kg'), _('DM')]));
2720
          else
2721
            if FormOptions.Expression = 0
2722
            then // sur frais
2723
              ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals]]))
2724
            else // sur mati?re s?che
2725
              ChartFeed4.SubTitle.Text.Add(Format('%s %1.*f %s %s', [_('Total:'), FormOptions.MineralsDecimals, Total, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]));
2659 2726
      end;
2660 2727
      ClientDataSetComposition.Filtered := False;
2661 2728
      ClientDataSetComposition.Filter := '';

Formats disponibles : Unified diff