File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
core/pv/src/main/java/org/phoebus/pv Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11/*******************************************************************************
2- * Copyright (c) 2017-2018 Oak Ridge National Laboratory.
2+ * Copyright (c) 2017-2022 Oak Ridge National Laboratory.
33 * All rights reserved. This program and the accompanying materials
44 * are made available under the terms of the Eclipse Public License v1.0
55 * which accompanies this distribution, and is available at
6969@ SuppressWarnings ("nls" )
7070public class DBRHelper
7171{
72+ /** 1990/01/01 00:00:00 epoch used by Channel Access and records on IOC */
73+ public static final long EPICS_EPOCH = 631152000L ;
74+
7275 /** @param plain Get plain type of CTRL_... type?
7376 * @param type Example data
7477 * @return CTRL_... type for this channel.
@@ -155,7 +158,7 @@ private static Time convertTime(final DBR dbr)
155158 if (epics_time == null )
156159 return Time .nowInvalid ();
157160
158- final Instant instant = Instant .ofEpochSecond (epics_time .secPastEpoch () + 631152000L , (int ) epics_time .nsec ());
161+ final Instant instant = Instant .ofEpochSecond (epics_time .secPastEpoch () + EPICS_EPOCH , (int ) epics_time .nsec ());
159162 if (epics_time .secPastEpoch () <= 0 )
160163 return Time .of (instant , 0 , false );
161164
Original file line number Diff line number Diff line change 7474import org .epics .vtype .VULongArray ;
7575import org .epics .vtype .VUShort ;
7676import org .epics .vtype .VUShortArray ;
77+ import org .phoebus .pv .ca .DBRHelper ;
7778
7879/** Decodes {@link Time}, {@link Alarm}, {@link Display}, ...
7980 * @author Kay Kasemir
@@ -166,7 +167,7 @@ static Time decodeTime(final PVAStructure struct)
166167 // as used for the Channel Access and IOC time stamp epoch
167168 // is considered invalid because IOCs send it for never processed records
168169 final boolean valid = timestamp .getNano () != 0 &&
169- (timestamp .getEpochSecond () > 0 && timestamp .getEpochSecond () != 631152000L );
170+ (timestamp .getEpochSecond () > 0 && timestamp .getEpochSecond () != DBRHelper . EPICS_EPOCH );
170171 return Time .of (timestamp , usertag , valid );
171172 }
172173
You can’t perform that action at this time.
0 commit comments