public EventLogList( DateTime start, DateTime end, LogFilterMode filterMode, LogEntryType entryType) { this.entries = new List <EventLog> (); this.dateStart = new DateTime(start.Year, start.Month, start.Day); this.dateEnd = new DateTime(end.Year, end.Month, end.Day); this.filterMode = filterMode; this.entryType = entryType; }
public EventLog( byte[] response) { this.logType = ( LogEntryType )response[BYTE_TYPE]; this.formatVersion = ( int )response[BYTE_FORMAT]; this.errorStatus = ( int )response[BYTE_ERROR]; this.totalLogs = Utils.GetNumericValueFromBytes <int> (response, BYTE_NUMLOGS, NUM_BYTES_NUMLOGS); // 3 and 4 this.index = Utils.GetNumericValueFromBytes <int> (response, BYTE_CURRENT, NUM_BYTES_CURRENT); // 5 and 6 long secTimeStamp = Utils.GetNumericValueFromBytes <long> (response, BYTE_SECSTIME, NUM_BYTES_SECSTIME); // 9, 10, 11 and 12 this.flags = Utils.GetNumericValueFromBytes <int> (response, BYTE_FLAGS, NUM_BYTES_FLAGS); // 13 and 14 this.readInterval = Utils.GetNumericValueFromBytes <int> (response, BYTE_READINTERVAL, NUM_BYTES_READINTERVAL); // 15 and 16 this.meterRead = Utils.GetNumericValueFromBytes <long> (response, BYTE_METERREAD, NUM_BYTES_METERREAD); // 17, 18, 19, 20 and 21 this.timeStamp = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(secTimeStamp); this.portNumber = ((this.flags & 3) == 0) ? 1 : (((this.flags & 3) == 1) ? 2 : -1); }