protected virtual void OnDateTimeDataReceived(DateTimeData e)
 {
     if (DateTimeDataReceived != null)
     {
         DateTimeDataReceived(this, e);
     }
 }
예제 #2
0
 /// <summary>
 /// Constructs a write date/time packet.
 /// </summary>
 /// <param name="dateTimeData">
 /// <see cref="DateTimeData"/> instance containing data to be written.
 /// </param>
 /// <returns>
 /// Constructed and encoded write date/time packet
 /// </returns>
 public static byte[] ConstructWriteDateTimePacket(DateTimeData dateTimeData)
 {
     byte[] decodedPacket = new byte[] { (byte)PacketHeaders.WriteDateTime,
                                         (byte)(((((dateTimeData.Year - 2000) % 100) / 10) << 4) | ((dateTimeData.Year - 2000) % 10)),
                                         (byte)(((((dateTimeData.Month) % 100) / 10) << 4) | (dateTimeData.Month % 10)),
                                         (byte)(((((dateTimeData.Day) % 100) / 10) << 4) | (dateTimeData.Day % 10)),
                                         (byte)(((((dateTimeData.Hours) % 100) / 10) << 4) | (dateTimeData.Hours % 10)),
                                         (byte)(((((dateTimeData.Minutes) % 100) / 10) << 4) | (dateTimeData.Minutes % 10)),
                                         (byte)(((((dateTimeData.Seconds) % 100) / 10) << 4) | (dateTimeData.Seconds % 10)),
                                         0 };
     decodedPacket = InsertChecksum(decodedPacket);
     return(PacketEncoding.EncodePacket(decodedPacket));
 }
예제 #3
0
 protected virtual void OnDateTimeDataReceived(DateTimeData e) { if (DateTimeDataReceived != null) DateTimeDataReceived(this, e); }
예제 #4
0
 /// <summary>
 /// Sends write date/time packet.
 /// </summary>
 /// <param name="dateTimeData">
 /// Date/time data to be written.
 /// </param>
 public void SendWriteDateTimePacket(DateTimeData dateTimeData)
 {
     SendByteArray(PacketConstruction.ConstructWriteDateTimePacket(dateTimeData));
     PacketsWrittenCounter.WriteDateTimePackets++;
 }
예제 #5
0
 /// <summary>
 /// Sends write date/time packet.
 /// </summary>
 /// <param name="dateTimeData">
 /// Date/time data to be written.
 /// </param>
 public void SendWriteDateTimePacket(DateTimeData dateTimeData)
 {
     SendByteArray(PacketConstruction.ConstructWriteDateTimePacket(dateTimeData));
     PacketsWrittenCounter.WriteDateTimePackets++;
 }
예제 #6
0
 /// <summary>
 /// Write <see cref="DateTimeData"/> to CSV file. Will create new file if required.
 /// </summary>
 /// <param name="dateTimeData">
 /// x-IMU data/time data.
 /// </param>
 public void WriteDateTimeData(DateTimeData dateTimeData)
 {
     WriteCSVlineAtFileIndex(dateTimeData.ConvertToCSVstring(), FileIndexes.DateTime);
     PacketsWrittenCounter.WriteDateTimePackets++;
 }
예제 #7
0
 /// <summary>
 /// Write <see cref="DateTimeData"/> to CSV file. Will create new file if required.
 /// </summary>
 /// <param name="dateTimeData">
 /// x-IMU data/time data.
 /// </param>
 public void WriteDateTimeData(DateTimeData dateTimeData)
 {
     WriteCSVlineAtFileIndex(dateTimeData.ConvertToCSVstring(), FileIndexes.DateTime);
     PacketsWrittenCounter.WriteDateTimePackets++;
 }
예제 #8
0
 /// <summary>
 /// Constructs a write date/time packet.
 /// </summary>
 /// <param name="dateTimeData">
 /// <see cref="DateTimeData"/> instance containing data to be written.
 /// </param>
 /// <returns>
 /// Constructed and encoded write date/time packet
 /// </returns> 
 public static byte[] ConstructWriteDateTimePacket(DateTimeData dateTimeData)
 {
     byte[] decodedPacket = new byte[] { (byte)PacketHeaders.WriteDateTime,
                                         (byte)(((((dateTimeData.Year - 2000) % 100) / 10) << 4) | ((dateTimeData.Year - 2000) % 10)),
                                         (byte)(((((dateTimeData.Month) % 100) / 10) << 4) | (dateTimeData.Month % 10)),
                                         (byte)(((((dateTimeData.Day) % 100) / 10) << 4) | (dateTimeData.Day % 10)),
                                         (byte)(((((dateTimeData.Hours) % 100) / 10) << 4) | (dateTimeData.Hours % 10)),
                                         (byte)(((((dateTimeData.Minutes) % 100) / 10) << 4) | (dateTimeData.Minutes % 10)),
                                         (byte)(((((dateTimeData.Seconds) % 100) / 10) << 4) | (dateTimeData.Seconds % 10)),
                                         0};
     decodedPacket = InsertChecksum(decodedPacket);
     return PacketEncoding.EncodePacket(decodedPacket);
 }