Skip to content

Commit 62aa994

Browse files
committed
Fix old existing file overwrite issue (it created random filename for new file, BUT it never really worked), now it overwrites existing files. adjust window size
1 parent 9be762f commit 62aa994

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

MainWindow.xaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:PointCloudConverter"
77
mc:Ignorable="d"
8-
Title="PointCloudConverter" Height="737" Width="907" Background="#FF252222" Closing="Window_Closing" Loaded="Window_Loaded" MinWidth="920">
8+
Title="PointCloudConverter" Height="737" Width="940" Background="#FF252222" Closing="Window_Closing" Loaded="Window_Loaded" MinWidth="940">
99
<Grid Margin="0,0,2,0">
10-
<Button x:Name="btnBrowseInput" Content="..." HorizontalAlignment="Left" Margin="636,48,0,0" VerticalAlignment="Top" Width="32" Height="23" Click="btnBrowseInput_Click" ToolTip="Browse for input file"/>
11-
<TextBox x:Name="txtInputFile" HorizontalAlignment="Left" AllowDrop="True" Height="23" Margin="20,48,0,0" VerticalAlignment="Top" Width="611" PreviewDrop="txtInputFile_Drop" PreviewDragOver="txtInputFile_DragEnter"/>
10+
<Button x:Name="btnBrowseInput" Content="..." HorizontalAlignment="Left" Margin="724,48,0,0" VerticalAlignment="Top" Width="32" Height="23" Click="btnBrowseInput_Click" ToolTip="Browse for input file"/>
11+
<TextBox x:Name="txtInputFile" HorizontalAlignment="Left" AllowDrop="True" Height="23" Margin="20,48,0,0" VerticalAlignment="Top" Width="699" PreviewDrop="txtInputFile_Drop" PreviewDragOver="txtInputFile_DragEnter"/>
1212
<Label x:Name="label" Content="Input file or folder:&#xD;&#xA;" HorizontalAlignment="Left" Margin="20,22,0,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}" Height="26"/>
13-
<Button x:Name="btnConvert" Content="Convert" HorizontalAlignment="Left" Margin="516,514,0,0" VerticalAlignment="Top" Width="371" Height="58" Click="btnConvert_Click"/>
14-
<Button x:Name="btnBrowseOutput" Content="..." HorizontalAlignment="Left" Margin="636,114,0,0" VerticalAlignment="Top" Width="32" Height="23" Click="btnBrowseOutput_Click" ToolTip="Browse for output file"/>
15-
<TextBox x:Name="txtOutput" HorizontalAlignment="Left" Height="23" Margin="20,114,0,0" VerticalAlignment="Top" Width="611"/>
13+
<Button x:Name="btnConvert" Content="Convert" HorizontalAlignment="Right" Margin="0,514,13,0" VerticalAlignment="Top" Width="371" Height="58" Click="btnConvert_Click"/>
14+
<Button x:Name="btnBrowseOutput" Content="..." HorizontalAlignment="Left" Margin="724,113,0,0" VerticalAlignment="Top" Width="32" Height="23" Click="btnBrowseOutput_Click" ToolTip="Browse for output file"/>
15+
<TextBox x:Name="txtOutput" HorizontalAlignment="Left" Height="23" Margin="20,114,0,0" VerticalAlignment="Top" Width="699"/>
1616
<Label x:Name="label_Copy" Content="Output:" HorizontalAlignment="Left" Margin="20,88,0,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}"/>
17-
<Label x:Name="label_Copy2" Content="Import format:&#xA;" HorizontalAlignment="Left" Margin="710,22,0,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}" Height="26"/>
18-
<ComboBox x:Name="cmbImportFormat" HorizontalAlignment="Left" Margin="710,48,0,0" VerticalAlignment="Top" Width="163" IsReadOnly="True"/>
19-
<Label x:Name="label_Copy1" Content="Export format:&#xD;&#xA;" HorizontalAlignment="Left" Margin="710,88,0,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}" Height="26"/>
20-
<ComboBox x:Name="cmbExportFormat" HorizontalAlignment="Left" Margin="710,114,0,0" VerticalAlignment="Top" Width="163" IsReadOnly="True" SelectionChanged="cmbExportFormat_SelectionChanged"/>
21-
<Button x:Name="btnPlugins" Content=".." HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Browse plugins folder" Margin="882,115,0,0" Width="16" Click="btnPlugins_Click"/>
17+
<Label x:Name="label_Copy2" Content="Import format:&#xA;" HorizontalAlignment="Right" Margin="0,22,65,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}" Height="26"/>
18+
<ComboBox x:Name="cmbImportFormat" HorizontalAlignment="Right" Margin="0,49,31,0" VerticalAlignment="Top" Width="117" IsReadOnly="True"/>
19+
<Label x:Name="label_Copy1" Content="Export format:&#xD;&#xA;" HorizontalAlignment="Right" Margin="0,88,63,0" VerticalAlignment="Top" Foreground="{DynamicResource MainText}" Height="26"/>
20+
<ComboBox x:Name="cmbExportFormat" HorizontalAlignment="Right" Margin="0,114,31,0" VerticalAlignment="Top" Width="117" IsReadOnly="True" SelectionChanged="cmbExportFormat_SelectionChanged"/>
21+
<Button x:Name="btnPlugins" Content=".." HorizontalAlignment="Right" VerticalAlignment="Top" ToolTip="Browse plugins folder" Margin="0,114,10,0" Width="16" Click="btnPlugins_Click" Height="22"/>
2222

