Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions ISOv4Plugin/Mappers/TimeLogMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ internal TimeLogMapper(TaskDataMapper taskDataMapper) : base(taskDataMapper, "TL
{
}

private static readonly DateTime _firstDayOf1980 = new DateTime(1980, 1, 1, 0, 0, 0, DateTimeKind.Local);

#region Export
private Dictionary<int, int> _dataLogValueOrdersByWorkingDataID;
public IEnumerable<ISOTimeLog> ExportTimeLogs(IEnumerable<OperationData> operationDatas, string dataPath)
Expand Down Expand Up @@ -150,7 +152,6 @@ private class BinaryWriter
{ // ATTENTION: CoordinateMultiplier and ZMultiplier also exist in Import\SpatialRecordMapper.cs!
private const double CoordinateMultiplier = 0.0000001;
private const double ZMultiplier = 0.001; // In ISO the PositionUp value is specified in mm.
private readonly DateTime _januaryFirst1980 = new DateTime(1980, 1, 1);

private readonly IEnumeratedValueMapper _enumeratedValueMapper;
private readonly INumericValueMapper _numericValueMapper;
Expand Down Expand Up @@ -193,7 +194,7 @@ private void WriteSpatialRecord(SpatialRecord spatialRecord, List<WorkingData> m
var millisecondsSinceMidnight = (UInt32)new TimeSpan(0, spatialRecord.Timestamp.Hour, spatialRecord.Timestamp.Minute, spatialRecord.Timestamp.Second, spatialRecord.Timestamp.Millisecond).TotalMilliseconds;
memoryStream.Write(BitConverter.GetBytes(millisecondsSinceMidnight), 0, 4);

var daysSinceJanOne1980 = (UInt16)(spatialRecord.Timestamp - (_januaryFirst1980)).TotalDays;
var daysSinceJanOne1980 = (UInt16)(spatialRecord.Timestamp - _firstDayOf1980).TotalDays;
memoryStream.Write(BitConverter.GetBytes(daysSinceJanOne1980), 0, 2);

//Position
Expand Down Expand Up @@ -753,8 +754,6 @@ internal static Dictionary<byte, int> ReadImplementGeometryValues(IEnumerable<by

protected class BinaryReader
{
private static readonly DateTime _firstDayOf1980 = new DateTime(1980, 01, 01);

public static Dictionary<byte, int> ReadImplementGeometryValues(string filePath, ISOTime templateTime, IEnumerable<byte> desiredDLVIndices, int version, IList<IError> errors)
{
Dictionary<byte, int> output = new Dictionary<byte, int>();
Expand Down
Loading