diff --git a/123.optset b/123.optset new file mode 100644 index 0000000..f92ed1e --- /dev/null +++ b/123.optset @@ -0,0 +1,17 @@ + + + 1251 + C:\Projects\СКС\POWERCAD30\UNITS;$(BRCC_IncludePath) + true + false + true + + + Delphi.Personality.12 + OptionSet + + + + 12 + + diff --git a/ExpertSCS.dof b/ExpertSCS.dof new file mode 100644 index 0000000..3717ca9 --- /dev/null +++ b/ExpertSCS.dof @@ -0,0 +1,135 @@ +[FileVersion] +Version=6.0 +[Compiler] +A=8 +B=0 +C=1 +D=1 +E=0 +F=0 +G=1 +H=1 +I=0 +J=1 +K=0 +L=1 +M=0 +N=1 +O=0 +P=1 +Q=0 +R=0 +S=0 +T=0 +U=1 +V=1 +W=0 +X=1 +Y=1 +Z=1 +ShowHints=0 +ShowWarnings=0 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription= +[Directories] +OutputDir=D:\Program Files\- 1.8.0 +UnitOutputDir=DCU +PackageDLLOutputDir= +PackageDCPOutputDir= +SearchPath=$(DELPHI)\Lib\Debug +Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;dsnap;tee;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;ip4000clientvcl6;ip4000v6;db211d6r;FR6;cds;vcldbx;visualdbclx;dsnapcrba;dsnapcon;dbexpress;dss;webdsnap;bdecds;dbxcds;soaprtl;inetdb;websnap;ibxpress;indy;dclOffice2k;qrpt;nmfast;teeqr;ip4000word2000vcl6;elmlgnD6;elpackD6;elpkdbD6;elpproD6;elmltgD6;visualclx;Rz30Ctls60;Rz30DBCtls60;xmlide +Conditionals=3D +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1049 +CodePage=1251 +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.7.1.1827 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName=- +ProductVersion=2.3.0 +Comments= +[Excluded Packages] +c:\program files\borland\delphi6\Bin\dclclxdb60.bpl=Borland CLX Database Components +C:\Program Files\Borland\Delphi6\Bin\dclclxstd60.bpl=Borland CLX Standard Components +c:\program files\borland\delphi6\Bin\dclite60.bpl=Borland Integrated Translation Environment +c:\program files\borland\delphi6\Bin\dclsoap60.bpl=Borland SOAP Components +D:\Program Files\CADE Control\Tutorial\Delphi\CADEPackage.bpl=CADE Control Component +C:\Program Files\Borland\Delphi6\Bin\dclaxserver60.bpl=Microsoft Office 97 Sample Automation Server Wrapper Components +D:\Program Files\KeverIT\EzPlanIT\Bpl\EzBasicDs_D6.bpl=EzPlan-IT's basic components +D:\Program Files\KeverIT\EzPlanIT\Bpl\EzBasic_D6.bpl=EzPlan-IT's basic components +D:\Program Files\KeverIT\EzPlanIT\Bpl\EZPlanitDs_D6.bpl=EzPlan-IT's main components +D:\Program Files\KeverIT\EzPlanIT\Bpl\EZPlanIT_D6.bpl=EzPlan-IT's main components +[HistoryLists\hlConditionals] +Count=30 +Item0=3D +Item1=FINAL_SCS; SCS_PE; 3D +Item2=FINAL_SCS; SCS_PE; TRIAL_SCS; 3D +Item3=FINAL_SCS; TRIAL_SCS; 3D; PROCAT_SCS +Item4=FINAL_SCS; TELECOM; 3D +Item5=FINAL_SCS; TELECOM; FLASH_SCS; 3D +Item6=FINAL_SCS; TELECOM; TRIAL_SCS; 3D +Item7=FINAL_SCS; TELECOM; SCS_RF; 3D +Item8=FINAL_SCS; TELECOM; SCS_RF; FLASH_SCS; 3D +Item9=FINAL_SCS; TELECOM; TRIAL_SCS; SCS_RF; 3D +Item10=FINAL_SCS; TELECOM; TRIAL_SCS; SCS_RF; 3D; PROCAT_SCS +Item11=FINAL_SCS; TRIAL_SCS; SCS_RF; 3D; PROCAT_SCS +Item12=FINAL_SCS; SCS_RF; 3D +Item13=FINAL_SCS; SCS_RF; FLASH_SCS; 3D +Item14=FINAL_SCS; TRIAL_SCS; SCS_RF; 3D +Item15=FINAL_SCS; FLASH_SCS; 3D +Item16=FINAL_SCS;3D +Item17=FINAL_SCS; TRIAL_SCS; 3D +Item18=FINAL_SCS; SCS_PE; TRIAL_SCS; 3D; PROCAT_SCS; SCS_PANDUIT +Item19=3D; ES_GRAPH_SC +Item20=FINAL_SCS; 3D; ES_GRAPH_SC +Item21=FINAL_SCS; SCS_SPA; 3D +Item22=SCS_SPA; 3D +Item23=FINAL_SCS; 3D +Item24=FINAL_SCS; +Item25=FINAL_SCS; 3D; MSWindows +Item26=FINAL_SCS +Item27=FINAL_SCS; SCS_RF; FLASH_SCS +Item28=FINAL_SCS; SCS_RF +Item29=FINAL_SCS; FLASH_SCS +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=$(DELPHI)\Lib\Debug +[HistoryLists\hlOutputDirectorry] +Count=1 +Item0=..\ diff --git a/POWERCAD30/UNITS/DrawEngine.pas b/POWERCAD30/UNITS/DrawEngine.pas index 9804332..0cbe1f1 100644 --- a/POWERCAD30/UNITS/DrawEngine.pas +++ b/POWERCAD30/UNITS/DrawEngine.pas @@ -1746,6 +1746,7 @@ begin ConvertCoord(pp2.x,pp2.y,pp2.z); rgn1 := CreateEllipticRgn(Round(pp1.x), Round(pp1.y), Round(pp2.x), Round(pp2.y)); CombineRgn(Rgn, Rgn, Rgn1, RGN_XOR); + DeleteObject(Rgn1); // Tolik 14/01/2025 -- end; end else diff --git a/POWERCAD30/UNITS/form3d.dfm b/POWERCAD30/UNITS/form3d.dfm index d7b556f..2e1f4c1 100644 --- a/POWERCAD30/UNITS/form3d.dfm +++ b/POWERCAD30/UNITS/form3d.dfm @@ -294,10 +294,6 @@ object frm3D: Tfrm3D FixedDimension = 19 object TabSheet1: TRzTabSheet Caption = #1052#1086#1076#1077#1083#1100 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object panObjects: TPanel Left = 0 Top = 0 @@ -335,12 +331,11 @@ object frm3D: Tfrm3D TabOrder = 0 TabStyle = tsRoundCorners OnTabClick = pcTreeTabClick - ExplicitHeight = 21 FixedDimension = 19 object TabArchModel: TRzTabSheet Caption = #1040#1088#1093'. '#1084#1086#1076#1077#1083#1100 ExplicitLeft = 0 - ExplicitTop = 1 + ExplicitTop = 0 ExplicitWidth = 0 ExplicitHeight = 0 object cxGroupBox1: TcxGroupBox @@ -424,16 +419,10 @@ object frm3D: Tfrm3D 000000000000000000000001067200650072006500720065002C000000000000 0000000000FFFFFFFFFFFFFFFF00000000000000000000000001077200650072 007200650072006500} - ExplicitWidth = 0 - ExplicitHeight = 64 end end object TabScsModel: TRzTabSheet Caption = #1057#1050#1057' '#1084#1086#1076#1077#1083#1100 - ExplicitLeft = 0 - ExplicitTop = 1 - ExplicitWidth = 0 - ExplicitHeight = 0 object cxGroupBox2: TcxGroupBox Left = 0 Top = 0 @@ -515,8 +504,14 @@ object frm3D: Tfrm3D 000000000000000000000001067200650072006500720065002C000000000000 0000000000FFFFFFFFFFFFFFFF00000000000000000000000001077200650072 007200650072006500} - ExplicitWidth = 0 - ExplicitHeight = 64 + end + object DuplicateNodeTree: TTreeView + Left = 160 + Top = 80 + Width = 121 + Height = 97 + Indent = 19 + TabOrder = 2 end end end @@ -536,7 +531,7 @@ object frm3D: Tfrm3D ExplicitLeft = 0 ExplicitTop = 0 ExplicitWidth = 0 - ExplicitHeight = 574 + ExplicitHeight = 0 object Panel1: TPanel Left = 0 Top = 0 @@ -3410,7 +3405,7 @@ object frm3D: Tfrm3D Left = 100 Top = 57 Bitmap = { - 494C01013A00B000140210001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C01013A00B0006C0210001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 000000000000360000002800000040000000F0000000010020000000000000F0 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 diff --git a/POWERCAD30/UNITS/form3d.pas b/POWERCAD30/UNITS/form3d.pas index 0e758d1..9197767 100644 --- a/POWERCAD30/UNITS/form3d.pas +++ b/POWERCAD30/UNITS/form3d.pas @@ -17,7 +17,7 @@ uses glFileObj, cxGraphics, cxLookAndFeels, GLMaterial, GLCoordinates, GLCrossPlatform, BaseClasses, glNodes, {Tolik 19/03/2019}GlColor, GLKeyboard, U_Common_Classes, OpenGL1x, GLBehaviours, GLParticleFX, IniFiles, RzPanel, - RzSplit, GLContext; + RzSplit, GLContext, GLRenderContextInfo; const // Koeff Cam Move @@ -25,6 +25,23 @@ const kmOrthogonel = 0.003; //04.01.2012 0.03; cmpNearestPointDelta = 0.05; type + //Tolik 19/03/2025 , + TWireTray = class(TGLLines) + private + FLength: Single; + FWidth: Single; + FHeight: Single; + procedure SetLength(const Value: Single); + procedure SetWidth(const Value: Single); + procedure SetHeight(const Value: Single); + public + constructor Create(AOwner: TComponent); override; + procedure BuildList(var rci: TRenderContextInfo); override; + property Length: Single read FLength write SetLength; + property Width: Single read FWidth write SetWidth; + property Height: Single read FHeight write SetHeight; + end; + // TModeType = (F3DFirstPerson, F3DPerspective, F3DOrtho); // Tolik 11/02/2020 -- // Tolik 11/10/2018 TOpen3dsModelDialog = class(TOpenDialog) @@ -336,6 +353,7 @@ type edWallsTransparency: TEdit; Label53: TLabel; RzSizePanel1: TRzSizePanel; + DuplicateNodeTree: TTreeView; //Tolik procedure GLSceneViewerMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -457,6 +475,8 @@ type procedure DeselectGLObjectsT; public { Public declarations } + //DuplicateNodeTree: TTreeView; //Tolik 07/05/2025 -- , + // FMode: TModeType; // Tolik -- 26/04/2018 -- isProjectModel: Boolean; // (True) (False) @@ -629,6 +649,7 @@ type procedure Move3DConnectorEvent(aObj: TGLBaseSceneObject); procedure Move3DLineEvent(aObj: TGLBaseSceneObject); procedure Move3DConnector(aObj: T3DConnector; dp: T3DPoint; AIsFirstObject: Boolean=false); + Function Get3DPoint(aLine: T3DLine; PointNum: Integer; dist: Double): PDoublePoint; // Tolik 07/04/2025 -- procedure Move3DRaiseConnector(aObj: T3DConnector; dp: T3DPoint); procedure Move3DBetweenRaiseConnector(aObj: T3DConnector; dp: T3DPoint); procedure Move3DLine(aObj: T3DConnector; aLine: T3DLine; aPos: T3DPoint); @@ -702,6 +723,100 @@ uses U_BaseConstants, U_Constants, U_BaseCommon, U_Common, U_SCSComponent, u_ma DrawObjects;} {$R *.dfm} +//Tolik 19/03/2025 -- +constructor TWireTray.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FLength := 1.0; // + FWidth := 1.0; // + FHeight := 0.2; // + LineColor.AsWinColor := clRed; // +end; + +procedure TWireTray.SetLength(const Value: Single); +begin + if FLength <> Value then + begin + ClearStructureChanged; + FLength := Value; + StructureChanged; + end; +end; + +procedure TWireTray.SetWidth(const Value: Single); +begin + if FWidth <> Value then + begin + ClearStructureChanged; + FWidth := Value; + StructureChanged; + end; +end; + +procedure TWireTray.SetHeight(const Value: Single); +begin + if FHeight <> Value then + begin + ClearStructureChanged; + FHeight := Value; + StructureChanged; + end; +end; + +procedure TWireTray.BuildList(var rci: TRenderContextInfo); +var + HalfLength, HalfWidth: Single; +begin + inherited; + + HalfLength := FLength / 2; + HalfWidth := FWidth / 2; + + // + glBegin(GL_LINES); + + // + glVertex3f(-HalfLength, -HalfWidth, 0); + glVertex3f(HalfLength, -HalfWidth, 0); + + glVertex3f(HalfLength, -HalfWidth, 0); + glVertex3f(HalfLength, HalfWidth, 0); + + glVertex3f(HalfLength, HalfWidth, 0); + glVertex3f(-HalfLength, HalfWidth, 0); + + glVertex3f(-HalfLength, HalfWidth, 0); + glVertex3f(-HalfLength, -HalfWidth, 0); + + // + glVertex3f(-HalfLength, -HalfWidth, FHeight); + glVertex3f(HalfLength, -HalfWidth, FHeight); + + glVertex3f(HalfLength, -HalfWidth, FHeight); + glVertex3f(HalfLength, HalfWidth, FHeight); + + glVertex3f(HalfLength, HalfWidth, FHeight); + glVertex3f(-HalfLength, HalfWidth, FHeight); + + glVertex3f(-HalfLength, HalfWidth, FHeight); + glVertex3f(-HalfLength, -HalfWidth, FHeight); + + // + glVertex3f(-HalfLength, -HalfWidth, 0); + glVertex3f(-HalfLength, -HalfWidth, FHeight); + + glVertex3f(HalfLength, -HalfWidth, 0); + glVertex3f(HalfLength, -HalfWidth, FHeight); + + glVertex3f(HalfLength, HalfWidth, 0); + glVertex3f(HalfLength, HalfWidth, FHeight); + + glVertex3f(-HalfLength, HalfWidth, 0); + glVertex3f(-HalfLength, HalfWidth, FHeight); + + glEnd; +end; +// // Tolik 25/12/2019 -- //function comparePoint(aCPoint1, ACPoint2: TDoublePoint): Boolean; @@ -1959,6 +2074,7 @@ var TextureId: GLuint; data: pointer; CreatedMaterial: TGLLibMaterial; + TubeList: TList; // Tolik 20/03/2025 -- //19.06.2012 - {function GetPointsForNormal(arr: T3DPointArray): T3DPointArray; var @@ -3259,16 +3375,34 @@ var dist1, dist2: double; cubeLineLen, cubeLineHeight: Double; canAddCompon: Boolean; + canAddTubetoList: Boolean; + //Tolik 10/4/2025 -- + WireTrayWidth, WireTrayHeight: double; + GLPipe: TGLFreeForm; + ap: T3DPointArray; + ap1, ap2, ap3, ap4, ap5, ap6, ap7, ap8: TDoublePoint; + p1,p2: PDoublePoint; + LineComponProp: PProperty; + HalfWidth, WireStep: Double; + WireNode: TTreeNode; + GLTray: TGLFreeForm; + + begin if LineLen = 0 then exit; currNode := aParentNode; + canAddTubetoList := False; //if ComponOutRadius <> -1 then begin LinearAngle := 0; LinearAngle1:= 0; childNode := Nil; - ComponOutRadius := getLineComponOutRadius(aCompon);//* UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; + if aCompon.ComponentType.SysName = ctsnTube then + canAddTubetoList := True; + ComponOutRadius := -1; // Tolik 10/04/2025 -- + if aCompon.ComponentType.SysName <> ctsnWireTray then // Tolik 10/04/2025 -- + ComponOutRadius := getLineComponOutRadius(aCompon);//* UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; if ComponOutRadius <> -1 then begin if ((aCompon.ComponentType.SysName = ctsnCableChannel) and (aCompon.Componenttype.GUID <> '{80B7A366-98B3-4D3A-A115-C64A3498218E}')) then @@ -3446,7 +3580,8 @@ var // else //CanAddCompon := (CompareValue(ComponOutRadius, StrToFloat_My(a3DLine.ComponDiameterList[1])) = 0); // cableChannel - CanAddCompon := ((FloatToStr(ComponOutRadius) = a3DLine.ComponDiameterList[1]) and CanAddTube); // cableChannel + // CanAddCompon := ((FloatToStr(ComponOutRadius) = a3DLine.ComponDiameterList[1]) and CanAddTube); // cableChannel + CanAddCompon := CanAddTube; if CanAddCompon then begin @@ -3464,8 +3599,10 @@ var begin TGLCyLinder(GLCyl).TopRadius := ComponOutRadius * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; TGLCyLinder(GLCyl).BottomRadius := ComponOutRadius * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; + TGLCyLinder(GLCyl).height := max(TGLCyLinder(GLCyl).TopRadius, TGLCyLinder(GLCyl).BottomRadius); end; - + if canAddTubetoList then + TubeList.Add(GLCyl); TGlCylinder(GLCyl).Loops := 2; TubePoint1 := GetPoint(LineFigure, 1, ComponOutRadius); TubePoint2 := GetPoint(LineFigure, 2, ComponOutRadius); @@ -3516,7 +3653,360 @@ var end; end; end; + //Tolik 10/04/2025 -- + if aCompon.ComponentType.SysName = ctsnWireTray then // + begin + CheckInterSection; //Tolik 13/05/2025 -- + WireTrayWidth := 0; + WireTrayHeight := 0; + SetLength(ap, 0); + LineComponProp := aCompon.GetPropertyBySysName(pnWidth); + if LineComponProp <> nil then + WireTrayWidth := aCompon.GetPropertyValueAsFloat(pnWidth); + + LineComponProp := aCompon.GetPropertyBySysName(pnHeight); + if LineComponProp <> nil then + WireTrayHeight := aCompon.GetPropertyValueAsFloat(pnHeight); + + if WireTrayWidth <> 0 then + begin + HalfWidth := WireTrayWidth/2; + + p1 := GetPoint(aLine, 1, HalfWidth); + p2 := GetPoint(aLine, 2, HalfWidth); + + ap1 := RotatePoint(aLine.ap1, p1^, -PI/2); + ap2 := RotatePoint(aLine.ap1, p1^, PI/2); + + ap3 := RotatePoint(aLine.ap2, p2^, -PI/2); + ap4 := RotatePoint(aLine.ap2, p2^, PI/2); + + F3DLineCompon := T3DLineComponent.Create(nil, nil,Self.F3DModel); + Self.F3DModel.FScsObjects.Add(F3DLineCompon); + childNode := ScsModelTree.Items.AddChild(aParentNode, aCompon.GetNameForVisible); + childNode.ImageIndex := 8; + childNode.SelectedIndex := 2; + ChildNode.Data := F3DLineCompon; + F3DLineCompon.FSCSCompon := aCompon; + F3DLineCompon.FSCSComponID := aCompon.ID; + (* + GLTray := TGLFREEFORM(DummyCube.AddNewChild(TGLLines)); + // 10 + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + + Dispose(p1); + Dispose(p2); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + p1 := GetPoint(aLine, 1, HalfWidth); + p2 := GetPoint(aLine, 2, HalfWidth); + + ap5 := RotatePoint(aLine.ap1, p1^, -PI/2); + ap6 := RotatePoint(aLine.ap1, p1^, PI/2); + ap7 := RotatePoint(aLine.ap2, p2^, -PI/2); + ap8 := RotatePoint(aLine.ap2, p2^, PI/2); + + TglLines(GLTray).Nodes.AddNode(ap6.x * factor, ap6.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap6.y * factor); + TglLines(GLTray).Nodes.AddNode(ap7.x * factor, ap7.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap7.y * factor); + TglLines(GLTray).Nodes.AddNode(ap8.x * factor, ap8.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap8.y * factor); + TglLines(GLTray).Nodes.AddNode(ap5.x * factor, ap5.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap5.y * factor); + + Dispose(p1); + Dispose(p2); + end; + + + if WireTrayHeight > 0 then // , + begin + HalfWidth := WireTrayHeight; + + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + //TglLines(GLTray).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TglLines(GLTray).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + end; + + // + HalfWidth := WireTrayHeight; + + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + //TglLines(GLTray).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TglLines(GLTray).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + end; + end; + + //TglLines(GLTray).SplineMode := lsmSegments; + + if GLTray.Material.Texture.Disabled then + begin + ComponColor := getLineComponColor(aCompon);//ConvertWinColor(clGreen); + GLTray.Material.FrontProperties.Ambient.Color := ComponColor; + GLTray.Material.FrontProperties.Diffuse.Color := ComponColor; + GLTray.Material.FrontProperties.Emission.Color := ComponColor; + GLTray.Material.BackProperties.Ambient.Color := ComponColor; + GLTray.Material.BackProperties.Diffuse.Color := ComponColor; + GLTray.Material.BackProperties.Emission.Color := ComponColor; + end; + + GLTray.Material.MaterialOptions := []; + GLTray.Material.Texture.Disabled := False; + GLTray.TagObject := ChildNode; + F3DLineCompon.FGLObject := GLTray; + TglLines(GLTray).ShowAxes := False; + TglLines(GLTray).LineColor.AsWinColor := clgreen;//TGLColor(ComponColor); + TglLines(GLTray).LineWidth := 4; + TglLines(GLTray).NodeSize := 0; + TglLines(GLTray).NodesAspect := lnaInvisible; + TglLines(GLTray).AntiAliased := true; + *) + + GLPipe := TGLFREEFORM(DummyCube.AddNewChild(TGLPipe)); + TGLPipe(GLPipe).Radius := 0.01 * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; + // 10 + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + + Dispose(p1); + Dispose(p2); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + p1 := GetPoint(aLine, 1, HalfWidth); + p2 := GetPoint(aLine, 2, HalfWidth); + + ap5 := RotatePoint(aLine.ap1, p1^, -PI/2); + ap6 := RotatePoint(aLine.ap1, p1^, PI/2); + ap7 := RotatePoint(aLine.ap2, p2^, -PI/2); + ap8 := RotatePoint(aLine.ap2, p2^, PI/2); + + TGLPipe(GLPipe).Nodes.AddNode(ap6.x * factor, ap6.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap6.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap7.x * factor, ap7.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap7.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap8.x * factor, ap8.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap8.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap5.x * factor, ap5.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap5.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + Dispose(p1); + Dispose(p2); + end; + + //TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + + if GLPipe.Material.Texture.Disabled then + begin + ComponColor := getLineComponColor(aCompon);//ConvertWinColor(clGreen); + GLPipe.Material.FrontProperties.Ambient.Color := ComponColor; + GLPipe.Material.FrontProperties.Diffuse.Color := ComponColor; + GLPipe.Material.FrontProperties.Emission.Color := ComponColor; + GLPipe.Material.BackProperties.Ambient.Color := ComponColor; + GLPipe.Material.BackProperties.Diffuse.Color := ComponColor; + GLPipe.Material.BackProperties.Emission.Color := ComponColor; + end; + + GLPipe.Material.MaterialOptions := []; + //GLPipe.Material.Texture.Disabled := False; + GLPipe.Material.Texture.Disabled := true; + GLPipe.TagObject := ChildNode; + F3DLineCompon.FGLObject := GLPipe; + TGLPipe(GLPipe).ObjectStyle := TGLPipe(GLPipe).ObjectStyle + [osDirectDraw]; + TGLPipe(GLPipe).SplineMode := lsmSegments;//lsmLines; // + if WireTrayHeight > 0 then // , + begin + HalfWidth := WireTrayHeight; + // + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, (ap4.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, (ap1.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + end; + + // + HalfWidth := WireTrayHeight; + TGLPipe(GLPipe).Nodes.AddNode(ap4.x * factor, ap4.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap4.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap1.x * factor, ap1.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap1.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + + while comparevalue(HalfWidth, 0.1) = 1 do + begin + HalfWidth := HalfWidth - 0.1; + TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, ap2.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, ap3.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap3.x * factor, (ap3.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap3.y * factor); + //TGLPipe(GLPipe).Nodes.AddNode(ap2.x * factor, (ap2.z + HalfWidth)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap2.y * factor); + end; + + // + WireStep := 0.1; // 10 + HalfWidth := WireTrayWidth/2; + if WireTrayHeight = 0 then + begin + while WireStep < aLine.LineLength do + begin + F3DLineCompon := T3DLineComponent.Create(nil, nil,Self.F3DModel); + Self.F3DModel.FScsObjects.Add(F3DLineCompon); + childNode := DuplicateNodeTree.Items.AddChild(aParentNode, aCompon.GetNameForVisible); + childNode.ImageIndex := 8; + childNode.SelectedIndex := 2; + ChildNode.Data := F3DLineCompon; + F3DLineCompon.FSCSCompon := aCompon; + F3DLineCompon.FSCSComponID := aCompon.ID; + + GLPipe := TGLFREEFORM(DummyCube.AddNewChild(TGLPipe)); + TGLPipe(GLPipe).Radius := 0.01 * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; + p1 := GetPoint(aLine, 1, WireStep); + p2 := GetPointA(p1^, aLine.ap2, HalfWidth); + ap5 := RotatePoint(p1^, p2^, -PI/2); + ap6 := RotatePoint(p1^, p2^, PI/2); + TGLPipe(GLPipe).Nodes.AddNode(ap5.x * factor, ap5.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap5.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap6.x * factor, ap6.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap6.y * factor); + + if GLPipe.Material.Texture.Disabled then + begin + ComponColor := getLineComponColor(aCompon);//ConvertWinColor(clGreen); + GLPipe.Material.FrontProperties.Ambient.Color := ComponColor; + GLPipe.Material.FrontProperties.Diffuse.Color := ComponColor; + GLPipe.Material.FrontProperties.Emission.Color := ComponColor; + GLPipe.Material.BackProperties.Ambient.Color := ComponColor; + GLPipe.Material.BackProperties.Diffuse.Color := ComponColor; + GLPipe.Material.BackProperties.Emission.Color := ComponColor; + end; + + GLPipe.Material.MaterialOptions := []; + //GLPipe.Material.Texture.Disabled := False; + GLPipe.Material.Texture.Disabled := true; + GLPipe.TagObject := ChildNode; + F3DLineCompon.FGLObject := GLPipe; + TGLPipe(GLPipe).ObjectStyle := TGLPipe(GLPipe).ObjectStyle + [osDirectDraw]; + TGLPipe(GLPipe).SplineMode := lsmSegments;//lsmLines; // + + WireStep := WireStep + 0.1; + end; + end + else + begin + while WireStep < aLine.LineLength do + begin + F3DLineCompon := T3DLineComponent.Create(nil, nil,Self.F3DModel); + Self.F3DModel.FScsObjects.Add(F3DLineCompon); + childNode := DuplicateNodeTree.Items.AddChild(nil, aCompon.GetNameForVisible); + childNode.ImageIndex := 8; + childNode.SelectedIndex := 2; + ChildNode.Data := F3DLineCompon; + F3DLineCompon.FSCSCompon := aCompon; + F3DLineCompon.FSCSComponID := aCompon.ID; + + GLPipe := TGLFREEFORM(DummyCube.AddNewChild(TGLPipe)); + TGLPipe(GLPipe).Radius := 0.01 * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; + + p1 := GetPoint(aLine, 1, WireStep); + + ap7.x := aLine.ap2.x; + ap7.y := aLine.ap2.y; + ap7.z := aLine.ActualZOrder[2]; + + p2 := GetPointA(p1^, ap7, HalfWidth); + + ap5 := RotatePoint(p1^, p2^, -PI/2); + ap6 := RotatePoint(p1^, p2^, PI/2); + TGLPipe(GLPipe).Nodes.AddNode(ap5.x * factor, (ap5.z + WireTrayHeight) * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap5.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap5.x * factor, ap5.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap5.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap6.x * factor, ap6.z * factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap6.y * factor); + TGLPipe(GLPipe).Nodes.AddNode(ap6.x * factor, (ap6.z + WireTrayHeight)* factor * UOMToMetre(1000 / FCAD.PCad.MapScale) + FZOrder*factor*(UOMToMetre(1000 / FCAD.PCad.MapScale)), ap6.y * factor); + + if GLPipe.Material.Texture.Disabled then + begin + ComponColor := getLineComponColor(aCompon);//ConvertWinColor(clGreen); + GLPipe.Material.FrontProperties.Ambient.Color := ComponColor; + GLPipe.Material.FrontProperties.Diffuse.Color := ComponColor; + GLPipe.Material.FrontProperties.Emission.Color := ComponColor; + GLPipe.Material.BackProperties.Ambient.Color := ComponColor; + GLPipe.Material.BackProperties.Diffuse.Color := ComponColor; + GLPipe.Material.BackProperties.Emission.Color := ComponColor; + end; + + GLPipe.Material.MaterialOptions := []; + //GLPipe.Material.Texture.Disabled := False; + GLPipe.Material.Texture.Disabled := true; + GLPipe.TagObject := ChildNode; + F3DLineCompon.FGLObject := GLPipe; + TGLPipe(GLPipe).ObjectStyle := TGLPipe(GLPipe).ObjectStyle + [osDirectDraw]; + TGLPipe(GLPipe).SplineMode := lsmSegments;//lsmLines; // + + WireStep := WireStep + 0.1; + end; + end; + end; + // + end; + end; { if ChildNode <> nil then currNode := ChildNode;} @@ -3525,6 +4015,54 @@ var end; end; + Procedure OffsetTubesOnLine; + var i, HalfCount: integer; + LeftList, RightList: TList; + CenterTube: TglCylinder; + LeftOffset, RightOffset: Double; + LineAngle: double; + begin + if TubeList.Count < 2 then + exit; + LineAngle := LineFigure.GetAngleInRad(LineFigure.ap1.x, LineFigure.ap1.y, LineFigure.ap2.x, LineFigure.ap2.y); + HalfCount := TubeList.Count div 2; + LeftList := TList.Create; + RightList := TList.Create; + LeftOffset := 0; + RightOffset := 0; + CenterTube := nil; + if ((TubeList.Count mod 2) <> 0) then + begin + CenterTube := TglCylinder(TubeList[HalfCount]); + LeftOffset := max(CenterTube.TopRadius, CenterTube.BottomRadius) + 0.1; + RightOffset := max(CenterTube.TopRadius, CenterTube.BottomRadius) + 0.1; + end; + + for I := HalfCount - 1 downto 0 do + begin + LeftList.Add(TglCylinder(TubeList[i])); + RightList.Add(TglCylinder(TubeList[TubeList.Count - i - 1])); + end; + + for I := 0 to HalfCount - 1 do + begin + LeftOffset := LeftOffset + max(TglCylinder(LeftList[i]).TopRadius,TglCylinder(LeftList[i]).BottomRadius) + 0.1; + RightOffset := RightOffset + max(TglCylinder(RightList[i]).TopRadius,TglCylinder(RightList[i]).BottomRadius) + 0.1; + TglCylinder(LeftList[i]).Position.z := TglCylinder(LeftList[i]).Position.z + LeftOffset*cos(LineAngle); + TglCylinder(RightList[i]).Position.z := TglCylinder(RightList[i]).Position.z - RightOffset*cos(LineAngle); + TglCylinder(LeftList[i]).Position.z := TglCylinder(LeftList[i]).Position.z + LeftOffset*cos(LineAngle); + TglCylinder(RightList[i]).Position.z := TglCylinder(RightList[i]).Position.z - RightOffset*cos(LineAngle); + + TglCylinder(LeftList[i]).Position.x := TglCylinder(LeftList[i]).Position.x + LeftOffset*sin(LineAngle); + TglCylinder(RightList[i]).Position.x := TglCylinder(RightList[i]).Position.x - RightOffset*sin(LineAngle); + TglCylinder(LeftList[i]).Position.x := TglCylinder(LeftList[i]).Position.x + LeftOffset*sin(LineAngle); + TglCylinder(RightList[i]).Position.x := TglCylinder(RightList[i]).Position.x - RightOffset*sin(LineAngle); + end; + + LeftList.Free; + RightList.Free; + end; + begin LineComponOffset := 0; CanAddCableCompon := True; @@ -3548,15 +4086,27 @@ var LineCatalog := LineList.GetCatalogFromReferencesBySCSID(LineFigure.ID); if LineCatalog <> nil then begin + TubeList.Clear; // Tolik 20/03/2025 -- for i := 0 to LineCatalog.ComponentReferences.Count - 1 do begin LineComponent := LineCatalog.ComponentReferences[i]; if LineComponent.IsTop then begin ParentNode := xNode; - AddLineCompon(ParentNode, LineComponent, LineFigure, aLine); + //Tolik 20/03/2025 + if LineComponent.Componenttype.sysname = ctsnTube then + begin + AddLineCompon(ParentNode, LineComponent, LineFigure, aLine); + CanAddTube := False; + end + else + begin + if LineComponent.Componenttype.sysname = ctsnWireTray then + AddLineCompon(ParentNode, LineComponent, LineFigure, aLine); + end; end; end; + //OffsetTubesOnLine; end; end; end; @@ -3936,15 +4486,12 @@ begin Result := Result + (arr[high(arr)][0] * arr[0][2]); Result := Result - (arr[high(arr)][2] * arr[0][0]); end; - end; - -// begin try bb := TBitmap.Create; bb.LoadFromFile(ExeDir + '\3DTextures\inner_wall_PE.bmp'); - + TubeList := TList.create; //bb_jpg := TJPEGImage.Create; //bb_jpg.LoadFromFile(ExeDir + '\3DTextures\inner_wall_PE.jpg'); @@ -4182,7 +4729,8 @@ try TGLPipe(glObject).Slices := 32; TGLPipe(glObject).NodesColorMode := pncmAmbient; TGLPipe(glObject).Division := 3; - TGLPipe(glObject).SplineMode := lsmNURBSCurve;//lsmBezierSpline; //lsmCubicSpline; + //TGLPipe(glObject).SplineMode := lsmNURBSCurve;//lsmBezierSpline; //lsmCubicSpline; + TGLPipe(glObject).SplineMode := lsmCubicSpline; end //Tolik 10/12/2018 -- else @@ -4368,8 +4916,19 @@ try if xConn.FisPipeElement then begin //TGLPipeNode(glPipe.Nodes[k]).RadiusFactor := xConn.FPipeRadius * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor; - if k = 0 then - xConn.FGLPoint := p; + //Tolik 08/04/2025 -- + //if k = 0 then + if pCnt = 2 then + begin + if k = 0 then + xConn.FGLPoint := p + end + else + begin + if pCnt = 3 then + if k = 1 then + xConn.FGLPoint := p; + end; //TGLPipeNode(glPipe.Nodes[k]).RadiusFactor := Round(xConn.FPipeRadiusArray[k]); end else @@ -4828,6 +5387,23 @@ try end; if ((xConn <> nil) and xConn.FisPipeElement) then begin + //Tolik 04/04/2025 -- + if glPipe.Nodes.Count = 2 then + begin + xConn.FGLPoint.x := glPipe.Nodes[0].x; + xConn.FGLPoint.y := glPipe.Nodes[0].y; + xConn.FGLPoint.z := glPipe.Nodes[0].z; + end + else + begin + if glPipe.Nodes.Count = 3 then + begin + xConn.FGLPoint.x := glPipe.Nodes[1].x; + xConn.FGLPoint.y := glPipe.Nodes[1].y; + xConn.FGLPoint.z := glPipe.Nodes[1].z; + end; + end; + // { glPipe.Position.X := xConn.FGLPoint.x; glPipe.Position.y := xConn.FGLPoint.y; glPipe.Position.z := xConn.FGLPoint.z;} @@ -5852,11 +6428,13 @@ try //Tolik 25/09/2018 -- //glPipe.Radius := Face.Size + { if xConn = nil then glPipe.Radius := Face.Size else if not xConn.FisPipeElement then glPipe.Radius := Face.Size; + } // {$IFEND} glPipe.Parts := [ppOutSide,ppInSide,ppStartDisk,ppStopDisk]; @@ -6019,6 +6597,15 @@ try //******************\ROOF******************* end; end; + //Tolik 19/03/2025 - , + glObject := TWireTray.Create(frm3D.DummyCube); + //TWireTray(glObject).BeginUpdate; + TWireTray(glObject).SetScene(GLScene); + TWireTray(glObject).Length := 100; + TWireTray(glObject).Width := 20; + TWireTray(glObject).Height := 20; + //TWireTray(glObject).EndUpdate; + // //// *********** FACES.COUNT ************************************************* //FCAD.FActiveNet; @@ -6324,7 +6911,7 @@ if ObjMatList.Count > 0 then except on E: Exception do AddExceptionToLogEx('Form3d.UpdateFaces', E.Message); end; - +TubeList.free; // Tolik 20/03/2025 end; procedure Tfrm3D.SetCubeBounds(var glCube: TGLCube; Points: T3dPointArray; Factor:Double); @@ -7353,8 +7940,11 @@ var xLine: T3DLine; xTube: T3DTube; Str: string; + LastConnID: integer;// Tolik 18/04/2025 -- begin try + LastConnID := -1; // Tolik 18/04/2025 -- + xModelNode := ScsModelTree.Items.GetFirstNode; // Str := FCAD.FCADListName + ' ' + IntToStr(FCAD.FCADListIndex); @@ -7383,11 +7973,38 @@ begin end else begin + //Tolik 07/05/2025 -- + if ((xConn.FSCSComponID <> -1) and (xConn.FSCSComponID = LastConnID)) then + begin + xScsNode := DuplicateNodeTree.Items.AddChild(nil, xConn.FName);; + xScsNode.Data := xConn; + xScsNode.ImageIndex := 3; + xScsNode.SelectedIndex := xScsNode.ImageIndex; + xConn.FFace.FTreeNode := xScsNode; + end + else + begin + LastConnID := xConn.FSCSComponID; + xScsNode := ScsModelTree.Items.AddChild(xListNode, xConn.FName); + xScsNode.Data := xConn; + xScsNode.ImageIndex := 3; + xScsNode.SelectedIndex := xScsNode.ImageIndex; + xConn.FFace.FTreeNode := xScsNode; + end; + { xScsNode := ScsModelTree.Items.AddChild(xListNode, xConn.FName); xScsNode.Data := xConn; xScsNode.ImageIndex := 3; xScsNode.SelectedIndex := xScsNode.ImageIndex; xConn.FFace.FTreeNode := xScsNode; + if xConn.FSCSComponID <> -1 then + begin + if xConn.FSCSComponID <> LastConnID then + LastConnID := xConn.FSCSComponID; + { else + xSCSNode.IsVisible := False; + end; + } end; end else @@ -8529,9 +9146,11 @@ var end; // begin - FMode := F3DPerspective; // Tolik 11/02/2020 - trWallTransparency.Position := 50; // Tolik 17/09/2021 -- - tbSetWallsTransparency.Enabled := False; // Tolik 17/09/2021 -- + DuplicateNodeTree.Visible := False; + + FMode := F3DPerspective; // Tolik 11/02/2020 + trWallTransparency.Position := 50; // Tolik 17/09/2021 -- + tbSetWallsTransparency.Enabled := False; // Tolik 17/09/2021 -- // Tolik 03/10/2019 -- , .obj // trWallTransparency.enabled := False; // Tolik 12/10/2021 -- @@ -8628,6 +9247,7 @@ var childNode: TTreeNode; // Tolik 18/10/2018 -- begin try + xObj := nil; // Tolik 12/05/2025 -- Result := TList.Create; xNodes := GetAllSidesNodesByNodes(aNodes); for i := 0 to xNodes.Count - 1 do @@ -8647,6 +9267,15 @@ begin if (TObject(xNode.Data).ClassName = 'T3DComponent') then xObj := TGLBaseSceneObject(T3DComponent(xNode.Data).FGLObject) else + //Tolik 17/04/2025 -- + if (TObject(xNode.Data).ClassName = 'T3DLineComponent') then + begin + //if T3DLineComponent(xNode.Data).FSCSCompon.ComponentType.SysName = ctsnWireTray then + if (T3DLineComponent(xNode.Data).FSCSCompon.ComponentType.SysName = ctsnWireTray) or + (T3DLineComponent(xNode.Data).FSCSCompon.ComponentType.SysName = ctsnTube) then // //Tolik 12/05/2025 -- + xObj := TGLBaseSceneObject(T3DLineComponent(xNode.Data).FGLObject) + end + else if (TObject(xNode.Data).ClassName = 'T3DConnector') then begin xObj := TGLBaseSceneObject(T3DConnector(xNode.Data).FGLObject); @@ -8757,6 +9386,7 @@ var LineComponentNode, LineComponentParentNode: TTreeNode; LineComponObject: TGLSceneObject; breakCounter: integer; + ComponID: integer; // Tolik 12/05/2025 -- begin try FSelection.Clear; @@ -8863,59 +9493,182 @@ begin end; if (xObj is TGLPipe) then begin - xConn := T3DConnector(TTreeNode(xObj.TagObject).Data); - // TO - if xConn.FConnType = ct_Full then + //Tolik 17/04/2025 -- + if TObject(TTreeNode(xObj.TagObject).Data).ClassName = 'T3DLineComponent' then begin - if (xConn.FGLObject1 is TGLFreeForm) then + ComponID := -1; + if T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon <> nil then + ComponID := T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon.ID; + + with TGLPipe(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material do begin - with TGLFreeForm(xConn.FGLObject1).Material do + if (TGLPipe(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.MaterialOptions = []) and + (TGLPipe(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.Texture.Disabled = False) then begin - if (TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions = []) and (TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled = False) then + TGLPipe(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.MaterialOptions := [moNoLighting]; + TGLPipe(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; + end; + //Tolik 12/05/2025 -- + if ComponID <> -1 then + begin + for j := 0 to DuplicateNodeTree.Items.Count - 1 do + begin + if TObject(DuplicateNodeTree.Items[j].Data).ClassName = 'T3DLineComponent' then begin - TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions := [moNoLighting]; - TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled := True; - end - else - begin - BackProperties.Ambient.Color := SelObjColor; - BackProperties.Diffuse.Color := SelObjColor; - BackProperties.Emission.Color := SelObjColor; - FrontProperties.Ambient.Color := SelObjColor; - FrontProperties.Diffuse.Color := SelObjColor; - FrontProperties.Emission.Color := SelObjColor; + if T3DLineComponent(DuplicateNodeTree.Items[j].Data).FSCSCompon <> nil then + begin + if T3DLineComponent(DuplicateNodeTree.Items[j].Data).FSCSCompon.ID = ComponID then + begin + with TglPipe(T3DLineComponent(DuplicateNodeTree.Items[j].Data).FGLObject).Material do + begin + if (TGLPipe(T3DLineComponent(DuplicateNodeTree.Items[j].Data).FGLObject).Material.MaterialOptions = []) and + (TGLPipe(T3DLineComponent(DuplicateNodeTree.Items[j].Data).FGLObject).Material.Texture.Disabled = False) then + begin + TGLPipe(T3DLineComponent(DuplicateNodeTree.Items[j].Data).FGLObject).Material.MaterialOptions := [moNoLighting]; + TGLPipe(T3DLineComponent(DuplicateNodeTree.Items[j].Data).FGLObject).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; + end; + end; + end; end; end; end; end else - // Clear Connector - begin - if xConn.FisPipeElement then + begin // + xConn := T3DConnector(TTreeNode(xObj.TagObject).Data); + // TO + if xConn.FConnType = ct_Full then begin - with TGLPipe(xConn.FGLObject).Material do + if (xConn.FGLObject1 is TGLFreeForm) then begin - if (TGLPipe(xConn.FGLObject).Material.MaterialOptions = []) and (TGLPipe(xConn.FGLObject).Material.Texture.Disabled = False) then + with TGLFreeForm(xConn.FGLObject1).Material do begin - TGLPipe(xConn.FGLObject).Material.MaterialOptions := [moNoLighting]; - TGLPipe(xConn.FGLObject).Material.Texture.Disabled := True; - end - else - begin - BackProperties.Ambient.Color := SelObjColor; - BackProperties.Diffuse.Color := SelObjColor; - BackProperties.Emission.Color := SelObjColor; - FrontProperties.Ambient.Color := SelObjColor; - FrontProperties.Diffuse.Color := SelObjColor; - FrontProperties.Emission.Color := SelObjColor; + if (TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions = []) and (TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled = False) then + begin + TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions := [moNoLighting]; + TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; end; end; + end + else + // Clear Connector + begin + if xConn.FisPipeElement then + begin + for j := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[j]).Data).ClassName = 'T3DConnector' then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FSCSComponID = xConn.FSCSComponID then + begin + with TGLPipe(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FGLObject).Material do + begin + if (TGLPipe(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FGLObject).Material.MaterialOptions = []) and + (TGLPipe(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FGLObject).Material.Texture.Disabled = False) then + begin + TGLPipe(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FGLObject).Material.MaterialOptions := [moNoLighting]; + TGLPipe(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FGLObject).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; + end; + end; + end; + end; + + for j := 0 to DuplicateNodeTree.Items.Count - 1 do + begin + if TObject(TTreeNode(DuplicateNodeTree.Items[j]).Data).ClassName = 'T3DConnector' then + begin + if T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FSCSComponID = xConn.FSCSComponID then + begin + with TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material do + begin + if (TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.MaterialOptions = []) and + (TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.Texture.Disabled = False) then + begin + TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.MaterialOptions := [moNoLighting]; + TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; + end; + end; + end; + end; + //Tolik 09/05/2025 -- + + { + with TGLPipe(xConn.FGLObject).Material do + begin + if (TGLPipe(xConn.FGLObject).Material.MaterialOptions = []) and (TGLPipe(xConn.FGLObject).Material.Texture.Disabled = False) then + begin + TGLPipe(xConn.FGLObject).Material.MaterialOptions := [moNoLighting]; + TGLPipe(xConn.FGLObject).Material.Texture.Disabled := True; + end + else + begin + BackProperties.Ambient.Color := SelObjColor; + BackProperties.Diffuse.Color := SelObjColor; + BackProperties.Emission.Color := SelObjColor; + FrontProperties.Ambient.Color := SelObjColor; + FrontProperties.Diffuse.Color := SelObjColor; + FrontProperties.Emission.Color := SelObjColor; + end; + end; + } + end; end; end; end; // Tolik 03/10/2018 -- if (xObj is TGLCylinder) then begin + //if TObject(TTreeNode(xObj.TagObject).Data).ClassName = 'T3DTube' then if TObject(TTreeNode(xObj.TagObject).Data).ClassName = 'T3DTube' then begin xTube := T3DTube(TTreeNode(xObj.TagObject).Data); @@ -8958,8 +9711,9 @@ begin if not isUserTransparency then begin ComponColor := ConvertWinColor(clGray); - if F3DLineComponent.FSCSCompon <> nil then - ComponColor := getLineComponColor(F3DLineComponent.FSCSCompon); + //Tolik 12/05/2025 -- + { if F3DLineComponent.FSCSCompon <> nil then + ComponColor := getLineComponColor(F3DLineComponent.FSCSCompon);} BackProperties.Ambient.Color := ComponColor; BackProperties.Diffuse.Color := ComponColor; @@ -9170,7 +9924,7 @@ var // Tolik 23/11/2018 -- LineComponentNode, LineComponentParentNode: TTreeNode; LineComponObject: TGLSceneObject; - + ComponID: integer; // Tolik 12/05/2025 -- begin try JoinConn1 := nil; @@ -9269,46 +10023,167 @@ begin end; if (xObj is TGLPipe) then begin - xConn := T3DConnector(TTreeNode(xObj.TagObject).Data); - if (xConn.FGLObject1 is TGLFreeForm) then + if TObject(TTreeNode(xObj.TagObject).Data).ClassName = 'T3DLineComponent' then begin - with TGLFreeForm(xConn.FGLObject1).Material do + ComponID := -1; + if T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon <> nil then + ComponID := T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon.ID; + + with TGLFreeForm(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material do begin - if (TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions = [moNoLighting]) and (TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled = True) then + if (TGLFreeForm(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.MaterialOptions = [moNoLighting]) and + (TGLFreeForm(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.Texture.Disabled = True) then begin - TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions := []; - TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled := False; + TGLFreeForm(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.MaterialOptions := []; + TGLFreeForm(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FGLObject).Material.Texture.Disabled := False; end else begin - BackProperties.Ambient.Color := xConn.FColor; - BackProperties.Diffuse.Color := xConn.FColor; - BackProperties.Emission.Color := xConn.FColor; - FrontProperties.Ambient.Color := xConn.FColor; - FrontProperties.Diffuse.Color := xConn.FColor; - FrontProperties.Emission.Color := xConn.FColor; + BackProperties.Ambient.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + BackProperties.Diffuse.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + BackProperties.Emission.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Ambient.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Diffuse.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Emission.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); end; end; - end; - if xConn.FisPipeElement then - begin - with TGLPipe(xConn.FGLObject).Material do + if ComponID <> -1 then begin - if (TGLPipe(xConn.FGLObject).Material.MaterialOptions = [moNoLighting]) and (TGLPipe(xConn.FGLObject).Material.Texture.Disabled = True) then + for j := 0 to DuplicateNodeTree.Items.Count - 1 do begin - TGLPipe(xConn.FGLObject).Material.MaterialOptions := []; - TGLPipe(xConn.FGLObject).Material.Texture.Disabled := False; - end - else - begin - BackProperties.Ambient.Color := xConn.FColor; - BackProperties.Diffuse.Color := xConn.FColor; - BackProperties.Emission.Color := xConn.FColor; - FrontProperties.Ambient.Color := xConn.FColor; - FrontProperties.Diffuse.Color := xConn.FColor; - FrontProperties.Emission.Color := xConn.FColor; + if TObject(DuplicateNodeTree.Items[j].data).ClassName = 'T3DLineComponent' then + begin + if T3DLineComponent(DuplicateNodeTree.Items[j].data).FSCSCompon <> nil then + begin + if T3DLineComponent(DuplicateNodeTree.Items[j].data).FSCSCompon.ID = ComponID then + begin + with TGLFreeForm(T3DLineComponent(DuplicateNodeTree.Items[j].data).FGLObject).Material do + begin + if (TGLFreeForm(T3DLineComponent(DuplicateNodeTree.Items[j].data).FGLObject).Material.MaterialOptions = [moNoLighting]) and + (TGLFreeForm(T3DLineComponent(DuplicateNodeTree.Items[j].data).FGLObject).Material.Texture.Disabled = True) then + begin + TGLFreeForm(T3DLineComponent(DuplicateNodeTree.Items[j].data).FGLObject).Material.MaterialOptions := []; + TGLFreeForm(T3DLineComponent(DuplicateNodeTree.Items[j].data).FGLObject).Material.Texture.Disabled := False; + end + else + begin + BackProperties.Ambient.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + BackProperties.Diffuse.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + BackProperties.Emission.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Ambient.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Diffuse.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + FrontProperties.Emission.Color := getLineComponColor(T3DLineComponent(TTreeNode(xObj.TagObject).Data).FSCSCompon); + end; + end; + end; + end; + end; end; end; + end + else + begin + // + xConn := T3DConnector(TTreeNode(xObj.TagObject).Data); + if (xConn.FGLObject1 is TGLFreeForm) then + begin + with TGLFreeForm(xConn.FGLObject1).Material do + begin + if (TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions = [moNoLighting]) and (TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled = True) then + begin + TGLFreeForm(xConn.FGLObject1).Material.MaterialOptions := []; + TGLFreeForm(xConn.FGLObject1).Material.Texture.Disabled := False; + end + else + begin + BackProperties.Ambient.Color := xConn.FColor; + BackProperties.Diffuse.Color := xConn.FColor; + BackProperties.Emission.Color := xConn.FColor; + FrontProperties.Ambient.Color := xConn.FColor; + FrontProperties.Diffuse.Color := xConn.FColor; + FrontProperties.Emission.Color := xConn.FColor; + end; + end; + end; + if xConn.FisPipeElement then + begin + //Tolik 18/04/2025 -- + for j := 0 to ScsModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(ScsModelTree.Items[j]).Data).ClassName = 'T3DConnector' then + begin + if T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FSCSComponID = xConn.FSCSComponID then + begin + with TGLPipe(T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FGLObject).Material do + begin + if (TGLPipe(T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FGLObject).Material.MaterialOptions = [moNoLighting]) and + (TGLPipe(T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FGLObject).Material.Texture.Disabled = True) then + begin + TGLPipe(T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FGLObject).Material.MaterialOptions := []; + TGLPipe(T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FGLObject).Material.Texture.Disabled := False; + end + else + begin + BackProperties.Ambient.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + BackProperties.Diffuse.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + BackProperties.Emission.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + FrontProperties.Ambient.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + FrontProperties.Diffuse.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + FrontProperties.Emission.Color := T3DConnector(TTreeNode(ScsModelTree.Items[j]).Data).FColor; + end; + end; + end; + end; + end; + + // Tolik 09/05/2025 -- + for j := 0 to DuplicateNodeTree.Items.Count - 1 do + begin + if TObject(TTreeNode(DuplicateNodeTree.Items[j]).Data).ClassName = 'T3DConnector' then + begin + if T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FSCSComponID = xConn.FSCSComponID then + begin + with TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material do + begin + if (TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.MaterialOptions = [moNoLighting]) and + (TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.Texture.Disabled = True) then + begin + TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.MaterialOptions := []; + TGLPipe(T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FGLObject).Material.Texture.Disabled := False; + end + else + begin + BackProperties.Ambient.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + BackProperties.Diffuse.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + BackProperties.Emission.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + FrontProperties.Ambient.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + FrontProperties.Diffuse.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + FrontProperties.Emission.Color := T3DConnector(TTreeNode(DuplicateNodeTree.Items[j]).Data).FColor; + end; + end; + end; + end; + end; + { + with TGLPipe(xConn.FGLObject).Material do + begin + if (TGLPipe(xConn.FGLObject).Material.MaterialOptions = [moNoLighting]) and (TGLPipe(xConn.FGLObject).Material.Texture.Disabled = True) then + begin + TGLPipe(xConn.FGLObject).Material.MaterialOptions := []; + TGLPipe(xConn.FGLObject).Material.Texture.Disabled := False; + end + else + begin + BackProperties.Ambient.Color := xConn.FColor; + BackProperties.Diffuse.Color := xConn.FColor; + BackProperties.Emission.Color := xConn.FColor; + FrontProperties.Ambient.Color := xConn.FColor; + FrontProperties.Diffuse.Color := xConn.FColor; + FrontProperties.Emission.Color := xConn.FColor; + end; + end; + } + end; end; end; // Tolik 03/10/2018 -- @@ -9763,7 +10638,9 @@ begin end; procedure Tfrm3D.FormDestroy(Sender: TObject); +var i: integer; begin + ObjMatList.Free; // Tolik 02/10/2019 -- if FSelection <> nil then //FreeAndNil(FSelection); @@ -18176,31 +19053,35 @@ var tmpdir, tmpfname: string; begin try - xObject := T3DLine(aObject.Data); - xGLObject := TGLBaseSceneObject(xObject.FGLObject); - edScsName.Text := xObject.FName; - edScsIndex.Text := IntToStr(xObject.FIndex); + //Tolik 17/04/2025 -- + if TObject(aObject.Data).ClassName = 'T3DLine' then + begin + xObject := T3DLine(aObject.Data); + xGLObject := TGLBaseSceneObject(xObject.FGLObject); + edScsName.Text := xObject.FName; + edScsIndex.Text := IntToStr(xObject.FIndex); - mScsDesc.Clear; - for i := 0 to xObject.FDescription.Count - 1 do - mScsDesc.Lines.Add(xObject.FDescription[i]); + mScsDesc.Clear; + for i := 0 to xObject.FDescription.Count - 1 do + mScsDesc.Lines.Add(xObject.FDescription[i]); - mScsCaption.Clear; - for i := 0 to xObject.FCaptions.Count - 1 do - mScsCaption.Lines.Add(xObject.FCaptions[i]); + mScsCaption.Clear; + for i := 0 to xObject.FCaptions.Count - 1 do + mScsCaption.Lines.Add(xObject.FCaptions[i]); - mScsNote.Clear; - for i := 0 to xObject.FNotes.Count - 1 do - mScsNote.Lines.Add(xObject.FNotes[i]); + mScsNote.Clear; + for i := 0 to xObject.FNotes.Count - 1 do + mScsNote.Lines.Add(xObject.FNotes[i]); - edScsLength.Text := FormatFloat(ffMask, xObject.FLength); + edScsLength.Text := FormatFloat(ffMask, xObject.FLength); - edScsLineX1.Text := FormatFloat(ffMask, xObject.FPoint1.x); - edScsLineY1.Text := FormatFloat(ffMask, xObject.FPoint1.y); - edScsLineZ1.Text := FormatFloat(ffMask, xObject.FPoint1.z); - edScsLineX2.Text := FormatFloat(ffMask, xObject.FPoint2.x); - edScsLineY2.Text := FormatFloat(ffMask, xObject.FPoint2.y); - edScsLineZ2.Text := FormatFloat(ffMask, xObject.FPoint2.z); + edScsLineX1.Text := FormatFloat(ffMask, xObject.FPoint1.x); + edScsLineY1.Text := FormatFloat(ffMask, xObject.FPoint1.y); + edScsLineZ1.Text := FormatFloat(ffMask, xObject.FPoint1.z); + edScsLineX2.Text := FormatFloat(ffMask, xObject.FPoint2.x); + edScsLineY2.Text := FormatFloat(ffMask, xObject.FPoint2.y); + edScsLineZ2.Text := FormatFloat(ffMask, xObject.FPoint2.z); + end; except on E: Exception do AddExceptionToLogEx('Tfrm3D.LoadPropertiesForSingleLine', E.Message); @@ -20552,10 +21433,94 @@ begin end; end; +Function Tfrm3D.Get3DPoint(aLine: T3DLine; PointNum: Integer; dist: Double): PDoublePoint; // Tolik 07/04/2025 -- + var p1, p2: TDoublePoint; + i, direction: Integer; + TubeCompon: TSCSComponent; + distx, disty, distz, koefx, koefy, koefz, LineLen: Double; + LineCatalog: TSCSCatalog; + CirclePoint: PDoublePoint; + RealRadius: Double; + PointsAngle: Double; + Conn1,Conn2: T3DConnector; + MaxX, MaxY, MinX, MinY, DistToPoint: Double; + + begin + Result := Nil; + New(Result); + + DistToPoint := Dist; + + Conn1 := T3DConnector(aLine.FJoinConnector1); + Conn2 := T3DConnector(aLine.FJoinConnector2); + + if PointNum = 1 then + begin + p1.x := Conn1.FGLPoint.x; + p1.y := Conn1.FGLPoint.y; + p1.z := Conn1.FGLPoint.z; + + p2.x := Conn2.FGLPoint.x; + p2.y := Conn2.FGLPoint.y; + p2.z := Conn2.FGLPoint.z; + end + else + if PointNum = 2 then + begin + p2.x := Conn1.FGLPoint.x; + p2.y := Conn1.FGLPoint.y; + p2.z := Conn1.FGLPoint.z; + + p1.x := Conn2.FGLPoint.x; + p1.y := Conn2.FGLPoint.y; + p1.z := Conn2.FGLPoint.z; + end + else + begin + Dispose(Result); + Result := Nil; + exit; + end; + + LineLen := SQRT(SQR(p1.x - p2.x) + SQR(p1.y - p2.y) + SQR(p1.z - p2.z)); + + koefx := ABS((p2.x - p1.x))/LineLen; + koefy := ABS((p2.y - p1.y))/LineLen; + koefz := ABS((p2.z - p1.z))/LineLen; + + direction := 0; + if comparevalue(p2.x, p1.x) = -1 then + direction := -1 + else + if comparevalue(p2.x, p1.x) = 1 then + direction := 1; + + Result.x := p1.x + direction * DistTopoint * koefx; + + direction := 0; + if comparevalue(p2.y, p1.y) = -1 then + direction := -1 + else + if comparevalue(p2.y, p1.y) = 1 then + direction := 1; + + Result.y := p1.y + direction * DistTopoint * koefy; + + direction := 0; + + if comparevalue(p2.z, p1.z) = -1 then + direction := -1 + else + if comparevalue(p2.z, p1.z) = 1 then + direction := 1; + + Result.z := p1.z + direction * DistTopoint * koefz; + end; + // Tolik 18/10/2018 -- -- procedure Tfrm3D.Move3DConnector(aObj: T3DConnector; dp: T3DPoint; AIsFirstObject: Boolean=false); var - i, j: integer; + i, j, k, l: integer; xConn, xConn1, xConn2, xGetConn, xRaiseConn, xObjFromRaise: T3DConnector; xLine: T3DLine; pos: T3DPoint; @@ -20569,6 +21534,8 @@ var OldParentAngle: double; ObjPos: TVector4F; OldParentPos: TDoublePoint; + //*Tolik 27/03/2025 -- + MovedLineList, OtherSideConnList, RelatedPipeConns, OtherRelatedPipeConns: TList; Function GetSelfNode: TTreeNode; var i: Integer; @@ -20694,6 +21661,191 @@ var if ConnNode <> nil then Result := CheckCanMoveChildCompons(ConnNode); end; + // Tolik 27/03/2025 -- + Procedure GetRelatedObjects; // , , , + // + var i: integer; + begin + // , + for I := 0 to DummyCube.Count - 1 do + begin + if DummyCube.Children[i] is TGLPipe then + begin + RelatedPipeConns.Add(DummyCube.Children[i]); + end; + end; + end; + + Procedure AlignPipeObjects; + var i, j: integer; + currPipe: TGLPipe; + PipePoint: PDoublePoint; + RelatedLine, RelatedLine2: T3DLine; + RelatedSCSLine: TOrthoLine; + A3DConn: T3DConnector; + begin + for j := 0 to RelatedPipeConns.Count - 1 do + begin + A3DConn := T3DConnector(RelatedPipeConns[j]); + if A3DConn.FRelatedLines.Count > 0 then + begin + if A3DConn.FRelatedLines.Count = 1 then // + begin + RelatedSCSLine := TOrthoLine(A3DConn.FRelatedLines[0]); + RelatedLine := nil; + for i := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[i]).Data) is T3DLine then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject <> nil then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject.ID = RelatedSCSLine.ID then + begin + RelatedLine := T3DLine(TTreeNode(SCSModelTree.Items[i]).Data); + break; + end; + end; + end; + end; + if RelatedLine <> nil then + begin + if A3DConn.FSCSObject.ID = RelatedLine.FJoinConnector1.FSCSObject.ID then + PipePoint := Get3DPoint(RelatedLine, 1, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor) + else + PipePoint := Get3DPoint(RelatedLine, 2, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor); + + {TGLPiPe(A3DConn.FGLObject).Nodes[0].X := TGLPiPe(A3DConn.FGLObject).Nodes[0].X + dp.x; + TGLPiPe(A3DConn.FGLObject).Nodes[0].Y := TGLPiPe(A3DConn.FGLObject).Nodes[0].Y + dp.y; + TGLPiPe(A3DConn.FGLObject).Nodes[0].Z := TGLPiPe(A3DConn.FGLObject).Nodes[0].Z + dp.z;} + + TGLPiPe(A3DConn.FGLObject).Nodes[1].X := PipePoint.x; + TGLPiPe(A3DConn.FGLObject).Nodes[1].Y := PipePoint.y; + TGLPiPe(A3DConn.FGLObject).Nodes[1].Z := PipePoint.z; + DisPose(PipePoint); + end; + end; + if A3DConn.FRelatedLines.Count = 2 then //, , + begin + RelatedSCSLine := TOrthoLine(A3DConn.FRelatedLines[0]); + RelatedLine := nil; + + for i := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[i]).Data) is T3DLine then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject <> nil then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject.ID = RelatedSCSLine.ID then + begin + RelatedLine := T3DLine(TTreeNode(SCSModelTree.Items[i]).Data); + break; + end; + end; + end; + end; + + if RelatedLine <> nil then + begin + if A3DConn.FSCSObject.ID = RelatedLine.FJoinConnector1.FSCSObject.ID then + PipePoint := Get3DPoint(RelatedLine, 1, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor) + else + PipePoint := Get3DPoint(RelatedLine, 2, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor); + + RelatedSCSLine := A3DConn.FRelatedLines[1]; + RelatedLine := nil; + + for i := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[i]).Data) is T3DLine then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject <> nil then + begin + if T3DLine(TTreeNode(SCSModelTree.Items[i]).Data).FSCSObject.ID = RelatedSCSLine.ID then + begin + RelatedLine := T3DLine(TTreeNode(SCSModelTree.Items[i]).Data); + break; + end; + end; + end; + end; + + if RelatedLine <> nil then + begin + TGLPiPe(A3DConn.FGLObject).Nodes[0].X := PipePoint.x; + TGLPiPe(A3DConn.FGLObject).Nodes[0].Y := PipePoint.y; + TGLPiPe(A3DConn.FGLObject).Nodes[0].Z := PipePoint.z; + { + TGLPiPe(A3DConn.FGLObject).Nodes[1].X := TGLPiPe(A3DConn.FGLObject).Nodes[0].X + dp.x; + TGLPiPe(A3DConn.FGLObject).Nodes[1].Y := TGLPiPe(A3DConn.FGLObject).Nodes[0].Y + dp.y; + TGLPiPe(A3DConn.FGLObject).Nodes[1].Z := TGLPiPe(A3DConn.FGLObject).Nodes[0].Z + dp.z; + } + Dispose(PipePoint); + if A3DConn.FSCSObject.ID = RelatedLine.FJoinConnector1.FSCSObject.ID then + PipePoint := Get3DPoint(RelatedLine, 1, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor) + else + PipePoint := Get3DPoint(RelatedLine, 2, A3DConn.FLength * UOMToMetre(1000 / FCAD.PCad.MapScale) * factor); + + TGLPiPe(A3DConn.FGLObject).Nodes[2].X := PipePoint.x; + TGLPiPe(A3DConn.FGLObject).Nodes[2].Y := PipePoint.y; + TGLPiPe(A3DConn.FGLObject).Nodes[2].Z := PipePoint.z; + + DisPose(PipePoint); + end; + end; + end; + end; + end; + end; + + Procedure AlignRelatedConns; + var i, j: integer; + LineConn1, LineConn2, NextSideConn: T3DConnector; + SelfLine, JoinedLine: T3DLine; + NextSideConnsList: TList; + SCSLineList: TList; + SCSConn: TConnectorObject; + SCSLine: TOrtholine; + + begin + SelfLine := nil; + NextSideConnsList := TList.Create; + SCSLineList := TList.Create; + RelatedPipeConns.Clear; + + if xConn.FSCSObject <> nil then + begin + for i := 0 to TConnectorObject(xConn.FSCSObject).JoinedOrtholinesList.Count - 1 do + begin + SCSLine := TConnectorObject(xConn.FSCSObject).JoinedOrtholinesList[i]; + if SCSLine.JoinConnector1.ID = TConnectorObject(xConn.FSCSObject).ID then + SCSConn := TConnectorObject(SCSLine.JoinConnector2) + else + SCSConn := TConnectorObject(SCSLine.JoinConnector1); + + for j := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[j]).Data) is T3DConnector then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FSCSObject <> nil then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FSCSObject.ID = SCSConn.ID then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data).FisPipeElement then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data) <> xConn then + RelatedPipeConns.Add(T3DConnector(TTreeNode(SCSModelTree.Items[j]).Data)); + end; + end; + end; + end; + end; + end; + end; + AlignPipeObjects; + NextSideConnsList.Free; + SCSLineList.Free; + end; + // begin try @@ -20701,6 +21853,7 @@ begin exit; xGLObject := nil; xConn := aObj; + // Tolik 26/04/2018 -- { if dp.y <> 0 then @@ -20710,7 +21863,11 @@ begin // if IsConnectorMoved(xConn) then exit; // object already moved! - + MovedLineList := TList.create; + OtherSideConnList := TList.create; + RelatedPipeConns := TList.create; + OtherRelatedPipeConns := TList.create; + //GetRelatedObjects; if WasShiftMouse then begin if FMovedComponent <> nil then @@ -20797,6 +21954,7 @@ begin begin if TglBasesceneObject(xConn.FGLObject).TagObject <> nil then if TTreeNode(TglBasesceneObject(xConn.FGLObject).TagObject).Count > 0 then + //if (TTreeNode(TglBasesceneObject(xConn.FGLObject).TagObject).Count > 0) or (xConn.FGLObject is TGLPipe) then begin TglBasesceneObject(xConn.FGLObject).Position.X := TglBasesceneObject(xConn.FGLObject).Position.X + dp.x; TglBasesceneObject(xConn.FGLObject).Position.Y := TglBasesceneObject(xConn.FGLObject).Position.Y + dp.y; @@ -20883,9 +22041,87 @@ begin begin if xGLObject <> nil then begin - xGLObject.Nodes[0].X := xGLObject.Nodes[0].X + dp.x; - xGLObject.Nodes[0].Y := xGLObject.Nodes[0].Y + dp.y; - xGLObject.Nodes[0].Z := xGLObject.Nodes[0].Z + dp.z; + //Tolik 26/03/2025 ** + if xConn.FisPipeElement then + begin + if xGLObject is TGLPipe then + begin + if xConn.FSCSObject <> nil then + begin + RelatedPipeConns.Clear; + for k := 0 to SCSModelTree.Items.Count - 1 do + begin + if TObject(TTreeNode(SCSModelTree.Items[k]).Data) is T3DConnector then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[k]).Data).FSCSObject <> nil then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[k]).Data).FSCSObject.ID = xConn.FSCSObject.ID then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[k]).Data).FGLObject <> nil then + begin + if T3DConnector(TTreeNode(SCSModelTree.Items[k]).Data).FGLObject is TGLPipe then + begin + RelatedPipeConns.Add(T3DConnector(TTreeNode(SCSModelTree.Items[k]).Data)); + end; + end; + end; + end; + end; + end; + { + for l := 0 to RelatedPipeConns.Count - 1 do + begin + for k := 0 to TGLPipe(RelatedPipeConns[l]).Nodes.Count - 1 do + begin + TGLPipe(RelatedPipeConns[l]).Nodes[k].X := TGLPipe(RelatedPipeConns[l]).Nodes[k].X + dp.x; + TGLPipe(RelatedPipeConns[l]).Nodes[k].Y := TGLPipe(RelatedPipeConns[l]).Nodes[k].Y + dp.y; + TGLPipe(RelatedPipeConns[l]).Nodes[k].Z := TGLPipe(RelatedPipeConns[l]).Nodes[k].Z + dp.z; + end; + end; + for k := 0 to xConn.FJoinedLinesList.Count - 1 do + MovedLineList.Add(xConn.FJoinedLinesList[k]); + } + for l := 0 to RelatedPipeConns.Count - 1 do + begin + if TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes.Count = 2 then + begin + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].X := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].X + dp.x; + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].Y := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].Y + dp.y; + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].Z := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[0].Z + dp.z; + end; + + if TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes.Count = 3 then + begin + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].X := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].X + dp.x; + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].Y := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].Y + dp.y; + TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].Z := TglPipe(T3DConnector(RelatedPipeConns[l]).FGLObject).Nodes[1].Z + dp.z; + end; + end; + //AlignPipeObjects; + end + else + begin + for k := 0 to xGLObject.Nodes.Count - 1 do + begin + xGLObject.Nodes[k].X := xGLObject.Nodes[k].X + dp.x; + xGLObject.Nodes[k].Y := xGLObject.Nodes[k].Y + dp.y; + xGLObject.Nodes[k].Z := xGLObject.Nodes[k].Z + dp.z; + end; + end; + end + else + begin + xGLObject.Nodes[0].X := xGLObject.Nodes[0].X + dp.x; + xGLObject.Nodes[0].Y := xGLObject.Nodes[0].Y + dp.y; + xGLObject.Nodes[0].Z := xGLObject.Nodes[0].Z + dp.z; + end; + end + else + begin + xGLObject.Nodes[0].X := xGLObject.Nodes[0].X + dp.x; + xGLObject.Nodes[0].Y := xGLObject.Nodes[0].Y + dp.y; + xGLObject.Nodes[0].Z := xGLObject.Nodes[0].Z + dp.z; + end; end; end; @@ -20915,9 +22151,59 @@ begin begin if xGLObject <> nil then begin - xConn.FGLPoint.x := xGLObject.Nodes[0].X; - xConn.FGLPoint.y := xGLObject.Nodes[0].Y - xConn.FZOrder; - xConn.FGLPoint.z := xGLObject.Nodes[0].Z; + //Tolik 03/04/2025 -- + if xGLObject is TGLPipe then + begin + //Tolik 03/04/2025 -- + if xConn.FisPipeelement then + begin + for i := 0 to RelatedPipeConns.Count - 1 do + begin + if TglPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes.Count = 2 then + begin + T3DConnector(RelatedPipeConns[i]).FGLPoint.x := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[0].X; + T3DConnector(RelatedPipeConns[i]).FGLPoint.y := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[0].Y - xConn.FZOrder; + T3DConnector(RelatedPipeConns[i]).FGLPoint.z := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[0].Z; + end + else + begin + if TglPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes.Count = 3 then + begin + T3DConnector(RelatedPipeConns[i]).FGLPoint.x := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[1].X; + T3DConnector(RelatedPipeConns[i]).FGLPoint.y := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[1].Y - xConn.FZOrder; + T3DConnector(RelatedPipeConns[i]).FGLPoint.z := TGLPipe(T3DConnector(RelatedPipeConns[i]).FGLObject).Nodes[1].Z; + end; + end; + end; + { + if xConn.FRelatedLines.Count = 1 then + begin + xConn.FGLPoint.x := xGLObject.Nodes[0].X; + xConn.FGLPoint.y := xGLObject.Nodes[0].Y - xConn.FZOrder; + xConn.FGLPoint.z := xGLObject.Nodes[0].Z; + end + else + begin + xConn.FGLPoint.x := xGLObject.Nodes[1].X; + xConn.FGLPoint.y := xGLObject.Nodes[1].Y - xConn.FZOrder; + xConn.FGLPoint.z := xGLObject.Nodes[1].Z; + end; + } + end + else + begin + xConn.FGLPoint.x := xGLObject.Nodes[0].X; + xConn.FGLPoint.y := xGLObject.Nodes[0].Y - xConn.FZOrder; + xConn.FGLPoint.z := xGLObject.Nodes[0].Z; + end; + end + else + begin + // + xConn.FGLPoint.x := xGLObject.Nodes[0].X; + xConn.FGLPoint.y := xGLObject.Nodes[0].Y - xConn.FZOrder; + xConn.FGLPoint.z := xGLObject.Nodes[0].Z; + end; end else begin @@ -20928,14 +22214,25 @@ begin xConn.FGLPoint.z := TGLDummyCube(xConn.FGLObject).Position.Z + dp.z; end; end; - - xConn.FPoint.x := xConn.FGLPoint.x / Factor; - {TODO ZCoord} - //xConn.FPoint.z := xConn.FGLPoint.y / Factor / FScaleDelta; - xConn.FPoint.z := xConn.FGLPoint.y / Factor / FScaleDeltaSCS; // NEWNEW - xConn.FPoint.y := xConn.FGLPoint.z / Factor; + if RelatedPipeConns.Count = 0 then + begin + xConn.FPoint.x := xConn.FGLPoint.x / Factor; + {TODO ZCoord} + //xConn.FPoint.z := xConn.FGLPoint.y / Factor / FScaleDelta; + xConn.FPoint.z := xConn.FGLPoint.y / Factor / FScaleDeltaSCS; // NEWNEW + xConn.FPoint.y := xConn.FGLPoint.z / Factor; + end + else + begin + for i := 0 to RelatedPipeConns.Count - 1 do + begin + T3DConnector(RelatedPipeConns[i]).FPoint.x := T3DConnector(RelatedPipeConns[i]).FGLPoint.x / Factor; + T3DConnector(RelatedPipeConns[i]).FPoint.z := T3DConnector(RelatedPipeConns[i]).FGLPoint.y / Factor / FScaleDeltaSCS; // NEWNEW + T3DConnector(RelatedPipeConns[i]).FPoint.y := T3DConnector(RelatedPipeConns[i]).FGLPoint.z / Factor; + end; + end; end; - + //AlignPipeObjects; if xConn.FGLCaption <> nil then begin xGLCaption := TGLSpaceText(xConn.FGLCaption); @@ -21001,13 +22298,30 @@ begin // if empty connector if xConn.FConnType = ct_Empty then begin - for i := 0 to xConn.FJoinedLinesList.Count - 1 do + //Tolik 07/04/2025 -- + if xConn.FisPipeElement then begin - xLine := T3DLine(xConn.FJoinedLinesList[i]); - pos.x := xGLObject.Nodes[0].X; - pos.y := xGLObject.Nodes[0].Y; - pos.z := xGLObject.Nodes[0].Z; - Move3DLine(xConn, xLine, pos); + pos.x := xConn.FglPoint.x; + pos.y := xConn.FglPoint.y; + pos.z := xConn.FglPoint.z; + + for i := 0 to xConn.FJoinedLinesList.Count - 1 do + begin + xLine := T3DLine(xConn.FJoinedLinesList[i]); + Move3DLine(xConn, xLine, pos); + end; + end + else + begin + // + for i := 0 to xConn.FJoinedLinesList.Count - 1 do + begin + xLine := T3DLine(xConn.FJoinedLinesList[i]); + pos.x := xGLObject.Nodes[0].X; + pos.y := xGLObject.Nodes[0].Y; + pos.z := xGLObject.Nodes[0].Z; + Move3DLine(xConn, xLine, pos); + end; end; end else @@ -21069,6 +22383,12 @@ begin if G3DModelForProject then Move3DBetweenRaiseConnector(xConn, dp); end; + AlignPipeObjects; + AlignRelatedConns; + MovedLineList.free; + OtherSideConnList.free; + RelatedPipeConns.free; + OtherRelatedPipeConns.free; except on E: Exception do AddExceptionToLogEx('Tfrm3D.Move3DConnector', E.Message); end; @@ -21561,10 +22881,12 @@ var F3DLineCompon: T3DLineComponent; pN, pP: TVector3f; childNode: TTreeNode; + TubeRadius: double; + TubePoint: PDoublePoint; begin if aNode <> nil then begin - + if TObject(aNode.Data).ClassName = 'T3DLineComponent' then begin if T3DLineComponent(aNode.Data).FGLObject <> nil then @@ -21579,6 +22901,29 @@ var pP[1] := xGLLine.Nodes[1].y; pP[2] := xGLLine.Nodes[1].z; + //Tolik 09/04/2025 -- + TubeRadius := TGLCylinder(T3DLineComponent(aNode.Data).FGLObject).TopRadius; + + if T3DLineComponent(aNode.Data).FSCSCompon.ComponentType.SysName = ctsnTube then + begin + if aLine.FJoinConnector1.FisPipeElement then + begin + TubePoint := Get3DPoint(aLine, 1, TubeRadius); + pN[0] := TubePoint.x; + pN[1] := TubePoint.y; + pN[2] := TubePoint.z; + Dispose(TubePoint); + end; + end; + if aLine.FJoinConnector2.FisPipeElement then + begin + TubePoint := Get3DPoint(aLine, 2, TubeRadius); + pP[0] := TubePoint.x; + pP[1] := TubePoint.y; + pP[2] := TubePoint.z; + Dispose(TubePoint); + end; + // TGLCylinder(T3DLineComponent(aNode.Data).FGLObject).Align(pN, pP); end else @@ -21617,7 +22962,8 @@ begin // xGLLine.Nodes[0].Y := aPos.y; xGLLine.Nodes[0].Z := aPos.z; - end; + end + else if xConn = xLine.FJoinConnector2 then begin xGLLine.Nodes[1].X := aPos.x; @@ -23302,6 +24648,7 @@ procedure Tfrm3D.N1Click(Sender: TObject); if ChildNode.Count > 0 then SetObjectsTransparency(ChildNode, TrCableChannel, TrTube, TrCorrugation); end; + isUserTransparency := True; end; begin diff --git a/REPORTS/RCablePaths.frf b/REPORTS/RCablePaths.frf new file mode 100644 index 0000000..1e7adde Binary files /dev/null and b/REPORTS/RCablePaths.frf differ diff --git a/REPORTS/RExplicationComponent.frf b/REPORTS/RExplicationComponent.frf new file mode 100644 index 0000000..f67cb75 Binary files /dev/null and b/REPORTS/RExplicationComponent.frf differ diff --git a/REPORTS/RGOSTCableJournal.frf b/REPORTS/RGOSTCableJournal.frf new file mode 100644 index 0000000..8681b48 Binary files /dev/null and b/REPORTS/RGOSTCableJournal.frf differ diff --git a/SCS_RF.optset b/SCS_RF.optset new file mode 100644 index 0000000..d4f100e --- /dev/null +++ b/SCS_RF.optset @@ -0,0 +1,22 @@ + + + C:\Program Files\Эксперт-СКС 1.8.0\ + false + false + SCS_RF;PROCAT_SCS;FINAL_SCS;$(DCC_Define) + 1251 + false + false + false + false + 0 + + + Delphi.Personality.12 + OptionSet + + + + 12 + + diff --git a/SRC/1.bat b/SRC/1.bat index a031c45..df2992c 100644 --- a/SRC/1.bat +++ b/SRC/1.bat @@ -1,4 +1,3 @@ set DELPHI=C:\Program Files\Borland\Delphi6 - @SET PATH=%PATH%;%DELPHI%\bin dcc32.exe -B %1 -LU > 1.log \ No newline at end of file diff --git a/SRC/ARCH/U_Arch3DNew.pas b/SRC/ARCH/U_Arch3DNew.pas index b59f8b5..8e8a8ec 100644 --- a/SRC/ARCH/U_Arch3DNew.pas +++ b/SRC/ARCH/U_Arch3DNew.pas @@ -356,6 +356,8 @@ type F3D_Length: Double; FUse3DSize: Boolean; HasPipeElements: Boolean; // , , . + FRelatedLines: TList; // Tolik 03/04/2025 -- , + FLength: Double; // Tolik 03/04/2025 // //Tolik -- 24//09/2018 -- //constructor Create(aFaces: TList; aSCSObject: TConnectorObject; aParent: T3DModel); @@ -535,6 +537,7 @@ type function ConverResultToUom(aResult: Double; aIzm: String): Double; // Tolik 18/10/2018 -- Function GetPoint(aLine: TOrthoLine; PointNum: Integer; dist: Double): PDoublePoint; // Tolik 18/10/2018 -- + Function GetPointA(apoint1, aPoint2: TDoublePoint; dist: Double): PDoublePoint; // Tolik 12/10/2025 -- const {TODO} FDeltaZ: Double = 0.030; @@ -708,8 +711,8 @@ function ConverResultToUom(aResult: Double; aIzm: String): Double; umFoot : CadUomIzm := 0.3; end; - //Result := aResult * (CadUomIzm/UomIzm); - Result := aResult * (UomIzm/CadUomIzm); + Result := aResult * (CadUomIzm/UomIzm); + //Result := aResult * (UomIzm/CadUomIzm); end; end; @@ -724,7 +727,6 @@ function ConverResultToUom(aResult: Double; aIzm: String): Double; PointsAngle: Double; Conn1,Conn2: TConnectorObject; MaxX, MaxY, MinX, MinY, DistToPoint: Double; - begin Result := Nil; New(Result); @@ -796,6 +798,37 @@ function ConverResultToUom(aResult: Double; aIzm: String): Double; //Result.z := MetreToUom((p1.z + ((Dist) * (UOMToMetre(1000 / GCadForm.PCad.MapScale)) * koefz))/(UOMToMetre(1000 / GCadForm.PCad.MapScale))); end; + // ( , , ) + Function GetPointA(aPoint1, aPoint2: TDoublePoint; dist: Double): PDoublePoint; // Tolik 12/10/2025 -- + var + p1, p2: TDoublePoint; + distx, disty, distz, koefx, koefy, koefz, LineLen: Double; + DistToPoint: Double; + begin + Result := Nil; + New(Result); + + DistToPoint := Dist; + + p1.x := aPoint1.x; + p1.y := aPoint1.y; + p1.z := UomToMetre(aPoint1.z) * (UOMToMetre(1000 / GCadForm.PCad.MapScale)); + //p1.z := TConnectorObject(aLine.JoinConnector1).ActualZOrder[1]; + p2.x := aPoint2.x; + p2.y := aPoint2.y; + p2.z := UomToMetre(aPoint2.z) * (UOMToMetre(1000 / GCadForm.PCad.MapScale)); + + LineLen := SQRT(SQR(P1.x - P2.x) + SQR(P1.y - P2.y) + SQR(P1.z - P2.z)); + koefx := (P2.x - P1.x)/LineLen; + koefy := (P2.y - P1.y)/LineLen; + koefz := (P2.z - P1.z)/LineLen; + + Result.x := P1.x + (DistTopoint * (UOMToMetre(1000 / GCadForm.PCad.MapScale)) * koefx); + Result.y := P1.y + (DistTopoint * (UOMToMetre(1000 / GCadForm.PCad.MapScale)) * koefy); + Result.z := MetreToUom(P1.z + DistTopoint * (UOMToMetre(1000 / GCadForm.PCad.MapScale)) * koefz)/(UOMToMetre(1000 / GCadForm.PCad.MapScale)); + //Result.x := p1.x + ((Dist) * (UOMToMetre(1000 / GCadForm.PCad.MapScale)) * koefx); + end; + function GetTubeRadius(aSCSCompon: TSCSComponent): Double; var i : Integer; NBProp: TNBProperty; @@ -4426,7 +4459,7 @@ var if Result.IndexOf(LineCatalog.ComponentReferences[i]) = -1 then begin Result.Add(LineCatalog.ComponentReferences[i]); - break; + //break; end; end; end; @@ -4462,17 +4495,19 @@ var Procedure CreatePipeElement(aConn: TConnectorObject); // Cable var i, j, k : Integer; - PrevPipeRadius, PipeRadius: Double; + MaxPipeRadius, PrevPipeRadius, PipeRadius: Double; LineCatalog: TSCSCatalog; - LineComponent: TSCSComponent; + LineComponent, LineComponent1: TSCSComponent; LineList, TubeList: TList; PipePoint, PrevPipePoint, addPoint: PDoublePoint; apArray: T3DPointArray; - TubeLine: TOrthoLine; + TubeLine, TubeLine1: TOrthoLine; JoinedConn: TConnectorObject; CableList: TList; CableOffset: Double; + ConnSide: integer; + exVals: Boolean; //Tolik 12/11/2021 -- function CheckisPipeElement(aConnector: TConnectorObject): Boolean; @@ -4508,6 +4543,8 @@ var TubeList := TList.Create; PipeList := TList.Create; CableList:= TList.Create; + PipePoint := nil; + PrevPipePoint := nil; //Collect Lines //Tolik 12/11/2021 -- //if aConn.ConnectorType = ct_Clear then @@ -4556,29 +4593,37 @@ var for k := 0 to LineCatalog.ComponentReferences.Count - 1 do begin LineComponent := LineCatalog.ComponentReferences[k]; - { + if LineComponent.ComponentType.SysName = ctsnTube then begin LineList.Add(TOrthoLine(JoinedConn.JoinedOrthoLineslist[i])); TubeList.Add(LineComponent); break; - end; - } + end + else + begin if isCableComponent(LineComponent) then if CableList.IndexOf(LineComponent) = - 1 then CableList.Add(LineComponent); + end; end; end; end; end; end; +(* for i := 0 to CableList.Count - 1 do begin SetLength(apArray, 3); TubeLine := TOrthoLine(LineList[0]); LineComponent := TSCSComponent(TubeList[0]); + PipeRadius := GetTubeRadius(LineComponent); + if PipeRadius = -1 then //Tolik 28/03/2025 -- - + Exit; + + PipeRadius := PipeRadius + PipeRadius /10; PipePoint := nil; if aConn.ConnectorType = ct_Clear then begin @@ -4614,6 +4659,7 @@ var TubeLine := TOrthoLine(LineList[0]); LineComponent := TSCSComponent(TubeList[0]); PrevPipeRadius := GetTubeRadius(LineComponent); + PrevPipeRadius := PrevPipeRadius + PrevPipeRadius /10; if aConn.ConnectorType = ct_Clear then begin if TConnectorObject(TubeLine.JoinConnector1).Id = aConn.ID then @@ -4632,6 +4678,7 @@ var TubeLine := TOrthoLine(LineList[i]); LineComponent := TSCSComponent(TubeList[j]); PipeRadius := GetTubeRadius(LineComponent); + PipeRadius := PipeRadius + PipeRadius /10; if PipeRadius <> -1 then // !!!! begin SetLength(apArray, 2); @@ -4803,9 +4850,438 @@ var SetLength(apArray, 0); end; end; + *) + // , + for i := LineList.Count - 1 downto 0 do + begin + LineComponent := TSCSComponent(TubeList[i]); + PipeRadius := GetTubeRadius(LineComponent); + if PipeRadius = -1 then + begin + LineList.Delete(i); + TubeList.Delete(i); + CableList.Delete(i); + end; + end; + + if LineList.Count > 0 then + begin + if LineList.Count = 1 then // + begin + SetLength(apArray, 2); + TubeLine := TOrthoLine(LineList[0]); + LineComponent := TSCSComponent(TubeList[0]); + + PipeRadius := GetTubeRadius(LineComponent); + PipeRadius := PipeRadius + PipeRadius /10; + PipePoint := nil; + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TubeLine.JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TubeLine, 1, PipeRadius) + else + PipePoint := GetPoint(TubeLine, 2, PipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TubeLine.JoinConnector1)) <> -1 then + PipePoint := GetPoint(TubeLine, 1, PipeRadius) + else + PipePoint := GetPoint(TubeLine, 2, PipeRadius) + end; + + apArray[1].x := PipePoint.x; + apArray[1].y := PipePoint.y; + apArray[1].z := PipePoint.z; + + DisPose(PipePoint); // 21/12/2019 -- Tolik + PipePoint := nil; + + apArray[0].x := aConn.ap1.x; + apArray[0].y := aConn.ap1.y; + apArray[0].z := aConn.ActualZOrder[1]; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TubeLine); + x3DConnector.FLength := PipeRadius; + end + else // + if LineList.Count = 2 then + begin + PipeRadius := GetTubeRadius(TSCSComponent(TubeList[0])); + PipeRadius := PipeRadius + PipeRadius /10; + PipePoint := nil; + PrevPipeRadius := GetTubeRadius(TSCSComponent(TubeList[1])); + PrevPipeRadius := PrevPipeRadius + PrevPipeRadius /10; + + if CompareValue(PipeRadius, PrevPipeRadius) = 0 then // , + begin + SetLength(apArray, 3 ); + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TOrthoLine(LineList[0]).JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TOrthoLine(LineList[0]), 1, PipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[0]), 2, PipeRadius); + + if TConnectorObject(TOrthoLine(LineList[1]).JoinConnector1).Id = aConn.ID then + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 1, PipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 2, PipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(LineList[0]).JoinConnector1)) <> -1 then + PipePoint := GetPoint(TOrthoLine(LineList[0]), 1, PipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[0]), 2, PipeRadius); + + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(LineList[1]).JoinConnector1)) <> -1 then + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 1, PipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 2, PipeRadius); + end; + SetLength(apArray, 3); + apArray[0].x := PipePoint.x; + apArray[0].y := PipePoint.y; + apArray[0].z := PipePoint.z; + + DisPose(PipePoint); + PipePoint := nil; + + apArray[1].x := aConn.ap1.x; + apArray[1].y := aConn.ap1.y; + apArray[1].z := aConn.ActualZOrder[1]; + + apArray[2].x := PrevPipePoint.x; + apArray[2].y := PrevPipePoint.y; + apArray[2].z := PrevPipePoint.z; + + Dispose(PrevPipePoint); + PrevPipePoint := nil; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TOrthoLine(LineList[0])); + x3DConnector.FRelatedLines.Add(TOrthoLine(LineList[1])); + x3DConnector.FLength := PipeRadius; + end + else + begin + exVals := False; + + if CompareValue(PipeRadius, PrevPiperadius) = -1 then + begin + ExchangeDouble(PipeRadius, PrevPipeRadius); // + exVals := True; + end; + + SetLength(apArray, 3); + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TOrthoLine(LineList[0]).JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TOrthoLine(LineList[0]), 1, PipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[0]), 2, PipeRadius); + + if TConnectorObject(TOrthoLine(LineList[1]).JoinConnector1).Id = aConn.ID then + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 1, PipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 2, PipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(LineList[0]).JoinConnector1)) <> -1 then + PipePoint := GetPoint(TOrthoLine(LineList[0]), 1, PipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[0]), 2, PipeRadius); + + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(LineList[1]).JoinConnector1)) <> -1 then + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 1, PipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(LineList[1]), 2, PipeRadius); + end; + SetLength(apArray, 3); + apArray[0].x := PipePoint.x; + apArray[0].y := PipePoint.y; + apArray[0].z := PipePoint.z; + + DisPose(PipePoint); + PipePoint := nil; + + apArray[1].x := aConn.ap1.x; + apArray[1].y := aConn.ap1.y; + apArray[1].z := aConn.ActualZOrder[1]; + + apArray[2].x := PrevPipePoint.x; + apArray[2].y := PrevPipePoint.y; + apArray[2].z := PrevPipePoint.z; + + Dispose(PrevPipePoint); + PrevPipePoint := nil; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TOrthoLine(LineList[0])); + x3DConnector.FRelatedLines.Add(TOrthoLine(LineList[1])); + x3DConnector.FLength := PipeRadius; + + if exVals then + TubeLine := LineList[0] + else + TubeLine := LineList[1]; + + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TubeLine.JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TubeLine, 1, PipeRadius + PrevPipeRadius) + else + PipePoint := GetPoint(TubeLine, 2, PipeRadius + PrevPipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TubeLine.JoinConnector1) <> -1 then + PipePoint := GetPoint(TubeLine, 1, PipeRadius + PrevPipeRadius) + else + PipePoint := GetPoint(TubeLine, 2, PipeRadius + PrevPipeRadius); + end; + + SetLength(apArray, 2); + + apArray[0].x := aConn.ap1.x; + apArray[0].y := aConn.ap1.y; + apArray[0].z := aConn.ActualZOrder[1]; + + apArray[1].x := PipePoint.x; + apArray[1].y := PipePoint.y; + apArray[1].z := PipePoint.z; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PrevPipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TubeLine); + x3DConnector.FLength := PipeRadius + PrevPipeRadius; + end; + end + else + if LineList.Count > 2 then + begin + MaxPipeRadius := -1; + TubeLine1 := nil; + TubeLine := nil; + + for i := 0 to TubeList.Count - 1 do //get Max tube Radius + begin + PipeRadius := GetTubeRadius(TSCSComponent(TubeList[i])); + if CompareValue(MaxPipeRadius, PipeRadius) = -1 then + begin + MaxPipeRadius := PipeRadius; + TubeLine := TOrthoLine(LineList[i]); + LineComponent := TSCSComponent(TubeList[i]); + j := i; + end; + end; + + Tubelist.Delete(j); // + LineList.Delete(j); + CableList.Delete(j); + + for i := 0 to TubeList.Count - 1 do //get next tube with Max Radius + begin + PipeRadius := GetTubeRadius(TSCSComponent(TubeList[i])); + if CompareValue(MaxPipeRadius, PipeRadius) = 0 then + begin + TubeLine1 := TOrthoLine(LineList[i]); + LineComponent1 := TSCSComponent(Tubelist[i]); + j := i; + break; + end; + end; + + MaxPipeRadius := MaxPipeRadius + MaxPipeRadius/10; + + if TubeLine1 = nil then // , , + begin + PipeRadius := -1; + for i := 0 to LineList.Count - 1 do + begin + PrevPipeRadius := GetTubeRadius(TSCSComponent(TubeList[i])); + if CompareValue(PipeRadius, PrevPipeRadius) = -1 then + begin + PipeRadius := PrevPipeRadius; + TubeLine1 := TOrthoLine(LineList[i]); + LineComponent1 := TSCSComponent(TubeList[i]); + j := i; + end; + end; + end; + + PipeRadius := PipeRadius + PipeRadius/10; + + Tubelist.Delete(j); // + LineList.Delete(j); + CableList.Delete(j); + + // + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TOrthoLine(TubeLine).JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TOrthoLine(TubeLine), 1, MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(TubeLine), 2, MaxPipeRadius); + + if TConnectorObject(TOrthoLine(TubeLine1).JoinConnector1).Id = aConn.ID then + PrevPipePoint := GetPoint(TOrthoLine(TubeLine1), 1, MaxPipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(TubeLine1), 2, MaxPipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(TubeLine).JoinConnector1)) <> -1 then + PipePoint := GetPoint(TOrthoLine(TubeLine), 1, MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(TubeLine), 2, MaxPipeRadius); + + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(TubeLine1).JoinConnector1)) <> -1 then + PrevPipePoint := GetPoint(TOrthoLine(TubeLine1), 1, MaxPipeRadius) + else + PrevPipePoint := GetPoint(TOrthoLine(TubeLine1), 2, MaxPipeRadius); + end; + + SetLength(apArray, 3); + apArray[0].x := PipePoint.x; + apArray[0].y := PipePoint.y; + apArray[0].z := PipePoint.z; + + DisPose(PipePoint); + PipePoint := nil; + + apArray[1].x := aConn.ap1.x; + apArray[1].y := aConn.ap1.y; + apArray[1].z := aConn.ActualZOrder[1]; + + apArray[2].x := PrevPipePoint.x; + apArray[2].y := PrevPipePoint.y; + apArray[2].z := PrevPipePoint.z; + + Dispose(PrevPipePoint); + PrevPipePoint := nil; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := MaxPipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TubeLine); + x3DConnector.FRelatedLines.Add(TubeLine1); + x3DConnector.FLength := MaxPipeRadius; + + // - + if CompareValue(MaxPipeRadius, PipeRadius) <> 0 then + begin + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TOrthoLine(TubeLine1).JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TOrthoLine(TubeLine1), 1, PipeRadius + MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(TubeLine1), 2, PipeRadius + MaxPipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(TubeLine1).JoinConnector1)) <> -1 then + PipePoint := GetPoint(TOrthoLine(TubeLine1), 1, PipeRadius + MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(TubeLine1), 2, PipeRadius + MaxPipeRadius); + end; + + SetLength(apArray, 2); + + apArray[0].x := aConn.ap1.x; + apArray[0].y := aConn.ap1.y; + apArray[0].z := aConn.ActualZOrder[1]; + + apArray[1].x := PipePoint.x; + apArray[1].y := PipePoint.y; + apArray[1].z := PipePoint.z; + + Dispose(PipePoint); + PipePoint := nil; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(TubeLine1); + x3DConnector.FLength := PipeRadius + MaxPipeRadius; + end; + // + for i := 0 to TubeList.Count - 1 do + begin + PipeRadius := GetTubeRadius(TSCSComponent(TubeList[i])); + PipeRadius := PipeRadius + PipeRadius/10; + if aConn.ConnectorType = ct_Clear then + begin + if TConnectorObject(TOrthoLine(LineList[i]).JoinConnector1).Id = aConn.ID then + PipePoint := GetPoint(TOrthoLine(LineList[i]), 1, PipeRadius + MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[i]), 2, PipeRadius + MaxPipeRadius); + end + else + begin + if aConn.JoinedConnectorsList.IndexOf(TConnectorObject(TOrthoLine(LineList[i]).JoinConnector1)) <> -1 then + PipePoint := GetPoint(TOrthoLine(LineList[i]), 1, PipeRadius + MaxPipeRadius) + else + PipePoint := GetPoint(TOrthoLine(LineList[i]), 2, PipeRadius + MaxPipeRadius); + end; + + SetLength(apArray, 2); + + apArray[0].x := aConn.ap1.x; + apArray[0].y := aConn.ap1.y; + apArray[0].z := aConn.ActualZOrder[1]; + + apArray[1].x := PipePoint.x; + apArray[1].y := PipePoint.y; + apArray[1].z := PipePoint.z; + + Dispose(PipePoint); + PipePoint := nil; + + x3DConnector := T3DConnector.Create(aFaces, xConn, Self, True); + x3DConnector.CollectConnector(aFaces, apArray); + x3DConnector.FPipeRadius := PipeRadius; + FScsObjects.Add(x3DConnector); + x3DConnector.FSCSObject.F3DObject := x3DConnector; + x3DConnector.FColor := ConvertWinColor(clGreen); + x3DConnector.FRelatedLines.Add(LineList[i]); + x3DConnector.FLength := PipeRadius + MaxPipeRadius; + end; + end; + LineList.Free; TubeList.Free; PipeList.Free; + CableList.Free; + end; end; // Function Get3dModelFileName(aConn: TConnectorObject): String; @@ -4981,7 +5457,11 @@ begin CheckAddZones(xConn); // end - else if xConn.JoinedConnectorsList.Count >= 0 then + //Tolik 08/04/2025 -- + //else if xConn.JoinedConnectorsList.Count >= 0 then + else + if ((xConn.JoinedConnectorsList.Count >= 0) and (not CheckisPipeElement(xConn))) then + // begin x3DConnector := T3DConnector.Create(aFaces, xConn, Self); x3DConnector.CollectConnector(aFaces, a3DPointArr); @@ -5003,7 +5483,7 @@ begin CreatePipeElement(TConnectorObject(xConn.JoinedConnectorsList[0])) else CreatePipeElement(xConn); - end; + end; // Tolik 20/09/2018 -- { @@ -5046,8 +5526,8 @@ begin FScsObjects.Add(x3DLine); x3DLine.FSCSObject.F3DObject := x3DLine; // Tolik 17/09/2018 -- - //TubeList := GetTubeList(xLine); //15/09/2021 -- - TubeList := nil; + TubeList := GetTubeList(xLine); //15/09/2021 -- + //TubeList := nil; ComponOffset := 0; if TubeList <> nil then @@ -5056,7 +5536,7 @@ begin for j := 0 to TubeList.Count - 1 do begin TubeRadius := GetTubeRadius(TSCSComponent(TubeList[j])); - + (* if TubeRadius <> -1 then begin x3DTube := T3DTube.create(aFaces, xLine, Self, TSCSComponent(TubeList[j]), TubeRadius*2, TailTubeList); @@ -5083,7 +5563,7 @@ begin x3DTube.FSCSObject.F3DObject := x3DTube; end; ComponOffset := ComponOffset + TubeRadius * 2; - + *) { if TailTubeList <> nil then // , , , , "" begin @@ -13729,7 +14209,18 @@ var i: Integer; begin try - FPoint := ap[0]; + //Tolik 08/04/2025 + //FPoint := ap[0]; + if Self.FisPipeElement then + begin + if Length(ap) = 3 then + FPoint := ap[1] + else + FPoint := ap[0]; + end + else + FPoint := ap[0]; + // {TODO ZCoord} //ap[0].z := ap[0].z * FScaleDelta; for i := 0 to (Length(ap) - 1) do @@ -13792,7 +14283,10 @@ begin else begin FSCSCompon := nil; - FSCSComponID := -1; + //Tolik 18/4/2025 -- + //FSCSComponID := -1; + FSCSComponID := aSCSObject.ID; + // end; FName := FSCSObject.Name; FIndex := FSCSObject.FIndex; @@ -13832,6 +14326,8 @@ begin FColor := clrBlack; FJoinedConnectorsList := TList.Create; FJoinedLinesList := TList.Create; + FRelatedLines := TList.Create; // -- Tolik 03/4/2025 , + FLength := 0; // Tolik 03/04/05 -- except on E: Exception do AddExceptionToLogEx('T3DConnector.Create', E.Message); end; @@ -14206,7 +14702,9 @@ var for i := 0 to SCSCatalog.ComponentReferences.Count - 1 do begin SCSCompon := SCSCatalog.ComponentReferences[i]; - if SCSCompon.ComponentType.SysName <> ctsnCableChannelAccessory then + //Tolik 10/04/2025 -- + //if SCSCompon.ComponentType.SysName <> ctsnCableChannelAccessory then + if ((SCSCompon.ComponentType.SysName <> ctsnCableChannelAccessory) and (SCSCompon.ComponentType.SysName <> ctsnWireTray)) then begin ComponDiam := getLineComponOutRadius(SCSCompon); if isCableComponent(SCSCompon) then // @@ -15257,6 +15755,7 @@ begin FNotes.Free; FJoinedConnectorsList.Free; FJoinedLinesList.Free; + FRelatedLines.Free; inherited; end; //*************** -\ROOF- ************************** diff --git a/SRC/ExpertGM.dpr b/SRC/ExpertGM.dpr index e629566..fc4a60c 100644 --- a/SRC/ExpertGM.dpr +++ b/SRC/ExpertGM.dpr @@ -637,7 +637,6 @@ var Req: string; TimeStr: string; begin - Randomize; Randomize; TimeStr := DateTimeToStr(Now); while Pos(':', TimeStr) > 0 do diff --git a/SRC/Main/U_Common.pas b/SRC/Main/U_Common.pas index 29f3ea0..f738ae7 100644 --- a/SRC/Main/U_Common.pas +++ b/SRC/Main/U_Common.pas @@ -6900,14 +6900,14 @@ var if ResultList.Count > 0 then begin ATraveledIndex := ATraveledIndex; - showmessage('CurrTick > 0.00009 and ResultList.Count = '+ inttostr(ResultList.Count)); + //showmessage('CurrTick > 0.00009 and ResultList.Count = '+ inttostr(ResultList.Count)); exit; end; end; if CurrTick > 0.00013 then begin ATraveledIndex := ATraveledIndex; - showmessage('CurrTick > 0.00013 '); + //showmessage('CurrTick > 0.00013 '); exit; end; @@ -6915,7 +6915,7 @@ var if ResultList.Count > 2 then begin ATraveledIndex := ATraveledIndex; - showmessage('ATraveledIndex > 60 and ResultList.Count > 2'); + //showmessage('ATraveledIndex > 60 and ResultList.Count > 2'); exit; end else @@ -6924,7 +6924,7 @@ var if CurrTick > 0.00006 then begin ATraveledIndex := ATraveledIndex; - showmessage('ATraveledIndex > 60 ResultList.Count > 100'); + //showmessage('ATraveledIndex > 60 ResultList.Count > 100'); exit; end; end; diff --git a/SRC/Main/U_ELCommon.pas b/SRC/Main/U_ELCommon.pas index 83a3bfb..ccb5516 100644 --- a/SRC/Main/U_ELCommon.pas +++ b/SRC/Main/U_ELCommon.pas @@ -1,6 +1,9 @@ + + //Tolik 23/01/2025 -- + {$A+,B-,C+,D+,E-,F-,G+,H+,I-,J-,K-,L+,M-,N+,O-,P+,Q-,R-,S-,T-,U+,V+,W-,X+,Y+,Z1} //{$MINSTACKSIZE $00004000} -//{$MAXSTACKSIZE $00100000} +//{$MAXSTACKSIZE $00100000} // //{$IMAGEBASE $00400000} //{$APPTYPE GUI} //{$J+} @@ -38,7 +41,7 @@ var i, j, k, l, m: integer; Line_Count: Integer; Switches, Connections, UzoList: TSCSComponents; ConnectedCompon: TSCSComponent; - CurrText: TRichText; + CurrText, elText: TRichText; TextList: TStringList; IconFigList: TList; ParentCatalog: TSCSCatalog; @@ -809,6 +812,10 @@ var i, j, k, l, m: integer; //SLine := TLine.create(GCadForm.PCad.WorkWidth/10 - 20, by - 8, GCadForm.PCad.WorkWidth/10 - 10, by - 8, 2, ord(psSolid), clBlack, 0, GCadForm.PCad.GetLayerHandle(0), mydsNormal, GCadForm.PCad); SLine := TLine.create(GCadForm.PCad.WorkWidth/10 - 20, by - 5, GCadForm.PCad.WorkWidth/10 - 10, by - 5, 2, ord(psSolid), clBlack, 0, GCadForm.PCad.GetLayerHandle(0), mydsNormal, GCadForm.PCad); GCadForm.PCad.AddCustomFigure(1, TFigure(SLine), false); + // Tolik 22/01/2025 + elText.Move((((GCadForm.PCad.WorkWidth/10 - 20) + (GCadForm.PCad.WorkWidth/10 - 10))/2) - elText.CenterPoint.x, + (((190 - 3 - MaxTableHeightArray[0]) + (by - 5))/2) - elText.CenterPoint.y); + // end; end; //bx := bx + 10; @@ -1202,7 +1209,7 @@ Begin CurrText := CreateTextObject(Line_x1 - 80, Line_y1 + 80, TextList); CurrText.Rotate(((-90)/180) * PI, CurrText.CenterPoint); //TextFigList.Add(CurrText); - + elText := CurrText; // Tolik 22/01/2025 -- ColObjList := TList.Create; TextList.Clear; diff --git a/SRC/Main/U_MasterNewList.dfm b/SRC/Main/U_MasterNewList.dfm index 2d93f0b..af0e189 100644 --- a/SRC/Main/U_MasterNewList.dfm +++ b/SRC/Main/U_MasterNewList.dfm @@ -521,10 +521,6 @@ object F_MasterNewList: TF_MasterNewList end object tsProjOptionsObjectProps: TRzTabSheet Caption = #1055#1072#1088#1072#1084#1077#1090#1088#1099' '#1086#1073#1098#1077#1082#1090#1086#1074 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object RzGroupBox18: TRzGroupBox Left = 4 Top = 6 @@ -1051,7 +1047,7 @@ object F_MasterNewList: TF_MasterNewList Width = 626 Height = 481 HelpContext = 33002 - ActivePage = TabPageParams + ActivePage = TabAll Align = alTop Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -1062,7 +1058,7 @@ object F_MasterNewList: TF_MasterNewList HotTrackStyle = htsText ParentFont = False ShowShadow = False - TabIndex = 1 + TabIndex = 0 TabOrder = 0 TabStyle = tsSquareCorners OnChange = ListPageControlChange @@ -3606,10 +3602,6 @@ object F_MasterNewList: TF_MasterNewList end object TabSheet5: TRzTabSheet Caption = #1050#1072#1073#1080#1085#1077#1090#1099 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object cbShowCabinetsBounds: TRzCheckBox Left = 4 Top = 32 @@ -3635,10 +3627,6 @@ object F_MasterNewList: TF_MasterNewList end object TabSheet4: TRzTabSheet Caption = #1055#1077#1095#1072#1090#1100 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object cbBlackPrint: TcxRadioButton Left = 5 Top = 8 @@ -4137,10 +4125,6 @@ object F_MasterNewList: TF_MasterNewList object tsListSpravochniki: TRzTabSheet HelpContext = 33006 Caption = #1058#1080#1087#1099' '#1082#1086#1084#1087#1086#1085#1077#1085#1090 - ExplicitLeft = 0 - ExplicitTop = 0 - ExplicitWidth = 0 - ExplicitHeight = 0 object pnComponentType: TRzPanel Left = 0 Top = 434 @@ -12667,8 +12651,6 @@ object F_MasterNewList: TF_MasterNewList object tsProjectSpravochniki: TRzTabSheet TabVisible = False Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082#1080 - ExplicitWidth = 0 - ExplicitHeight = 0 end end object RzGroupBox20: TRzGroupBox diff --git a/SRC/Main/U_Reserv.dfm b/SRC/Main/U_Reserv.dfm index 63bd852..69954f1 100644 --- a/SRC/Main/U_Reserv.dfm +++ b/SRC/Main/U_Reserv.dfm @@ -1,10 +1,11 @@ object F_Reserv: TF_Reserv - Left = 380 - Top = 178 - BorderIcons = [biSystemMenu] + Left = 414 + Top = 175 + BorderIcons = [] + BorderStyle = bsSingle Caption = #1059#1087#1088#1072#1074#1083#1077#1085#1080#1077' '#1088#1077#1079#1077#1088#1074#1085#1099#1084#1080' '#1082#1086#1087#1080#1103#1084#1080' '#1085#1072' '#1091#1076#1072#1083#1077#1085#1085#1086#1084' '#1089#1077#1088#1074#1077#1088#1077 - ClientHeight = 311 - ClientWidth = 532 + ClientHeight = 344 + ClientWidth = 556 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -17,8 +18,8 @@ object F_Reserv: TF_Reserv PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel - Left = 32 - Top = 4 + Left = 8 + Top = 43 Width = 180 Height = 16 Caption = #1057#1087#1080#1089#1086#1082' '#1092#1072#1081#1083#1086#1074' '#1085#1072' '#1089#1077#1088#1074#1077#1088#1077 @@ -30,8 +31,8 @@ object F_Reserv: TF_Reserv ParentFont = False end object Label2: TLabel - Left = 32 - Top = 256 + Left = 8 + Top = 301 Width = 286 Height = 13 Caption = #1047#1072#1085#1103#1090#1086' '#1076#1080#1089#1082#1086#1074#1086#1075#1086' '#1087#1088#1086#1089#1090#1088#1072#1085#1089#1090#1074#1072' '#1085#1072' '#1089#1077#1088#1074#1077#1088#1077', '#1052#1073' ' @@ -43,8 +44,8 @@ object F_Reserv: TF_Reserv ParentFont = False end object Label3: TLabel - Left = 32 - Top = 280 + Left = 8 + Top = 325 Width = 279 Height = 13 Caption = #1051#1080#1084#1080#1090' '#1076#1080#1089#1082#1086#1074#1086#1075#1086' '#1087#1088#1086#1089#1090#1088#1072#1085#1089#1090#1074#1072' '#1085#1072' '#1089#1077#1088#1074#1077#1088#1077', '#1052#1073' ' @@ -56,8 +57,8 @@ object F_Reserv: TF_Reserv ParentFont = False end object lbAllowedSpace: TLabel - Left = 320 - Top = 280 + Left = 296 + Top = 325 Width = 3 Height = 13 Caption = ' ' @@ -69,8 +70,8 @@ object F_Reserv: TF_Reserv ParentFont = False end object lbUsedSpace: TLabel - Left = 320 - Top = 256 + Left = 296 + Top = 301 Width = 3 Height = 13 Caption = ' ' @@ -81,201 +82,112 @@ object F_Reserv: TF_Reserv Font.Style = [fsBold] ParentFont = False end - object Button1: TButton - Left = 437 - Top = 278 - Width = 75 - Height = 25 - Caption = #1047#1072#1082#1088#1099#1090#1100 - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - ParentFont = False + object ToolBar1: TToolBar + AlignWithMargins = True + Left = 3 + Top = 3 + Width = 550 + Height = 34 + ButtonHeight = 30 + ButtonWidth = 31 + Caption = 'ToolBar1' + DisabledImages = FSCS_Main.imagePanel + DoubleBuffered = True + Images = FSCS_Main.imagePanel + ParentDoubleBuffered = False + ParentShowHint = False + ShowHint = True TabOrder = 0 - OnClick = Button1Click + object ToolButton1: TToolButton + Left = 0 + Top = 0 + Action = aRefresh + end + object ToolButton2: TToolButton + Left = 31 + Top = 0 + Action = aUpload + end + object ToolButton3: TToolButton + Left = 62 + Top = 0 + Hint = #1047#1072#1075#1088#1091#1079#1080#1090#1100' '#1092#1072#1081#1083' '#1089' '#1089#1077#1088#1074#1077#1088#1072 + Action = aLoad + end + object ToolButton4: TToolButton + Left = 93 + Top = 0 + Action = aDelFileFrom + end + object ToolButton6: TToolButton + Left = 124 + Top = 0 + Hint = #1054#1090#1082#1088#1099#1090#1100' '#1092#1072#1081#1083' '#1074' '#1087#1088#1080#1083#1086#1078#1077#1085#1080#1080 + Action = aToPM + ImageIndex = 7 + end + object ToolButton7: TToolButton + Left = 155 + Top = 0 + Hint = #1057#1086#1093#1088#1072#1085#1080#1090#1100' '#1090#1077#1082#1091#1097#1080#1081' '#1087#1088#1086#1077#1082#1090' '#1085#1072' '#1089#1077#1088#1074#1077#1088 + Action = aFromPM + ImageIndex = 6 + end + object ToolButton5: TToolButton + Left = 186 + Top = 0 + Action = aExit + end end - object ListBox1: TListBox - Left = 32 - Top = 24 - Width = 345 - Height = 226 - ItemHeight = 13 + object cxGrid1: TcxGrid + Left = 8 + Top = 62 + Width = 537 + Height = 233 + PopupMenu = PopupMenu1 TabOrder = 1 - end - object btnSave: TBitBtn - Left = 389 - Top = 24 - Width = 135 - Height = 41 - Caption = 'btnSave' - DoubleBuffered = True - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - Glyph.Data = { - 36040000424D3604000000000000360000002800000010000000100000000100 - 2000000000000004000000000000000000000000000000000000FF00FF00FF00 - FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000808 - 0800A59CA500A59CA500A59CA500A59CA500A59CA500A59CA500181818000808 - 080000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00181818000808 - 0800C6C6C60029292900424242009C9C9C00C6C6C600CECECE00181818000808 - 080008080800FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00101010000808 - 0800C6C6C60018181800292929009C9C9C00BDBDBD00C6C6C600181818000808 - 0800080808000808080000000000FF00FF00FF00FF00FF00FF00101010000808 - 0800CECECE00C6C6C600C6C6C600C6C6C600BDBDBD00BDBDBD00181818000808 - 0800101010000808080008080800FF00FF00FF00FF00FF00FF00101010000808 - 0800080808000808080008080800080808000808080008080800080808000808 - 08001010100008080800080808000808080000000000FF00FF00212121000808 - 0800FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F7000808 - 08001818180008080800101010000808080008080800FF00FF00212121000808 - 0800FFF7F700C6C6C6009C9C9C009C9C9C009C9C9C00E7E7E700FFF7F7000808 - 08002929290008080800101010000808080008080800FF00FF00292929000808 - 0800FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F7000808 - 08002929290008080800181818000808080010101000FF00FF00292929000808 - 0800FFF7F700C6C6C6009C9C9C009C9C9C009C9C9C00E7E7E700FFF7F7000808 - 08002929290008080800292929000808080010101000FF00FF00292929000808 - 0800FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F7000808 - 08002929290008080800292929000808080018181800FF00FF00292929000808 - 0800DE842100DE7B2100D67B1800D6731800CE731800CE6B1000CE6B10000808 - 08002929290008080800292929000808080029292900FF00FF00FF00FF00FF00 - FF002929290008080800FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7 - F700FFF7F70008080800292929000808080029292900FF00FF00FF00FF00FF00 - FF002929290008080800DE842100DE7B2100D67B1800D6731800CE731800CE6B - 1000CE6B100008080800292929000808080029292900FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF002929290008080800FFF7F700FFF7F700FFF7F700FFF7 - F700FFF7F700FFF7F700FFF7F7000808080029292900FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF002929290008080800DE842100DE7B2100D67B1800D673 - 1800CE731800CE6B1000CE6B10000808080029292900FF00FF00} - ParentDoubleBuffered = False - ParentFont = False - TabOrder = 2 - OnClick = btnSaveClick - end - object btnLoad: TBitBtn - Left = 389 - Top = 96 - Width = 135 - Height = 41 - Caption = 'btnLoad' - DoubleBuffered = True - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - Glyph.Data = { - 36040000424D3604000000000000360000002800000010000000100000000100 - 2000000000000004000000000000000000000000000000000000FF00FF00FF00 - FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00944A - 0000E7DEB500E7DEB500E7DEB500E7DEB500E7DEB500E7DEB500AD5A0800944A - 000084420000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A55A0800944A - 0000DEDED600C66B1000DE8C3100EFDEB500DEDED600E7E7DE00AD5A0800944A - 00008C420000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00A5520800944A - 0000DEDED600AD5A0800C66B1000EFDEB500DEDECE00DEDED600AD5A0800944A - 0000944A0000944A000084420000FF00FF00FF00FF00FF00FF00A5520800944A - 0000E7E7D600DEDED600DEDED600DEDECE00DEDECE00DEDECE00AD5A0800944A - 00009C520000944A00008C420000FF00FF00FF00FF00FF00FF00A5520800944A - 0000944A0000944A0000944A0000944A0000944A0000944A0000944A0000944A - 0000A5520800944A0000944A0000944A000084420000FF00FF00B5630800944A - 0000FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700944A - 0000AD5A0800944A00009C520000944A00008C420000FF00FF00BD631000944A - 0000FFF7F700E7E7D600EFDEB500EFDEB500EFDEB500EFEFEF00FFF7F700944A - 0000C66B1800944A0000A5520800944A0000944A0000FF00FF00BD6B1000944A - 0000FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700944A - 0000C6731800944A0000AD5A0800944A00009C520000FF00FF00BD6B1000944A - 0000FFF7F700E7E7D600EFDEB500EFDEB500EFDEB500EFEFEF00FFF7F700944A - 0000C6731800944A0000C66B1800944A0000A5520800FF00FF00C66B1000944A - 0000FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700944A - 0000C6731800944A0000C6731800944A0000AD5A0800FF00FF00C66B1000944A - 0000E79C2900E7942900E7942100DE8C2100DE8C2100DE8C1800DE841800944A - 0000C6731800944A0000C6731800944A0000C66B1800FF00FF00FF00FF00FF00 - FF00C66B1800944A0000FFF7F700FFF7F700FFF7F700FFF7F700FFF7F700FFF7 - F700FFF7F700944A0000C6731800944A0000C6731800FF00FF00FF00FF00FF00 - FF00C66B1000944A0000E79C2900E7942900E7942100DE8C2100DE8C2100DE8C - 1800DE841800944A0000C6731800944A0000C6731800FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF00C66B1800944A0000FFF7F700FFF7F700FFF7F700FFF7 - F700FFF7F700FFF7F700FFF7F700944A0000C6731800FF00FF00FF00FF00FF00 - FF00FF00FF00FF00FF00C66B1000944A0000E79C2900E7942900E7942100DE8C - 2100DE8C2100DE8C1800DE841800944A0000C66B1000FF00FF00} - ParentDoubleBuffered = False - ParentFont = False - TabOrder = 3 - OnClick = btnLoadClick - end - object btnDelete: TBitBtn - Left = 389 - Top = 168 - Width = 135 - Height = 41 - Caption = 'btnDelete' - DoubleBuffered = True - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'Tahoma' - Font.Style = [fsBold] - Glyph.Data = { - 36060000424D3606000000000000360400002800000020000000100000000100 - 08000000000000020000630E0000630E00000001000000000000000000003300 - 00006600000099000000CC000000FF0000000033000033330000663300009933 - 0000CC330000FF33000000660000336600006666000099660000CC660000FF66 - 000000990000339900006699000099990000CC990000FF99000000CC000033CC - 000066CC000099CC0000CCCC0000FFCC000000FF000033FF000066FF000099FF - 0000CCFF0000FFFF000000003300330033006600330099003300CC003300FF00 - 330000333300333333006633330099333300CC333300FF333300006633003366 - 33006666330099663300CC663300FF6633000099330033993300669933009999 - 3300CC993300FF99330000CC330033CC330066CC330099CC3300CCCC3300FFCC - 330000FF330033FF330066FF330099FF3300CCFF3300FFFF3300000066003300 - 66006600660099006600CC006600FF0066000033660033336600663366009933 - 6600CC336600FF33660000666600336666006666660099666600CC666600FF66 - 660000996600339966006699660099996600CC996600FF99660000CC660033CC - 660066CC660099CC6600CCCC6600FFCC660000FF660033FF660066FF660099FF - 6600CCFF6600FFFF660000009900330099006600990099009900CC009900FF00 - 990000339900333399006633990099339900CC339900FF339900006699003366 - 99006666990099669900CC669900FF6699000099990033999900669999009999 - 9900CC999900FF99990000CC990033CC990066CC990099CC9900CCCC9900FFCC - 990000FF990033FF990066FF990099FF9900CCFF9900FFFF99000000CC003300 - CC006600CC009900CC00CC00CC00FF00CC000033CC003333CC006633CC009933 - CC00CC33CC00FF33CC000066CC003366CC006666CC009966CC00CC66CC00FF66 - CC000099CC003399CC006699CC009999CC00CC99CC00FF99CC0000CCCC0033CC - CC0066CCCC0099CCCC00CCCCCC00FFCCCC0000FFCC0033FFCC0066FFCC0099FF - CC00CCFFCC00FFFFCC000000FF003300FF006600FF009900FF00CC00FF00FF00 - FF000033FF003333FF006633FF009933FF00CC33FF00FF33FF000066FF003366 - FF006666FF009966FF00CC66FF00FF66FF000099FF003399FF006699FF009999 - FF00CC99FF00FF99FF0000CCFF0033CCFF0066CCFF0099CCFF00CCCCFF00FFCC - FF0000FFFF0033FFFF0066FFFF0099FFFF00CCFFFF00FFFFFF00000080000080 - 000000808000800000008000800080800000C0C0C00080808000191919004C4C - 4C00B2B2B200E5E5E500C8AC2800E0CC6600F2EABF00B59B2400D8E9EC009933 - 6600D075A300ECC6D900646F710099A8AC00E2EFF10000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000E8E8E8E8E8E8 - E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E86CE8E8 - E8E8E8E8E8E8E8E8B4E8E8E8E881E8E8E8E8E8E8E8E8E8E8ACE8E8E897B46CE8 - E8E8E8E8E8E8E8E8E8E8E8E881AC81E8E8E8E8E8E8E8E8E8E8E8E8E897C7B46C - E8E8E8E8E8E8E8B4E8E8E8E881E3AC81E8E8E8E8E8E8E8ACE8E8E8E8E897C090 - E8E8E8E8E8E8B4E8E8E8E8E8E881E381E8E8E8E8E8E8ACE8E8E8E8E8E8E890B4 - 6CE8E8E8E8B46CE8E8E8E8E8E8E881AC81E8E8E8E8AC81E8E8E8E8E8E8E8E890 - B46CE8E8B46CE8E8E8E8E8E8E8E8E881AC81E8E8AC81E8E8E8E8E8E8E8E8E8E8 - 90B46CB46CE8E8E8E8E8E8E8E8E8E8E881AC81AC81E8E8E8E8E8E8E8E8E8E8E8 - E890B46CE8E8E8E8E8E8E8E8E8E8E8E8E881AC81E8E8E8E8E8E8E8E8E8E8E8E8 - 90B46C906CE8E8E8E8E8E8E8E8E8E8E881AC818181E8E8E8E8E8E8E8E8E8E890 - B46CE8E8906CE8E8E8E8E8E8E8E8E881AC81E8E88181E8E8E8E8E8E8E890B4B4 - 6CE8E8E8E8906CE8E8E8E8E8E881ACAC81E8E8E8E88181E8E8E8E8E890C7B46C - E8E8E8E8E8E8906CE8E8E8E881E3AC81E8E8E8E8E8E88181E8E8E8E87A907AE8 - E8E8E8E8E8E8E8E890E8E8E8AC81ACE8E8E8E8E8E8E8E8E881E8E8E8E8E8E8E8 - E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8 - E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8} - NumGlyphs = 2 - ParentDoubleBuffered = False - ParentFont = False - TabOrder = 4 - OnClick = btnDeleteClick + LookAndFeel.NativeStyle = True + object cxGrid1DBTableView1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsBehavior.CopyRecordsToClipboard = False + OptionsBehavior.ImmediateEditor = False + OptionsBehavior.ColumnHeaderHints = False + OptionsData.Deleting = False + OptionsData.Editing = False + OptionsData.Inserting = False + OptionsSelection.CellSelect = False + OptionsView.FocusRect = False + OptionsView.GroupByBox = False + object cxGrid1DBTableView1FileName: TcxGridDBColumn + Caption = #1060#1072#1081#1083 + DataBinding.FieldName = 'FileName' + Options.Editing = False + Options.Filtering = False + Options.Moving = False + Width = 280 + end + object cxGrid1DBTableView1FileSize: TcxGridDBColumn + Caption = #1056#1072#1079#1084#1077#1088', '#1052#1073 + DataBinding.FieldName = 'FileSize' + Options.Editing = False + Options.Filtering = False + Options.Moving = False + end + object cxGrid1DBTableView1FileDate: TcxGridDBColumn + Caption = #1044#1072#1090#1072 + DataBinding.FieldName = 'FileDate' + Options.Editing = False + Options.Filtering = False + Options.Moving = False + end + end + object cxGrid1Level1: TcxGridLevel + GridView = cxGrid1DBTableView1 + end end object siLangLinked1: TsiLangLinked Version = '6.5.2' @@ -365,59 +277,284 @@ object F_Reserv: TF_Reserv 01000D000A006C00620041006C006C006F007700650064005300700061006300 65000100200001000100010001000100010001000D000A006C00620055007300 6500640053007000610063006500010020000100010001000100010001000100 - 0D000A0042007500740074006F006E0031000100170430043A0440044B044204 - 4C040100170430043A044004380442043804010043006C006F00730065000100 - 01000100010001000D000A00620074006E005300610076006500010062007400 - 6E00530061007600650001000100010001000100010001000D000A0062007400 - 6E004C006F00610064000100620074006E004C006F0061006400010001000100 - 01000100010001000D000A00620074006E00440065006C006500740065000100 - 620074006E00440065006C006500740065000100010001000100010001000100 - 0D000A0073007400480069006E00740073005F0055006E00690063006F006400 - 65000D000A007300740044006900730070006C00610079004C00610062006500 - 6C0073005F0055006E00690063006F00640065000D000A007300740046006F00 - 6E00740073005F0055006E00690063006F00640065000D000A00540046005F00 - 52006500730065007200760001005400610068006F006D006100010001000100 - 01000100010001000D000A004C006100620065006C0031000100540061006800 - 6F006D00610001000100010001000100010001000D000A004C00610062006500 - 6C00320001005400610068006F006D0061000100010001000100010001000100 - 0D000A004C006100620065006C00330001005400610068006F006D0061000100 - 0100010001000100010001000D000A006C00620041006C006C006F0077006500 - 64005300700061006300650001005400610068006F006D006100010001000100 - 01000100010001000D000A006C00620055007300650064005300700061006300 - 650001005400610068006F006D00610001000100010001000100010001000D00 - 0A0042007500740074006F006E00310001005400610068006F006D0061000100 - 0100010001000100010001000D000A00620074006E0053006100760065000100 - 5400610068006F006D00610001000100010001000100010001000D000A006200 - 74006E004C006F006100640001005400610068006F006D006100010001000100 - 01000100010001000D000A00620074006E00440065006C006500740065000100 - 5400610068006F006D00610001000100010001000100010001000D000A007300 - 74004D0075006C00740069004C0069006E00650073005F0055006E0069006300 - 6F00640065000D000A007300740053007400720069006E00670073005F005500 - 6E00690063006F00640065000D000A00730074004F0074006800650072005300 - 7400720069006E00670073005F0055006E00690063006F00640065000D000A00 - 7300740043006F006C006C0065006300740069006F006E0073005F0055006E00 - 690063006F00640065000D000A00730074004300680061007200530065007400 - 73005F0055006E00690063006F00640065000D000A00540046005F0052006500 - 73006500720076000100440045004600410055004C0054005F00430048004100 - 520053004500540001000100010001000100010001000D000A004C0061006200 - 65006C0031000100440045004600410055004C0054005F004300480041005200 - 53004500540001000100010001000100010001000D000A004C00610062006500 - 6C0032000100440045004600410055004C0054005F0043004800410052005300 - 4500540001000100010001000100010001000D000A004C006100620065006C00 - 33000100440045004600410055004C0054005F00430048004100520053004500 - 540001000100010001000100010001000D000A006C00620041006C006C006F00 - 770065006400530070006100630065000100440045004600410055004C005400 + 0D000A0054006F006F006C004200610072003100010054006F006F006C004200 + 61007200310001000100010001000100010001000D000A006100520065006600 + 7200650073006800010052006500660072006500730068000100010001000100 + 0100010001000D000A006100550070006C006F00610064000100170430043304 + 400443043704380442044C0420004404300439043B0420003D04300420004104 + 35044004320435044004010017043004320430043D0442043004360438044204 + 380420004404300439043B0420003D0430042000410435044004320435044004 + 0100550070006C006F00610064002000660069006C006500200074006F002000 + 730065007200760065007200010001000100010001000D000A0061004C006F00 + 610064000100170430043304400443043704380442044C042000440430043904 + 3B04200041042000410435044004320435044004300401001704300432043004 + 3D0442043004360438044204380420004404300439043B042000370420004104 + 35044004320435044004300401004C006F00610064002000660069006C006500 + 2000660072006F006D0020007300650072007600650072000100010001000100 + 01000D000A006100440065006C00460069006C006500460072006F006D000100 + 2304340430043B04380442044C0420004404300439043B040100120438043404 + 30043B0438044204380420004404300439043B040100440065006C0065007400 + 65002000660069006C006500010001000100010001000D000A00610054006F00 + 50004D000100610054006F0050004D0001000100010001000100010001000D00 + 0A006100460072006F006D0050004D0001006100460072006F006D0050004D00 + 01000100010001000100010001000D000A006100450078006900740001006100 + 450078006900740001000100010001000100010001000D000A00630078004700 + 7200690064003100440042005400610062006C00650056006900650077003100 + 460069006C0065004E0061006D0065000100460069006C0065004E0061006D00 + 650001000100010001000100010001000D000A00630078004700720069006400 + 3100440042005400610062006C00650056006900650077003100460069006C00 + 6500530069007A0065000100460069006C006500530069007A00650001000100 + 010001000100010001000D000A00630078004700720069006400310044004200 + 5400610062006C00650056006900650077003100460069006C00650044006100 + 740065000100460069006C006500440061007400650001000100010001000100 + 010001000D000A0073007400480069006E00740073005F0055006E0069006300 + 6F00640065000D000A0054006F006F006C0042007500740074006F006E003300 + 0100170430043304400443043704380442044C0420004404300439043B042000 + 410420004104350440043204350440043004010017043004320430043D044204 + 3004360438044204380420004404300439043B04200037042000410435044004 + 320435044004300401004C006F00610064002000660069006C00650020006600 + 72006F006D002000730065007200760065007200010001000100010001000D00 + 0A0054006F006F006C0042007500740074006F006E00360001001E0442043A04 + 40044B0442044C0420004404300439043B042000320420003F04400438043B04 + 3E04360435043D043804380401001204560434043A0440043804420438042000 + 4404300439043B042000320420003F0440043E043304400430043C0456042000 + 01004F00700065006E002000660069006C006500200069006E00200061007000 + 70006C00690063006100740069006F006E00010001000100010001000D000A00 + 54006F006F006C0042007500740074006F006E003700010021043E0445044004 + 30043D04380442044C042000420435043A04430449043804390420003F044004 + 3E0435043A04420420003D043004200041043504400432043504400401001704 + 310435044004350433044204380420003F043E0442043E0447043D0438043904 + 20003F0440043E0435043A04420420003D043004200041043504400432043504 + 40040100550070006C006F00610064002000630075007200720065006E007400 + 2000700072006F006A00650063007400200074006F0020007300650072007600 + 65007200010001000100010001000D000A006100520065006600720065007300 + 680001001E0431043D043E043204380442044C04200041043F04380441043E04 + 3A0420004404300439043B043E04320401001F043E043D043E04320438044204 + 3804200041043F04380441043E043A0420004404300439043B04560432040100 + 52006500660072006500730068002000660069006C006500730020006C006900 + 73007400010001000100010001000D000A006100550070006C006F0061006400 + 0100170430043304400443043704380442044C0420004404300439043B042000 + 3D0430042000410435044004320435044004010017043004320430043D044204 + 3004360438044204380420004404300439043B0420003D043004200041043504 + 40043204350440040100550070006C006F00610064002000660069006C006500 + 200074006F002000730065007200760065007200010001000100010001000D00 + 0A006100440065006C00460069006C006500460072006F006D00010023043404 + 30043B04380442044C0420004404300439043B04010012043804340430043B04 + 38044204380420004404300439043B040100440065006C006500740065002000 + 660069006C006500010001000100010001000D000A0061004500780069007400 + 010012044B0445043E0434040100120438044504560434040100450078006900 + 7400010001000100010001000D000A007300740044006900730070006C006100 + 79004C006100620065006C0073005F0055006E00690063006F00640065000D00 + 0A00460069006C0065005400610062006C006500460069006C00650053006900 + 7A0065000100460069006C006500530069007A00650001000100010001000100 + 010001000D000A00460069006C0065005400610062006C006500460069006C00 + 650044006100740065000100460069006C006500440061007400650001000100 + 010001000100010001000D000A00460069006C0065005400610062006C006500 + 3100460069006C006500530069007A0065000100460069006C00650053006900 + 7A00650001000100010001000100010001000D000A00460069006C0065005400 + 610062006C0065003100460069006C0065004400610074006100010046006900 + 6C006500440061007400610001000100010001000100010001000D000A007300 + 740046006F006E00740073005F0055006E00690063006F00640065000D000A00 + 540046005F0052006500730065007200760001005400610068006F006D006100 + 01000100010001000100010001000D000A004C006100620065006C0031000100 + 5400610068006F006D00610001000100010001000100010001000D000A004C00 + 6100620065006C00320001005400610068006F006D0061000100010001000100 + 0100010001000D000A004C006100620065006C00330001005400610068006F00 + 6D00610001000100010001000100010001000D000A006C00620041006C006C00 + 6F007700650064005300700061006300650001005400610068006F006D006100 + 01000100010001000100010001000D000A006C00620055007300650064005300 + 700061006300650001005400610068006F006D00610001000100010001000100 + 010001000D000A00730074004D0075006C00740069004C0069006E0065007300 + 5F0055006E00690063006F00640065000D000A00730074005300740072006900 + 6E00670073005F0055006E00690063006F00640065000D000A00730074004F00 + 740068006500720053007400720069006E00670073005F0055006E0069006300 + 6F00640065000D000A00460069006C0065005400610062006C0065002E004300 + 75007200720065006E007400560065007200730069006F006E00010039002E00 + 30003000200001000100010001000100010001000D000A00460069006C006500 + 5400610062006C00650031002E00560065007200730069006F006E0001003700 + 2E00370034002E00300030002000500072006F00660065007300730069006F00 + 6E0061006C002000450064006900740069006F006E0001000100010001000100 + 010001000D000A007300740043006F006C006C0065006300740069006F006E00 + 73005F0055006E00690063006F00640065000D000A00460069006C0065005400 + 610062006C0065002E0049006E0064006500780044006500660073005B003000 + 5D002E0044006500730063004600690065006C00640073000100460069006C00 + 65004E0061006D00650001000100010001000100010001000D000A0046006900 + 6C0065005400610062006C0065002E0049006E00640065007800440065006600 + 73005B0030005D002E004600690065006C00640073000100460069006C006500 + 4E0061006D00650001000100010001000100010001000D000A00730074004300 + 68006100720053006500740073005F0055006E00690063006F00640065000D00 + 0A00540046005F00520065007300650072007600010044004500460041005500 + 4C0054005F004300480041005200530045005400010001000100010001000100 + 01000D000A004C006100620065006C0031000100440045004600410055004C00 + 54005F0043004800410052005300450054000100010001000100010001000100 + 0D000A004C006100620065006C0032000100440045004600410055004C005400 5F00430048004100520053004500540001000100010001000100010001000D00 - 0A006C0062005500730065006400530070006100630065000100440045004600 - 410055004C0054005F0043004800410052005300450054000100010001000100 - 0100010001000D000A0042007500740074006F006E0031000100440045004600 - 410055004C0054005F0043004800410052005300450054000100010001000100 - 0100010001000D000A00620074006E0053006100760065000100440045004600 - 410055004C0054005F0043004800410052005300450054000100010001000100 - 0100010001000D000A00620074006E004C006F00610064000100440045004600 - 410055004C0054005F0043004800410052005300450054000100010001000100 - 0100010001000D000A00620074006E00440065006C0065007400650001004400 + 0A004C006100620065006C0033000100440045004600410055004C0054005F00 + 430048004100520053004500540001000100010001000100010001000D000A00 + 6C00620041006C006C006F007700650064005300700061006300650001004400 45004600410055004C0054005F00430048004100520053004500540001000100 - 010001000100010001000D000A00} + 010001000100010001000D000A006C0062005500730065006400530070006100 + 630065000100440045004600410055004C0054005F0043004800410052005300 + 4500540001000100010001000100010001000D000A00} + end + object DataSource1: TDataSource + DataSet = FileTable + Left = 136 + Top = 56 + end + object FileTable: TSQLMemTable + CurrentVersion = '9.00 ' + StoreDefs = True + DatabaseName = 'MEMORY' + ReadOnly = False + CaseInsensitive = False + IndexDefs = < + item + Name = 'FileTableIndex1' + DescFields = 'FileName' + Fields = 'FileName' + Options = [ixDescending] + end> + FieldDefs = < + item + Name = 'FileName' + DataType = ftString + Size = 255 + end + item + Name = 'FileSize' + DataType = ftString + Size = 20 + end + item + Name = 'FileDate' + DataType = ftString + Size = 20 + end> + TableName = 'Table1997262626_14648' + Exclusive = False + MemoryTableAllocBy = 1000 + Left = 256 + Top = 64 + object FileTableFileName: TStringField + FieldName = 'FileName' + Size = 255 + end + object FileTableFileSize: TStringField + FieldName = 'FileSize' + end + object FileTableFileDate: TStringField + FieldName = 'FileDate' + end + end + object ActionList1: TActionList + Images = FSCS_Main.imagePanel + Left = 464 + Top = 120 + object aRefresh: TAction + Caption = 'Refresh' + Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1089#1087#1080#1089#1086#1082' '#1092#1072#1081#1083#1086#1074 + ImageIndex = 96 + OnExecute = aRefreshExecute + end + object aUpload: TAction + Caption = #1047#1072#1075#1088#1091#1079#1080#1090#1100' '#1092#1072#1081#1083' '#1085#1072' '#1089#1077#1088#1074#1077#1088 + Hint = #1047#1072#1075#1088#1091#1079#1080#1090#1100' '#1092#1072#1081#1083' '#1085#1072' '#1089#1077#1088#1074#1077#1088 + ImageIndex = 1 + OnExecute = aUploadExecute + end + object aLoad: TAction + Caption = #1047#1072#1075#1088#1091#1079#1080#1090#1100' '#1092#1072#1081#1083' '#1089' '#1089#1077#1088#1074#1077#1088#1072 + ImageIndex = 2 + OnExecute = aLoadExecute + end + object aDelFileFrom: TAction + Caption = #1059#1076#1072#1083#1080#1090#1100' '#1092#1072#1081#1083 + Hint = #1059#1076#1072#1083#1080#1090#1100' '#1092#1072#1081#1083 + ImageIndex = 50 + OnExecute = aDelFileFromExecute + end + object aToPM: TAction + Caption = 'aToPM' + OnExecute = aToPMExecute + end + object aFromPM: TAction + Caption = 'aFromPM' + OnExecute = aFromPMExecute + end + object aExit: TAction + Caption = 'aExit' + Hint = #1042#1099#1093#1086#1076 + ImageIndex = 9 + ShortCut = 27 + OnExecute = aExitExecute + end + end + object PopupMenu1: TPopupMenu + Left = 256 + Top = 176 + object N1: TMenuItem + Action = aLoad + end + object N2: TMenuItem + Action = aUpload + end + object aDelete1: TMenuItem + Action = aDelFileFrom + end + end + object FileTable1: TkbmMemTable + Active = True + DesignActivation = True + AttachedAutoRefresh = True + AttachMaxCount = 1 + FieldDefs = < + item + Name = 'FileName' + DataType = ftString + Size = 256 + end + item + Name = 'FileSize' + DataType = ftString + Size = 20 + end + item + Name = 'FileData' + DataType = ftString + Size = 20 + end> + IndexDefs = <> + SortOptions = [] + PersistentBackup = False + ProgressFlags = [mtpcLoad, mtpcSave, mtpcCopy] + LoadedCompletely = False + SavedCompletely = False + FilterOptions = [] + Version = '7.74.00 Professional Edition' + LanguageID = 0 + SortID = 0 + SubLanguageID = 1 + LocaleID = 1024 + Left = 368 + Top = 56 + object FileTable1FileName: TStringField + FieldName = 'FileName' + Size = 256 + end + object FileTable1FileSize: TStringField + FieldName = 'FileSize' + end + object FileTable1FileData: TStringField + FieldName = 'FileData' + end + end + object Query1: TQuery + Left = 352 + Top = 216 + end + object MemSQL1: TkbmMemSQL + Left = 400 + Top = 192 end end diff --git a/SRC/Main/U_Reserv.pas b/SRC/Main/U_Reserv.pas index 2d6ae84..44d40a7 100644 --- a/SRC/Main/U_Reserv.pas +++ b/SRC/Main/U_Reserv.pas @@ -8,28 +8,74 @@ uses IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase, IdFTP, idUri, idFTPCommon,idFTPLIST, IdAllFTPListParsers, IdFTPListParseBase,IdFTPListParseAS400, IdFTPListParsePcTcp, IdFTPListTypes, - Wininet, siComp, siLngLnk; + Wininet, siComp, siLngLnk, Grids, DBGrids, RzDBGrid, DB, SQLMemMain, + cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxStyles, + cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator, cxDBData, + cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, + cxClasses, cxGridCustomView, cxGrid, ExtCtrls, RzPanel, ActnList, + PlatformDefaultStyleActnCtrls, ActnMan, ToolWin, ActnCtrls, ComCtrls, acDBGrid, + Menus, kbmMemTable, kbmMemSQL, DBTables; type TF_Reserv = class(TForm) - Button1: TButton; - ListBox1: TListBox; - btnSave: TBitBtn; - btnLoad: TBitBtn; - btnDelete: TBitBtn; Label1: TLabel; Label2: TLabel; Label3: TLabel; lbAllowedSpace: TLabel; lbUsedSpace: TLabel; siLangLinked1: TsiLangLinked; - procedure Button1Click(Sender: TObject); + DataSource1: TDataSource; + FileTable: TSQLMemTable; + FileTableFileSize: TStringField; + FileTableFileDate: TStringField; + ToolBar1: TToolBar; + ToolButton1: TToolButton; + ToolButton2: TToolButton; + ToolButton3: TToolButton; + ToolButton4: TToolButton; + ToolButton5: TToolButton; + ActionList1: TActionList; + aRefresh: TAction; + aUpload: TAction; + aLoad: TAction; + aDelFileFrom: TAction; + aExit: TAction; + PopupMenu1: TPopupMenu; + N1: TMenuItem; + N2: TMenuItem; + aDelete1: TMenuItem; + FileTable1: TkbmMemTable; + aToPM: TAction; + aFromPM: TAction; + ToolButton6: TToolButton; + ToolButton7: TToolButton; + FileTableFileName: TStringField; + Query1: TQuery; + FileTable1FileName: TStringField; + FileTable1FileSize: TStringField; + FileTable1FileData: TStringField; + MemSQL1: TkbmMemSQL; + cxGrid1DBTableView1: TcxGridDBTableView; + cxGrid1Level1: TcxGridLevel; + cxGrid1: TcxGrid; + cxGrid1DBTableView1FileName: TcxGridDBColumn; + cxGrid1DBTableView1FileSize: TcxGridDBColumn; + cxGrid1DBTableView1FileDate: TcxGridDBColumn; + //procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); - procedure btnSaveClick(Sender: TObject); - procedure btnLoadClick(Sender: TObject); - procedure btnDeleteClick(Sender: TObject); + //procedure btnSaveClick(Sender: TObject); + //procedure btnLoadClick(Sender: TObject); + //procedure btnDeleteClick(Sender: TObject); + procedure aRefreshExecute(Sender: TObject); + procedure aUploadExecute(Sender: TObject); + procedure aExitExecute(Sender: TObject); + procedure aLoadExecute(Sender: TObject); + procedure aDelFileFromExecute(Sender: TObject); + procedure aToPMExecute(Sender: TObject); + procedure aFromPMExecute(Sender: TObject); + //procedure RzDBGrid1TitleClick(Column: TColumn); private { Private declarations } public @@ -39,9 +85,11 @@ type function GetFileListFromFtp(aFtpStr: string): TStringList; function DeleteFileFromFtp(aFtpStr, aFileName: string): boolean; Procedure RefreshFileList; - Procedure SetButtons(aSave, aLoad, aDelete: Boolean); + //Procedure SetButtons(aSave, aLoad, aDelete: Boolean); Procedure SelectItem; Function HexToStr(const HexStr: string): string; + function SaveCurrProjToTemFile: boolean; + //function GetTempDir: string; end; var @@ -49,13 +97,88 @@ var Selected_Item: integer; FClientLimit: integer; // , FFact: Integer; // , + FileDateList: TStringList; + FileSizeList: TStringList; + MyHeaderStyle: TcxStyle; //FConnStr: string; implementation -uses USCS_Main, U_Common, U_BaseCommon, U_BaseConstants; +uses USCS_Main, U_Common, U_BaseCommon, U_BaseConstants, U_ProtectionCommon, U_Main, U_SCSComponent; {$R *.dfm} +(* +function GetTempDir: string; +var + buff: pchar; + s: string; +begin + if length(TempDir) > 0 then + begin + if DirectoryExists(TempDir) then + Result := TempDir + else + begin + TempDir := ''; + Result := GetTempDir; + end; + end + else + begin + // Tolik 24/06/* 2019 -- + s := GetEnvironmentVariable('tmp'); + + if ((s = '') or (not DirectoryExists(s))) then + s := GetEnvironmentVariable('temp'); + + if ((s = '') or (not DirectoryExists(s))) then + s := exedir; + + (* + // Tolik 21/06/2019 -- + getmem(buff, 256*2); + // + s := ''; + if (GetEnvironmentVariable('tmp',buff, 254) >0) + and (DirectoryExists(buff)) then + begin + s := buff; + end + else + if (GetEnvironmentVariable('temp',buff, 254) >0) + and (DirectoryExists(buff)) then + begin + s := buff; + end + else + s := exedir; + freemem(buff); + *) + (* try + if not DirectoryExists(s + OurTempDir) then + MkDir(s + OurTempDir); + TempDir := s + OurTempDir; + result := TempDir; + except + ShowMessage(cTmpDirErr); + {$if Defined(ES_GRAPH_SC)} + Application.Terminate; + {$else} + ExitProcess(1); + {$ifend} + end; + end; +end; +*) +function TF_Reserv.SaveCurrProjToTemFile: boolean; +var TempProj: TSCSProject; + CurrProjNode: TTreeNode; +begin + CurrProjNode := F_ProjMan.GSCSBase.CurrProject.TreeViewNode; + Result := false; + +end; + function TF_Reserv.HexToStr(const HexStr: string): string; var i: Integer; @@ -72,7 +195,7 @@ end; Procedure TF_Reserv.SelectItem; var i: integer; begin - if F_Reserv.ListBox1.Count > 0 then + {if F_Reserv.ListBox1.Count > 0 then begin for i := 0 to F_Reserv.ListBox1.Count - 1 do begin @@ -87,13 +210,141 @@ begin end else Selected_Item := 0; + } end; - +(* Procedure TF_Reserv.SetButtons(aSave, aLoad, aDelete: Boolean); begin +{ F_Reserv.btnSave.Enabled := aSave; F_Reserv.btnLoad.Enabled := aLoad; F_Reserv.btnDelete.Enabled := aDelete; + } +end; +*) +procedure TF_Reserv.aUploadExecute(Sender: TObject); +var OpenDlg: TOpenDialog; + FileNameShort, Filename: string; + i: integer; + +begin + OpenDlg := TOpenDialog.Create(nil); + OpenDlg.Filter := ' (*.scs)|*.SCS'; + if OpenDlg.Execute then + begin + FileName := OpenDlg.FileName; + if SendFileToFtp(HexToStr(GFtpConnectStr), FileName) then + RefreshFileList; + end; + OpenDlg.Free; +end; + +procedure TF_Reserv.aDelFileFromExecute(Sender: TObject); +begin + if DeleteFileFromFtp(HexToStr(GFtpConnectStr), f_Reserv.filetable.fieldvalues['filename']) then + begin + RefreshFileList; + end; +end; + +procedure TF_Reserv.aExitExecute(Sender: TObject); +begin + F_Reserv.Close; +end; + +procedure TF_Reserv.aFromPMExecute(Sender: TObject); +var tdir: string; + canProceed, formHide: Boolean; + fName: String; +begin + if CheckIsOpenProject(false) then + begin + tdir := ''; + tdir := GetTempDir; + if tdir <> '' then + begin + FName := tdir + '\'+ F_ProjMan.GSCSBase.CurrProject.Name + '.scs'; + if FileExists(FName) then + DeleteFile(FName); + if F_ProjMan.GSCSBase.CurrProject.SaveToStreamOrFile(nil, FName) then + begin + if SendFileToFtp(HexToStr(GFtpConnectStr), FName) then + RefreshFileList; + end; + + if FileExists(FName) then + DeleteFile(FName); + end; + end + else + ShowMessage(''); +end; + +procedure TF_Reserv.aLoadExecute(Sender: TObject); +var SaveDlg: TSaveDialog; + FileName: string; + i: integer; +begin + FileName := ''; + FileName := FileTable.fieldvalues['FileName']; + if fileName <> '' then + begin + SaveDlg := TSaveDialog.Create(nil); + SaveDlg.Filter := ' (*.scs)|*.SCS'; + SaveDlg.FileName := fileName; + if SaveDlg.Execute then + begin + FileName := SaveDlg.FileName; + GetFileFromFtp(HexToStr(GFtpConnectStr), extractfilename(FileName), SaveDlg.FileName); + end; + SaveDlg.Free; + end; + +end; + +procedure TF_Reserv.aRefreshExecute(Sender: TObject); +begin + RefreshFileList; +end; + +procedure TF_Reserv.aToPMExecute(Sender: TObject); +var tdir: string; + canProceed, formHide: Boolean; +begin + tdir := ''; + tdir := GetTempDir; + if tdir <> '' then + begin + CanProceed := False; + formHide := False; + if CheckIsOpenProject(false) then + begin + if MessageBox(F_Reserv.Handle, PChar(cFtpmes7), PChar(cWarningSlowCap), MB_YESNO) = IDYes then + begin + F_Reserv.Hide; + formHide := True; + CanProceed := CloseCurrProject(true) <> IDCancel; + end; + end + else + CanProceed := True; + + if CanProceed then + begin + GetFileFromFtp(HexToStr(GFtpConnectStr), FileTable.FieldValues['FileName'], tdir + '\'+ FileTable.FieldValues['FileName']); + if FileExists(tdir + '\'+ FileTable.FieldValues['FileName']) then + begin + F_ProjMan.LoadProjectFromFile(tdir + '\'+ FileTable.FieldValues['FileName']); + DeleteFile(tdir + '\'+ FileTable.FieldValues['FileName']); + F_Reserv.Close; + end; + end + else + begin + if formHide then + F_Reserv.ShowModal; + end; + end; end; Procedure TF_Reserv.RefreshFileList; @@ -108,7 +359,10 @@ begin vLoad := False; vDelete := False; //FConnStr := HexToStr(GFtpConnectStr); - F_Reserv.ListBox1.Clear; + //F_Reserv.ListBox1.Clear; + f_Reserv.FileTable.Close; + f_Reserv.FileTable.Open; + tmppath := GetDefaultTempPath;//+'\' + 'USER.CFG'; { FileList := F_Reserv.GetFileListFromFtp(GFtpConnectStr); if FileList <> nil then @@ -142,39 +396,100 @@ begin CloseFile(f); UserLimit := strtoint(s); lballowedspace.Caption := s; - vSave := true; - vLoad := true; - vDelete := true; + //vSave := true; + //vLoad := true; + //vDelete := true; //// FileList := F_Reserv.GetFileListFromFtp(HexToStr(GFtpConnectStr)); if FileList <> nil then begin - F_Reserv.ListBox1.Clear; + //FileTable.ReadOnly := False; + // F_Reserv.FileTable.EmptyTable; + While F_Reserv.FileTable.RecordCount > 0 do + begin + F_Reserv.FileTable.Delete; + end; + //F_Reserv.ListBox1.Clear; for i := 0 to fileList.Count - 1 do // Client Config begin - F_Reserv.ListBox1.AddItem(filelist[i], nil); + //F_Reserv.ListBox1.AddItem(filelist[i], nil); + F_Reserv.FileTable.Append; + F_Reserv.FileTable.FieldByName('FileName').AsString := FileList[i]; + F_Reserv.FileTable.FieldByName('FileDate').AsString := FileDateList[i]; + F_Reserv.FileTable.FieldByName('FileSize').AsString := FileSizeList[i]; end; - if F_Reserv.ListBox1.Items.Count = 0 then + //FileTable.ReadOnly := True; + //if F_Reserv.ListBox1.Items.Count = 0 then + F_Reserv.aDelFileFrom.Enabled := True; + F_Reserv.aLoad.Enabled := True; + F_Reserv.aToPM.Enabled := True; + + if F_Reserv.FileTable.RecordCount = 0 then begin - vDelete := False; - vLoad := False; + F_Reserv.aDelFileFrom.Enabled := False; + F_Reserv.aLoad.Enabled := False; + F_Reserv.aToPM.Enabled := False; + end + else + begin + F_Reserv.FileTable.First; + F_Reserv.cxGrid1DBTableView1.Controller.FocusedRowIndex := 0; end; - SelectItem; + //F_Reserv.FileTable.First; + //SelectItem; fileList.Free; - if UserLimit >= strtoint(lbUsedSpace.Caption) then - vSave := True + if UserLimit <= strtoint(lbUsedSpace.Caption) then + begin + F_Reserv.aUpload.Enabled := False; + F_Reserv.aFromPM.Enabled := False; + end else - vSave := False; + begin + F_Reserv.aUpload.Enabled := True; + //F_Reserv.aFromPM.Enabled := True; + if CheckIsOpenProject(false) then + F_Reserv.aFromPM.Enabled := True + else + F_Reserv.aFromPM.Enabled := False; + end; + end + else + begin + F_Reserv.aDelFileFrom.Enabled := False; + F_Reserv.aLoad.Enabled := False; + F_Reserv.aToPM.Enabled := False; + F_Reserv.aUpload.Enabled := False; + F_Reserv.aFromPM.Enabled := False; + Showmessage('cFtpmes12'); end; + end + else + begin + F_Reserv.aDelFileFrom.Enabled := False; + F_Reserv.aLoad.Enabled := False; + F_Reserv.aToPM.Enabled := False; + F_Reserv.aUpload.Enabled := False; + F_Reserv.aFromPM.Enabled := False; + Showmessage('cFtpmes12'); end; - SetButtons(vSave, vLoad, vDelete); + //SetButtons(vSave, vLoad, vDelete); end; - - function TF_Reserv.SendFileToFtp(aFtpStr, aFileName: string): boolean; - var NameShort: String; +{ +procedure TF_Reserv.RzDBGrid1TitleClick(Column: TColumn); +var FldName: string; +begin + FldName := Column.FieldName; + FileTable.IndexName := 'Filename'; +end; +} +function TF_Reserv.SendFileToFtp(aFtpStr, aFileName: string): boolean; + var NameShort, NewName: String; Ftp_serv: TIdFtp; Uri: TIdURI; + bm: TBookmark; + FileNameExists: Boolean; + i: integer; begin Result := False; if FileExists(aFileName) then @@ -187,7 +502,7 @@ end; ftp_serv.Password := uri.password; ftp_serv.Port := 21; ftp_serv.Passive := true; - + ftp_serv.TransferType := ftBinary; try ftp_serv.Connect; except @@ -204,6 +519,59 @@ end; if ftp_serv.Connected then begin NameShort := ExtractFileName(aFileName); + + if F_Reserv.FileTable.RecordCount > 0 then // + begin + FileNameExists := false; + bm := F_Reserv.FileTable.Bookmark; + F_Reserv.FileTable.DisableControls; + F_Reserv.FileTable.First; + + while not F_Reserv.FileTable.Eof do + begin + if NameShort = F_Reserv.FileTable.FieldValues['FileName'] then + begin + FileNameExists := true; + break; + end; + F_Reserv.FileTable.Next; + end; + + F_Reserv.FileTable.Bookmark := bm; + F_Reserv.FileTable.EnableControls; + end; + + if FileNameExists then // - + begin // + if MessageBox(F_Reserv.Handle, PChar(cFtpmes8), PChar(cWarningSlowCap), MB_YESNO) <> IDYes then + begin + NameShort := Trim(InputBox(cFtpmes9, cFtpmes10, '')); + if length(NameShort) > 0 then + begin + NewName := ''; + for i := 1 to Length(NameShort) do + begin + if NameShort[i] = '.' then + break + else + NewName := NewName + NameShort[i]; + end; + if NewName <> '' then + NameShort := NewName + '.scs' + else + begin + ShowMessage(cFtpmes11); + ftp_serv.Disconnect; + ftp_serv.Free; + URi.Free; + exit; + end; + end; + end + else + DeleteFileFromFtp(aFtpStr, aFileName); // , + end; + try ftp_serv.Put(aFileName, NameShort); Result := True; @@ -237,6 +605,7 @@ end; ftp_serv.Password := uri.password; ftp_serv.Port := 21; ftp_serv.Passive := true; + ftp_serv.TransferType := ftBinary; try ftp_serv.Connect; @@ -294,7 +663,7 @@ end; var Ftp_serv: TIdFtp; Uri: TIdURI; - Size: Double; + Size, FileSize: Double; i, rsize: integer; begin Result := TstringList.Create; @@ -331,7 +700,10 @@ end; Size := 0; for i := 0 to ftp_serv.DirectoryListing.Count - 1 do begin - Size := Size + ftp_serv.Size(ftp_serv.DirectoryListing[i].FileName); + FileSize := ftp_serv.Size(ftp_serv.DirectoryListing[i].FileName); + Size := Size + FileSize; + FileDateList.Add(DateTostr(ftp_serv.FileDate(ftp_serv.DirectoryListing[i].FileName))); + FileSizeList.Add(FloatToStr(RoundX(FileSize/1048576, 3))); end; rsize := round(size/1048576); lbUsedSpace.Caption := inttostr(rsize); @@ -402,10 +774,13 @@ end; URi.Free; end; - +(* procedure TF_Reserv.btnDeleteClick(Sender: TObject); var i: integer; begin + i := f_Reserv.RzDBGrid1.SelectedIndex; + i := 0; + { if ListBox1.Count > 0 then begin for i := 0 to ListBox1.Count - 1 do @@ -421,14 +796,17 @@ begin end; end; end; + } end; - +*) +(* procedure TF_Reserv.btnLoadClick(Sender: TObject); var SaveDlg: TSaveDialog; FileName: string; i: integer; begin FileName := ''; + { for i := 0 to ListBox1.Count - 1 do begin if ListBox1.Selected[i] = true then @@ -437,6 +815,7 @@ begin break; end; end; + } if fileName <> '' then begin SaveDlg := TSaveDialog.Create(nil); @@ -450,13 +829,15 @@ begin SaveDlg.Free; end; end; - +*) +(* procedure TF_Reserv.btnSaveClick(Sender: TObject); var OpenDlg: TOpenDialog; FileNameShort, Filename: string; i: integer; begin + { for i := 0 to ListBox1.Count - 1 do begin if ListBox1.Selected[i] = true then @@ -465,6 +846,7 @@ begin break; end; end; + } OpenDlg := TOpenDialog.Create(nil); OpenDlg.Filter := ' (*.scs)|*.SCS'; if OpenDlg.Execute then @@ -476,37 +858,42 @@ begin end; OpenDlg.Free; end; - -procedure TF_Reserv.Button1Click(Sender: TObject); +*) +{procedure TF_Reserv.Button1Click(Sender: TObject); begin F_Reserv.Close; end; - +} procedure TF_Reserv.FormCreate(Sender: TObject); begin + FileDateList := TStringList.Create; + FileSizeList := TStringList.Create; { btnSave.Caption := ' ' + #13#10 + ' '; btnLoad.Caption := ' ' + #13#10 + ' '; btnDelete.Caption := ' ' + #13#10 + ' '; } - btnSave.Caption := cFtpbtnSaveCaption; + {btnSave.Caption := cFtpbtnSaveCaption; btnLoad.Caption := cFtpbtnLoadCaption; - btnDelete.Caption := cFtpbtnDeleteCaption; + btnDelete.Caption := cFtpbtnDeleteCaption;} Selected_Item := 0; FClientLimit := 0; FFact := 0; lballowedspace.Font.Color := clBlue; lbUsedSpace.Font.Color := clBlue; + MyHeaderStyle := TcxStyle.Create(nil); + MyHeaderStyle.Font.Style := [fsBold]; + cxGrid1DBTableView1.Styles.Header := MyHeaderStyle; end; procedure TF_Reserv.FormShow(Sender: TObject); var FileList: TStringList; i: integer; begin + FileDateList.Clear; + FileSizeList.Clear; RefreshFileList; //SelectItem; end; - - end. diff --git a/SRC/Protection/U_ProtectionCommon.pas b/SRC/Protection/U_ProtectionCommon.pas index c7f532a..6216e99 100644 --- a/SRC/Protection/U_ProtectionCommon.pas +++ b/SRC/Protection/U_ProtectionCommon.pas @@ -3,7 +3,7 @@ interface uses Windows, Forms, Graphics, Registry, Classes, SysUtils, Messages,{ bz2,} Dialogs, ComCtrls, ShlObj, ShellAPI, Controls, IcsPlus, Printers, - AbBzip2, AbZBrows, AbUnZper, AbArcTyp, AbMeter, AbBrowse, AbBase; + AbBzip2, AbZBrows, AbUnZper, AbArcTyp, AbMeter, AbBrowse, AbBase, U_BaseConstants; type // TPeriod = (pWeek, pMonth, pQuarter); @@ -732,7 +732,10 @@ begin TempDir := s + OurTempDir; result := TempDir; except - ShowMessage(' !'); + //Tolik 31/01/2025 -- + //ShowMessage(' !'); + ShowMessage(cTmpDirErr); + // {$if Defined(ES_GRAPH_SC)} Application.Terminate; {$else} diff --git a/SRC/SCSNormBase/U_AddComponent.dfm b/SRC/SCSNormBase/U_AddComponent.dfm index 9160263..6fbdb1b 100644 --- a/SRC/SCSNormBase/U_AddComponent.dfm +++ b/SRC/SCSNormBase/U_AddComponent.dfm @@ -2478,8 +2478,6 @@ object F_AddComponent: TF_AddComponent object tsApplyInPM: TRzTabSheet TabVisible = False Caption = 'tsApplyInPM' - ExplicitWidth = 0 - ExplicitHeight = 0 object GroupBox_ApplyForAllComponents: TRzGroupBox Left = 0 Top = 0 diff --git a/SRC/SCSNormBase/U_BaseCommon.pas b/SRC/SCSNormBase/U_BaseCommon.pas index f77b5ef..40875fd 100644 --- a/SRC/SCSNormBase/U_BaseCommon.pas +++ b/SRC/SCSNormBase/U_BaseCommon.pas @@ -488,6 +488,8 @@ const //*** Component Types ctsnUZO = 'UZO_EL'; // ctsnElCounter = 'EL_COUNTER'; // ctsnSwitchInput = 'EL_INPUTSHITCH'; // + + ctsnWireTray = 'WIRETRAY'; // Tolik 10/04/2025 -- // //*** ReportTypes diff --git a/SRC/SCSNormBase/U_BaseConstants.pas b/SRC/SCSNormBase/U_BaseConstants.pas index 561e6f5..b2d65e7 100644 --- a/SRC/SCSNormBase/U_BaseConstants.pas +++ b/SRC/SCSNormBase/U_BaseConstants.pas @@ -1764,6 +1764,7 @@ const cMakeEditComponentType_Msg7 = ''; cMakeEditComponentType_Msg8 = ' , .'; cMakeEditComponentType_Msg9 = ' '; + cMakeEditComponentType_Msg10 = ' '; //------------------------------ cMakeEditCrossConnection_Msg1_1 = ' '; @@ -3235,6 +3236,16 @@ const cFtpmes4 = ' !'; cFtpmes5 = ' !'; cFtpmes6 = ' !'; + cFtpmes7 = ' ?'; + cFtpmes8 = ' ' + #13#10 + ' . ?'; + cFtpmes9 = ' '; + cFtpmes10 = ' :'; + cFtpmes11 = ' !'; + cFtpmes12 = ' !' + #13#10 +' ' + #13#10 + + ' .'; + cTmpDirErr = ' !'; //Tolik 31/01/2025 -- + + {$IFEND} diff --git a/SRC/SCSNormBase/U_BaseConstantsPE.pas b/SRC/SCSNormBase/U_BaseConstantsPE.pas index d7f839e..1e8a018 100644 --- a/SRC/SCSNormBase/U_BaseConstantsPE.pas +++ b/SRC/SCSNormBase/U_BaseConstantsPE.pas @@ -3267,3 +3267,12 @@ cFtpmes4 = 'Failed to delete file on the server!'; cFtpmes5 = 'Failed to get list of files from the server!'; cFtpmes6 = 'Unable to determine user limit!'; + cFtpmes7 = 'Do You want to close current project?'; + cFtpmes8 = 'A file with this name already exists ' + #13#10 + ' on the server. Overwrite?'; + cFtpmes9 = 'Backup'; + cFtpmes10 = 'Enter new file name:'; + cFtpmes11 = 'There is wrong file name!'; + cFtpmes12 = 'Failed to get user settings!' + #13#10 +'Try to refresh files list or contact' + #13#10 + + 'the technical support service.'; + + cTmpDirErr = 'Error defining temporary directory!'; //Tolik 31/01/2025 -- diff --git a/SRC/SCSNormBase/U_BaseConstantsUKR.pas b/SRC/SCSNormBase/U_BaseConstantsUKR.pas index 739a494..9aeaf7d 100644 --- a/SRC/SCSNormBase/U_BaseConstantsUKR.pas +++ b/SRC/SCSNormBase/U_BaseConstantsUKR.pas @@ -3223,3 +3223,12 @@ cFtpmes4 = ' !'; cFtpmes5 = ' !'; cFtpmes6 = ' !'; + cFtpmes7 = ' ?'; + cFtpmes8 = ' ' + #13#10 + ' . ?'; + cFtpmes9 = ' '; + cFtpmes10 = ' ' + ''''+ ' :'; + cFtpmes11 = ' ' + ''''+ ' !'; + cFtpmes12 = ' !' + #13#10 +' ' + #13#10 + + ' .'; + + cTmpDirErr = ' !'; // Tolik 31/01/2025 -- diff --git a/SRC/SCSNormBase/U_MAIN.dfm b/SRC/SCSNormBase/U_MAIN.dfm index f6ba1c1..62f1f5f 100644 --- a/SRC/SCSNormBase/U_MAIN.dfm +++ b/SRC/SCSNormBase/U_MAIN.dfm @@ -52,7 +52,6 @@ object F_MAIN: TF_MAIN ParentFont = False TabOrder = 0 Visible = False - ExplicitTop = 650 object Label_Kolvo: TLabel Left = 16 Top = 8 @@ -111,7 +110,6 @@ object F_MAIN: TF_MAIN OnDblClick = Panel_Main1Click OnResize = Panel_MainResize OnUnDock = Panel_MainUnDock - ExplicitHeight = 650 object Panel_Addition: TRzSizePanel Left = 0 Top = 434 @@ -125,7 +123,6 @@ object F_MAIN: TF_MAIN SizeBarWidth = 7 TabOrder = 0 VisualStyle = vsClassic - ExplicitTop = 449 object ToolBar_CompData: TToolBar Left = 0 Top = 47 @@ -1324,18 +1321,16 @@ object F_MAIN: TF_MAIN TabStyle = tsSquareCorners OnChange = pcObjectsChange OnMouseMove = pcObjectsMouseMove - ExplicitHeight = 449 FixedDimension = 22 object tsTemplates: TRzTabSheet Hint = #1054#1073#1098#1077#1082#1090#1099 ImageIndex = 1 Caption = #1054#1073#1098#1077#1082#1090#1099 - ExplicitHeight = 449 object lvTemplates: TRzListView Left = 160 Top = 30 Width = 172 - Height = 419 + Height = 404 Align = alClient Columns = <> ColumnClick = False @@ -1363,6 +1358,7 @@ object F_MAIN: TF_MAIN OnResize = lvTemplatesResize OnStartDrag = lvTemplatesStartDrag OnSelectItem = lvTemplatesSelectItem + ExplicitHeight = 419 end object cbTemplates: TControlBar Left = 0 @@ -1437,7 +1433,7 @@ object F_MAIN: TF_MAIN object gbTemplateGroups: TRzGroupBar Left = 0 Top = 30 - Height = 419 + Height = 404 ExclusiveMode = True GradientColorStart = clBtnFace GradientColorStop = clBtnShadow @@ -1458,7 +1454,6 @@ object F_MAIN: TF_MAIN ImageIndex = 2 Caption = #1050#1086#1084#1087#1086#1085#1077#1085#1090#1099 OnResize = tsComponentsResize - ExplicitHeight = 449 object Panel_Tree: TPanel Left = 0 Top = 0 @@ -1481,7 +1476,6 @@ object F_MAIN: TF_MAIN OnEndDock = Panel_TreeEndDock OnMouseMove = Panel_TreeMouseMove OnStartDock = Panel_TreeStartDock - ExplicitHeight = 449 object splFindInTree: TSplitter Left = 0 Top = 201 @@ -1625,7 +1619,6 @@ object F_MAIN: TF_MAIN OnMouseMove = Tree_CatalogMouseMove OnMouseUp = Tree_CatalogMouseUp OnStartDrag = Tree_CatalogStartDrag - ExplicitHeight = 226 end object Panel_New: TPanel Left = -169 @@ -1717,6 +1710,10 @@ object F_MAIN: TF_MAIN FixedDimension = 13 object tsFind: TRzTabSheet Caption = #1055#1086#1080#1089#1082 + ExplicitLeft = 0 + ExplicitTop = 0 + ExplicitWidth = 0 + ExplicitHeight = 0 object Panel2: TPanel Left = 0 Top = 0 @@ -2177,7 +2174,6 @@ object F_MAIN: TF_MAIN BorderInner = fsFlat BorderOuter = fsNone TabOrder = 4 - ExplicitTop = 430 object lbFilterIsOn: TRzLabel Left = 8 Top = 2 @@ -2220,7 +2216,6 @@ object F_MAIN: TF_MAIN Caption = #1043#1088#1091#1087#1087#1099 ParentShowHint = False ShowHint = False - ExplicitHeight = 449 object Splitter1: TSplitter Left = 0 Top = 105 @@ -8303,7 +8298,7 @@ object F_MAIN: TF_MAIN Left = 200 Top = 152 Bitmap = { - 494C010104005001200310001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010104005001240310001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 diff --git a/SRC/SCSNormBase/U_MAIN.pas b/SRC/SCSNormBase/U_MAIN.pas index 11bdfb7..cca3688 100644 --- a/SRC/SCSNormBase/U_MAIN.pas +++ b/SRC/SCSNormBase/U_MAIN.pas @@ -11190,7 +11190,7 @@ begin Act_ReplaceCableCanals.Visible := true; Act_SetCableCanalConnectors.Visible := true; Act_SetCableCanalConnectorsToSelected.Visible := true; - //Act_SetTubesElements.Visible := True; + Act_SetTubesElements.Visible := True; end; end; @@ -26132,7 +26132,7 @@ var i: integer; for j := 0 to TubeCompon.CableCanalConnectors.Count - 1 do begin PtrTubeConnector := PCableCanalConnector(TubeCompon.CableCanalConnectors[j]); - //TubeConn := TSCSComponent(TubeCompon.CableCanalConnectors[j]); + TubeConn := TSCSComponent(TubeCompon.CableCanalConnectors[j]); //TubeConn := //PtrTubeConnector.GuidNBConnector @@ -34056,7 +34056,10 @@ end; i: Integer; begin if Assigned(ACableCanalCompon) and - (ACableCanalCompon.ComponentType.SysName = ctsnCableChannel) and (ASide > 0) then + //Tolik 07/03/2025 -- + //(ACableCanalCompon.ComponentType.SysName = ctsnCableChannel) and (ASide > 0) then + ((ACableCanalCompon.ComponentType.SysName = ctsnCableChannel) or + (ACableCanalCompon.ComponentType.SysName = ctsnTube)) and (ASide > 0) then begin CanalObject := ACableCanalCompon.GetFirstParentCatalog; if Assigned(CanalObject) then @@ -34127,7 +34130,10 @@ end; CableCanalObject := GSCSBase.CurrProject.GetCatalogFromReferencesBySCSID(ConnectorLinesID[i]); if Assigned(CableCanalObject) then if assigned(CableCanalObject.ComponentReferences) then - if CableCanalObject.ComponentReferences.GetComponentByType(ctsnCableChannel) <> nil then + //Tolik 07/03/2025 + // if CableCanalObject.ComponentReferences.GetComponentByType(ctsnCableChannel) <> nil then + if CableCanalObject.ComponentReferences.GetComponentByType(ACableCanalCompon.Componenttype.SysName) <> nil then + // ConnectedLines.Add(CableCanalObject); end; GetMem(ptrConnectorWithLines, SizeOf(TConnectorWithLines)); @@ -35624,7 +35630,18 @@ end; //SavedNBComponent: TSCSComponent; // SavedGConnecntOnlyOneLineCompon: boolean; + ComponSName, ElementSName: string; begin + if aInstallTubesElements then + begin + ComponSName := ctsnTube; + ElementSName := ctsnTubeElement; + end + else + begin + ComponSName := ctsnCableChannel; + ElementSName := ctsnCableChannelElement; + end; try SavedGConnecntOnlyOneLineCompon := GConnecntOnlyOneLineCompon; GConnecntOnlyOneLineCompon := True; @@ -35656,7 +35673,10 @@ end; begin ConnectorComponent := AConnectorWithLines.ConnectorObject.SCSComponents[i]; if ConnectorComponent.ComeFrom = cftAuto then - if ConnectorComponent.ComponentType.SysName = ctsnCableChannelElement then + //Tolik 07/03/2025 -- + //if ConnectorComponent.ComponentType.SysName = ctsnCableChannelElement then + if ConnectorComponent.ComponentType.SysName = ElementSName then + // begin CCESideCount := GetCCESideCount(ConnectorComponent); JoinedCountToConnector := GetJoinedCountToComponWithChilds(ConnectorComponent); @@ -35665,7 +35685,10 @@ end; (AConnectorWithLines.ConnectedLines.Count <> CCESideCount) then begin // - JoinedComponent := GetJoinedComponWithType(ConnectorComponent, ctsnCableChannelElement); + //Tolik 07/03/2025 -- + //JoinedComponent := GetJoinedComponWithType(ConnectorComponent, ctsnCableChannelElement); + JoinedComponent := GetJoinedComponWithType(ConnectorComponent, ElementSName); + // if (JoinedComponent = nil) or (CCESideCount > GetCCESideCount(JoinedComponent)) then CCEToDel.Add(ConnectorComponent); //DelCompon(ConnectorComponent, nil, true, true, true, false); end; @@ -35681,7 +35704,10 @@ end; while i <= ConnectorComponent.JoinedComponents.Count - 1 do begin JoinedComponent := ConnectorComponent.JoinedComponents[i]; - if JoinedComponent.ComponentType.SysName = ctsnCableChannelElement then + //Tolik 07/03/2025 -- + //if JoinedComponent.ComponentType.SysName = ctsnCableChannelElement then + if JoinedComponent.ComponentType.SysName = ElementSName then + // begin CCEToDel.Remove(JoinedComponent); DelCompon(JoinedComponent, nil, true, true, true, false) @@ -35717,7 +35743,10 @@ end; if assigned(LineObject.ComponentReferences) then for j := 0 to LineObject.ComponentReferences.Count - 1 do if Assigned(LineObject.ComponentReferences[j]) then - if LineObject.ComponentReferences[j].ComponentType.SysName = ctsnCableChannel then + //Tolik 07/03/2025 -- ComponSName + //if LineObject.ComponentReferences[j].ComponentType.SysName = ctsnCableChannel then + if LineObject.ComponentReferences[j].ComponentType.SysName = ComponSName then + // if LineObject.ComponentReferences[j].GetInterfcesCountByTypeIsBusySide(itFunctional, biTrue, CurrLineSide) = 0 then begin CanalComponent := LineObject.ComponentReferences[j]; diff --git a/SRC/SCSNormBase/U_MakeEditComponentType.pas b/SRC/SCSNormBase/U_MakeEditComponentType.pas index 0b83e76..9625b2b 100644 --- a/SRC/SCSNormBase/U_MakeEditComponentType.pas +++ b/SRC/SCSNormBase/U_MakeEditComponentType.pas @@ -715,7 +715,8 @@ begin AddSysNameTYoTable(ctsnConnectingModule, cMakeEditComponentType_Msg5_37); AddSysNameTYoTable(ctsnTestingAccessory, cMakeEditComponentType_Msg5_38); AddSysNameTYoTable(ctsnTube, cMakeEditComponentType_Msg5_39); - AddSysNameTYoTable(ctsnTubeElement,cMakeEditComponentType_Msg5_39_1);// Tolik 13/10/2018 -- + AddSysNameTYoTable(ctsnTubeElement,cMakeEditComponentType_Msg5_39_1);// Tolik 13/10/2018 -- + AddSysNameTYoTable(ctsnWireTray,cMakeEditComponentType_Msg10); // Tolik 10/04/2025 -- AddSysNameTYoTable(ctsnInstallBox, cMakeEditComponentType_Msg5_40); AddSysNameTYoTable(ctsnCupboard, cMakeEditComponentType_Msg5_41); AddSysNameTYoTable(ctsnJackPlug, cMakeEditComponentType_Msg5_42); diff --git a/SRC/SCSNormBase/U_MakeEditCrossConnection.dfm b/SRC/SCSNormBase/U_MakeEditCrossConnection.dfm index ded3feb..c05b6aa 100644 --- a/SRC/SCSNormBase/U_MakeEditCrossConnection.dfm +++ b/SRC/SCSNormBase/U_MakeEditCrossConnection.dfm @@ -1708,7 +1708,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 8 Top = 136 Bitmap = { - 494C01010B002800700010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C01010B002800B80010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000003000000001002000000000000030 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000EF6B @@ -2140,7 +2140,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 40 Top = 136 Bitmap = { - 494C010105002800640010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010105002800AC0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000004D4F 4F004D4F4F0000000000000000000000000000000000000000004D4F4F004D4F @@ -2415,7 +2415,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 72 Top = 136 Bitmap = { - 494C010105002800640010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010105002800AC0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000004D4F 4F004D4F4F0000000000000000000000000000000000000000004D4F4F004D4F @@ -2728,7 +2728,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 88 Top = 200 Bitmap = { - 494C010105002800640010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010105002800AC0010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -3521,7 +3521,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 576 Top = 344 Bitmap = { - 494C010105002800580010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010105002800A00010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000949494005A5A5A00B5B5B500CECECE000000 @@ -3796,7 +3796,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 544 Top = 344 Bitmap = { - 494C010105002800580010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C010105002800A00010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000002000000001002000000000000020 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000018F70000008400106BA5001094D6000000 @@ -4071,7 +4071,7 @@ object F_MakeEditCrossConnection: TF_MakeEditCrossConnection Left = 512 Top = 344 Bitmap = { - 494C01010B002800580010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 494C01010B002800A00010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 0000000000003600000028000000400000003000000001002000000000000030 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000A5BDAD0094B5A50094ADA50094ADA500000000000000 diff --git a/SRC/SCSNormBase/U_MakeNorm.dfm b/SRC/SCSNormBase/U_MakeNorm.dfm index 1a77bf8..0871621 100644 --- a/SRC/SCSNormBase/U_MakeNorm.dfm +++ b/SRC/SCSNormBase/U_MakeNorm.dfm @@ -159,6 +159,7 @@ object F_MakeNorm: TF_MakeNorm Top = 16 Width = 81 Height = 21 + AutoComplete = False Ctl3D = False FrameHotTrack = True FrameVisible = True diff --git a/SRC/SCSNormBase/U_MakeNorm.pas b/SRC/SCSNormBase/U_MakeNorm.pas index b2be4cd..1f8fc98 100644 --- a/SRC/SCSNormBase/U_MakeNorm.pas +++ b/SRC/SCSNormBase/U_MakeNorm.pas @@ -694,8 +694,10 @@ end; procedure TF_MakeNorm.CorrectCypher(var AMainCyper, ARestCypher: String); var - WholeCypher: String; - + //Tolik 20/02/2025 + //WholeCypher: String; + WholeCypher: AnsiString; + // KolvoZnak: array [0..5] of integer; TempShifr: string; @@ -1050,6 +1052,110 @@ begin FNormCypherTitles.Add(''); FNormCypherTitles.Add(''); FNormCypherTitles.Add(''); + //Tolik 19/02/2025 -- + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + // + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + FNormCypherTitles.Add(''); + + // + FResMatCypherTitles := TStringList.Create; FResMatCypherTitles.Add('1'); diff --git a/SRC/SCSNormBase/U_PECommon.pas b/SRC/SCSNormBase/U_PECommon.pas index 978ce57..81d484c 100644 --- a/SRC/SCSNormBase/U_PECommon.pas +++ b/SRC/SCSNormBase/U_PECommon.pas @@ -1,6 +1,5 @@ unit U_PECommon; - interface uses @@ -218,8 +217,10 @@ begin ListOfAllTraces := GetAllTraceInCADByMarked_New1(CurrentServer, CurrentWS) else ListOfAllTraces := GetAllTraceInCADByMarked(CurrentServer, CurrentWS); - - if ListOfAllTraces.Count > 0 then + //Tolik 21/01/2025 -- (, nil) + //if ListOfAllTraces.Count > 0 then + if ((ListOfAllTraces <> nil) and (ListOfAllTraces.Count > 0)) then + // begin //if GCadForm.FTracingListIndex > ListOfAllTraces.Count - 1 then GCadForm.FTracingListIndex := 0; @@ -289,8 +290,10 @@ begin end; //ListOfAllTraces := GetAllTraceInCADByMarked(ConnTo, ConnFrom{ConnFrom, ConnTo}); ListOfAllTraces := GetAllTraceInCADByMarked(ConnFrom, ConnTo); - - if ListOfAllTraces.Count > 0 then + // Tolik 21/01/2025 -- + //if ListOfAllTraces.Count > 0 then + if ((ListOfAllTraces <> nil) and (ListOfAllTraces.Count > 0)) then + // begin //if GCadForm.FTracingListIndex > ListOfAllTraces.Count - 1 then // GCadForm.FTracingListIndex := 0; @@ -675,6 +678,9 @@ begin ListFolder := nil; ListObject := nil; isLastShield := False; + ListAllComponent := nil; // Tolik 21/01/2025 -- + + LastPoint := nil; // Tolik -- 16/09/2021 -- @@ -1591,6 +1597,8 @@ begin if EndPointComponList <> nil then FreeAndNil(EndPointComponList); // + if ListAllComponent <> nil then + FreeAndNil(ListAllComponent); //Tolik 21/01/2025 -- end; //GCanRefreshCad := True; GCadForm.PCad.Refresh; @@ -1599,7 +1607,7 @@ end; procedure PE_AutoTrace(ATypeAutoTrace: integer; AEndList, AWorkList: TList); var ListShield: tList; - vLists: TList; + //vLists: TList; begin if F_NormBase.GSCSBase.SCSComponent.ComponentType.SysName = ctsnCable then begin @@ -1619,6 +1627,7 @@ begin tatIndivid: LIstShield := AutoTraseToShield(AWorkList, AEndList, True); end; + FreeAndNil(ListShield); //Tolik 20/1/2025 -- end; // EndAutoTrace; end; @@ -2775,9 +2784,17 @@ end; inc(k); SetLength(TraceList, k); TraceList[k - 1] := TracesLength; - FreeAndNil(CurrPathList); - FreeAndNil(currPath); + //Tolik 21/01/2025 -+ + //FreeAndNil(CurrPathList); + //FreeAndNil(currPath); + // end; + //Tolik 21/01/2025 + for j := 0 to CurrPathList.Count - 1 do + TList(CurrPathList[j]).Free; + FreeAndNil(CurrPathList); + currPath := nil; + // end end; end; @@ -2906,15 +2923,15 @@ end; end; end; Begin - ComponList := TList.Create; - ComponList1 := TList.Create; - + //ComponList := TList.Create; // Tolik 21/01/2025 -- 2 + //ComponList1 := TList.Create; + currPath:= nil; //Tolik 21/01/2025 -- IdCable := F_NormBase.GSCSBase.SCSComponent.ID; if AFigList.Count > 0 then begin SortFigList(AFigList, LengthsList); end; - PassList := TList.Create; + //PassList := TList.Create; // Tolik 21/01/2025 -- SetLength(LenList, 0); //connect First Figure To Server Figure := TFigure(AFigList[0]); @@ -2962,7 +2979,10 @@ end; for i := 0 to AFigList.Count - 1 do begin currPathList := GetAllTraceInCADByMarked(Figure, TFigure(aFigList[i])); - if currPathList.Count > 0 then + //Tolik 21/01/2025 -- + //if currPathList.Count > 0 then + if ((currPathList <> nil) and (currPathList.Count > 0)) then + // begin SortPathListByLength(CurrPathList); currPathsToFigure.Add(currPathList[0]); @@ -3009,6 +3029,7 @@ end; currPath:= nil; currPathsToFigure.Clear; end; + FreeAndNil(currPathsToFigure); // Tolik 21/01/2025 -- if not F_PEAutoTraceDialog.CheckPassedTraces.Checked then // Tolik 20/02/2021 -- { @@ -3033,15 +3054,24 @@ end; currPath := GetPathByMode(CurrPathList); //currPathList[0]; // + //Tolik 21/05/2025 -- + { if F_PEAutoTraceDialog.TypeConnection.ItemIndex = 1 then - CanConnect := ConnectFigures(TConnectorObject(Figure), CurrentServer, currPath, IDCable); - + CanConnect := ConnectFigures(TConnectorObject(Figure), CurrentServer, currPath, IDCable); + } + if F_NormBase.GSCSBase.SCSComponent.IDNetType <> 3 then // ( ) + begin + if F_PEAutoTraceDialog.TypeConnection.ItemIndex = 1 then + CanConnect := ConnectFigures(TConnectorObject(Figure), CurrentServer, currPath, IDCable); + end; + // if F_PEAutoTraceDialog.CheckPassedTraces.Checked then CheckPassedPath(currPath); if currPathList <> nil then FreeAndNil(currPathList); if currPath <> nil then FreeAndNil(currPath); + SetLength(LenList, 0); // Tolik 21/01/2025 -- End; { procedure GetServerCompons(aNode : TFlyNode); @@ -3356,6 +3386,7 @@ begin // { if WSSideCompons.IndexOf(CurrentServer.ID) = -1 then begin} + CurrFiguresList := TraceFiguresToServer(CurrentServer); if ((CurrFiguresList <> nil) and (CurrFiguresList.Count > 0)) then @@ -3397,7 +3428,12 @@ begin FreeAndNil(AllPassedTraces); if ConnectedComponList <> nil then FreeAndNil(ConnectedComponList); - // GDragOnCAD := false; + // GDragOnCAD := false; + //Tolik 20/01/2025 -- + FreeAndNil(CurrFiguresList); + FreeAndNil(currPathList); + FreeAndNil(CurrPath); + // end; end; // @@ -3844,7 +3880,7 @@ begin try Result := False; AllTrace := Nil; - CurrTraceList := Nil; + //CurrTraceList := Nil; //20/01/2025 CurrTraceList := TList.Create; //if ACurrPoint.ConnectorType = ct_Clear then // begin @@ -7848,6 +7884,9 @@ var begin try + if WayList <> nil then + FreeAndNil(WayList);//Tolik 20/01/2025 -- + DistanceList := TList.Create; For i := 0 to AStartIndex - 1 do DistanceList.Add(Nil); @@ -7860,11 +7899,19 @@ var OperFigure := TConnectorObject(AWorkFigures[i]); for Count := 0 to OperFigure.JoinedConnectorsList.Count - 1 do begin + //Tolik 20/01/2025 -- + { WayList := Nil; + } WayList := GetAllTracePEInCADforLamp(AEndObjects, Operfigure, true); - operdist := TotalLength(WayList); - if ((operdist <> -1) and(operdist < distance)) or (distance = -1) then - distance := operdist; + if WayList <> nil then + begin + // + operdist := TotalLength(WayList); + if ((operdist <> -1) and(operdist < distance)) or (distance = -1) then + distance := operdist; + FreeAndNil(WayList); // Tolik 20/01/2025 -- + end; end; if i = 0 + AStartIndex then begin diff --git a/TOOLS/license.key b/TOOLS/license.key new file mode 100644 index 0000000..3d3cecd Binary files /dev/null and b/TOOLS/license.key differ