@@ -28,7 +28,7 @@ namespace PointCloudConverter
28
28
{
29
29
public partial class MainWindow : Window
30
30
{
31
- static readonly string version = "16 .09.2024" ;
31
+ static readonly string version = "17 .09.2024" ;
32
32
static readonly string appname = "PointCloud Converter - " + version ;
33
33
static readonly string rootFolder = AppDomain . CurrentDomain . BaseDirectory ;
34
34
@@ -100,43 +100,42 @@ private async void Main()
100
100
101
101
var pluginsDirectory = "plugins" ;
102
102
103
- if ( ! Directory . Exists ( pluginsDirectory ) )
103
+ if ( Directory . Exists ( pluginsDirectory ) )
104
104
{
105
- Log . Write ( "Plugins directory not found." ) ;
106
- return ;
107
- }
105
+ //Log.Write("Plugins directory not found.");
108
106
109
- // Get all DLL files in the plugins directory
110
- var pluginFiles = Directory . GetFiles ( pluginsDirectory , "*.dll" ) ;
107
+ // Get all DLL files in the plugins directory
108
+ var pluginFiles = Directory . GetFiles ( pluginsDirectory , "*.dll" ) ;
111
109
112
- foreach ( var pluginDLL in pluginFiles )
113
- {
114
- try
110
+ foreach ( var pluginDLL in pluginFiles )
115
111
{
116
- // Load the DLL file as an assembly
117
- var assembly = Assembly . LoadFrom ( pluginDLL ) ;
112
+ try
113
+ {
114
+ // Load the DLL file as an assembly
115
+ var assembly = Assembly . LoadFrom ( pluginDLL ) ;
118
116
119
- // Find all types in the assembly that implement IWriter
120
- var writerTypes = assembly . GetTypes ( ) . Where ( type => typeof ( IWriter ) . IsAssignableFrom ( type ) && ! type . IsInterface && ! type . IsAbstract ) ;
117
+ // Find all types in the assembly that implement IWriter
118
+ var writerTypes = assembly . GetTypes ( ) . Where ( type => typeof ( IWriter ) . IsAssignableFrom ( type ) && ! type . IsInterface && ! type . IsAbstract ) ;
121
119
122
- foreach ( var writerType in writerTypes )
123
- {
124
- // Derive a unique key for the writer (e.g., from its name or class name)
125
- string writerName = writerType . Name ; //.Replace("Writer", ""); // Customize the key generation logic
126
- if ( ! externalWriters . ContainsKey ( writerName ) )
120
+ foreach ( var writerType in writerTypes )
127
121
{
128
- // Add the writer type to the dictionary for later use
129
- externalWriters . Add ( writerName , writerType ) ;
130
- //Log.Write($"Found writer: {writerType.FullName} in {pluginDLL}");
122
+ // Derive a unique key for the writer (e.g., from its name or class name)
123
+ string writerName = writerType . Name ; //.Replace("Writer", ""); // Customize the key generation logic
124
+ if ( ! externalWriters . ContainsKey ( writerName ) )
125
+ {
126
+ // Add the writer type to the dictionary for later use
127
+ externalWriters . Add ( writerName , writerType ) ;
128
+ //Log.Write($"Found writer: {writerType.FullName} in {pluginDLL}");
131
129
132
- // TODO take extensions from plugin? has 2: .glb and .gltf
133
- externalFileFormats += "|" + writerName + " (" + writerType . FullName + ")|*." + writerName . ToLower ( ) ;
130
+ // TODO take extensions from plugin? has 2: .glb and .gltf
131
+ externalFileFormats += "|" + writerName + " (" + writerType . FullName + ")|*." + writerName . ToLower ( ) ;
132
+ }
134
133
}
135
134
}
136
- }
137
- catch ( Exception ex )
138
- {
139
- Console . WriteLine ( $ "Error loading plugin { pluginDLL } : { ex . Message } " ) ;
135
+ catch ( Exception ex )
136
+ {
137
+ Console . WriteLine ( $ "Error loading plugin { pluginDLL } : { ex . Message } " ) ;
138
+ }
140
139
}
141
140
}
142
141
@@ -413,7 +412,7 @@ private static async Task ProcessAllFiles(object workerParamsObject)
413
412
Interlocked . Increment ( ref errorCounter ) ; // thread-safe error counter increment
414
413
if ( importSettings . useJSONLog )
415
414
{
416
- Trace . WriteLine ( "useJSONLoguseJSONLoguseJSONLoguseJSONLog" ) ;
415
+ // Trace.WriteLine("useJSONLoguseJSONLoguseJSONLoguseJSONLog");
417
416
Log . Write ( "{\" event\" : \" " + LogEvent . File + "\" , \" path\" : " + System . Text . Json . JsonSerializer . Serialize ( importSettings . inputFiles [ i ] ) + ", \" status\" : \" " + LogStatus . Processing + "\" }" , LogEvent . Error ) ;
418
417
}
419
418
else
0 commit comments