unit Settings;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TSettingsForm = class(TForm)
    Button1: TButton;
    Button2: TButton;
    GroupBox5: TGroupBox;
    Label5: TLabel;
    Label6: TLabel;
    cbChanal1: TComboBox;
    cbChanal2: TComboBox;
  private
    { Private declarations }
    // Загрузить конфигурацию из реестра
//    procedure LoadConfiguration(AConfig: TConfig);

    // Сохранить конфигурацию в реестр
//    procedure SaveConfiguration(AConfig: TConfig);
  public
    class procedure Execute;
    { Public declarations }
  end;

{
var
  SettingsForm: TSettingsForm;
}
implementation

{$R *.dfm}

class procedure TSettingsForm.Execute;
begin
  with TSettingsForm.Create(Application) do
  try
    ShowModal;
  finally
    Free;
  end;
end;

{procedure TSettingsForm.FormCreate(Sender: TObject);
begin
  LoadConfiguration(Config);
end;

procedure TSettingsForm.LoadConfiguration(AConfig: TConfig);
begin
  chbADC00.Checked := AConfig.General.ADC00;
  chbADC01.Checked := AConfig.General.ADC01;
  chbADC02.Checked := AConfig.General.ADC02;
  chbADC03.Checked := AConfig.General.ADC03;
  chbADC04.Checked := AConfig.General.ADC04;
  chbADC05.Checked := AConfig.General.ADC05;
  chbADC06.Checked := AConfig.General.ADC06;
  chbADC07.Checked := AConfig.General.ADC07;

  cbGain00.ItemIndex := AConfig.General.Gain00;
  cbGain01.ItemIndex := AConfig.General.Gain01;
  cbGain02.ItemIndex := AConfig.General.Gain02;
  cbGain03.ItemIndex := AConfig.General.Gain03;
  cbGain04.ItemIndex := AConfig.General.Gain04;
  cbGain05.ItemIndex := AConfig.General.Gain05;
  cbGain06.ItemIndex := AConfig.General.Gain06;
  cbGain07.ItemIndex := AConfig.General.Gain07;

end;

procedure TSettingsForm.SaveConfiguration(AConfig: TConfig);
begin
  AConfig.General.ADC00 := chbADC00.Checked;
  AConfig.General.ADC01 := chbADC01.Checked;
  AConfig.General.ADC02 := chbADC02.Checked;
  AConfig.General.ADC03 := chbADC03.Checked;
  AConfig.General.ADC04 := chbADC04.Checked;
  AConfig.General.ADC05 := chbADC05.Checked;
  AConfig.General.ADC06 := chbADC06.Checked;
  AConfig.General.ADC07 := chbADC07.Checked;

  AConfig.General.Gain00 := cbGain00.ItemIndex;
  AConfig.General.Gain01 := cbGain01.ItemIndex;
  AConfig.General.Gain02 := cbGain02.ItemIndex;
  AConfig.General.Gain03 := cbGain03.ItemIndex;
  AConfig.General.Gain04 := cbGain04.ItemIndex;
  AConfig.General.Gain05 := cbGain05.ItemIndex;
  AConfig.General.Gain06 := cbGain06.ItemIndex;
  AConfig.General.Gain07 := cbGain07.ItemIndex;

end;


procedure TSettingsForm.Button2Click(Sender: TObject);
begin
  SaveConfiguration(Config);
end;
 }
end.



