Esempio n. 1
0
 public PsnDataInformationSimple(string id, DateTime?beginTime, DateTime?endTime, DateTime?saveTime, PsnDataFragmentType dataDataFragmentType, bool isLastDeviceLog, string deviceInformationId)
 {
     _id                   = new IdentifierStringToLowerBased(id);
     _beginTime            = beginTime;
     _endTime              = endTime;
     _saveTime             = saveTime;
     _dataDataFragmentType = dataDataFragmentType;
     _isLastDeviceLog      = isLastDeviceLog;
     _deviceInformationId  = new IdentifierStringToLowerBased(deviceInformationId);
 }
Esempio n. 2
0
        public static string ToSimpleString(this PsnDataFragmentType value)
        {
            switch (value)
            {
            case PsnDataFragmentType.FixedLength:
                return("F");

            case PsnDataFragmentType.PowerDepended:
                return("P");

            case PsnDataFragmentType.LinkedToFault:
                return("L");
            }
            throw new Exception("Cannot convert value to string");
        }
 public void Add(IIdentifier psnLogInformationId, DateTime?beginTime, DateTime?endTime, DateTime?saveTime, PsnDataFragmentType psnDataType, bool isLastDeviceLog, IIdentifier deviceInformationId)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
        /// <summary>
        /// Добавляет новые данные в хранилище
        /// </summary>
        /// <param name="psnLogInformationId">Идентификатор записи данных</param>
        /// <param name="beginTime">Время начала лога ПСН</param>
        /// <param name="endTime">Время окончания лога ПСН</param>
        /// <param name="saveTime">Время сохранения лога ПСН</param>
        /// <param name="psnDataType">Тип лога ПСН</param>
        /// <param name="isLastDeviceLog">Флаг, является ли лог последним на устройстве</param>
        /// <param name="deviceInformationId">Информация об устройстве</param>
        public void Add(IIdentifier psnLogInformationId, DateTime?beginTime, DateTime?endTime, DateTime?saveTime, PsnDataFragmentType psnDataType, bool isLastDeviceLog, IIdentifier deviceInformationId)
        {
            var doc = ReadXDocFromStream();

            doc.Element("PsnDataInformations").
            Add(
                new XElement(
                    "PsnDataInformation",
                    new XAttribute("Id", psnLogInformationId.IdentyString),
                    new XAttribute("SaveTime", saveTime.ToFileMsString()),
                    new XAttribute("LogType", psnDataType.ToSimpleString()),
                    new XAttribute("BeginTime", beginTime.ToFileMsString()),
                    new XAttribute("EndTime", endTime.ToFileMsString()),
                    new XAttribute("DeviceInformationId", deviceInformationId.IdentyString)));
            WriteOutXml(doc);
        }
 public PsnLogTypeBuilderFromLowLevel(PsnDataFragmentType val)
 {
     _val = val;
 }
 public void Add(IIdentifier psnLogInformationId, DateTime?beginTime, DateTime?endTime, DateTime?saveTime, PsnDataFragmentType psnDataType, bool isLastDeviceLog, IIdentifier deviceInformationId)
 {
     _relayOnStorage.Add(psnLogInformationId, beginTime, endTime, saveTime, psnDataType, isLastDeviceLog, deviceInformationId);
     _psnDataInformations.Add(
         new PsnDataInformationSimple(
             psnLogInformationId.IdentyString,
             beginTime,
             endTime,
             saveTime,
             psnDataType,
             isLastDeviceLog,
             deviceInformationId.IdentyString));
 }
 /// <summary>
 /// Добавляет новые данные в хранилище (операция не поддерживается)
 /// </summary>
 /// <param name="psnLogInformationId">Идентификатор записи</param>
 /// <param name="beginTime">Время начала лога</param>
 /// <param name="endTime">Время конца лога</param>
 /// <param name="saveTime">Время сохранения данных</param>
 /// <param name="psnDataType">Тип лога</param>
 /// <param name="isLastDeviceLog">Индикатор того, что лог является последним на устройстве</param>
 /// <param name="deviceInformationId">Идентификатор информации об устройстве</param>
 public void Add(IIdentifier psnLogInformationId, DateTime?beginTime, DateTime?endTime, DateTime?saveTime, PsnDataFragmentType psnDataType, bool isLastDeviceLog, IIdentifier deviceInformationId)
 {
     throw new NotSupportedException("Операция добавления данных на устройство не поддерживается");
 }