• R/O
  • HTTP
  • SSH
  • HTTPS

automap: 提交

Automap (OSS) GIT software repository


Commit MetaInfo

修订版e65d8ea78e343de8704b48ca98eb0b82346a9ca3 (tree)
时间2020-03-20 10:27:14
作者melchior <melchior@user...>
Commitermelchior

Log Message

Pre-RC1: Added Tab delimited POI/EOI report file

更改概述

差异

--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -36,6 +36,7 @@ namespace Automap
3636 private const string chunkFile_filter = @"*_*.png";
3737 private const string poiFileName = @"poi_binary";
3838 private const string eoiFileName = @"eoi_binary";
39+ private const string pointsTsvFileName = @"points_of_interest.tsv";
3940 private static Regex chunkShardRegex = new Regex(@"(?<X>[\d]+)_(?<Z>[\d]+).png", RegexOptions.Singleline);
4041
4142 private ConcurrentDictionary<Vec2i, uint> columnCounter = new ConcurrentDictionary<Vec2i, uint>(3, 150);
@@ -225,7 +226,6 @@ namespace Automap
225226 //What about chunk updates themselves; a update bitmap isn't kept...
226227 updatedChunksTotal += updatedChunks;
227228 GenerateJSONMetadata();
228- PersistPointsData( );
229229 updatedChunks = 0;
230230 }
231231
@@ -251,6 +251,7 @@ namespace Automap
251251 finally
252252 {
253253 Logger.VerboseDebug("Thread '{0}' executing finally block.", Thread.CurrentThread.Name);
254+ PersistPointsData( );
254255 }
255256 }
256257
@@ -532,7 +533,7 @@ namespace Automap
532533 /// </summary>
533534 private void PersistPointsData( )
534535 {
535- //POI and EOI raw dump files ~ reload em!
536+ //POI and EOI raw dump files ~ WRITE em!
536537 //var poiRawFile = File.
537538 string poiPath = Path.Combine(path, poiFileName);
538539 string eoiPath = Path.Combine(path, eoiFileName);
@@ -548,6 +549,31 @@ namespace Automap
548549 Serializer.Serialize<EntitiesOfInterest>(eoiFile, this.EOIs);
549550 }
550551 }
552+
553+ //Create Easy to Parse CSV file for tool/human use....
554+ string pointsTsvPath = Path.Combine(path, pointsTsvFileName);
555+
556+ using (var tsvWriter = new StreamWriter(pointsTsvPath, false, Encoding.UTF8))
557+ {
558+ tsvWriter.WriteLine("Name\tDescription\tLocation\tTime\t");
559+ foreach (var point in this.POIs) {
560+ tsvWriter.Write(point.Name + "\t");
561+ tsvWriter.Write(point.Notes + "\t");
562+ tsvWriter.Write(point.Location.PrettyCoords(ClientAPI) + "\t");
563+ tsvWriter.Write(point.Timestamp.ToString("u")+"\t");
564+ tsvWriter.WriteLine();
565+ }
566+ foreach (var entity in this.EOIs) {
567+ tsvWriter.Write(entity.Name + "\t");
568+ tsvWriter.Write(entity.Notes + "\t");
569+ tsvWriter.Write(entity.Location.PrettyCoords(ClientAPI) + "\t");
570+ tsvWriter.Write(entity.Timestamp.ToString("u") + "\t");
571+ tsvWriter.WriteLine( );
572+ }
573+ tsvWriter.WriteLine();
574+ tsvWriter.Flush( );
575+ }
576+
551577 }
552578
553579 private ColumnMeta CreateColumnMetadata(KeyValuePair<Vec2i, uint> mostActiveCol, IMapChunk mapChunk)
Show on old repository browser