Automap (client) [VS plugin mod]
Revision | e65d8ea78e343de8704b48ca98eb0b82346a9ca3 (tree) |
---|---|
Time | 2020-03-20 10:27:14 |
Author | melchior <melchior@user...> |
Commiter | melchior |
Pre-RC1: Added Tab delimited POI/EOI report file
@@ -36,6 +36,7 @@ namespace Automap | ||
36 | 36 | private const string chunkFile_filter = @"*_*.png"; |
37 | 37 | private const string poiFileName = @"poi_binary"; |
38 | 38 | private const string eoiFileName = @"eoi_binary"; |
39 | + private const string pointsTsvFileName = @"points_of_interest.tsv"; | |
39 | 40 | private static Regex chunkShardRegex = new Regex(@"(?<X>[\d]+)_(?<Z>[\d]+).png", RegexOptions.Singleline); |
40 | 41 | |
41 | 42 | private ConcurrentDictionary<Vec2i, uint> columnCounter = new ConcurrentDictionary<Vec2i, uint>(3, 150); |
@@ -225,7 +226,6 @@ namespace Automap | ||
225 | 226 | //What about chunk updates themselves; a update bitmap isn't kept... |
226 | 227 | updatedChunksTotal += updatedChunks; |
227 | 228 | GenerateJSONMetadata(); |
228 | - PersistPointsData( ); | |
229 | 229 | updatedChunks = 0; |
230 | 230 | } |
231 | 231 |
@@ -251,6 +251,7 @@ namespace Automap | ||
251 | 251 | finally |
252 | 252 | { |
253 | 253 | Logger.VerboseDebug("Thread '{0}' executing finally block.", Thread.CurrentThread.Name); |
254 | + PersistPointsData( ); | |
254 | 255 | } |
255 | 256 | } |
256 | 257 |
@@ -532,7 +533,7 @@ namespace Automap | ||
532 | 533 | /// </summary> |
533 | 534 | private void PersistPointsData( ) |
534 | 535 | { |
535 | - //POI and EOI raw dump files ~ reload em! | |
536 | + //POI and EOI raw dump files ~ WRITE em! | |
536 | 537 | //var poiRawFile = File. |
537 | 538 | string poiPath = Path.Combine(path, poiFileName); |
538 | 539 | string eoiPath = Path.Combine(path, eoiFileName); |
@@ -548,6 +549,31 @@ namespace Automap | ||
548 | 549 | Serializer.Serialize<EntitiesOfInterest>(eoiFile, this.EOIs); |
549 | 550 | } |
550 | 551 | } |
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 | + | |
551 | 577 | } |
552 | 578 | |
553 | 579 | private ColumnMeta CreateColumnMetadata(KeyValuePair<Vec2i, uint> mostActiveCol, IMapChunk mapChunk) |