From e3315ee5722a18464054c913c2efa4671fe09915 Mon Sep 17 00:00:00 2001 From: Oleksiy Penkov Date: Thu, 15 Jun 2023 11:57:02 +0800 Subject: [PATCH] * Sync --- XRayCalc3.dpr | 6 +- XRayCalc3.dproj | 10 +- components/editor_Layer.dfm | 12 +- components/editor_Layer.pas | 38 +- components/editor_Substrate.dfm | 119 ------ components/editor_Substrate.pas | 59 --- components/unit_XRCLayerControl.pas | 53 ++- components/unit_XRCProjectTree.pas | 22 ++ components/unit_XRCStackControl.pas | 13 +- components/unit_XRCStructure.pas | 370 +++++++++++-------- editors/editor_Gradient.dfm | 22 +- editors/editor_Gradient.pas | 2 - forms/frm_ExtensionType.dfm | 10 +- forms/frm_ExtensionType.pas | 2 +- forms/frm_Main.dfm | 552 ++++++++++++++-------------- forms/frm_Main.pas | 324 ++++++++++++---- math/unit_LFPSO_Base.pas | 29 +- math/unit_LFPSO_Periodic.pas | 14 + math/unit_LFPSO_Regular.pas | 107 +++++- math/unit_calc.pas | 2 +- math/unit_materials.pas | 10 +- units/unit_Types.pas | 86 ++++- 22 files changed, 1053 insertions(+), 809 deletions(-) delete mode 100644 components/editor_Substrate.dfm delete mode 100644 components/editor_Substrate.pas diff --git a/XRayCalc3.dpr b/XRayCalc3.dpr index adb6d9a..58b4e69 100644 --- a/XRayCalc3.dpr +++ b/XRayCalc3.dpr @@ -14,7 +14,6 @@ uses unit_XRCStackControl in 'components\unit_XRCStackControl.pas', unit_SMessages in 'components\unit_SMessages.pas', editor_Stack in 'components\editor_Stack.pas' {edtrStack}, - editor_Substrate in 'components\editor_Substrate.pas' {edtrSubstrate}, unit_calc in 'math\unit_calc.pas', unit_materials in 'math\unit_materials.pas', math_globals in 'math\math_globals.pas', @@ -30,7 +29,9 @@ uses unit_LFPSO_Regular in 'math\unit_LFPSO_Regular.pas', frm_MaterialSelector in 'forms\frm_MaterialSelector.pas' {frmMaterialSelector}, editor_Gradient in 'editors\editor_Gradient.pas' {edtrGradient}, - frm_ExtensionType in 'forms\frm_ExtensionType.pas' {frmExtensionSelector}; + frm_ExtensionType in 'forms\frm_ExtensionType.pas' {frmExtensionSelector}, + Vcl.Themes, + Vcl.Styles; {$R *.res} @@ -39,7 +40,6 @@ begin Application.MainFormOnTaskbar := True; Application.CreateForm(TfrmMain, frmMain); Application.CreateForm(TedtrStack, edtrStack); - Application.CreateForm(TedtrSubstrate, edtrSubstrate); Application.CreateForm(TedtrLayer, edtrLayer); Application.CreateForm(TfrmLimits, frmLimits); Application.CreateForm(TedtrProjectItem, edtrProjectItem); diff --git a/XRayCalc3.dproj b/XRayCalc3.dproj index a8ca9c1..c79dd08 100644 --- a/XRayCalc3.dproj +++ b/XRayCalc3.dproj @@ -112,8 +112,9 @@ 200 true true - -f "d:\DelphiProjects\X-Ray Calc\X-Ray Calc 3\test_data\Multilayer(4x20).xrcx" -a CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=3.0.0.200;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=3.0.0.0;Comments= + -f "d:\DelphiProjects\X-Ray Calc\X-Ray Calc 3\test_data\ML_PairingTest.xrcx" -a + Resources\XRayCalc3_Icon.ico PerMonitorV2 @@ -133,8 +134,8 @@ false Resources\XRayCalc3_Icon.ico 3 - 310 - CompanyName=Zhejiang University;FileDescription=$(MSBuildProjectName);FileVersion=3.0.0.310;InternalName=;LegalCopyright=Oleksiy Penkov;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=3.0.0;Comments= + 324 + CompanyName=Zhejiang University;FileDescription=$(MSBuildProjectName);FileVersion=3.0.0.324;InternalName=;LegalCopyright=Oleksiy Penkov;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=3.0.0;Comments= true true @@ -160,9 +161,6 @@
edtrStack
- -
edtrSubstrate
-
diff --git a/components/editor_Layer.dfm b/components/editor_Layer.dfm index fda1cb7..fad3552 100644 --- a/components/editor_Layer.dfm +++ b/components/editor_Layer.dfm @@ -3,7 +3,7 @@ object edtrLayer: TedtrLayer Top = 0 BorderStyle = bsToolWindow Caption = 'Layer properties' - ClientHeight = 116 + ClientHeight = 125 ClientWidth = 358 Color = 16765595 Font.Charset = DEFAULT_CHARSET @@ -12,19 +12,18 @@ object edtrLayer: TedtrLayer Font.Name = 'Tahoma' Font.Style = [] Position = poMainFormCenter - OnShow = FormShow TextHeight = 13 object RzPanel1: TRzPanel AlignWithMargins = True Left = 3 Top = 3 Width = 352 - Height = 63 + Height = 72 Align = alClient BorderOuter = fsFlatRounded Color = 15987699 TabOrder = 0 - ExplicitWidth = 336 + ExplicitWidth = 344 ExplicitHeight = 51 object Label1: TLabel Left = 9 @@ -114,7 +113,7 @@ object edtrLayer: TedtrLayer object RzPanel2: TRzPanel AlignWithMargins = True Left = 3 - Top = 72 + Top = 81 Width = 352 Height = 41 Align = alBottom @@ -122,7 +121,7 @@ object edtrLayer: TedtrLayer Color = 15987699 TabOrder = 1 ExplicitTop = 60 - ExplicitWidth = 336 + ExplicitWidth = 344 object btnOK: TRzBitBtn Left = 192 Top = 10 @@ -131,7 +130,6 @@ object edtrLayer: TedtrLayer ParentColor = True TabOrder = 2 TabStop = False - OnClick = btnOKClick Kind = bkOK end object btnCancel: TRzBitBtn diff --git a/components/editor_Layer.pas b/components/editor_Layer.pas index a42e2a1..5dab293 100644 --- a/components/editor_Layer.pas +++ b/components/editor_Layer.pas @@ -32,18 +32,13 @@ TedtrLayer = class(TForm) Label6: TLabel; btnPrev: TRzBitBtn; btnNext: TRzBitBtn; - procedure btnOKClick(Sender: TObject); - procedure FormShow(Sender: TObject); - - procedure FillEdits; - procedure SaveData; procedure edMaterialButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } - Data : TLayerData; + function ShowEditor(const IsSubstrate: Boolean; var Data: TLayerData): boolean; end; var @@ -55,31 +50,30 @@ implementation {$R *.dfm} -procedure TedtrLayer.FillEdits; + +function TedtrLayer.ShowEditor(const IsSubstrate: Boolean; var Data: TLayerData): boolean; begin + Result := False; edMaterial.Text := Data.Material; edH.Value := Data.H.V; edSigma.Value := Data.S.V; edRo.Value := Data.R.V; -end; -procedure TedtrLayer.FormShow(Sender: TObject); -begin - FillEdits; + edH.Visible := not IsSubstrate; + Label2.Visible := not IsSubstrate; + + ActiveControl := edMaterial; -end; -procedure TedtrLayer.SaveData; -begin - Data.Material := edMaterial.Text; - Data.H.V := edH.Value; - Data.S.V := edSigma.Value; - Data.R.V := edRo.Value; -end; + if ShowModal = mrOk then + begin + Data.Material := edMaterial.Text; + Data.H.V := edH.Value; + Data.S.V := edSigma.Value; + Data.R.V := edRo.Value; + Result := True; + end; -procedure TedtrLayer.btnOKClick(Sender: TObject); -begin - SaveData; end; procedure TedtrLayer.edMaterialButtonClick(Sender: TObject); diff --git a/components/editor_Substrate.dfm b/components/editor_Substrate.dfm deleted file mode 100644 index fcec2e9..0000000 --- a/components/editor_Substrate.dfm +++ /dev/null @@ -1,119 +0,0 @@ -object edtrSubstrate: TedtrSubstrate - Left = 0 - Top = 0 - BorderStyle = bsToolWindow - Caption = 'Substrate' - ClientHeight = 124 - ClientWidth = 269 - Color = clBtnFace - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [] - Position = poMainFormCenter - TextHeight = 13 - object RzPanel2: TRzPanel - AlignWithMargins = True - Left = 3 - Top = 80 - Width = 263 - Height = 41 - Align = alBottom - BorderOuter = fsFlatRounded - Color = 15987699 - TabOrder = 0 - ExplicitTop = 37 - ExplicitWidth = 236 - object btnOK: TRzBitBtn - Left = 11 - Top = 10 - Width = 93 - TabOrder = 0 - TabStop = False - Kind = bkOK - end - object btnCancel: TRzBitBtn - Left = 162 - Top = 10 - Width = 87 - TabOrder = 1 - TabStop = False - Kind = bkCancel - end - end - object RzPanel1: TRzPanel - AlignWithMargins = True - Left = 3 - Top = 3 - Width = 263 - Height = 71 - Align = alClient - BorderOuter = fsFlatRounded - Color = 15987699 - TabOrder = 1 - ExplicitWidth = 236 - ExplicitHeight = 28 - object Label1: TLabel - Left = 9 - Top = 10 - Width = 95 - Height = 13 - Caption = 'Substrate'#39's material' - end - object Label7: TLabel - Left = 169 - Top = 31 - Width = 9 - Height = 20 - Caption = 'r' - Font.Charset = GREEK_CHARSET - Font.Color = clBlack - Font.Height = -16 - Font.Name = 'Symbol' - Font.Style = [] - ParentFont = False - end - object Label6: TLabel - Left = 67 - Top = 31 - Width = 10 - Height = 20 - Caption = 's' - Font.Charset = GREEK_CHARSET - Font.Color = clBlack - Font.Height = -16 - Font.Name = 'Symbol' - Font.Style = [] - ParentFont = False - end - object edMaterial: TRzButtonEdit - Left = 110 - Top = 6 - Width = 139 - Height = 21 - Text = '' - TabOrder = 0 - AltBtnNumGlyphs = 1 - ButtonNumGlyphs = 1 - end - object edRo: TJvCalcEdit - Left = 184 - Top = 33 - Width = 65 - Height = 21 - ButtonFlat = True - TabOrder = 2 - DecimalPlacesAlwaysShown = False - end - object edSigma: TJvCalcEdit - Left = 83 - Top = 33 - Width = 65 - Height = 21 - ButtonFlat = True - TabOrder = 1 - DecimalPlacesAlwaysShown = False - end - end -end diff --git a/components/editor_Substrate.pas b/components/editor_Substrate.pas deleted file mode 100644 index b78ca47..0000000 --- a/components/editor_Substrate.pas +++ /dev/null @@ -1,59 +0,0 @@ -(* ***************************************************************************** - * - * X-Ray Calc 3 - * - * Copyright (C) 2001-2023 Oleksiy Penkov - * e-mail: oleksiypenkov@intl.zju.edu.cn - * - ****************************************************************************** *) - -unit editor_Substrate; - -interface - -uses - Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, JvExMask, JvToolEdit, JvBaseEdits, StdCtrls, Mask, RzEdit, RzBtnEdt, - RzButton, ExtCtrls, RzPanel, unit_types; - -type - TedtrSubstrate = class(TForm) - RzPanel2: TRzPanel; - btnOK: TRzBitBtn; - btnCancel: TRzBitBtn; - RzPanel1: TRzPanel; - Label1: TLabel; - Label7: TLabel; - Label6: TLabel; - edMaterial: TRzButtonEdit; - edRo: TJvCalcEdit; - edSigma: TJvCalcEdit; - private - { Private declarations } - public - { Public declarations } - procedure Edit(var Material, Sigma, rho: string); - end; - -var - edtrSubstrate: TedtrSubstrate; - -implementation - -{$R *.dfm} - -procedure TedtrSubstrate.Edit; -begin - edMaterial.Text := Material; - edSigma.Text := Sigma; - edRo.Text := rho; - if ShowModal = mrOk then - begin - Material := edMaterial.Text; - Sigma := edSigma.Text; - rho := edRo.Text; - end; -end; - - -end. diff --git a/components/unit_XRCLayerControl.pas b/components/unit_XRCLayerControl.pas index 5a949f9..31e8a40 100644 --- a/components/unit_XRCLayerControl.pas +++ b/components/unit_XRCLayerControl.pas @@ -27,7 +27,6 @@ TXRCLayerControl = class (TRzPanel) FSubstrate: boolean; FSelected: boolean; - procedure CheckBoxClick(Sender: TObject); procedure ValueChange(Sender: TObject); procedure SetIncrement(const Value: Double); @@ -48,6 +47,8 @@ TXRCLayerControl = class (TRzPanel) function AddCheckBox(const index, Left: integer): TRzCheckBox; procedure SetPairable(const Value: boolean); procedure SetLinkChecked(const Value: boolean); + function GetID: Integer; + function GetStackID: Integer; public constructor Create(AOwner: TComponent; const Handler: HWND; const Data: TLayerData); destructor Destroy; override; @@ -71,12 +72,15 @@ TXRCLayerControl = class (TRzPanel) procedure DecreaseThickness; procedure UpdateID(const StackID, LayerID: integer); property LinkChecked: boolean read GetLinkChecked write SetLinkChecked; + + property ID: Integer read GetID; + property StackID: Integer read GetStackID; end; implementation uses - editor_Substrate, unit_SMessages; + unit_SMessages; { TXRCLayerControl } @@ -109,6 +113,8 @@ function TXRCLayerControl.AddCheckBox(const index, Left: integer):TRzCheckBox; Result.Left := Left; Result.Top := 13; Result.Tag := Index; + Result.ShowHint := True; + Result.Hint := 'Mark this parameter as paired accross all repeated stacks'; Result.OnClick := CheckBoxClick; end; @@ -178,6 +184,8 @@ constructor TXRCLayerControl.Create(AOwner: TComponent; const Handler: HWND; con FLinkCheckBox.Width := 19; FLinkCheckBox.Height := 15; FLinkCheckBox.TabOrder := 3; + FLinkCheckBox.ShowHint := True; + FLinkCheckBox.Hint := 'Pair to another layer'; Name.Caption := Data.Material; @@ -210,35 +218,13 @@ destructor TXRCLayerControl.Destroy; end; procedure TXRCLayerControl.Edit; -var - S1, S2, S3: string; - begin - if FSubstrate then + if edtrLayer.ShowEditor(FSubstrate, FData) then begin - S2 := Sigma.Text; - S3 := Rho.Text; - - edtrSubstrate.Edit(FData.Material, S2, S3); - - Sigma.Text := S1; - Rho.Text := S2; - end - else begin - edtrLayer.Data.Material := Name.Caption; - edtrLayer.Data.H.V := Thickness.Value; - edtrLayer.Data.s.V := Sigma.Value; - edtrLayer.Data.r.V := Rho.Value; - - if edtrLayer.ShowModal = mrOk then - begin - Name.Caption := edtrLayer.Data.Material; - Thickness.Value := edtrLayer.Data.H.V; - Sigma.Value := edtrLayer.Data.s.V; - Rho.Value := edtrLayer.Data.r.V; - end; - + Name.Caption := Data.Material; + SetLayerData(FData); end; + SetSlected(False); end; @@ -262,6 +248,16 @@ function TXRCLayerControl.GetEnabled: Boolean; Result := Enabled; end; +function TXRCLayerControl.GetID: Integer; +begin + Result := FData.LayerID; +end; + +function TXRCLayerControl.GetStackID: Integer; +begin + Result := FData.StackID; +end; + function TXRCLayerControl.GetLinkChecked: Boolean; begin if FLinkCheckBox.Visible then @@ -302,6 +298,7 @@ procedure TXRCLayerControl.LinkedOnClick(Sender: TObject); LinkedClick(FData.StackID, FData.LayerID); end; + procedure TXRCLayerControl.SetIncrement(const Value: Double); begin Thickness.Increment := Value; diff --git a/components/unit_XRCProjectTree.pas b/components/unit_XRCProjectTree.pas index d00d001..d53c0b7 100644 --- a/components/unit_XRCProjectTree.pas +++ b/components/unit_XRCProjectTree.pas @@ -45,6 +45,7 @@ TXRCProjectTree = class (TVirtualStringTree) property ActiveData:PProjectData read FActiveData write FActiveData; property LinkedData:PProjectData read FLinkedData write FLinkedData; property IgnoreFocusChange: boolean read FIgnoreFocusChange write FIgnoreFocusChange; + function ProfileAttached(Node: PVirtualNode): Boolean; published end; @@ -133,6 +134,27 @@ destructor TXRCProjectTree.Free; inherited Free; end; +function TXRCProjectTree.ProfileAttached(Node: PVirtualNode): Boolean; +var + Data: PProjectData; +begin + Result := False; + + Node := GetFirstChild(Node); + if Node <> nil then + begin + repeat + Data := GetNodeData(Node); + if Data.ExtType = etProfile then + begin + Result := True; + Break; + end; + Node := GetNextSibling(Node); + until Node = nil; + end; +end; + procedure TXRCProjectTree.ProjectAdvancedHeaderDraw(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements); begin diff --git a/components/unit_XRCStackControl.pas b/components/unit_XRCStackControl.pas index 78c562c..b8989b6 100644 --- a/components/unit_XRCStackControl.pas +++ b/components/unit_XRCStackControl.pas @@ -9,13 +9,15 @@ interface type + TLayers = array of TXRCLayerControl; + TXRCStack = class (TRzPanel) private lblLayers: TRzLabel; RzSeparator: TRzSeparator; - FLayers: array of TXRCLayerControl; + FLayers: TLayers; FID: Integer; FN: Integer; FTitle: string; @@ -39,7 +41,7 @@ TXRCStack = class (TRzPanel) constructor Create(AOwner: TComponent; const Title: string; const N: integer); destructor Destroy; override; - procedure AddLayer(Data: TLayerData); + function AddLayer(Data: TLayerData): integer; procedure AddSubstrate(const Material: string; s, rho: single); procedure UpdateLayer(const Index: integer; AData: TLayerData); procedure DeleteLayer(const Index: integer); @@ -48,7 +50,8 @@ TXRCStack = class (TRzPanel) property ID: Integer read FID write SetID; property N:integer read FN; procedure Edit; - property Layers: TLayersData read GetLayersData; + property Layers:TLayers read FLayers write FLayers; + property LayerData: TLayersData read GetLayersData; property Increment:Single write SetIncrement; property Title: string read FTitle; property Materials: TMaterialsList read GetMaterialsList; @@ -56,7 +59,6 @@ TXRCStack = class (TRzPanel) procedure Select(const LayerID: integer); procedure EnablePairing(const Enabled: Boolean); procedure LinkLayer(const LayerID: Integer); - end; implementation @@ -66,7 +68,7 @@ implementation { TXRCStack } -procedure TXRCStack.AddLayer(Data: TLayerData); +function TXRCStack.AddLayer(Data: TLayerData): integer; var Count: Integer; begin @@ -87,6 +89,7 @@ procedure TXRCStack.AddLayer(Data: TLayerData); lblLayers.Top := 1; FLayers[Count].Top := ClientHeight - 10; + Result := Count; end; procedure TXRCStack.AddSubstrate(const Material: string; s, rho: single); diff --git a/components/unit_XRCStructure.pas b/components/unit_XRCStructure.pas index 468f7dd..85f65e1 100644 --- a/components/unit_XRCStructure.pas +++ b/components/unit_XRCStructure.pas @@ -10,6 +10,8 @@ interface type + TStacks = array of TXRCStack; + TXRCStructure = class (TRzPanel) private Header: TRzPanel; @@ -19,7 +21,7 @@ TXRCStructure = class (TRzPanel) Label4: TRzLabel; Box: TJvDesignScrollBox; - Stacks: array of TXRCStack; + FStacks: TStacks; Substrate: TXRCStack; FSelectedStack : Integer; @@ -31,16 +33,21 @@ TXRCStructure = class (TRzPanel) FVisibility: boolean; FClipBoardLayers: TLayersData; + JLayer, JStack, JSub: TJSONValue; procedure RealignStacks; procedure SetIncrement(const Value: single); function GetSelected: Integer; procedure ClearSelection(const Reset:boolean = False); inline; + function FindBoolValue(const Value: string): boolean; + function FindValue(const Value: string; Base: single): single; + function FindStrValue(const Value: string): string; public constructor Create(AOwner: TComponent); destructor Destroy; override; property Selected: Integer read GetSelected; + property Stacks: TStacks read FStacks; procedure AddLayer(const StackID: Integer; const Data: TLayerData); procedure AddStack(const N: Integer; const Title: string); @@ -53,7 +60,7 @@ TXRCStructure = class (TRzPanel) procedure DeleteStack; procedure DeleteLayer; - function Model: TLayeredModel; + function Model(const ExpandProfiles: Boolean): TLayeredModel; function Materials: TMaterialsList; function ToString: string; @@ -61,16 +68,18 @@ TXRCStructure = class (TRzPanel) function ToFitStructure: TFitStructure; procedure FromFitStructure(const Inp: TLayeredModel); procedure RecreateFromFitStructure(const Inp: TFitStructure); - procedure StoreFitLimits(const Inp: TFitStructure); - procedure StoreFitLimitsNP(const Inp: TFitStructure); + procedure UpdateInterfaceP(const Inp: TFitStructure); + procedure UpdateInterfaceNP(const Inp: TFitStructure); + procedure UpdateProfiles(const Inp: TLayeredModel); procedure Clear; procedure CopyLayer(const Reset: boolean); procedure PasteLayer; - function IsPeriodic(const Index: integer): boolean; + function IsPeriodic: boolean; overload; + function IsPeriodic(const Index: integer): boolean; overload; procedure GetStacksList(PeriodicOnly: Boolean; List: TStrings; var RealID: TIntArray); procedure GetLayersList(const ID: integer; List: TStrings); function GetStackSize(const ID: Integer): Integer; - procedure EnablePairing(const Enabled: Boolean); + procedure EnablePairing; published property Increment: single read FIncrement write SetIncrement; end; @@ -86,9 +95,9 @@ procedure TXRCStructure.AddLayer(const StackID: Integer; const Data: TLayerData); begin if StackID <> -1 then - Stacks[StackID].AddLayer(Data) + FStacks[StackID].AddLayer(Data) else - Stacks[High(Stacks)].AddLayer(Data) + FStacks[High(FStacks)].AddLayer(Data) end; procedure TXRCStructure.RealignStacks; @@ -97,18 +106,18 @@ procedure TXRCStructure.RealignStacks; MaxHeigh: integer; begin - Count := Length(Stacks) - 1; + Count := Length(FStacks) - 1; Substrate.Align := alBottom; for I := 0 to Count do - Stacks[i].Align := alNone; + FStacks[i].Align := alNone; MaxHeigh := 20; for I := 0 to Count do begin - Stacks[i].Top := MaxHeigh + 5; - Stacks[i].Align := alTop; - MaxHeigh := MaxHeigh + Stacks[i].Height + 5; + FStacks[i].Top := MaxHeigh + 5; + FStacks[i].Align := alTop; + MaxHeigh := MaxHeigh + FStacks[i].Height + 5; end; Substrate.Top := ClientHeight - 5; @@ -120,7 +129,7 @@ procedure TXRCStructure.RealignStacks; procedure TXRCStructure.RecreateFromFitStructure(const Inp: TFitStructure); var - i, j: integer; + i: integer; begin // Visible := False; @@ -141,11 +150,11 @@ procedure TXRCStructure.AddStack(const N: Integer; const Title: string); begin FVisibility := Visible; Visible := False; - Count := Length(Stacks); + Count := Length(FStacks); - SetLength(Stacks, Count + 1); - Stacks[Count] := TXRCStack.Create(Box, Title, N); - Stacks[Count].ID := Count; + SetLength(FStacks, Count + 1); + FStacks[Count] := TXRCStack.Create(Box, Title, N); + FStacks[Count].ID := Count; RealignStacks; end; @@ -163,19 +172,20 @@ procedure TXRCStructure.Clear; var i: Integer; begin - for I := 0 to High(Stacks) do - Stacks[i].Free; - Finalize(Stacks); + for I := 0 to High(FStacks) do + FStacks[i].Free; + Finalize(FStacks); Substrate.Free; end; + procedure TXRCStructure.ClearSelection; var i: integer; begin - for I := 0 to High(Stacks) do - Stacks[i].ClearSelection; + for I := 0 to High(FStacks) do + FStacks[i].ClearSelection; if Reset then begin @@ -186,7 +196,7 @@ procedure TXRCStructure.ClearSelection; procedure TXRCStructure.CopyLayer; begin - FClipBoardLayers[0] := Stacks[FSelectedLayerParent].Layers[FSelectedLayer]; + FClipBoardLayers[0] := FStacks[FSelectedLayerParent].LayerData[FSelectedLayer]; ClearSelection(Reset); end; @@ -242,7 +252,7 @@ constructor TXRCStructure.Create(AOwner: TComponent); //Label2 Label2.Name := 'Label2'; Label2.Parent := Header; - Label2.Left := 120; + Label2.Left := 110; Label2.Top := 6; Label2.Width := 35; Label2.Height := 16; @@ -256,7 +266,7 @@ constructor TXRCStructure.Create(AOwner: TComponent); //Label3 Label3.Name := 'Label3'; Label3.Parent := Header; - Label3.Left := 191; + Label3.Left := 181; Label3.Top := 6; Label3.Width := 35; Label3.Height := 16; @@ -274,7 +284,7 @@ constructor TXRCStructure.Create(AOwner: TComponent); Label4.Top := 6; Label4.Width := 65; Label4.Height := 16; - Label4.Caption := 'ρ (g/cm³) N'; + Label4.Caption := 'ρ (g/cm³) N'; Label4.Font.Color := clWindowText; Label4.Font.Height := -13; Label4.Font.Name := 'Tahoma'; @@ -304,7 +314,7 @@ procedure TXRCStructure.DeleteLayer; begin if (FSelectedLayer >= 0) and (FSelectedLayerParent >= 0) then begin - Stacks[FSelectedLayerParent].DeleteLayer(FSelectedLayer); + FStacks[FSelectedLayerParent].DeleteLayer(FSelectedLayer); FSelectedLayerParent := -1; FSelectedLayer := -1; end; @@ -316,12 +326,12 @@ procedure TXRCStructure.DeleteStack; begin if FSelectedStack > -1 then begin - Stacks[FSelectedStack].Free; - Delete(Stacks, FSelectedStack, 1); + FStacks[FSelectedStack].Free; + Delete(FStacks, FSelectedStack, 1); FSelectedStack := -1; - for I := 0 to High(Stacks) do - Stacks[i].ID := i; + for I := 0 to High(FStacks) do + FStacks[i].ID := i; end; end; @@ -333,47 +343,60 @@ destructor TXRCStructure.Destroy; procedure TXRCStructure.EditStack; begin - Stacks[ID].Edit; + FStacks[ID].Edit; end; -procedure TXRCStructure.EnablePairing(const Enabled: Boolean); +procedure TXRCStructure.EnablePairing; var Stack: TXRCStack; begin - for Stack in Stacks do - Stack.EnablePairing(Enabled); - + for Stack in FStacks do + Stack.EnablePairing(True); end; + procedure TXRCStructure.InsertStack(const N: Integer; const Title: string); var Count, pos: Integer; begin Visible := False; - Count := Length(Stacks); + Count := Length(FStacks); if FSelectedStack <> -1 then Pos := FSelectedStack else Pos := count; - Insert(Nil, Stacks, pos); + Insert(Nil, FStacks, pos); - Stacks[Pos] := TXRCStack.Create(Box, Title, N); - Stacks[Pos].ID := Pos; + FStacks[Pos] := TXRCStack.Create(Box, Title, N); + FStacks[Pos].ID := Pos; RealignStacks; end; +function TXRCStructure.IsPeriodic: boolean; +var + i: Integer; +begin + Result := False; + for I := 0 to High(FStacks) do + if IsPeriodic(i) then + begin + Result := True; + Break; + end; +end; + function TXRCStructure.IsPeriodic(const Index: integer): boolean; begin - if Index > High(Stacks) then + if Index > High(FStacks) then Result := False else - Result := Stacks[Index].N > 1; + Result := FStacks[Index].N > 1; end; procedure TXRCStructure.LinkLayer(const StackID, LayerID: Integer); begin - Stacks[StackID].LinkLayer(LayerID); + FStacks[StackID].LinkLayer(LayerID); end; function TXRCStructure.Materials: TMaterialsList; @@ -381,38 +404,49 @@ function TXRCStructure.Materials: TMaterialsList; i: integer; begin SetLength(Result, 0); - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin - if Stacks[i].N > 1 then - Result := Result + Stacks[i].Materials; + if FStacks[i].N > 1 then + Result := Result + FStacks[i].Materials; end; end; -function TXRCStructure.Model: TLayeredModel; +function TXRCStructure.Model(const ExpandProfiles: Boolean): TLayeredModel; var - i, j: Integer; + i, j, k: Integer; StackLayers: TLayersData; begin Result := TLayeredModel.Create; Result.Init; - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin - StackLayers := Stacks[i].Layers; - for j := 1 to Stacks[i].N do + StackLayers := FStacks[i].LayerData; + for j := 1 to FStacks[i].N do + begin + if ExpandProfiles and (FStacks[i].N > 1) then + begin + for k := 0 to High(StackLayers) do + begin + StackLayers[k].H.V := StackLayers[k].PH[j - 1]; + StackLayers[k].s.V := StackLayers[k].PS[j - 1]; + StackLayers[k].r.V := StackLayers[k].PR[j - 1]; + end; + end; Result.AddLayers(i, StackLayers); + end; end; - Result.AddSubstrate(Substrate.Layers); + Result.AddSubstrate(Substrate.LayerData); end; procedure TXRCStructure.PasteLayer; begin if FSelectedStack <> -1 then - Stacks[FSelectedStack].AddLayer(FClipBoardLayers[0]) + FStacks[FSelectedStack].AddLayer(FClipBoardLayers[0]) else if FSelectedLayerParent <> -1 then - Stacks[FSelectedLayerParent].AddLayer(FClipBoardLayers[0]) + FStacks[FSelectedLayerParent].AddLayer(FClipBoardLayers[0]) end; procedure TXRCStructure.Select(const ID: Integer); @@ -422,11 +456,11 @@ procedure TXRCStructure.Select(const ID: Integer); if ID = FSelectedStack then begin FSelectedStack := -1; - Stacks[ID].Selected := False; + FStacks[ID].Selected := False; end else begin - for I := 0 to High(Stacks) do - Stacks[i].Selected := (ID = i); + for I := 0 to High(FStacks) do + FStacks[i].Selected := (ID = i); FSelectedStack := ID; end; @@ -438,7 +472,7 @@ procedure TXRCStructure.SelectLayer(const StackID, LayerID: Integer); if (StackID <> FSelectedLayerParent) and (LayerID <> FSelectedLayer) then begin - Stacks[StackID].Select(LayerID); + FStacks[StackID].Select(LayerID); FSelectedLayerParent := StackID; FSelectedLayer := LayerID; end @@ -453,53 +487,63 @@ procedure TXRCStructure.SetIncrement(const Value: single); i: Integer; begin FIncrement := Value; - for I := 0 to High(Stacks) do - Stacks[i].Increment := Value; + for I := 0 to High(FStacks) do + FStacks[i].Increment := Value; end; -procedure TXRCStructure.StoreFitLimits(const Inp: TFitStructure); +procedure TXRCStructure.UpdateInterfaceNP(const Inp: TFitStructure); var i, j: integer; Count: integer; Data: TLayerData; begin - Count := 1; + Count := 0; + for I := 0 to High(FStacks) do + begin + for j := 0 to High(FStacks[i].Layers) do + begin + Data.Material := Inp.Stacks[0].Layers[Count].Material; + Data.H := Inp.Stacks[0].Layers[Count].H; + Data.s := Inp.Stacks[0].Layers[Count].s; + Data.r := Inp.Stacks[0].Layers[Count].r; + FStacks[i].UpdateLayer(j, Data); + inc(Count); + end; + inc(Count, (FStacks[i].N - 1) * (High(FStacks[i].Layers) + 1)); + end; +end; - for I := 0 to High(Stacks) do +procedure TXRCStructure.UpdateInterfaceP(const Inp: TFitStructure); +var + i, j: integer; + Data: TLayerData; +begin + for I := 0 to High(FStacks) do begin - for j := 0 to High(Stacks[i].Layers) do + for j := 0 to High(FStacks[i].LayerData) do begin Data.Material := Inp.Stacks[i].Layers[j].Material; Data.H := Inp.Stacks[i].Layers[j].H; Data.s := Inp.Stacks[i].Layers[j].s; Data.r := Inp.Stacks[i].Layers[j].r; - Stacks[i].UpdateLayer(j, Data); - inc(Count); + FStacks[i].UpdateLayer(j, Data); end; - inc(Count, (Stacks[i].N - 1) * (High(Stacks[i].Layers) + 1)); end; end; -procedure TXRCStructure.StoreFitLimitsNP(const Inp: TFitStructure); +procedure TXRCStructure.UpdateProfiles(const Inp: TLayeredModel); var - i, j: integer; - Count: integer; - Data: TLayerData; + i, j, SID, LID: integer; begin - Count := 0; + for I := 0 to High(FStacks) do + for j := 0 to High(FStacks[i].Layers) do + FStacks[i].Layers[j].Data.ClearProfiles; - for I := 0 to High(Stacks) do + for I := 1 to High(Inp.Layers) - 1 do begin - for j := 0 to High(Stacks[i].Layers) do - begin - Data.Material := Inp.Stacks[0].Layers[Count].Material; - Data.H := Inp.Stacks[0].Layers[Count].H; - Data.s := Inp.Stacks[0].Layers[Count].s; - Data.r := Inp.Stacks[0].Layers[Count].r; - Stacks[i].UpdateLayer(j, Data); - inc(Count); - end; - inc(Count, (Stacks[i].N - 1) * (High(Stacks[i].Layers) + 1)); + SID := Inp.Layers[i].StackID; + LID := Inp.Layers[i].LayerID; + Structure.FStacks[SID].Layers[LID].Data.AddProfilePoint(Inp.Layers[i].L, Inp.Layers[i].s, Inp.Layers[i].ro); end; end; @@ -509,43 +553,43 @@ function TXRCStructure.ToFitStructure: TFitStructure; D: single; begin - SetLength(Result.Stacks, Length(Stacks)); + SetLength(Result.Stacks, Length(FStacks)); - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin - Result.Stacks[i].ID := Stacks[i].ID; - Result.Stacks[i].N := Stacks[i].N; - Result.Stacks[i].Header := Stacks[i].Title; + Result.Stacks[i].ID := FStacks[i].ID; + Result.Stacks[i].N := FStacks[i].N; + Result.Stacks[i].Header := FStacks[i].Title; - SetLength(Result.Stacks[i].Layers, Length(Stacks[i].Layers)); + SetLength(Result.Stacks[i].Layers, Length(FStacks[i].LayerData)); - if Stacks[i].N > 1 then + if FStacks[i].N > 1 then begin D := 0; - for j := 0 to High(Stacks[i].Layers) do + for j := 0 to High(FStacks[i].LayerData) do begin Result.Stacks[i].Layers[j].LayerID := j; - D := D + Stacks[i].Layers[j].H.V; + D := D + FStacks[i].LayerData[j].H.V; end; Result.Stacks[i].D := D; end; - for j := 0 to High(Stacks[i].Layers) do + for j := 0 to High(FStacks[i].LayerData) do begin - Result.Stacks[i].Layers[j].Material := Stacks[i].Layers[j].Material; - Result.Stacks[i].Layers[j].H := Stacks[i].Layers[j].H; - Result.Stacks[i].Layers[j].s := Stacks[i].Layers[j].s; - Result.Stacks[i].Layers[j].r := Stacks[i].Layers[j].r; + Result.Stacks[i].Layers[j].Material := FStacks[i].LayerData[j].Material; + Result.Stacks[i].Layers[j].H := FStacks[i].LayerData[j].H; + Result.Stacks[i].Layers[j].s := FStacks[i].LayerData[j].s; + Result.Stacks[i].Layers[j].r := FStacks[i].LayerData[j].r; Result.Stacks[i].Layers[j].StackID := i; Result.Stacks[i].Layers[j].LayerID := j; end; Result.Stacks[i].D := D; end; - Result.Subs.Material := Substrate.Layers[0].Material; - Result.Subs.H := Substrate.Layers[0].H; - Result.Subs.s := Substrate.Layers[0].s; - Result.Subs.r := Substrate.Layers[0].r; + Result.Subs.Material := Substrate.LayerData[0].Material; + Result.Subs.H := Substrate.LayerData[0].H; + Result.Subs.s := Substrate.LayerData[0].s; + Result.Subs.r := Substrate.LayerData[0].r; end; function TXRCStructure.ToString: string; @@ -554,20 +598,21 @@ function TXRCStructure.ToString: string; Data: TLayerData; JStstructure, JLayer, JStack, JSub : TJSONObject; JStacks, JLayers : TJSONArray; + Profile: string; begin JStstructure := TJSONObject.Create; try JStacks := TJSONArray.Create; - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin JStack := TJSONObject.Create; - JStack.AddPair('T', Stacks[i].Title); - JStack.AddPair('N', Stacks[i].N); + JStack.AddPair('T', FStacks[i].Title); + JStack.AddPair('N', FStacks[i].N); JLayers := TJSONArray.Create; - for j := 0 to High(Stacks[i].Layers) do + for j := 0 to High(FStacks[i].LayerData) do begin - Data := Stacks[i].Layers[j]; + Data := FStacks[i].LayerData[j]; JLayer := TJSONObject.Create; JLayer.AddPair('M', Data.Material); @@ -575,16 +620,22 @@ function TXRCStructure.ToString: string; JLayer.AddPair('HP', Data.H.Paired); JLayer.AddPair('Hmin', Data.H.min); JLayer.AddPair('Hmax', Data.H.max); + Profile := Data.ProfileToSrting(gsL); + JLayer.AddPair('ProfileH', Profile); JLayer.AddPair('s', Data.s.V); JLayer.AddPair('SP', Data.s.Paired); JLayer.AddPair('Smin', Data.s.min); JLayer.AddPair('Smax', Data.s.max); + Profile := Data.ProfileToSrting(gsS); + JLayer.AddPair('ProfileS', Profile); JLayer.AddPair('r', Data.r.V); JLayer.AddPair('RP', Data.r.Paired); JLayer.AddPair('Rmin', Data.r.min); JLayer.AddPair('Rmax', Data.r.max); + Profile := Data.ProfileToSrting(gsRo); + JLayer.AddPair('ProfileR', Profile); JLayers.Add(JLayer); end; @@ -592,7 +643,7 @@ function TXRCStructure.ToString: string; JStacks.Add(JStack); end; - Data := Substrate.Layers[0]; + Data := Substrate.LayerData[0]; JSub := TJSONObject.Create; JSub.AddPair('M', Data.Material); JSub.AddPair('s', Data.s.V); @@ -614,52 +665,65 @@ procedure TXRCStructure.FromFitStructure(const Inp: TLayeredModel); begin Count := 1; - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin - for j := 0 to High(Stacks[i].Layers) do + for j := 0 to High(FStacks[i].LayerData) do begin Data.Material := Inp.Layers[Count].Name; Data.H.V := Inp.Layers[Count].L; Data.s.V := Inp.Layers[Count].s * 1.41; Data.r.V := Inp.Layers[Count].ro; - Stacks[i].UpdateLayer(j, Data); + FStacks[i].UpdateLayer(j, Data); inc(Count); end; - inc(Count, (Stacks[i].N - 1) * (High(Stacks[i].Layers) + 1)); + inc(Count, (FStacks[i].N - 1) * (High(FStacks[i].LayerData) + 1)); end; end; + +function TXRCStructure.FindValue(const Value: string; Base: single): single; +var + JVal : TJSONValue; +begin + JVal := JLayer.FindValue(Value); + if JVal <> nil then + Result := JVal.AsType + else + Result := Base; +end; + + +function TXRCStructure.FindBoolValue(const Value: string): boolean; +var + JVal : TJSONValue; +begin + JVal := JLayer.FindValue(Value); + if JVal <> nil then + Result := JVal.AsType + else + Result := False; +end; + +function TXRCStructure.FindStrValue(const Value: string): string; +var + JVal : TJSONValue; +begin + JVal := JLayer.FindValue(Value); + if JVal <> nil then + Result := JVal.AsType + else + Result := ''; +end; + procedure TXRCStructure.FromString(const S: string); var i, j, p: Integer; Data: TLayerData; JStstructure: TJSONObject; - JLayer, JStack, JSub: TJSONValue; JStacks, JLayers : TJSONArray; ts: string; - - function FindValue(const Value: string; Base: single): single; - var - JVal : TJSONValue; - begin - JVal := JLayer.FindValue(Value); - if JVal <> nil then - Result := JVal.AsType - else - Result := Base; - end; - - - function FindBoolValue(const Value: string): boolean; - var - JVal : TJSONValue; - begin - JVal := JLayer.FindValue(Value); - if JVal <> nil then - Result := JVal.AsType - else - Result := False; - end; + Profiles: array [1..3] of string; + LayerIndex: Integer; begin Visible := False; @@ -690,18 +754,31 @@ procedure TXRCStructure.FromString(const S: string); Data.H.Paired := FindBoolValue('HP'); Data.H.min := FindValue('Hmin', Data.H.V); Data.H.max := FindValue('Hmax', Data.H.V); + Profiles[1] := FindStrValue('ProfileH'); + Data.s.V := JLayer.GetValue('s'); Data.s.Paired := FindBoolValue('SP'); Data.s.min := FindValue('Smin', Data.s.V); Data.s.max := FindValue('Smax', Data.s.V); + Profiles[2] := FindStrValue('ProfileS'); + Data.r.V := JLayer.GetValue('r'); Data.r.Paired := FindBoolValue('RP'); Data.r.min := FindValue('Rmin', Data.r.V); Data.r.max := FindValue('Rmax', Data.r.V); + Profiles[3] := FindStrValue('ProfileR'); + + if Profiles[1] <> '' then + begin + Data.ClearProfiles; + Data.ProfileFromSrting(gsL, Profiles[1]); + Data.ProfileFromSrting(gsS, Profiles[2]); + Data.ProfileFromSrting(gsRo, Profiles[3]); + end; - Stacks[i].AddLayer(Data); + LayerIndex := FStacks[i].AddLayer(Data); end; end; @@ -714,11 +791,11 @@ procedure TXRCStructure.FromString(const S: string); procedure TXRCStructure.GetLayersList(const ID: integer; List: TStrings); var - i, j: Integer; + j: Integer; begin List.Clear; - for j := 0 to High(Stacks[ID].Layers) do - List.Add(Stacks[ID].Layers[j].Material); + for j := 0 to High(FStacks[ID].LayerData) do + List.Add(FStacks[ID].LayerData[j].Material); end; function TXRCStructure.GetSelected: Integer; @@ -728,7 +805,10 @@ function TXRCStructure.GetSelected: Integer; function TXRCStructure.GetStackSize(const ID: Integer): Integer; begin - Result := Stacks[ID].N; + if ID < Length(FStacks) then + Result := FStacks[ID].N + else + Result := -1; end; procedure TXRCStructure.GetStacksList(PeriodicOnly: Boolean; List: TStrings; var RealID: TIntArray); @@ -737,14 +817,14 @@ procedure TXRCStructure.GetStacksList(PeriodicOnly: Boolean; List: TStrings; var begin List.Clear; count := 0; - for I := 0 to High(Stacks) do + for I := 0 to High(FStacks) do begin if not PeriodicOnly then - List.Add(Stacks[i].Title) + List.Add(FStacks[i].Title) else - if Stacks[i].N > 1 then + if FStacks[i].N > 1 then begin - List.Add(Stacks[i].Title); + List.Add(FStacks[i].Title); Inc(Count); SetLength(RealID, Count); RealID[count - 1] := i; diff --git a/editors/editor_Gradient.dfm b/editors/editor_Gradient.dfm index a74391c..8e579a0 100644 --- a/editors/editor_Gradient.dfm +++ b/editors/editor_Gradient.dfm @@ -3,8 +3,8 @@ object edtrGradient: TedtrGradient Top = 0 BorderStyle = bsToolWindow Caption = 'Gradient' - ClientHeight = 257 - ClientWidth = 215 + ClientHeight = 245 + ClientWidth = 207 Color = 16765595 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -17,18 +17,20 @@ object edtrGradient: TedtrGradient object RzPanel2: TRzPanel AlignWithMargins = True Left = 3 - Top = 213 - Width = 209 + Top = 201 + Width = 201 Height = 41 Align = alBottom BorderOuter = fsFlatRounded Color = 15987699 TabOrder = 0 + ExplicitTop = 213 + ExplicitWidth = 209 DesignSize = ( - 209 + 201 41) object btnOK: TRzBitBtn - Left = -7 + Left = -23 Top = 10 Width = 66 Alignment = taRightJustify @@ -40,7 +42,7 @@ object edtrGradient: TedtrGradient ExplicitLeft = 9 end object btnCancel: TRzBitBtn - Left = 119 + Left = 103 Top = 10 Width = 72 Alignment = taRightJustify @@ -55,12 +57,14 @@ object edtrGradient: TedtrGradient AlignWithMargins = True Left = 3 Top = 3 - Width = 209 - Height = 204 + Width = 201 + Height = 192 Align = alClient BorderOuter = fsFlatRounded Color = 15987699 TabOrder = 1 + ExplicitWidth = 209 + ExplicitHeight = 204 object Label1: TLabel Left = 9 Top = 10 diff --git a/editors/editor_Gradient.pas b/editors/editor_Gradient.pas index 91ee3b8..59a16f1 100644 --- a/editors/editor_Gradient.pas +++ b/editors/editor_Gradient.pas @@ -67,8 +67,6 @@ procedure TedtrGradient.cbbStackChange(Sender: TObject); end; procedure TedtrGradient.FillStacksList; -var - i: Integer; begin cbbStack.Text := ''; FStructure.GetStacksList(True, cbbStack.Items, FRealStackID); diff --git a/forms/frm_ExtensionType.dfm b/forms/frm_ExtensionType.dfm index 2a6f134..424c837 100644 --- a/forms/frm_ExtensionType.dfm +++ b/forms/frm_ExtensionType.dfm @@ -29,17 +29,15 @@ object frmExtensionSelector: TfrmExtensionSelector Margins.Bottom = 50 Align = alClient TabOrder = 1 - ExplicitLeft = 48 - ExplicitTop = 32 - ExplicitWidth = 185 - ExplicitHeight = 41 + ExplicitWidth = 480 + ExplicitHeight = 219 DesignSize = ( 484 220) object txtGradient: TLabel Left = 88 Top = 49 - Width = 293 + Width = 289 Height = 26 Anchors = [akLeft, akTop, akRight] AutoSize = False @@ -50,7 +48,7 @@ object frmExtensionSelector: TfrmExtensionSelector object txtUnregister: TLabel Left = 88 Top = 119 - Width = 349 + Width = 345 Height = 51 Anchors = [akLeft, akTop, akRight] AutoSize = False diff --git a/forms/frm_ExtensionType.pas b/forms/frm_ExtensionType.pas index e1c576f..c2df650 100644 --- a/forms/frm_ExtensionType.pas +++ b/forms/frm_ExtensionType.pas @@ -44,7 +44,7 @@ implementation resourcestring rstrGradientRadioCaption = 'Gradient'; rstrGradientRadioHint = 'Create ad istribution of a parameter (H, s, rho) for cirtain layer'; - rstrProfileRadioCaption = 'Distribution'; + rstrProfileRadioCaption = 'Profile'; rstrProfileRadioHint = 'Create a parameters'' distribution table'; function AskSelectExtensionTypenAction: TExtentionType; diff --git a/forms/frm_Main.dfm b/forms/frm_Main.dfm index 22a9525..2f5c701 100644 --- a/forms/frm_Main.dfm +++ b/forms/frm_Main.dfm @@ -978,7 +978,6 @@ object frmMain: TfrmMain Checked = True State = cbChecked TabOrder = 6 - OnClick = cbTreatPeriodicClick end end object TabSheet2: TRzTabSheet @@ -1828,6 +1827,7 @@ object frmMain: TfrmMain '0.25' '0.1' '0.01') + ItemIndex = 4 Values.Strings = ( '10' '5' @@ -3930,14 +3930,11 @@ object frmMain: TfrmMain OnPopup = pmProjectPopup Left = 128 Top = 368 - object pmiNorm: TMenuItem - Caption = 'Normalize' - object Auto1: TMenuItem - Action = DataNormAuto - end - object Manual1: TMenuItem - Action = DataNormMan - end + object pmiEnabled: TMenuItem + AutoCheck = True + Caption = 'Enabled' + ShortCut = 114 + OnClick = pmiEnabledClick end object pmiVisible: TMenuItem AutoCheck = True @@ -3949,11 +3946,14 @@ object frmMain: TfrmMain Caption = 'Linked' OnClick = pmiLinkedClick end - object pmiEnabled: TMenuItem - AutoCheck = True - Caption = 'Enabled' - ShortCut = 114 - OnClick = pmiEnabledClick + object pmiNorm: TMenuItem + Caption = 'Normalize' + object Auto1: TMenuItem + Action = DataNormAuto + end + object Manual1: TMenuItem + Action = DataNorm + end end object N1: TMenuItem Caption = '-' @@ -3979,8 +3979,8 @@ object frmMain: TfrmMain end object ilStructure: TImageList ColorDepth = cd32Bit - Left = 480 - Top = 40 + Left = 392 + Top = 80 Bitmap = { 494C010109004800040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000003000000001002000000000000030 @@ -4000,110 +4000,105 @@ object frmMain: TfrmMain 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E75FFAC9A + 71FFAA976DFFA69369FFA49064FFA08E60FF9E8A5CFF9C8759FF988354FF9680 + 50FF000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFAF2E9FFF7EDE0FFF6E7 - D7FFF3E2CFFF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFBF7F0FFFAF2E9FFF7ED - E0FFF6E7D7FF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E75FFAC9A + 71FFAA976DFFA69369FFA49064FFA08E60FF9E8A5CFF9C8759FF988354FF9680 + 50FF000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFEFBFAFFFBF7F0FFFAF2 - E9FFF7EDE0FF93846FFF00000000000000000000000000000000000000000610 - 0470000000100000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF93846FFF93846FFF93846FFF93846FFF000000001E54 - 15FF14370ECF0001002000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000658A + A8EF658AA8EF3F3F3F400000000000000000AF9E74FFAB996EFFA69569FFA38F + 62FF9F8A5DFF9A8656FF978151FF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 000093846FFFFAF2E9FFF7EDE0FFF6E7D7FFF3E2CFFF93846FFF000000001E54 - 15FF196B15F71B4A13EF03080250000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000658AA8EF004182FF0041 + 82FF4079B7F7004182FF7F7F7F80000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 000093846FFFFBF7F0FFFAF2E9FFF7EDE0FFF6E7D7FF93846FFF000000001E54 - 15FF1E9F20ED1B6916F81E5415FF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000004182FF9CC1DEEDA2C4 + E0ED8AB6E0ED4D82C3F5004182FF00000000AF9E74FFAB996EFFA69569FFA38F + 62FF9F8A5DFF9A8656FF978151FF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 000093846FFFFEFBFAFFFBF7F0FFFAF2E9FFF7EDE0FF93846FFF000000001E54 - 15FF278224F61B4A13EF040C0360000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000658AA8EF004182FF0041 + 82FF5290BEF6004182FF8D8D8D8F000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF93846FFF93846FFF93846FFF93846FFF000000001E54 - 15FF14370ECF0103003000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000658A + A8EF658AA8EF4F4F4F500000000000000000AF9E74FFAB996EFFA69569FFA38F + 62FF9F8A5DFF9A8656FF978151FF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFAF2E9FFF7EDE0FFF6E7 - D7FFF3E2CFFF93846FFF00000000000000000000000000000000000000000815 - 0580000000100000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFBF7F0FFFAF2E9FFF7ED - E0FFF6E7D7FF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E75FFAC9A + 71FFAA976DFFA69369FFA49064FFA08E60FF9E8A5CFF9C8759FF988354FF9680 + 50FF000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFFFEFBFAFFFBF7F0FFFAF2 - E9FFF7EDE0FF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E75FFAC9A + 71FFAA976DFFA69369FFA49064FFA08E60FF9E8A5CFF9C8759FF988354FF9680 + 50FF000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -4115,259 +4110,264 @@ object frmMain: TfrmMain 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000696969FF696969FF686868FF676767FF666666FF666666FF656565FF6464 - 64FF646464FF636363FF00000000000000000000000000000000000000000000 - 0000000000001D12019F754D07FF634006FF1009008000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000686868FF686868FF676767FF676767FF666666FF656565FF656565FF6464 - 64FF636363FF636363FF636363FF000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000797979FFF7F7F7FF98A9CBFFEFEFEFFFEFEFEFFFEFEFEFFFEEEEEEFFEEEE - EEFFF6F6F6FF747474FF00000000000000000000000000000000000000000000 - 0000020100306B4506FF130B008F1D1000AF573402FF06030050000000000000 - 00000000000000000000000000000000000000000000246595FF246595FF2465 - 95FF787878FFF7F7F7FF98A9CBFFEFEFEFFFEFEFEFFFEFEFEFFFEEEEEEFFEEEE - EEFFEEEEEEFFF6F6F6FF727272FF0000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000888888FF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000636363FF636363FF626262FF616161FF606060FF606060FF5F5F5FFF5E5E + 5EFF5E5E5EFF5D5D5DFF00000000000000000000000000000000000000000000 + 0000000000009696959F6F4701FF5D3A00FF7E7E7D8000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000626262FF626262FF616161FF616161FF606060FF5F5F5FFF5F5F5FFF5E5E + 5EFF5D5D5DFF5D5D5DFF5D5D5DFF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000737373FFF7F7F7FF98A9CBFFEFEFEFFFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFF6F6F6FF6E6E6EFF00000000000000000000000000000000000000000000 + 00002F2F2F30653F00FF8A8A898F9F9D9CAF512E00FF4F4F4F50000000000000 + 000000000000000000000000000000000000000000001E5F95FF1E5F95FF1E5F + 95FF727272FFF7F7F7FF98A9CBFFEFEFEFFFEFEFEFFFEFEFEFFFEEEEEEFFEEEE + EEFFEEEEEEFFF6F6F6FF6C6C6CFF000000000000000000000000AF9E78FFAC9A + 74FFAA9770FFA6936CFFA49067FFA08E63FF9E8A5FFF9C875CFF988357FF9680 + 53FF000000000000000000000000000000000000000000000000000000000000 + 0000888888FF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 8CFFD9B08CFF838383FF00000000000000000000000000000000000000000000 - 000002010030613C05FF0603005000000000291700BF2E1B01BF000000000000 - 00000000000000000000000000000000000000000000246595FF4C9DC1FF4E9F - C4FF868686FF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFD9B08CFF818181FF0000000093846FFFFAF2E9FFF7EDE0FFF6E7 - D7FFF3E2CFFF93846FFF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000696969FF696969FF6262 - 62FF939393FFF3F3F3FF98A9CBFFE7E7E7FFE7E7E7FFE7E7E7FFE6E6E6FFE3E3 + 00002F2F2F305B3600FF4F4F4F5000000000A4A19BBFA4A19CBF000000000000 + 000000000000000000000000000000000000000000001E5F95FF469DC1FF489F + C4FF868686FF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 + 8CFFD9B08CFFD9B08CFF818181FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000636363FF636363FF5C5C + 5CFF939393FFF3F3F3FF98A9CBFFE7E7E7FFE7E7E7FFE7E7E7FFE6E6E6FFE3E3 E3FFF0F0F0FF909090FF00000000000000000000000000000000000000000000 - 000000000000361F00DF4E3005EF06030050271600BF341D01BF000000000000 - 00000000000000000000000000000000000000000000246595FF4EA0C5FF50A3 + 000000000000928779DF7F6A4DEF4F4F4F50A3A19BBFA5A19CBF000000000000 + 000000000000000000000000000000000000000000001E5F95FF48A0C5FF4AA3 C6FF919191FFF2F2F2FF98A9CBFFE6E6E6FFE6E6E6FFE6E6E6FFE6E6E6FFE5E5 - E5FFE2E2E2FFF0F0F0FF8C8C8CFF0000000093846FFFFBF7F0FFFAF2E9FFF7ED - E0FFF4E7D7FF93846FFF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000797979FFF7F7F7FF8E96 + E5FFE2E2E2FFF0F0F0FF8C8C8CFF000000000000000000000000AF9E78FFAC9A + 74FFAA9770FFA6936CFFA49067FFA08E63FF9E8A5FFF9C875CFF988357FF9680 + 53FF0000000000000000000000000000000000000000737373FFF7F7F7FF8E96 AAFF9D9D9DFFD9B08CFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFF999999FF000000000000000002010030130B008F130B008F0402 - 00400000000004020040754507FFA46514FF7D4808FF10090080000000000000 - 00000000000000000000000000000000000000000000296B99FF51A4C7FF52A7 + 8CFFD9B08CFF999999FF00000000000000002F2F2F308A8A898F8A8A898F3F3F + 3F40000000003F3F3F406F3F01FFA45F0EFF774202FF7E7E7D80000000000000 + 00000000000000000000000000000000000000000000236599FF4BA4C7FF4CA7 C9FF999999FFD9B08CFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFD9B08CFF979797FF0000000093846FFFFEFCFAFFFBF7F0FFFAF0 - E7FFF7EDE0FF93846FFF00000000010300301B4A13EF00000000000000000000 - 00000000000000000000000000000000000000000000888888FF7C7C7DFF8E96 + 8CFFD9B08CFFD9B08CFF979797FF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000888888FF767677FF8E96 AAFFA3A3A3FFF6F6F6FF98A9CBFFEFEFEFFFEFEFEFFFEFEFEFFFEEEEEEFFEBEB - EBFFF4F4F4FFA0A0A0FF00000000000000004F3203EF583702EF4A2902DF5932 - 02FF221300AF00000010130B008FA4590EFF2E1900CF00000000000000000000 - 000000000000000000000000000000000000000000002F729FFF53A9CAFF54AB + EBFFF4F4F4FFA0A0A0FF00000000000000007F6A4BEF866E4BEF9B8C7ADF532C + 00FF9F9E9CAF0F0F0F108A8A898FA45308FFA09A92CF00000000000000000000 + 00000000000000000000000000000000000000000000296C9FFF4DA9CAFF4EAB CCFFA0A0A0FFF6F6F6FF98A9CBFFEEEEEEFFEEEEEEFFEEEEEEFFEDEDEDFFEBEB - EBFFEAEAEAFFF3F3F3FF9E9E9EFF0000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF040C03601B4A13EF1E5415FF0000000093846FFF9384 - 6FFF93846FFF93846FFF93846FFF93846FFF00000000939393FFF3F3F3FF8E96 - AAFFA7A7A7FF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFA6A6A6FF0000000000000000623D02FF1009008000000000180D - 009F91540AFF432602DF04020040492802EF462702DF00000000000000000000 - 000000000000000000000000000000000000000000003477A4FF55ACCCFF56AF - CFFFA6A6A6FF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFD9B08CFFA4A4A4FF000000000000000000000000000000000000 - 000000000000091A068F206719FF149616FF1E5415FF0000000093846FFFFAF2 - E9FFF7EDE0FFF6E7D7FFF3E2CFFF93846FFF000000009D9D9DFFD9B08CFF8E96 + EBFFEAEAEAFFF3F3F3FF9E9E9EFF0000000000000000000000003F3F3F409BA4 + A9BF004589FF000000000000000000000000AF9E77FFAB9971FFA6956CFFA38F + 65FF9F8A60FF9A8659FF978154FF0000000000000000939393FFF3F3F3FF8E96 + AAFFA7A7A7FF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 + 8CFFD9B08CFFA6A6A6FF00000000000000005C3700FF7E7E7D80000000009695 + 959F914E04FF978B7ADF3F3F3F407B644BEF998C7ADF00000000000000000000 + 000000000000000000000000000000000000000000002E71A4FF4FACCCFF50AF + CFFFA6A6A6FF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 + 8CFFD9B08CFFD9B08CFFA4A4A4FF0000000000000000898A8B8F00559DFF2D84 + D7FB025BB1FF004589FF004589FF000000000000000000000000000000000000 + 000000000000000000000000000000000000000000009D9D9DFFD9B08CFF8E96 AAFFABABABFFFAFAFAFF98A9CBFFF6F6F6FFF6F6F6FFF4F4F4FFF3F3F3FFF2F2 - F2FFF7F7F7FFAAAAAAFF0000000000000000362101CF462A01EF040200400603 - 00508F520AFFA55A0EFF683805FF231300BF462903FF0C0A0860000000000000 - 000000000000000000000000000000000000000000003C83ADFF57B0D0FF59B2 + F2FFF7F7F7FFAAAAAAFF0000000000000000A29C93CF79654AEF3F3F3F404F4F + 4F508F4C04FFA55408FF623200FFA29F9BBF402300FF5F5F5F60000000000000 + 000000000000000000000000000000000000000000003683ADFF51B0D0FF53B2 D3FFA9A9A9FFF8F8F8FF98A9CBFFF3F3F3FFF4F4F4FFF3F3F3FFF3F3F3FFF2F2 - F2FFEFEFEFFFF6F6F6FFA7A7A7FF000000000000000000000000000000000000 - 0000040C03601E5415FF51CF5AFF33CE39FF1E5415FF0000000093846FFFFBF7 - F0FFFAF2E9FFF7EDE0FFF4E7D7FF93846FFF00000000A3A3A3FFF6F6F6FF8E96 + F2FFEFEFEFFFF6F6F6FFA7A7A7FF0000000000000000004E90FF60B3E6FA7DBD + E7F5509DE3F54485DFF5004589FF00000000AF9E77FFAB9971FFA6956CFFA38F + 65FF9F8A60FF9A8659FF978154FF0000000000000000A3A3A3FFF6F6F6FF8E96 AAFFADADADFFD9B08CFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFACACACFF000000000000000002010030362000DF543001FF5A32 - 02FF522F03EF462705BE271600BF462903FF625B51FF5B5B5BEF030303300000 - 00000000000000000000000000000000000000000000428AB2FF59B4D4FF5BB6 + 8CFFD9B08CFFACACACFF00000000000000002F2F2F30928779DF4E2A00FF542C + 00FF81694BEFA8A49DBEA3A19BBF402300FF5C554BFF888888EF2F2F2F300000 + 000000000000000000000000000000000000000000003C8AB2FF53B4D4FF55B6 D7FFACACACFFD9B08CFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFD9B0 - 8CFFD9B08CFFD9B08CFFABABABFF000000000000000000000000000000000000 - 000000000000061004702A6522FF37BC3CFF1E5415FF0000000093846FFFFEFC - FAFFFBF7F0FFFAF0E7FFF7EDE0FF93846FFF00000000A7A7A7FF7C7C7DFF8E96 + 8CFFD9B08CFFD9B08CFFABABABFF00000000000000006E6F6F700C5D97FF84BD + E0FA0C67B2FF004589FF004589FF000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000A7A7A7FF767677FF8E96 AAFFADADADFFFBFBFBFF98A9CBFFFAFAFAFFFAFAFAFFF8F8F8FFA5A5A5FFA5A5 - A5FFBFBFBFFFADADADFF00000000000000000000000000000000040200400402 - 004001000020000000000000000005050440595959EFA0A0A0FF565656EF0303 - 033000000000000000000000000000000000000000004791B8FF5BB7D7FF5DBA + A5FFBFBFBFFFADADADFF000000000000000000000000000000003F3F3F403F3F + 3F401F1F1F2000000000000000003F3F3F40878787EFA0A0A0FF858585EF2F2F + 2F3000000000000000000000000000000000000000004191B8FF55B7D7FF57BA D9FFADADADFFFBFBFBFF98A9CBFFF8F8F8FFF8F8F8FFF8F8F8FFF7F7F7FFF6F6 - F6FFF3F3F3FFF8F8F8FFADADADFF0000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF030802501B4A13EF1E5415FF0000000093846FFF9384 - 6FFF93846FFF93846FFF93846FFF93846FFF00000000ABABABFFFAFAFAFF8E96 - AAFFAFAFAFFF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFA5A5A5FFF2F2 - F2FFC9C9C9FF737373CF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000003030330656565EF7A7A7AFF5A5A - 5AEF03030330000000000000000000000000000000004F9AC0FF5EBBD9FF5FBD - DCFFAFAFAFFF7C7C7DFF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFB6B6 - B6FFB4B4B4FFBFBFBFFFADADADFF0000000093846FFFFAF2E9FFF7EDE0FFF6E7 - D7FFF3E2CFFF93846FFF000000000103003014370ECF00000000000000000000 + F6FFF3F3F3FFF8F8F8FFADADADFF0000000000000000000000003F3F3F407996 + A9DF004589FF000000000000000000000000AF9E77FFAB9971FFA6956CFFA38F + 65FF9F8A60FF9A8659FF978154FF0000000000000000ABABABFFFAFAFAFF8E96 + AAFFAFAFAFFF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFA5A5A5FFF2F2 + F2FFC9C9C9FFB3B3B3CF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000002F2F2F30909090EF747474FF8787 + 87EF2F2F2F3000000000000000000000000000000000499AC0FF58BBD9FF59BD + DCFFAFAFAFFF767677FF98A9CBFFD9B08CFFD9B08CFFD9B08CFFD9B08CFFB6B6 + B6FFB4B4B4FFBFBFBFFFADADADFF000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000ADADADFFD9B08CFF8E96 AAFFAFAFAFFFFEFEFEFF98A9CBFFFEFEFEFFFEFEFEFFFCFCFCFFBBBBBBFFBDBD - BDFF737373CF0000001000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000090909507C7C7CFF7575 - 75FF666666EF09090950000000000000000000000000509DC1FF61BFDDFF62C1 + BDFFB3B3B3CF0F0F0F1000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000004F4F4F50767676FF6F6F + 6FFF919191EF4F4F4F500000000000000000000000004A9DC1FF5BBFDDFF5CC1 DEFFAFAFAFFFFCFCFCFF98A9CBFFFAFAFAFFFBFBFBFFFAFAFAFFFAFAFAFFBCBC - BCFFE9E9E9FFBABABAFF4343439F0000000093846FFFFBF7F0FFFAF2E9FFF7ED - E0FFF4E7D7FF93846FFF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000ADADADFFFBFBFBFF8E96 - AAFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFF7373 - 73CF000000100000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000191919807676 - 76FF5A5A5AEF626262FF0D0D0D600000000000000000519EC2FF63C2E0FF898C - 8EFF787C7DFF717475FF696C6DFF696C6DFF626566FF626566FF626566FFE2E2 - E2FFBBBBBBFF4343439F000000000000000093846FFFFEFCFAFFFBF7F0FFFAF0 - E7FFF7EDE0FF93846FFF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000AFAFAFFF7C7C7DFF8E96 - AAFFB5AAA0FFB5AAA0FFB5AAA0FFB5AAA0FFA5A5A5FFB8B8B8FF737373CF0000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000002626 - 269F4B4B4BDF09090950565656EF0D0D0D6000000000529FC2FF65C6E2FF66A7 - BAFF696B6BFF717374FF878C8EFF8F9899FF757878FF696A6BFF959595FFAFAF - AFFF799EAFFF00000000000000000000000093846FFF93846FFF93846FFF9384 - 6FFF93846FFF93846FFF00000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000AFAFAFFFFEFEFEFF98A9 - CBFFFEFEFEFFFEFEFEFFFCFCFCFFFBFBFBFFBDBDBDFF737373CF000000100000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0010404040CF0D0D0D60000000100D0D0D600000000053A0C4FF67CAE6FF69CC - E7FF6E6F6FFFADB2B4FFA3A9AAFFB8C2C4FFB0B5B6FF676868FF74E1F7FF76E3 - F8FF368BB5FF0000000000000000000000000000000000000000000000000000 + BCFFE9E9E9FFBABABAFF9898989F000000000000000000000000AF9E78FFAC9A + 74FFAA9770FFA6936CFFA49067FFA08E63FF9E8A5FFF9C875CFF988357FF9680 + 53FF0000000000000000000000000000000000000000ADADADFFFBFBFBFF8E96 + AAFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFB3B3 + B3CF0F0F0F100000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007E7E7E807070 + 70FF878787EF5C5C5CFF5F5F5F6000000000000000004B9EC2FF5DC2E0FF898C + 8EFF727677FF6B6E6FFF636667FF636667FF5C5F60FF5C5F60FF5C5F60FFE2E2 + E2FFBBBBBBFF9898989F00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000AFAFAFFF767677FF8E96 + AAFFB5AAA0FFB5AAA0FFB5AAA0FFB5AAA0FFA5A5A5FFB8B8B8FFB3B3B3CF0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000009797 + 979F9B9B9BDF4F4F4F50858585EF5F5F5F60000000004C9FC2FF5FC6E2FF60A7 + BAFF636565FF6B6D6EFF878C8EFF8F9899FF6F7272FF636465FF959595FFAFAF + AFFF739EAFFF0000000000000000000000000000000000000000AF9E78FFAC9A + 74FFAA9770FFA6936CFFA49067FFA08E63FF9E8A5FFF9C875CFF988357FF9680 + 53FF0000000000000000000000000000000000000000AFAFAFFFFEFEFEFF98A9 + CBFFFEFEFEFFFEFEFEFFFCFCFCFFFBFBFBFFBDBDBDFFB3B3B3CF0F0F0F100000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000F0F + 0F10A5A5A5CF5F5F5F600F0F0F105F5F5F60000000004DA0C4FF61CAE6FF63CC + E7FF686969FFADB2B4FFA3A9AAFFB8C2C4FFB0B5B6FF616262FF6EE1F7FF70E3 + F8FF308BB5FF0000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000AFAFAFFFAFAFAFFFAFAF - AFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFF737373CF00000010000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000102E2E2EAF00000000000000000000000054A3C5FF54A3C5FF55A4 - C6FF517587FF577D8EFF697880FF6B7C83FF507586FF527888FF57A9CBFF4AA0 - C5FF4096BCFF0000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000002200000039010000550100005E0101005D0101 - 005D0101005D0101005700000011000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000002030155032A01DD28271FB4F5EFE7FFEFE8DFFFEEE5DBFFEDE4 - D8FFF3ECE1FF766E64E80000000D000000000000000000000000000000000004 - 0840002948BF004B89FF000000000000000000000000AF9E7DFFAB9977FFA695 - 72FFA38F6BFF9F8A66FF9A865FFF97815AFF0000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000000000000000 - 00000009007F108E1EFF004A01F11F1B18A2FFFFFFFFFFFAF1FFFCF0E4FFF9E8 - D6FFFFFFEFFF6D6762DD0000000E0000000000000000000000000017288F045B - 9DFF1B7AD7FB0861B1FF004B89FF004B89FF0000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000193516B260E36DFF07610EE71E1917A4FFFFFFFFFFFBF5FFFAF2E8FFF7E9 - DCFFFFFFF2FF6B665FDD0000000E000000000000000000000000025490FF54AD - E6FA62B1E7F52986E3F51969DFF5004B89FF00000000AF9E7DFFAB9977FFA695 - 72FFA38F6BFF9F8A66FF9A865FFF97815AFF0000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000A000000190000001C0000 - 0019000000100A1C09AE0B5713F325221BB2FFFFFFFFFFFFFCFFFFFAF4FFFEF6 - EEFFFFFFFBFF7E766BF00000000B000000000000000000000000000E18701263 - 97FF78B7E0FA126DB2FF004B89FF004B89FF0000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + AFFFAFAFAFFFAFAFAFFFAFAFAFFFAFAFAFFFB3B3B3CF0F0F0F10000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000F0F0F10A1A1A1AF0000000000000000000000004EA3C5FF4EA3C5FF4FA4 + C6FF4B6F87FF51778EFF637280FF657683FF4A6F86FF4C7288FF51A9CBFF44A0 + C5FF3A96BCFF0000000000000000000000000000000000000000000000000000 + 000000000000000000000000002202020239040200550401005E0302005D0302 + 015D0502015D0504025701010111000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000060B0555043101DD38372DB4F5EFE7FFEFE8DFFFEEE5DBFFEDE4 + D8FFF3ECE1FF827A6EE80101010D000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000013007F108E1EFF004F01F1302B26A2FFFFFFFFFFFAF1FFFCF0E4FFF9E8 + D6FFFFFFEFFF7F7772DD0000000E0000000093846BFF93846BFF93846BFF9384 + 6BFF93846BFF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FF938469FF938469FF9384 + 69FF938469FF938469FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000003F3F + 3F40909BA2BF004689FF000000000000000000000000AF9E78FFAB9972FFA695 + 6DFFA38F66FF9F8A61FF9A865AFF978155FF0000000000000000000000000000 + 0000244C20B260E36DFF086B10E7302723A4FFFFFFFFFFFBF5FFFAF2E8FFF7E9 + DCFFFFFFF2FF7D776FDD0000000E0000000093846BFFFAF2E9FFF7EDE0FFF6E7 + D7FFF3E2CFFF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FFFAF2E9FFF7EDE0FFF6E7 + D7FFF3E2CFFF938469FF00000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000008687888F0056 + 9DFF2A82D7FB035CB1FF004689FF004689FF0000000000000000000000000000 + 0000000000000000000000000000000000000000000A000000190000001C0000 + 0019000000100E2A0EAE0C5C14F3353227B2FFFFFFFFFFFFFCFFFFFAF4FFFEF6 + EEFFFFFFFBFF867E72F00000000B0000000093846BFFFBF7F0FFFAF2E9FFF7ED + E0FFF4E7D7FF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FFFBF7F0FFFAF2E9FFF7ED + E0FFF6E7D7FF938469FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000004F90FF5EB2 + E6FA78BBE7F54A9AE3F53E80DFF5004689FF00000000AF9E78FFAB9972FFA695 + 6DFFA38F66FF9F8A61FF9A865AFF978155FF857C6EE89C958DED9D968DEE9D96 + 8DEE9E958FE8988D88E62D3622C712130F585F59549558544D9558544F955854 + 50955B5651953836327A000000000000000093846BFFFEFCFAFFFBF7F0FFFAF0 + E7FFF7EDE0FF93846BFF000000002F2F2F30496D43EF00000000000000000000 + 000000000000000000000000000000000000938469FFFEFBFAFFFBF7F0FFFAF2 + E9FFF7EDE0FF938469FF00000000000000000000000000000000000000006E6F + 6E700F0F0F1000000000000000000000000000000000000000006D6E6E700D5E + 97FF82BCE0FA0D68B2FF004689FF004689FF0000000000000000000000000000 + 000000000000000000000000000000000000D5CFC6FFFFFFFFFFFFFFF6FFFFFC + EFFFFFF7E5FFFFFFFFFF322C2BA2000000000000000000000000000000000000 + 00000000000000000000000000000000000093846BFF93846BFF93846BFF9384 + 6BFF93846BFF93846BFF5D5E5D60496D43EF1A5011FF0000000093846BFF9384 + 6BFF93846BFF93846BFF93846BFF93846BFF938469FF938469FF938469FF9384 + 69FF938469FF938469FF938469FF938469FF938469FF938469FF00000000184E + 0FFF98A297CF1F1F1F2000000000000000000000000000000000000000003F3F + 3F406B8CA2DF004689FF000000000000000000000000AF9E78FFAB9972FFA695 + 6DFFA38F66FF9F8A61FF9A865AFF978155FFC9C2B9FFFBF7F2FFF8F0E6FFF6EB + DFFFF6E5D3FFFFFAECFF322E2AA8000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008183818F1C6315FF109612FF1A5011FF0000000093846BFFFAF2 + E9FFF7EDE0FFF6E7D7FFF3E2CFFF93846BFF0000000000000000000000000000 + 0000938469FFFAF2E9FFF7EDE0FFF6E7D7FFF3E2CFFF938469FF00000000184E + 0FFF3B7E38F75C7C56EF4F4F4F50000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000D4CDC3FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFF6FFFFFFFFFF35312DAC000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00005D5E5D601A5011FF4DCF56FF2FCE35FF1A5011FF0000000093846BFFFBF7 + F0FFFAF2E9FFF7EDE0FFF4E7D7FF93846BFF0000000000000000000000000000 + 0000938469FFFBF7F0FFFAF2E9FFF7EDE0FFF6E7D7FF938469FF00000000184E + 0FFF63BA65ED397B35F8184E0FFF000000000000000000000000AF9E79FFAC9A + 75FFAA9771FFA6936DFFA49068FFA08E64FF9E8A60FF9C875DFF988358FF9680 + 54FF00000000000000000000000000000000766E63D58B867FDA8B867FDA8B85 + 7FDA8B867FDA908B83DB201D198F000000020000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000006B6C6B7026611EFF33BC38FF1A5011FF0000000093846BFFFEFC + FAFFFBF7F0FFFAF0E7FFF7EDE0FF93846BFF0000000000000000000000000000 + 0000938469FFFEFBFAFFFBF7F0FFFAF2E9FFF7EDE0FF938469FF00000000184E + 0FFF4B9849F65C7C56EF5F5F5F60000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000373028A03A352FAC3B362FAD3B36 + 2FAD3B3832AD403A32AE120F0C7B010101040000000000000000000000000000 + 00000000000000000000000000000000000093846BFF93846BFF93846BFF9384 + 6BFF93846BFF93846BFF4F4F4F50496D43EF1A5011FF0000000093846BFF9384 + 6BFF93846BFF93846BFF93846BFF93846BFF938469FF938469FF938469FF9384 + 69FF938469FF938469FF938469FF938469FF938469FF938469FF00000000184E + 0FFF98A297CF2F2F2F3000000000000000000000000000000000AF9E79FFAC9A + 75FFAA9771FFA6936DFFA49068FFA08E64FF9E8A60FF9C875DFF988358FF9680 + 54FF00000000000000000000000000000000D4CDC1FFFFFFFCFFFFFEF4FFFFFB + F0FFFFF7E9FFFFFFFBFF37332EB0000000000000000000000000000000000000 + 00000000000000000000000000000000000093846BFFFAF2E9FFF7EDE0FFF6E7 + D7FFF3E2CFFF93846BFF000000002F2F2F307C8C7ACF00000000000000000000 + 000000000000000000000000000000000000938469FFFAF2E9FFF7EDE0FFF6E7 + D7FFF3E2CFFF938469FF00000000000000000000000000000000000000007E7E + 7E800F0F0F100000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000CAC3BBFFFCF7F1FFF9EFE3FFF7EB + DCFFF6E4D1FFFFFAECFF322E2AA8000000000000000000000000000000000000 + 00000000000000000000000000000000000093846BFFFBF7F0FFFAF2E9FFF7ED + E0FFF4E7D7FF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FFFBF7F0FFFAF2E9FFF7ED + E0FFF6E7D7FF938469FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E79FFAC9A + 75FFAA9771FFA6936DFFA49068FFA08E64FF9E8A60FF9C875DFF988358FF9680 + 54FF00000000000000000000000000000000CCC5BCFFFFFFFFFFFFFCF6FFFFF6 + EDFFFEF2E4FFFFFFF9FF322E29A9000000000000000000000000000000000000 + 00000000000000000000000000000000000093846BFFFEFCFAFFFBF7F0FFFAF0 + E7FFF7EDE0FF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FFFEFBFAFFFBF7F0FFFAF2 + E9FFF7EDE0FF938469FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000BBB3A6FFE6E2DEFFE5E1DBFFE5DF + D9FFE5DED6FFE9E6DEFF2D29249F000000000000000000000000000000000000 + 00000000000000000000000000000000000093846BFF93846BFF93846BFF9384 + 6BFF93846BFF93846BFF00000000000000000000000000000000000000000000 + 000000000000000000000000000000000000938469FF938469FF938469FF9384 + 69FF938469FF938469FF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000AF9E79FFAC9A + 75FFAA9771FFA6936DFFA49068FFA08E64FF9E8A60FF9C875DFF988358FF9680 + 54FF00000000000000000000000000000000403B357E3B37317E3C37317E3C38 + 327E3C38337E413A347E19181645000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000797064E8918B83ED928C84EE928C - 84EE908782E8897F7BE6232A1AC7060605583733309533302D9533302D953331 - 2E9534322F951B1A177A00000000000000000000000000000000000000000004 - 0840013D69DF004B89FF000000000000000000000000AF9E7DFFAB9977FFA695 - 72FFA38F6BFF9F8A66FF9A865FFF97815AFF0000000000000000000408400029 - 48BF004B89FF000000000000000000000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF000000000000000000000000000000000041 - 71EF004171EF000408400000000000000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF00000000D5CFC6FFFFFFFFFFFFFFF6FFFFFC - EFFFFFF7E5FFFFFFFFFF201C1BA2000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000017288F045B9DFF1B7A - D7FB0861B1FF004B89FF004B89FF000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000004171EF004A82FF004A - 82FF0B59A5F7004A82FF00132080000000000000000000000000000000000000 - 000000000000000000000000000000000000C9C2B9FFFBF7F2FFF8F0E6FFF6EB - DFFFF6E5D3FFFFFAECFF211E1BA8000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF0000000000000000000000000000000000000000025490FF54ADE6FA62B1 - E7F52986E3F51969DFF5004B89FF00000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF0000000000000000004A82FF549BD5ED5EA2 - D9ED3585D8ED0B58B1F5004A82FF00000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF00000000D4CDC3FFFFFFFFFFFFFFFFFFFFFF - FFFFFFFFF6FFFFFFFFFF24211EAC000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000E1870126397FF78B7 - E0FA126DB2FF004B89FF004B89FF000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000004171EF004A82FF004A - 82FF1B6CACF6004A82FF0017288F000000000000000000000000000000000000 - 000000000000000000000000000000000000625B52D577726CDA77726CDA7772 - 6CDA77726CDA7C7770DB12100D8F000000020000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF00000000000000000000000000000000000000000000000000040840013D - 69DF004B89FF000000000000000000000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF000000000000000000000000000000000041 - 71EF004171EF00070C500000000000000000AF9E7DFFAB9977FFA69572FFA38F - 6BFF9F8A66FF9A865FFF97815AFF00000000221E19A027241FAC282520AD2825 - 20AD282521AD2C2822AE0907067B000000040000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000D4CDC1FFFFFFFCFFFFFEF4FFFFFB - F0FFFFF7E9FFFFFFFBFF26231FB0000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF00000000000000000000000000000000CAC3BBFFFCF7F1FFF9EFE3FFF7EB - DCFFF6E4D1FFFFFAECFF211E1CA8000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000CCC5BCFFFFFFFFFFFFFCF6FFFFF6 - EDFFFEF2E4FFFFFFF9FF211F1BA9000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF000000000000000000000000000000000000000000000000AF9E7EFFAC9A - 7AFFAA9776FFA69372FFA4906DFFA08E69FF9E8A65FF9C8762FF98835DFF9680 - 59FF00000000000000000000000000000000BBB3A6FFE6E2DEFFE5E1DBFFE5DF - D9FFE5DED6FFE9E6DEFF1C1A169F000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000001F1D1A001D1B187E1E1B187E1E1C - 197E1E1C197E1F1D1A7E07060645000000000000000000000000000000000000 000000000000000000000000000000000000424D3E000000000000003E000000 2800000040000000300000000100010000000000800100000000000000000000 000000000000000000000000FFFFFF0000000000000000000000000000000000 @@ -4378,11 +4378,11 @@ object frmMain: TfrmMain 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FC01000000000000F801000000000000 + F001000000000000F00100000000000000010000000000000003000000000000 + 01FF00000000000001FF00000000000001FF00000000000000FF000000000000 + 00FF00000000000001FF00000000000001FF00000000000001FF000000000000 + 01FF00000000000001FF00000000000000000000000000000000000000000000 000000000000} end object ilCalc: TImageList diff --git a/forms/frm_Main.pas b/forms/frm_Main.pas index d804cc0..1c68339 100644 --- a/forms/frm_Main.pas +++ b/forms/frm_Main.pas @@ -359,7 +359,6 @@ TfrmMain = class(TForm) procedure ChartZoom(Sender: TObject); procedure RzButton1Click(Sender: TObject); procedure DataNormAutoExecute(Sender: TObject); - procedure cbTreatPeriodicClick(Sender: TObject); private Project : TXRCProjectTree; LFPSO: TLFPSO_Base; @@ -384,6 +383,7 @@ TfrmMain = class(TForm) FThicknessSeries: TSeriesList ; FRoughnessSeries: TSeriesList ; FDensitySeries: TSeriesList ; + FGradients: TGradients; procedure CreateProjectTree; procedure LoadProject(const FileName: string; Clear: Boolean); @@ -400,7 +400,6 @@ TfrmMain = class(TForm) procedure SaveProject(const FileName: string); procedure SaveData; procedure AddCurve(Data: PProjectData); - procedure PlotDistributions(Model: TLayeredModel); procedure PrepareDistributionCharts; function GetFitParams: TFitParams; procedure EditProjectItem; @@ -410,10 +409,18 @@ TfrmMain = class(TForm) procedure DeleteFolder(Node: PVirtualNode); procedure CreateNewModel(Node: PVirtualNode); procedure MatchToStructure; - procedure CreateNewGradientExtension(Node: PVirtualNode); + procedure CreateGradientExtension(Node: PVirtualNode); procedure EditGradient(var Data: PProjectData); - function FindLastParentNode(out Node: PVirtualNode): boolean; //inline; + function CreateChildNode(out Node: PVirtualNode): boolean; //inline; function GetGradients: TGradients; + procedure CreateProfileExtension; + function FindParentModel(out Node: PVirtualNode): PVirtualNode; + procedure PlotProfileNP; + procedure PlotProfile; + function IsProfileEnbled: Boolean; + procedure PlotGradedProfile; + procedure PlotSimpleProfile; + procedure ClearProfiles; { Private declarations } public { Public declarations } @@ -527,7 +534,7 @@ procedure TfrmMain.OnFitUpdateMsg(var Msg: TMessage); procedure TfrmMain.OnMyMessage(var Msg: TMessage); begin - PlotDistributions(Structure.Model); + PlotProfile; CalcRunExecute(Self); end; @@ -548,6 +555,8 @@ procedure TfrmMain.ProjectChange(Sender: TBaseVirtualTree; Node: PVirtualNode); if FIgnoreFocusChange then Exit; + if Node = LastNode then Exit; + LastData := Project.GetNodeData(LastNode); if LastData <> nil then begin @@ -704,7 +713,7 @@ procedure TfrmMain.ProjectItemDeleteExecute(Sender: TObject); ProjectChange(Project, Nil); end; -function TfrmMain.FindLastParentNode(out Node: PVirtualNode): boolean; +function TfrmMain.CreateChildNode(out Node: PVirtualNode): boolean; var Data: PProjectData; begin @@ -720,7 +729,27 @@ function TfrmMain.FindLastParentNode(out Node: PVirtualNode): boolean; Node := Project.AddChild(Node.Parent); Result := True; end - else Result := False; + else begin + ShowMessage('Parent model is not selected!'); + Result := False; + end; +end; + +function TfrmMain.FindParentModel(out Node: PVirtualNode): PVirtualNode; +var + Data: PProjectData; +begin + Result := nil; + if Node = Nil then Exit; + + Data := Project.GetNodeData(Node); + if Data.Group = gtModel then + begin + if Data.RowType = prExtension then + Result := Node.Parent + else + Result := Node; + end end; procedure TfrmMain.ProjectItemExtensionExecute(Sender: TObject); @@ -731,19 +760,44 @@ procedure TfrmMain.ProjectItemExtensionExecute(Sender: TObject); EType := AskSelectExtensionTypenAction; if EType = etNone then Exit; - if not FindLastParentNode(Node) then - begin - ShowMessage('Parent model is not selected!'); - Exit; + case EType of + etGradient : begin + if CreateChildNode(Node) then + CreateGradientExtension(Node); + end; + etProfile : CreateProfileExtension; end; +end; - case EType of - etGradient : CreateNewGradientExtension(Node); - etProfile : ; +procedure TfrmMain.CreateProfileExtension; +var + Data: PProjectData; + Node: PVirtualNode; +begin + Node := FindParentModel(LastNode); + if Node = nil then Exit; + + + if not Project.ProfileAttached(Node) then + begin + Node := Project.AddChild(Node); + Data := Project.GetNodeData(Node); + + Data.Group := gtModel; + Data.Enabled := True; + Data.RowType := prExtension; + Data.Title := 'Profile'; + Data.ExtType := etProfile; + Data.StackID := -1; + Data.LayerID := -1; + Data.Form := ffLine; + + Project.ClearSelection; + Project.Selected[Node] := True; end; end; -procedure TfrmMain.CreateNewGradientExtension(Node: PVirtualNode); +procedure TfrmMain.CreateGradientExtension(Node: PVirtualNode); var Data: PProjectData; begin @@ -940,7 +994,7 @@ procedure TfrmMain.btnSetFitLimitsClick(Sender: TObject); begin FitStructure := Structure.ToFitStructure; frmLimits.Show(FitStructure); - Structure.StoreFitLimits(FitStructure); + Structure.UpdateInterfaceP(FitStructure); end; procedure TfrmMain.DataPasteExecute(Sender: TObject); @@ -966,7 +1020,7 @@ procedure TfrmMain.DataPasteExecute(Sender: TObject); procedure TfrmMain.MatchToStructure; begin PrepareDistributionCharts; - PlotDistributions(Structure.Model); + PlotProfile; Project.ActiveModel.Data := Structure.ToString; end; @@ -1252,9 +1306,33 @@ procedure TfrmMain.pmiVisibleClick(Sender: TObject); end; procedure TfrmMain.pmProjectPopup(Sender: TObject); -begin - pmiVisible.Checked := LastData.Visible; - pmiLinked.Checked := LastData = Project.LinkedData; +var + IsModel, IsProfile: boolean; +begin + case LastData.RowType of + prItem: begin + IsModel := LastData.IsModel; + pmiEnabled.Visible := False; + pmiVisible.Visible := True; + pmiVisible.Checked := LastData.Visible; + pmiLinked.Visible := not IsModel; + pmiLinked.Checked := LastData = Project.LinkedData; + pmiNorm.Visible := not IsModel; + pmCopytoclipboard.Visible := not IsModel; + pmExporttofile.Visible := not IsModel; + end; + prExtension: begin + pmiNorm.Visible := False; + pmiEnabled.Visible := True; + pmiEnabled.Checked := LastData.Enabled; + pmiVisible.Visible := False; + pmiLinked.Visible := False; + + IsProfile := LastData.ExtType = etProfile; + pmCopytoclipboard.Visible := IsProfile; + pmExporttofile.Visible := IsProfile; + end; + end; end; procedure TfrmMain.FinalizeCalc(Calc: TCalc); @@ -1309,63 +1387,123 @@ procedure TfrmMain.PrepareDistributionCharts; begin Materials := Structure.Materials; - CreateSeries(chThickness, FThicknessSeries); CreateSeries(chRoughness, FRoughnessSeries); CreateSeries(chDensity, FDensitySeries); - end; -procedure TfrmMain.PlotDistributions(Model: TLayeredModel); +procedure TfrmMain.PlotProfileNP; var - i, j: integer; - Layers: TCalcLayers; - Gradients: TGradients; + i, j, k, shift: integer; begin - for i := 0 to High(FThicknessSeries) do + shift := 1; + for i := 0 to High(Structure.Stacks) do begin - FThicknessSeries[i].Clear; - FRoughnessSeries[i].Clear; - FDensitySeries[i].Clear; + if Structure.Stacks[i].N = 1 then Continue; + for j := 0 to High(Structure.Stacks[i].Layers) do + begin + for k := 0 to High(Structure.Stacks[i].Layers[j].Data.PH) do + begin + FThicknessSeries[j].AddXY(k + shift, Structure.Stacks[i].Layers[j].Data.PH[k]); + FRoughnessSeries[j].AddXY(k + shift, Structure.Stacks[i].Layers[j].Data.PS[k]); + FDensitySeries[j]. AddXY(k + shift, Structure.Stacks[i].Layers[j].Data.PR[k]); + end; + end; + Inc(shift, Structure.Stacks[i].N); end; +end; - Layers := Model.Layers; - Gradients := GetGradients; - - for i := 1 to High(Layers) - 1 do +procedure TfrmMain.PlotGradedProfile; +var + StackIndex, LayerIndex, PeriodIndex, GradientIndex, shift, d: integer; +begin + shift := 0; d := 0; + for StackIndex := 0 to High(Structure.Stacks) do begin - if Structure.IsPeriodic(Layers[i].StackID) then + if Structure.Stacks[StackIndex].N = 1 then Continue; + + for LayerIndex := 0 to High(Structure.Stacks[StackIndex].Layers) do begin - if Length(Gradients) > 0 then + for PeriodIndex := 1 to Structure.Stacks[StackIndex].N do begin - for j := 0 to High(Gradients) do - begin - if (Layers[i].StackID = Gradients[j].StackID) and - (Layers[i].LayerID = Gradients[j].LayerID) then + for GradientIndex := 0 to High(FGradients) do begin - case Gradients[j].Subj of - gsL : FThicknessSeries[Model.Layers[i].LayerID].AddXY(i, CalcGradient(Layers[i].L, Gradients[j])); - gsS : FThicknessSeries[Model.Layers[i].LayerID].AddXY(i, CalcGradient(Layers[i].s, Gradients[j])); - gsRo: FThicknessSeries[Model.Layers[i].LayerID].AddXY(i, CalcGradient(Layers[i].ro, Gradients[j])); + if (Structure.Stacks[StackIndex].Layers[LayerIndex].StackID = FGradients[GradientIndex].StackID) and + (Structure.Stacks[StackIndex].Layers[LayerIndex].ID = FGradients[GradientIndex].LayerID) then + begin + case FGradients[GradientIndex].Subj of + gsL : FThicknessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, CalcGradient(Structure.Stacks[StackIndex].Layers[LayerIndex].Data.H.V, FGradients[GradientIndex])); + gsS : FThicknessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, CalcGradient(Structure.Stacks[StackIndex].Layers[LayerIndex].Data.s.V, FGradients[GradientIndex])); + gsRo: FThicknessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, CalcGradient(Structure.Stacks[StackIndex].Layers[LayerIndex].Data.r.V, FGradients[GradientIndex])); + end; + inc(FGradients[GradientIndex].Count); + end; + + if (Structure.Stacks[StackIndex].Layers[LayerIndex].StackID <> FGradients[GradientIndex].StackID) and + (Structure.Stacks[StackIndex].Layers[LayerIndex].ID <> FGradients[GradientIndex].LayerID) then + begin + FThicknessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.H.V); + FRoughnessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.s.V); + FDensitySeries[LayerIndex + d].AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.r.V); end; - inc(Gradients[j].Count); - end - else begin - FThicknessSeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].L); - FRoughnessSeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].s); - FDensitySeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].ro); end; - end; end - else begin - FThicknessSeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].L); - FRoughnessSeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].s); - FDensitySeries[Model.Layers[i].LayerID].AddXY(i, Layers[i].ro); - end; end; + Inc(shift, Structure.Stacks[StackIndex].N); + Inc(d, Length(Structure.Stacks[StackIndex].Layers)); + end; +end; + + +procedure TfrmMain.PlotSimpleProfile; +var + StackIndex, LayerIndex, PeriodIndex, GradientIndex, shift, d: integer; +begin + shift := 0; d := 0; + for StackIndex := 0 to High(Structure.Stacks) do + begin + if Structure.Stacks[StackIndex].N = 1 then Continue; + + for LayerIndex := 0 to High(Structure.Stacks[StackIndex].Layers) do + begin + for PeriodIndex := 1 to Structure.Stacks[StackIndex].N do + begin + FThicknessSeries[LayerIndex + d].AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.H.V); + FRoughnessSeries[LayerIndex+ d].AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.s.V); + FDensitySeries[LayerIndex + d]. AddXY(PeriodIndex + shift, Structure.Stacks[StackIndex].Layers[LayerIndex].Data.s.V); + end; + end; + Inc(shift, Structure.Stacks[StackIndex].N); + Inc(d, Length(Structure.Stacks[StackIndex].Layers)); end; end; +procedure TfrmMain.ClearProfiles; +var + StackIndex: integer; +begin + for StackIndex := 0 to High(FThicknessSeries) do + begin + FThicknessSeries[StackIndex].Clear; + FRoughnessSeries[StackIndex].Clear; + FDensitySeries[StackIndex].Clear; + end; +end; + +procedure TfrmMain.PlotProfile; +begin + ClearProfiles; + + FGradients := GetGradients; + if Length(FGradients) > 0 then + PlotGradedProfile + else + if IsProfileEnbled and not cbTreatPeriodic.Checked then + PlotProfileNP + else + PlotSimpleProfile; +end; + procedure TfrmMain.CalcAllExecute(Sender: TObject); var Node: PVirtualNode; @@ -1388,6 +1526,26 @@ procedure TfrmMain.CalcAllExecute(Sender: TObject); end; end; +function TfrmMain.IsProfileEnbled: Boolean; +var + Data: PProjectData; + Node: PVirtualNode; +begin + Result := False; + Node := Project.GetFirstChild(FLastModel); + while Node <> nil do + begin + Data := Project.GetNodeData(Node); + if Data.ExtType = etProfile then + begin + Result := Data.Enabled; + Break; + end; + Node := Project.GetNextSibling(Node); + end; + +end; + procedure TfrmMain.CalcRunExecute(Sender: TObject); var CD: TCalcThreadParams; @@ -1413,7 +1571,7 @@ procedure TfrmMain.CalcRunExecute(Sender: TObject); try Calc.Params := CD; Calc.Limit := StrToFloat(cbMinLimit.Text); - Calc.Model := Structure.Model; + Calc.Model := Structure.Model(IsProfileEnbled and not cbTreatPeriodic.Checked); Calc.Model.Gradients := GetGradients; Calc.Run; if (Project.LinkedData <> nil) and FSeriesList[Project.ActiveModel.CurveID].Visible then @@ -1423,7 +1581,11 @@ procedure TfrmMain.CalcRunExecute(Sender: TObject); end else spChiSqr.Caption := ''; - PlotDistributions(Calc.Model); + + if IsProfileEnbled and not cbTreatPeriodic.Checked then + PlotProfileNP + else + PlotProfile; except on E: exception do begin @@ -1453,6 +1615,7 @@ procedure TfrmMain.actAutoFittingExecute(Sender: TObject); Hour, Min, Sec, MSec: Word; FitStructure: TFitStructure; Params: TFitParams; + Result : TLayeredModel; begin Randomize; @@ -1461,7 +1624,7 @@ procedure TfrmMain.actAutoFittingExecute(Sender: TObject); FitStructure := Structure.ToFitStructure; if frmLimits.Show(FitStructure) then - Structure.StoreFitLimits(FitStructure) + Structure.UpdateInterfaceP(FitStructure) else Exit; @@ -1495,7 +1658,7 @@ procedure TfrmMain.actAutoFittingExecute(Sender: TObject); Calc.Params := CD; Calc.Limit := StrToFloat(cbMinLimit.Text); - Calc.Model := Structure.Model; + Calc.Model := Structure.Model(IsProfileEnbled and not cbTreatPeriodic.Checked); Calc.Run; Calc.CalcChiSquare(Params.ThetaWieght); lsrConvergence.AddXY(-1, Calc.ChiSQR); @@ -1515,16 +1678,22 @@ procedure TfrmMain.actAutoFittingExecute(Sender: TObject); LFPSO.MovAvg := Calc.MovAvg ; LFPSO.Run(CD); - Calc.Model := LFPSO.Result; + Result := LFPSO.Result; + Calc.Model := Result; Calc.Run; Calc.CalcChiSquare(Params.ThetaWieght); spChiSqr.Caption := FloatToStrF(Calc.ChiSQR, ffFixed, 8, 1); - if cbTreatPeriodic.Checked then - Structure.StoreFitLimits(LFPSO.Structure) + + if not cbTreatPeriodic.Checked and Structure.IsPeriodic then + begin + CreateProfileExtension; + Structure.UpdateInterfaceNP(LFPSO.Structure); + Structure.UpdateProfiles(Result); + end else begin - Structure.StoreFitLimitsNP(LFPSO.Structure); - PlotDistributions(LFPSO.Result); + Structure.UpdateInterfaceP(LFPSO.Structure); end; + PlotProfile; except on E: exception do begin @@ -1536,6 +1705,7 @@ procedure TfrmMain.actAutoFittingExecute(Sender: TObject); end; end; FinalizeCalc(Calc); + Project.ActiveModel.Data := Structure.ToString; finally Calc.Free; LFPSO.Free; @@ -1549,6 +1719,7 @@ procedure TfrmMain.RecoverProjectTree(const ActiveID: Integer); Node, First: PVirtualNode; Data: PProjectData; begin + Project.LinkedData := nil; // восстанавливаем дерево проектов Project.Version := FProjectVersion; Project.LoadFromFile(FProjectDir + PROJECT_FILE_NAME); @@ -1606,7 +1777,7 @@ procedure TfrmMain.RecoverProjectTree(const ActiveID: Integer); end; Structure.FromString(Project.ActiveModel.Data); - Structure.EnablePairing(cbTreatPeriodic.Checked); + Structure.EnablePairing; end; procedure TfrmMain.ResultCopyExecute(Sender: TObject); @@ -1652,9 +1823,17 @@ procedure TfrmMain.RecoverDataCurves(const LinkedID: integer); end; procedure TfrmMain.LayerAddExecute(Sender: TObject); +var + Data: TLayerData; begin - if edtrLayer.ShowModal = mrOk then - Structure.AddLayer(Structure.Selected, edtrLayer.Data); + Data.Material := 'Si'; + + Data.H.New(25); + Data.s.New(3); + Data.r.New(0); + + if edtrLayer.ShowEditor(False, Data) then + Structure.AddLayer(Structure.Selected, Data); MatchToStructure; end; @@ -1693,6 +1872,7 @@ procedure TfrmMain.LoadProject(const FileName: string; Clear: Boolean); RecoverProjectTree(ActiveID); RecoverDataCurves(LinkedID); + ClearProfiles; FIgnoreFocusChange := False; Project.Repaint; Caption := 'X-Ray Calc 3: ' + ExtractFileName(FileName); @@ -1707,6 +1887,7 @@ procedure TfrmMain.FileCopyPlotBMPExecute(Sender: TObject); procedure TfrmMain.FileNewExecute(Sender: TObject); begin Structure.Clear; + ClearProfiles; CreateDefaultProject; end; @@ -1953,7 +2134,7 @@ procedure TfrmMain.CreateDefaultProject; FDataRoot := PG; Caption := 'X-Ray Calc 3: ' + FProjectName; - + Project.LinkedData := nil; end; procedure TfrmMain.FormCreate(Sender: TObject); @@ -2024,11 +2205,6 @@ procedure TfrmMain.cbIncrementChange(Sender: TObject); Structure.Increment := StrToFloat(cbIncrement.Value); end; -procedure TfrmMain.cbTreatPeriodicClick(Sender: TObject); -begin - Structure.EnablePairing(cbTreatPeriodic.Checked); -end; - procedure TfrmMain.WMLayerClick(var Msg: TMessage); var ID, LayerID: Integer; diff --git a/math/unit_LFPSO_Base.pas b/math/unit_LFPSO_Base.pas index bca8d2f..79d92b4 100644 --- a/math/unit_LFPSO_Base.pas +++ b/math/unit_LFPSO_Base.pas @@ -26,6 +26,7 @@ TUpdateFitProgressMsg = record TLFPSO_BASE = class protected + FReInit : Boolean; FFitParams: TFitParams; FCalcParams: TCalcThreadParams; FStructure: TFitStructure; // initial (input) structure @@ -67,11 +68,10 @@ TLFPSO_BASE = class procedure CheckLimits(const i, j, k: integer); inline; procedure SetParams(const Value: TFitParams); procedure ReInit(const Step: integer); //inline; - procedure CopySolution(const Source: TSolution; var Dest: TSolution); function Omega(const t, TMax: integer): single; inline; procedure SetDomain(const Count: integer; var X: TPopulation); - procedure InitVelocity; + procedure InitVelocity; virtual; procedure UpdatePSO(const t: integer); virtual; procedure UpdateLFPSO(const t: integer); virtual; procedure Seed;virtual; @@ -213,21 +213,8 @@ function TLFPSO_BASE.GetStructure: TFitStructure; end; procedure TLFPSO_BASE.InitVelocity; -var - i, j, k: integer; begin - MultiplyVector(Xrange, FFitParams.Vmax, Vmax); - MultiplyVector(Vmax, -1, Vmin); - - for i := 0 to High(V) do // for every member of the population - for j := 1 to 3 do // for H, s, rho - for k := 0 to High(V[i][j]) do // for every layer - V[i][j][k] := Random * (Vmax[0][j][k] - Vmin[0][j][k]) + Vmin[0][j][k]; -end; -procedure TLFPSO_BASE.CopySolution(const Source: TSolution; var Dest: TSolution); -begin - Dest := Source; end; procedure TLFPSO_BASE.CheckLimits(const i, j, k: integer); @@ -308,12 +295,12 @@ procedure TLFPSO_BASE.FindTheBest; end; end; - CopySolution(X[Result], pbest); + pbest := X[Result]; if FLastBestChiSqr < FGlobalBestChiSqr then begin FGlobalBestChiSqr := FLastBestChiSqr; - CopySolution(X[Result], gbest); + gbest := X[Result]; end else begin SetLength(FResultingCurve, 0); @@ -323,7 +310,7 @@ procedure TLFPSO_BASE.FindTheBest; if FGlobalBestChiSqr < FAbsoluteBestChiSqr then begin FAbsoluteBestChiSqr := FGlobalBestChiSqr; - CopySolution(X[Result], abest); + abest := X[Result]; end; end; @@ -347,6 +334,7 @@ procedure TLFPSO_BASE.Run; Vmax0: single; SuccessCount: integer; begin + FReInit := False; FTerminated := False; Vmax0 := FFitParams.Vmax ; ReInitCount := 0; @@ -374,11 +362,12 @@ procedure TLFPSO_BASE.Run; if FFitParams.Shake and (FJammingCount > FFitParams.JammingMax) then begin + FReInit := True; if ReInitCount > FFitParams.ReInitMax then begin ReInitCount := 0; SetStructure(GBestStructure(abest)); - CopySolution(abest, gbest); + gbest := abest; FGlobalBestChiSqr := FAbsoluteBestChiSqr; FFitParams.Vmax := Vmax0; end @@ -394,7 +383,7 @@ procedure TLFPSO_BASE.Run; dec(SuccessCount); end else begin - CopySolution(gbest, abest); + abest := gbest; inc(SuccessCount); end; end; diff --git a/math/unit_LFPSO_Periodic.pas b/math/unit_LFPSO_Periodic.pas index 377b4ca..2f85df0 100644 --- a/math/unit_LFPSO_Periodic.pas +++ b/math/unit_LFPSO_Periodic.pas @@ -15,6 +15,7 @@ TLFPSO_Periodic = class (TLFPSO_BASE) procedure NormalizeD(const ParticleIndex: integer); procedure SetStructure(const Inp: TFitStructure); override; procedure UpdatePSO(const t: integer); override; + procedure InitVelocity; override; public // end; @@ -105,6 +106,19 @@ procedure TLFPSO_Periodic.NormalizeD; // keep D for every periodic stack constan end; end; +procedure TLFPSO_Periodic.InitVelocity; +var + i, j, k: integer; +begin + MultiplyVector(Xrange, FFitParams.Vmax, Vmax); + MultiplyVector(Vmax, -1, Vmin); + + for i := 0 to High(V) do // for every member of the population + for j := 1 to 3 do // for H, s, rho + for k := 0 to High(V[i][j]) do // for every layer + V[i][j][k] := Random * (Vmax[0][j][k] - Vmin[0][j][k]) + Vmin[0][j][k]; +end; + procedure TLFPSO_Periodic.Seed; var i, j, k: integer; diff --git a/math/unit_LFPSO_Regular.pas b/math/unit_LFPSO_Regular.pas index 5b0afd9..76eddd9 100644 --- a/math/unit_LFPSO_Regular.pas +++ b/math/unit_LFPSO_Regular.pas @@ -10,10 +10,13 @@ interface TLFPSO_Regular = class (TLFPSO_BASE) private + FLinks : array [1..3] of TIntArray; + procedure UpdateLFPSO(const t: integer); override; procedure Seed; override; procedure SetStructure(const Inp: TFitStructure); override; procedure UpdatePSO(const t: integer); override; + procedure InitVelocity; override; public // end; @@ -43,11 +46,16 @@ procedure TLFPSO_Regular.UpdateLFPSO(const t: integer); for j := 1 to 3 do // for H, s, rho for k := 0 to High(X[I][j]) do // for every layer begin - V[i][j][k] := Omega(t, FTMax) * LevyWalk(X[i][j][k], gbest[j][k]) + - c1 * Random * (pbest[j][k] - X[i][j][k]) + - c2 * Random * (gbest[j][k] - X[i][j][k]); - - CheckLimits(i, j, k); + if FLinks[j][k] = -1 then + begin + V[i][j][k] := Omega(t, FTMax) * LevyWalk(X[i][j][k], gbest[j][k]) + + c1 * Random * (pbest[j][k] - X[i][j][k]) + + c2 * Random * (gbest[j][k] - X[i][j][k]); + + CheckLimits(i, j, k); + end + else + X[i][j][k] := X[i][j][FLinks[j][k]]; end; end; end; @@ -65,15 +73,36 @@ procedure TLFPSO_Regular.UpdatePSO(const t: integer); for j := 1 to 3 do // for H, s, rho for k := 0 to High(X[I][j]) do // for every layer except subtrate begin - V[i][j][k] := Omega(t, FTMax) * V[i][j][k] + + if FLinks[j][k] = -1 then + begin + V[i][j][k] := Omega(t, FTMax) * V[i][j][k] + c1 * Random * (pbest[j][k] - X[i][j][k]) + c2 * Random * (gbest[j][k] - X[i][j][k]); - CheckLimits(i, j, k); + CheckLimits(i, j, k); + end + else + X[i][j][k] := X[i][j][FLinks[j][k]]; end; end; end; +procedure TLFPSO_Regular.InitVelocity; +var + i, j, k: integer; +begin + MultiplyVector(Xrange, FFitParams.Vmax, Vmax); + MultiplyVector(Vmax, -1, Vmin); + + for i := 0 to High(V) do // for every member of the population + for j := 1 to 3 do // for H, s, rho + for k := 0 to High(V[i][j]) do // for every layer + if FLinks[j][k] > -1 then + V[i][j][k] := 0 + else + V[i][j][k] := Random * (Vmax[0][j][k] - Vmin[0][j][k]) + Vmin[0][j][k]; +end; + procedure TLFPSO_Regular.Seed; var i, j, k: integer; @@ -84,14 +113,27 @@ procedure TLFPSO_Regular.Seed; begin for j := 1 to 3 do // for H, s, rho for k := 0 to High(X[0][j]) do // for every layer - X[i][j][k] := Xmin[0][j][k] + Random * (Xmax[0][j][k] - Xmin[0][j][k]); // min + Random * (min-max) + begin + if FLinks[j][k] > -1 then + X[i][j][k] := X[i][j][FLinks[j][k]] + else + X[i][j][k] := Xmin[0][j][k] + Random * (Xmax[0][j][k] - Xmin[0][j][k]); // min + Random * (min-max) + end; end; end; +procedure InitArray(const Length: Integer; var A: TIntArray); +begin + SetLength(A, 0); + SetLength(A, Length); +end; + procedure TLFPSO_Regular.SetStructure(const Inp: TFitStructure); var i, j, k, Index: integer; D: double; + HLinks, SLinks, RLinks: TIntArray; + NLayers: Integer; begin FLayersCount := Inp.TotalNP; @@ -110,11 +152,27 @@ procedure TLFPSO_Regular.SetStructure(const Inp: TFitStructure); SetDomain(FLayersCount, Vmax); SetDomain(FLayersCount, V); + if not FReInit then + begin + InitArray(FLayersCount, FLinks[1]); + InitArray(FLayersCount, FLinks[2]); + InitArray(FLayersCount, FLinks[3]); + end; + Index := 0; for i := 0 to High(Inp.Stacks) do begin + NLayers := Length(Inp.Stacks[i].Layers); for k := 1 to Inp.Stacks[i].N do - for j := 0 to High(Inp.Stacks[i].Layers) do + begin + if (k = 1) and not FReInit then + begin + InitArray(NLayers, HLinks); + InitArray(NLayers, SLinks); + InitArray(NLayers, RLinks); + end; + + for j := 0 to NLayers - 1 do begin FStructure.Stacks[0].Layers[Index] := Inp.Stacks[i].Layers[j]; @@ -133,8 +191,39 @@ procedure TLFPSO_Regular.SetStructure(const Inp: TFitStructure); Xmin[0][3][Index] := Inp.Stacks[i].Layers[j].r.min; Xrange[0][3][Index] := Xmax[0][3][Index] - Xmin[0][3][Index]; + + if not FReInit then + begin + if k = 1 then + begin + FLinks[1][Index] := -1; + FLinks[2][Index] := -1; + FLinks[3][Index] := -1; + + HLinks[j] := -1; + SLinks[j] := -1; + RLinks[j] := -1; + + if Inp.Stacks[i].Layers[j].H.Paired then + HLinks[j] := Index; + + if Inp.Stacks[i].Layers[j].s.Paired then + SLinks[j] := Index; + + if Inp.Stacks[i].Layers[j].r.Paired then + RLinks[j] := Index; + + end + else begin + FLinks[1][Index] := HLinks[j] ; + FLinks[2][Index] := SLinks[j] ; + FLinks[3][Index] := RLinks[j] ; + end; + end; + Inc(Index); end; + end; end; end; diff --git a/math/unit_calc.pas b/math/unit_calc.pas index 7878db1..3cf0f3c 100644 --- a/math/unit_calc.pas +++ b/math/unit_calc.pas @@ -138,7 +138,7 @@ procedure TCalc.PrepareWorkers; dt, step: single; begin NThreads := Environment.Process.Affinity.Count; - {$IFDEF DEBUG} NThreads := 2; {$ENDIF} + {$IFDEF DEBUG} NThreads := 8; {$ENDIF} SetLength(Tasks, NThreads); SetLength(CalcParams, NThreads); diff --git a/math/unit_materials.pas b/math/unit_materials.pas index e147db3..0da5252 100644 --- a/math/unit_materials.pas +++ b/math/unit_materials.pas @@ -158,16 +158,16 @@ function TLayeredModel.GetLayers: TCalcLayers; procedure TLayeredModel.PrepareLayers; var i, g, NL: Integer; - c, ro: Single; + c, l_ro: Single; begin NL := Length(FLayers); for I := 1 to High(FLayers) - 1 do begin AddMaterial(FLayers[i].Name, FLambda); if FLayers[i].ro <> 0 then - ro := FLayers[i].ro + l_ro := FLayers[i].ro else - ro := FMaterials[CurrentMaterial].ro; // use default falue for density + l_ro := FMaterials[CurrentMaterial].ro; // use default falue for density with FLayers[i] do begin @@ -178,12 +178,12 @@ procedure TLayeredModel.PrepareLayers; case FGradients[g].Subj of gsL : L := CalcGradient(L, FGradients[g]); gsS : s := CalcGradient(s, FGradients[g]); - gsRo: ro := CalcGradient(ro, FGradients[g]); + gsRo: l_ro := CalcGradient(l_ro, FGradients[g]); end; Inc(FGradients[g].Count); end end; - c := kk * ro / FMaterials[CurrentMaterial].am * sqr(FLambda); + c := kk * l_ro / FMaterials[CurrentMaterial].am * sqr(FLambda); e.re := 1 - FMaterials[CurrentMaterial].f.re * c; e.im := FMaterials[CurrentMaterial].f.im * c; end; diff --git a/units/unit_Types.pas b/units/unit_Types.pas index 235e8b0..096a86d 100644 --- a/units/unit_Types.pas +++ b/units/unit_Types.pas @@ -7,6 +7,9 @@ interface type + TFloatArray = array of Single; + TIntArray = array of Integer; + TRoughnessFunction = (rfError, rfExp, rfLinear, rfStep, rfSinus); TCalcMode = (cmTheta, cmLambda, cmTest); TPolarisation = (cmS, cmSP); @@ -25,7 +28,7 @@ TProjectData = record Group: TProjectGroupType; Description: string; Data: string; - function IsModel:Boolean; + function IsModel: Boolean; case RowType: TProjRowType of prGroup, prFolder: @@ -119,6 +122,7 @@ TMaterial = record TFitValue = record Paired: Boolean; V, min, max: single; + procedure New(const Val: single); procedure Init(const dev: single); overload; procedure Init(const AMin, AMax: single); overload; procedure Init; overload; @@ -129,9 +133,17 @@ TLayerData = record Material: string; H, s, r: TFitValue; StackID, LayerID: integer; + PH, PS, PR: TFloatArray; + public + procedure ClearProfiles; + procedure AddProfilePoint(const H, s, r: Single); + function ProfileFromSrting(const Subj: TParameterType; + Profile: string): string; + function ProfileToSrting(const Subj: TParameterType): string; end; TLayersData = array of TLayerData; + PLayersData = ^TLayersData ; TDataPoint = record t, r: single; @@ -139,17 +151,6 @@ TDataPoint = record TDataArray = array of TDataPoint; - TIntArray = array of Integer; - - TDistrtibution = record - Name: string; - DType: TParameterType; - Values: array of single; - end; - - TDistributions = array of TDistrtibution; - - TMaterialsList = array of record Name: string; StackID: integer; @@ -197,6 +198,14 @@ procedure TFitValue.Init; max := V; end; +procedure TFitValue.New(const Val: single); +begin + V := Val; + min := 0; + max := 0; + Paired := False; +end; + procedure TFitValue.Seed; begin V := Min + Random * (Max - min); @@ -230,4 +239,57 @@ function TFitStructure.TotalNP: integer; Result := Result + Length(Stacks[i].Layers) * Stacks[i].N; end; +{ TLayerData } + +procedure TLayerData.ClearProfiles; +begin + SetLength(PH, 0); + SetLength(PS, 0); + SetLength(PR, 0); +end; + +procedure TLayerData.AddProfilePoint(const H, s, r: Single); +begin + Insert(H, PH, MaxInt); + Insert(s, PS, MaxInt); + Insert(r, PR, MaxInt); +end; + +function TLayerData.ProfileFromSrting(const Subj: TParameterType; + Profile: string): string; +var + i, p: Integer; + val: single; +begin + i := 1; p := Pos(';', Profile); + while i < Length(Profile) do + begin + p := Pos(';', Profile, i); + val := StrToFloat(copy(Profile, i, p - i - 1)); + case Subj of + gsL: Insert(Val, PH, MaxInt); + gsS: Insert(Val, PS, MaxInt); + gsRo: Insert(Val, PR, MaxInt); + end; + i := p + 1; + end; +end; + +function TLayerData.ProfileToSrting(const Subj: TParameterType): string; +var + i: Integer; + Val : single; +begin + Result := ''; + for I := 0 to High(PH) do + begin + case Subj of + gsL: Val := PH[i]; + gsS: Val := PS[i]; + gsRo: Val := PR[i]; + end; + Result := Format('%s%f;',[Result, Val]) + end; +end; + end.