@@ -76,14 +76,14 @@ omi_cboe_c1options_auctionfeed_pitch_v1_1_1.fields.timestamp = ProtoField.new("T
7676---- -------------------------------------------------------------------
7777
7878-- timestamp format
79- local timestamp_format_enum = {
79+ local time_offset_format_enum = {
8080 { 1 , " Raw" , 0 },
8181 { 2 , " Time of Day" , 1 },
8282 { 3 , " Full DateTime" , 2 }
8383}
8484
8585-- 0=Raw, 1=TimeOfDay, 2=FullDateTime
86- cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp_format = 2
86+ cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset_format = 2
8787
8888-- Hours behind UTC (EST) for midnight calculation
8989cboe_c1options_auctionfeed_pitch_v1_1_1 .utc_offset_hours = 5
@@ -111,7 +111,7 @@ omi_cboe_c1options_auctionfeed_pitch_v1_1_1.prefs.show_packet = Pref.bool("Show
111111omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .show_packet_header = Pref .bool (" Show Packet Header" , show .packet_header , " Parse and add Packet Header to protocol tree" )
112112omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .show_message_index = Pref .bool (" Show Message Index" , show .message_index , " Show generated message index in protocol tree" )
113113
114- omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .timestamp_format = Pref .enum (" Timestamp Format" , 2 , " Timestamp display format" , timestamp_format_enum , false )
114+ omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .time_offset_format = Pref .enum (" Time Offset Format" , 2 , " Time Offset display format" , time_offset_format_enum , false )
115115omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .utc_offset_hours = Pref .uint (" UTC Offset (hours)" , 5 , " Hours behind UTC (EST) for midnight calculation" )
116116
117117-- Handle changed preferences
@@ -136,8 +136,8 @@ function omi_cboe_c1options_auctionfeed_pitch_v1_1_1.prefs_changed()
136136 if show .message_index ~= omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .show_message_index then
137137 show .message_index = omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .show_message_index
138138 end
139- if cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp_format ~= omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .timestamp_format then
140- cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp_format = omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .timestamp_format
139+ if cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset_format ~= omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .time_offset_format then
140+ cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset_format = omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .time_offset_format
141141 end
142142 if cboe_c1options_auctionfeed_pitch_v1_1_1 .utc_offset_hours ~= omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .utc_offset_hours then
143143 cboe_c1options_auctionfeed_pitch_v1_1_1 .utc_offset_hours = omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .prefs .utc_offset_hours
@@ -1131,44 +1131,44 @@ end
11311131cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp = {}
11321132
11331133-- Translate: Timestamp
1134- cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .translate = function (timestamp , stored_time )
1134+ cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .translate = function (time_offset , stored_time )
11351135 return UInt64 .new (stored_time * 1000000000 + time_offset )
11361136end
11371137
11381138-- Display: Timestamp
1139- cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .display = function (timestamp , stored_time , packet )
1139+ cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .display = function (time_offset , stored_time , packet )
11401140 -- Raw display mode
1141- if cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp_format == 0 then
1142- return " Timestamp: " .. (stored_time * 1000000000 + timestamp )
1141+ if cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset_format == 0 then
1142+ return " Timestamp: " .. (stored_time * 1000000000 + time_offset )
11431143 end
11441144
11451145 -- Full datetime mode (calculate from capture date + UTC offset)
1146- if cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp_format == 2 and packet then
1146+ if cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset_format == 2 and packet then
11471147 local capture_time = type (packet .abs_ts ) == " number" and packet .abs_ts or packet .abs_ts :tonumber ()
11481148 local utc_offset_seconds = cboe_c1options_auctionfeed_pitch_v1_1_1 .utc_offset_hours * 3600
11491149 local local_midnight = math.floor ((capture_time - utc_offset_seconds ) / 86400 ) * 86400
11501150 local full_seconds = local_midnight + stored_time
11511151
1152- return " Timestamp: " .. os.date (" !%Y-%m-%d %H:%M:%S." , full_seconds ).. string.format (" %09d" , timestamp )
1152+ return " Timestamp: " .. os.date (" !%Y-%m-%d %H:%M:%S." , full_seconds ).. string.format (" %09d" , time_offset )
11531153 end
11541154
11551155 -- Time of day mode
1156- return " Timestamp: " .. os.date (" !%H:%M:%S." , stored_time ).. string.format (" %09d" , timestamp )
1156+ return " Timestamp: " .. os.date (" !%H:%M:%S." , stored_time ).. string.format (" %09d" , time_offset )
11571157end
11581158
11591159-- Composite: Timestamp
11601160cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .composite = function (buffer , offset , stored_time , packet , parent )
1161- local length = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .size
1161+ local length = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .size
11621162 local range = buffer (offset , length )
1163- local timestamp = range :le_uint ()
1164- local value = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .translate (timestamp , stored_time )
1165- local display = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .display (timestamp , stored_time , packet )
1163+ local time_offset = range :le_uint ()
1164+ local value = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .translate (time_offset , stored_time )
1165+ local display = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .display (time_offset , stored_time , packet )
11661166 parent = parent :add (omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .fields .timestamp , range , value , display )
11671167
11681168 cboe_c1options_auctionfeed_pitch_v1_1_1 .time .generated (stored_time , range , packet , parent )
11691169
1170- display = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .display (timestamp )
1171- parent :add (omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .fields .timestamp , range , timestamp , display )
1170+ display = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .display (time_offset )
1171+ parent :add (omi_cboe_c1options_auctionfeed_pitch_v1_1_1 .fields .time_offset , range , time_offset , display )
11721172
11731173 return offset + length , value
11741174end
@@ -1181,7 +1181,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.timestamp.dissect = function(buffer, off
11811181 return cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .composite (buffer , offset , stored_time , packet , parent )
11821182 end
11831183
1184- return cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , offset , packet , parent )
1184+ return cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , offset , packet , parent )
11851185end
11861186
11871187
@@ -1301,7 +1301,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.width_update_message.fields = function(b
13011301 local index = offset
13021302
13031303 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1304- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1304+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
13051305
13061306 -- Underlying: 8 Byte Ascii String
13071307 index , underlying = cboe_c1options_auctionfeed_pitch_v1_1_1 .underlying .dissect (buffer , index , packet , parent )
@@ -1354,7 +1354,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.auction_summary_message.fields = functio
13541354 local index = offset
13551355
13561356 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1357- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1357+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
13581358
13591359 -- Symbol Extended: 8 Byte Ascii String
13601360 index , symbol_extended = cboe_c1options_auctionfeed_pitch_v1_1_1 .symbol_extended .dissect (buffer , index , packet , parent )
@@ -1414,7 +1414,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.auction_update_message.fields = function
14141414 local index = offset
14151415
14161416 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1417- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1417+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
14181418
14191419 -- Symbol Extended: 8 Byte Ascii String
14201420 index , symbol_extended = cboe_c1options_auctionfeed_pitch_v1_1_1 .symbol_extended .dissect (buffer , index , packet , parent )
@@ -1482,7 +1482,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.auction_trade_message.fields = function(
14821482 local index = offset
14831483
14841484 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1485- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1485+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
14861486
14871487 -- Auction Id: 8 Byte Unsigned Fixed Width Integer
14881488 index , auction_id = cboe_c1options_auctionfeed_pitch_v1_1_1 .auction_id .dissect (buffer , index , packet , parent )
@@ -1535,7 +1535,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.auction_cancel_message.fields = function
15351535 local index = offset
15361536
15371537 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1538- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1538+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
15391539
15401540 -- Auction Id: 8 Byte Unsigned Fixed Width Integer
15411541 index , auction_id = cboe_c1options_auctionfeed_pitch_v1_1_1 .auction_id .dissect (buffer , index , packet , parent )
@@ -1588,7 +1588,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.auction_notification_message.fields = fu
15881588 local index = offset
15891589
15901590 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1591- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1591+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
15921592
15931593 -- Symbol: 6 Byte Ascii String
15941594 index , symbol = cboe_c1options_auctionfeed_pitch_v1_1_1 .symbol .dissect (buffer , index , packet , parent )
@@ -1658,7 +1658,7 @@ cboe_c1options_auctionfeed_pitch_v1_1_1.unit_clear_message.fields = function(buf
16581658 local index = offset
16591659
16601660 -- Time Offset: 4 Byte Unsigned Fixed Width Integer
1661- index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .time_offset .dissect (buffer , index , packet , parent )
1661+ index , time_offset = cboe_c1options_auctionfeed_pitch_v1_1_1 .timestamp .dissect (buffer , index , packet , parent )
16621662
16631663 return index
16641664end
0 commit comments