3737using System . Collections . Generic ;
3838using System . Diagnostics ;
3939using System . IO ;
40+ using BH . oM . Base . Attributes ;
41+ using System . ComponentModel ;
4042
4143namespace BH . Adapter . Lusas
4244{
@@ -56,15 +58,45 @@ public partial class LusasV17Adapter : BHoMAdapter
5658 /**** Constructors ****/
5759 /***************************************************/
5860#if Debug18 || Release18
59- public LusasV18Adapter ( string filePath , LusasConfig lusasConfig = null , bool active = false )
61+ [ PreviousVersion ( "7.0" , "BH.Adapter.Lusas.LusasV18Adapter(System.String, BH.oM.Adapters.Lusas.LusasConfig, System.Boolean)" ) ]
62+ [ Description ( "Adapter to connect to a Lusas .mdl file." ) ]
63+ [ Input ( "filePath" , "Path to the Lusas .mdl file to be used." ) ]
64+ [ Input ( "lusasSettings" , "General settings that are applicable to all actions performed by this adapter, e.g. merge tolerance to be used." ) ]
65+ [ Input ( "active" , "Initiate the adapter by setting to True. Open a session of Lusas and close any dialogue boxes before setting to True." ) ]
66+ [ Output ( "adapter" , "Adapter for Lusas." ) ]
67+ public LusasV18Adapter ( string filePath , LusasSettings lusasSettings = null , bool active = false )
6068#elif Debug19 || Release19
61- public LusasV19Adapter ( string filePath , LusasConfig lusasConfig = null , bool active = false )
69+ [ PreviousVersion ( "7.0" , "BH.Adapter.Lusas.LusasV19Adapter(System.String, BH.oM.Adapters.Lusas.LusasConfig, System.Boolean)" ) ]
70+ [ Description ( "Adapter to connect to a Lusas .mdl file." ) ]
71+ [ Input ( "filePath" , "Path to the Lusas .mdl file to be used." ) ]
72+ [ Input ( "lusasSettings" , "General settings that are applicable to all actions performed by this adapter, e.g. merge tolerance to be used." ) ]
73+ [ Input ( "active" , "Initiate the adapter by setting to True. Open a session of Lusas and close any dialogue boxes before setting to True." ) ]
74+ [ Output ( "adapter" , "Adapter for Lusas." ) ]
75+ public LusasV19Adapter ( string filePath , LusasSettings lusasSettings = null , bool active = false )
6276#elif Debug191 || Release191
63- public LusasV191Adapter ( string filePath , LusasConfig lusasConfig = null , bool active = false )
77+ [ PreviousVersion ( "7.0" , "BH.Adapter.Lusas.LusasV191Adapter(System.String, BH.oM.Adapters.Lusas.LusasConfig, System.Boolean)" ) ]
78+ [ Description ( "Adapter to connect to a Lusas .mdl file." ) ]
79+ [ Input ( "filePath" , "Path to the Lusas .mdl file to be used." ) ]
80+ [ Input ( "lusasSettings" , "General settings that are applicable to all actions performed by this adapter, e.g. merge tolerance to be used." ) ]
81+ [ Input ( "active" , "Initiate the adapter by setting to True. Open a session of Lusas and close any dialogue boxes before setting to True." ) ]
82+ [ Output ( "adapter" , "Adapter for Lusas." ) ]
83+ public LusasV191Adapter ( string filePath , LusasSettings lusasSettings = null , bool active = false )
6484#elif Debug200 || Release200
65- public LusasV200Adapter ( string filePath , LusasConfig lusasConfig = null , bool active = false )
85+ [ PreviousVersion ( "7.0" , "BH.Adapter.Lusas.LusasV200Adapter(System.String, BH.oM.Adapters.Lusas.LusasConfig, System.Boolean)" ) ]
86+ [ Description ( "Adapter to connect to a Lusas .mdl file." ) ]
87+ [ Input ( "filePath" , "Path to the Lusas .mdl file to be used." ) ]
88+ [ Input ( "lusasSettings" , "General settings that are applicable to all actions performed by this adapter, e.g. merge tolerance to be used." ) ]
89+ [ Input ( "active" , "Initiate the adapter by setting to True. Open a session of Lusas and close any dialogue boxes before setting to True." ) ]
90+ [ Output ( "adapter" , "Adapter for Lusas." ) ]
91+ public LusasV200Adapter ( string filePath , LusasSettings lusasSettings = null , bool active = false )
6692#else
67- public LusasV17Adapter ( string filePath , LusasConfig lusasConfig = null , bool active = false )
93+ [ PreviousVersion ( "7.0" , "BH.Adapter.Lusas.LusasV17Adapter(System.String, BH.oM.Adapters.Lusas.LusasConfig, System.Boolean)" ) ]
94+ [ Description ( "Adapter to connect to a Lusas .mdl file." ) ]
95+ [ Input ( "filePath" , "Path to Lusas the .mdl file to be used." ) ]
96+ [ Input ( "lusasSettings" , "General settings that are applicable to all actions performed by this adapter, e.g. merge tolerance to be used." ) ]
97+ [ Input ( "active" , "Initiate the adapter by setting to True. Open a session of Lusas and close any dialogue boxes before setting to True." ) ]
98+ [ Output ( "adapter" , "Adapter for Lusas." ) ]
99+ public LusasV17Adapter ( string filePath , LusasSettings lusasSettings = null , bool active = false )
68100#endif
69101 {
70102 if ( active )
@@ -131,6 +163,14 @@ public LusasV17Adapter(string filePath, LusasConfig lusasConfig = null, bool act
131163 {
132164 throw new Exception ( "An exception has been flagged by Lusas, it is likely the file is from a higher version of Lusas than the adapter being used." ) ;
133165 }
166+
167+ if ( lusasSettings != null && ! double . IsNaN ( lusasSettings . MergeTolerance ) )
168+ {
169+ m_mergeTolerance = lusasSettings . MergeTolerance ;
170+ d_LusasData . getOptions ( ) . setDouble ( "TOLMRG" , m_mergeTolerance ) ;
171+ }
172+
173+ if ( lusasSettings != null ) { m_g = lusasSettings . StandardGravity ; }
134174 }
135175 }
136176 }
@@ -151,10 +191,12 @@ public static bool IsApplicationRunning()
151191 //Add any comlink object as a private field here, example named:
152192
153193 private string m_directory ;
194+ public double m_mergeTolerance = double . NaN ;
195+ public double m_g = 9.80665 ;
154196 public LusasWinApp m_LusasApplication ;
155197 public IFDatabase d_LusasData ;
156198 private Dictionary < Type , Dictionary < int , HashSet < string > > > m_tags = new Dictionary < Type , Dictionary < int , HashSet < string > > > ( ) ;
157- public LusasConfig lusasConfig ;
199+ public LusasSettings lusasSettings ;
158200
159201
160202 /***************************************************/
0 commit comments