Exemple #1
0
        protected override void WriteEpochGroupStart(string label,
                                                     string source,
                                                     string[] keywords,
                                                     IDictionary <string, object> properties,
                                                     Guid identifier,
                                                     DateTimeOffset startTime,
                                                     double timeZoneOffset)
        {
            H5FileOrGroupId parent = CurrentEpochGroupID == null ?
                                     (H5FileOrGroupId)fileId : CurrentEpochGroupID.SubGroupsId;

            var epochGroup = H5G.create((H5LocId)parent, label + "-" + identifier);

            var subGroups = H5G.create((H5LocId)epochGroup, "epochGroups");
            var epochs    = H5G.create((H5LocId)epochGroup, "epochs");

            WriteAttribute(epochGroup, "label", label);
            WriteAttribute(epochGroup, "source", string.IsNullOrEmpty(source) ? "<none>" : source);
            WriteDictionary(epochGroup, "properties", properties);
            WriteAttribute(epochGroup, "symphony.uuid", identifier.ToString());
            WriteKeywords(epochGroup, new HashSet <string>(keywords));
            WriteAttribute(epochGroup, startTimeUtcName, startTime.Ticks);
            WriteAttribute(epochGroup, startTimeOffsetName, timeZoneOffset);

            //H5G.close(subGroups);
            //H5G.close(epochs);

            EpochGroupsIDs.Push(new EpochGroupIDs(epochGroup, subGroups, epochs));
        }
Exemple #2
0
        protected override void WriteEpochGroupEnd(DateTimeOffset endTime)
        {
            if (CurrentEpochGroupID == null)
            {
                throw new InvalidOperationException("There is no open EpochGroup.");
            }

            var epochGroup = EpochGroupsIDs.Pop();

            WriteAttribute(epochGroup.GroupId, endTimeUtcName, endTime.UtcTicks);
            WriteAttribute(epochGroup.GroupId, endTimeOffsetName, endTime.Offset.TotalHours);//TimeZone.CurrentTimeZone.GetUtcOffset(endTime.DateTime).TotalHours);

            H5G.close(epochGroup.SubGroupsId);
            H5G.close(epochGroup.EpochsId);
            H5G.close(epochGroup.GroupId);

            H5F.flush(fileId);
        }