23-
<TextBox x:Name="txtConsole" HorizontalAlignment="Left" Height="67" Margin="10,603,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="877" IsReadOnly="True" UndoLimit="1" Background="#FF404040" BorderBrush="{x:Null}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
23+
<TextBox x:Name="txtConsole" HorizontalAlignment="Left" Height="67" Margin="10,603,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="915" IsReadOnly="True" UndoLimit="1" Background="#FF404040" BorderBrush="{x:Null}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
2424

2525
<Label x:Name="label_Copy5" Content="Generated commandline parameters:" HorizontalAlignment="Left" Margin="10,577,0,0" VerticalAlignment="Top" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" FontWeight="Bold"/>
2626
<Button x:Name="btnCopyToClipboard" Content="Copy" HorizontalAlignment="Left" VerticalAlignment="Top" Width="40" Height="20" ToolTip="Browse for output file" Margin="239,580,0,0" Click="btnCopyToClipboard_Click"/>

Readers/LAZ.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ ushort IReader.GetIntensity()
395395
//{
396396
// i = (byte)(p.intensity);
397397
//}
398-
399398
// get min and max
400399
if (i < minIntensity) minIntensity = i;
401400
if (i > maxIntensity) maxIntensity = i;

Writers/PCROOT.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,15 @@ void IWriter.Save(int fileIndex)
590590
string fullpathFileOnly = fileOnly + "_" + fileIndex + "_" + key + tileExtension;
591591

592592
// if batch mode (more than 1 file), FIXME generates new unique filename..but why not overwrite?
593-
if (fileIndex > 0 && File.Exists(fullpath))
594-
{
595-
//Console.WriteLine("File already exists! " + fullpath);
596-
Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
597-
fullpath = Path.Combine(baseFolder, fileOnly) + "_" + fileIndex + "_" + key + "_r" + (unixTimestamp) + tileExtension;
598-
fullpathFileOnly = fileOnly + "_" + fileIndex + "_" + key + tileExtension;
599-
}
593+
// THIS is now disabled, it didnt really work since pcroot was not updated with new file names!
594+
//if (fileIndex > 0 && File.Exists(fullpath))
595+
//{
596+
//Log.Write("File already exists! " + fullpath);
597+
////Console.WriteLine("File already exists! " + fullpath);
598+
//Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
599+
//fullpath = Path.Combine(baseFolder, fileOnly) + "_" + fileIndex + "_" + key + "_r" + (unixTimestamp) + tileExtension;
600+
//fullpathFileOnly = fileOnly + "_" + fileIndex + "_" + key + tileExtension;
601+
//}
600602

601603
// save this tile
602604
//Log.Write("*** Saving tile: " + fullpathFileOnly + " (" + nodeTempX.Count + " points)");

0 commit comments

Comments
 (0)