Skip to content

Commit 78b5dfb

Browse files
authored
Rename SynchronizationPTP's time_source to leader_time_source (#169)
1 parent 54d1afc commit 78b5dfb

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

src/main/python/camdkit/examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def _get_complete_dynamic_clip():
200200
leader_identity="00:11:22:33:44:55",
201201
leader_priorities=SynchronizationPTPPriorities(128, 128),
202202
leader_accuracy=0.00000005,
203-
time_source=PTPLeaderTimeSource.GNSS,
203+
leader_time_source=PTPLeaderTimeSource.GNSS,
204204
mean_path_delay=0.000123,
205205
vlan=100)
206206
),)

src/main/python/camdkit/timing_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ class SynchronizationPTP(CompatibleBaseModel):
139139
leader_accuracy: Annotated[NonNegativeFloat,
140140
Field(alias="leaderAccuracy")]
141141

142-
time_source: Annotated[PTPLeaderTimeSource | None,
143-
Field(alias="timeSource")] = None
142+
leader_time_source: Annotated[PTPLeaderTimeSource | None,
143+
Field(alias="leaderTimeSource")] = None
144144

145145
mean_path_delay: Annotated[NonNegativeFloat,
146146
Field(alias="meanPathDelay")]
@@ -263,7 +263,7 @@ class Timing(CompatibleBaseModel):
263263
following:
264264
- "vlan": Integer representing the VLAN ID for PTP traffic (e.g., 100 for
265265
VLAN 100)
266-
- "timeSource": Indicates the leader's source of time, such as GNSS, atomic
266+
- "leaderTimeSource": Indicates the leader's source of time, such as GNSS, atomic
267267
clock, or NTP
268268
- "genlock": The tracking device has an external black/burst or
269269
tri-level analog sync signal that is triggering the capture of

src/test/python/test_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_serialize(self):
100100
leader_identity="00:11:22:33:44:55",
101101
leader_priorities=SynchronizationPTPPriorities(128, 128),
102102
leader_accuracy=0.1,
103-
time_source=PTPLeaderTimeSource.GNSS,
103+
leader_time_source=PTPLeaderTimeSource.GNSS,
104104
mean_path_delay=0.2,
105105
vlan=100),
106106
source=SynchronizationSourceEnum.PTP)
@@ -202,7 +202,7 @@ def test_serialize(self):
202202
"leaderIdentity": "00:11:22:33:44:55",
203203
"leaderPriorities": {"priority1": 128, "priority2": 128},
204204
"leaderAccuracy": 0.1,
205-
"timeSource": PTPLeaderTimeSource.GNSS.value,
205+
"leaderTimeSource": PTPLeaderTimeSource.GNSS.value,
206206
"meanPathDelay": 0.2,
207207
"vlan": 100},
208208
"offsets": {"translation":1.0, "rotation":2.0, "lensEncoders":3.0 } }

src/test/python/test_schema_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# with open("/tmp/sorted_current_schema_file.json", "w") as scusf:
2727
# json.dump(current_schema, scusf, indent=4, sort_keys=True)
2828
# self.assertEqual(classic_schema, current_schema)
29-
30-
29+
#
30+
#
3131
# if __name__ == '__main__':
3232
# unittest.main()

src/test/resources/classic/examples/complete_dynamic_example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"leaderAccuracy": 5e-08,
125125
"meanPathDelay": 0.000123,
126126
"vlan": 100,
127-
"timeSource": "GNSS"
127+
"leaderTimeSource": "GNSS"
128128
}
129129
},
130130
"timecode": {

src/test/resources/classic/examples/complete_static_example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"leaderAccuracy": 5e-08,
172172
"meanPathDelay": 0.000123,
173173
"vlan": 100,
174-
"timeSource": "GNSS"
174+
"leaderTimeSource": "GNSS"
175175
}
176176
},
177177
"timecode": {

src/test/resources/classic/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
"type": "number",
461461
"minimum": 0.0
462462
},
463-
"timeSource": {
463+
"leaderTimeSource": {
464464
"enum": [
465465
"GNSS",
466466
"Atomic clock",
@@ -494,7 +494,7 @@
494494
"source"
495495
],
496496
"additionalProperties": false,
497-
"description": "Object describing how the tracking device is synchronized for this\nsample.\n\nfrequency: The frequency of a synchronization signal.This may differ from\nthe sample frame rate for example in a genlocked tracking device. This is\nnot required if the synchronization source is PTP or NTP.\nlocked: Is the tracking device locked to the synchronization source\noffsets: Offsets in seconds between sync and sample. Critical for e.g.\nframe remapping, or when using different data sources for\nposition/rotation and lens encoding\npresent: Is the synchronization source present (a synchronization\nsource can be present but not locked if frame rates differ for\nexample)\nptp: If the synchronization source is a PTP leader, then this object\ncontains:\n- \"profile\": Specifies the PTP profile in use. This defines the operational\nrules and parameters for synchronization. For example \"SMPTE ST2059-2:2021\"\nfor SMPTE 2110 based systems, or \"IEEE Std 1588-2019\" or\n\"IEEE Std 802.1AS-2020\" for industrial applications\n- \"domain\": Identifies the PTP domain the device belongs to. Devices in the\nsame domain can synchronize with each other\n- \"leaderIdentity\": The unique identifier (usually MAC address) of the\ncurrent PTP leader (grandmaster)\n- \"leaderPriorities\": The priority values of the leader used in the Best\nMaster Clock Algorithm (BMCA). Lower values indicate higher priority\n- \"priority1\": Static priority set by the administrator\n- \"priority2\": Dynamic priority based on the leader's role or clock quality\n- \"leaderAccuracy\": The timing offset in seconds from the sample timestamp\nto the PTP timestamp\n- \"meanPathDelay\": The average round-trip delay between the device and the\nPTP leader, measured in seconds\nsource: The source of synchronization must be defined as one of the\nfollowing:\n- \"vlan\": Integer representing the VLAN ID for PTP traffic (e.g., 100 for\nVLAN 100)\n- \"timeSource\": Indicates the leader's source of time, such as GNSS, atomic\nclock, or NTP\n- \"genlock\": The tracking device has an external black/burst or\ntri-level analog sync signal that is triggering the capture of\ntracking samples\n- \"videoIn\": The tracking device has an external video signal that is\ntriggering the capture of tracking samples\n- \"ptp\": The tracking device is locked to a PTP leader\n- \"ntp\": The tracking device is locked to an NTP server\n"
497+
"description": "Object describing how the tracking device is synchronized for this\nsample.\n\nfrequency: The frequency of a synchronization signal.This may differ from\nthe sample frame rate for example in a genlocked tracking device. This is\nnot required if the synchronization source is PTP or NTP.\nlocked: Is the tracking device locked to the synchronization source\noffsets: Offsets in seconds between sync and sample. Critical for e.g.\nframe remapping, or when using different data sources for\nposition/rotation and lens encoding\npresent: Is the synchronization source present (a synchronization\nsource can be present but not locked if frame rates differ for\nexample)\nptp: If the synchronization source is a PTP leader, then this object\ncontains:\n- \"profile\": Specifies the PTP profile in use. This defines the operational\nrules and parameters for synchronization. For example \"SMPTE ST2059-2:2021\"\nfor SMPTE 2110 based systems, or \"IEEE Std 1588-2019\" or\n\"IEEE Std 802.1AS-2020\" for industrial applications\n- \"domain\": Identifies the PTP domain the device belongs to. Devices in the\nsame domain can synchronize with each other\n- \"leaderIdentity\": The unique identifier (usually MAC address) of the\ncurrent PTP leader (grandmaster)\n- \"leaderPriorities\": The priority values of the leader used in the Best\nMaster Clock Algorithm (BMCA). Lower values indicate higher priority\n- \"priority1\": Static priority set by the administrator\n- \"priority2\": Dynamic priority based on the leader's role or clock quality\n- \"leaderAccuracy\": The timing offset in seconds from the sample timestamp\nto the PTP timestamp\n- \"meanPathDelay\": The average round-trip delay between the device and the\nPTP leader, measured in seconds\nsource: The source of synchronization must be defined as one of the\nfollowing:\n- \"vlan\": Integer representing the VLAN ID for PTP traffic (e.g., 100 for\nVLAN 100)\n- \"leaderTimeSource\": Indicates the leader's source of time, such as GNSS, atomic\nclock, or NTP\n- \"genlock\": The tracking device has an external black/burst or\ntri-level analog sync signal that is triggering the capture of\ntracking samples\n- \"videoIn\": The tracking device has an external video signal that is\ntriggering the capture of tracking samples\n- \"ptp\": The tracking device is locked to a PTP leader\n- \"ntp\": The tracking device is locked to an NTP server\n"
498498
},
499499
"timecode": {
500500
"type": "object",

src/test/resources/classic/subschemas/timing.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
},
8383
"synchronization": {
8484
"additionalProperties": false,
85-
"description": "Object describing how the tracking device is synchronized for this\nsample.\n\nfrequency: The frequency of a synchronization signal.This may differ from\nthe sample frame rate for example in a genlocked tracking device. This is\nnot required if the synchronization source is PTP or NTP.\nlocked: Is the tracking device locked to the synchronization source\noffsets: Offsets in seconds between sync and sample. Critical for e.g.\nframe remapping, or when using different data sources for\nposition/rotation and lens encoding\npresent: Is the synchronization source present (a synchronization\nsource can be present but not locked if frame rates differ for\nexample)\nptp: If the synchronization source is a PTP leader, then this object\ncontains:\n- \"profile\": Specifies the PTP profile in use. This defines the operational\nrules and parameters for synchronization. For example \"SMPTE ST2059-2:2021\"\nfor SMPTE 2110 based systems, or \"IEEE Std 1588-2019\" or\n\"IEEE Std 802.1AS-2020\" for industrial applications\n- \"domain\": Identifies the PTP domain the device belongs to. Devices in the\nsame domain can synchronize with each other\n- \"leaderIdentity\": The unique identifier (usually MAC address) of the\ncurrent PTP leader (grandmaster)\n- \"leaderPriorities\": The priority values of the leader used in the Best\nMaster Clock Algorithm (BMCA). Lower values indicate higher priority\n- \"priority1\": Static priority set by the administrator\n- \"priority2\": Dynamic priority based on the leader's role or clock quality\n- \"leaderAccuracy\": The timing offset in seconds from the sample timestamp\nto the PTP timestamp\n- \"meanPathDelay\": The average round-trip delay between the device and the\nPTP leader, measured in seconds\nsource: The source of synchronization must be defined as one of the\nfollowing:\n- \"vlan\": Integer representing the VLAN ID for PTP traffic (e.g., 100 for\nVLAN 100)\n- \"timeSource\": Indicates the leader's source of time, such as GNSS, atomic\nclock, or NTP\n- \"genlock\": The tracking device has an external black/burst or\ntri-level analog sync signal that is triggering the capture of\ntracking samples\n- \"videoIn\": The tracking device has an external video signal that is\ntriggering the capture of tracking samples\n- \"ptp\": The tracking device is locked to a PTP leader\n- \"ntp\": The tracking device is locked to an NTP server\n",
85+
"description": "Object describing how the tracking device is synchronized for this\nsample.\n\nfrequency: The frequency of a synchronization signal.This may differ from\nthe sample frame rate for example in a genlocked tracking device. This is\nnot required if the synchronization source is PTP or NTP.\nlocked: Is the tracking device locked to the synchronization source\noffsets: Offsets in seconds between sync and sample. Critical for e.g.\nframe remapping, or when using different data sources for\nposition/rotation and lens encoding\npresent: Is the synchronization source present (a synchronization\nsource can be present but not locked if frame rates differ for\nexample)\nptp: If the synchronization source is a PTP leader, then this object\ncontains:\n- \"profile\": Specifies the PTP profile in use. This defines the operational\nrules and parameters for synchronization. For example \"SMPTE ST2059-2:2021\"\nfor SMPTE 2110 based systems, or \"IEEE Std 1588-2019\" or\n\"IEEE Std 802.1AS-2020\" for industrial applications\n- \"domain\": Identifies the PTP domain the device belongs to. Devices in the\nsame domain can synchronize with each other\n- \"leaderIdentity\": The unique identifier (usually MAC address) of the\ncurrent PTP leader (grandmaster)\n- \"leaderPriorities\": The priority values of the leader used in the Best\nMaster Clock Algorithm (BMCA). Lower values indicate higher priority\n- \"priority1\": Static priority set by the administrator\n- \"priority2\": Dynamic priority based on the leader's role or clock quality\n- \"leaderAccuracy\": The timing offset in seconds from the sample timestamp\nto the PTP timestamp\n- \"meanPathDelay\": The average round-trip delay between the device and the\nPTP leader, measured in seconds\nsource: The source of synchronization must be defined as one of the\nfollowing:\n- \"vlan\": Integer representing the VLAN ID for PTP traffic (e.g., 100 for\nVLAN 100)\n- \"leaderTimeSource\": Indicates the leader's source of time, such as GNSS, atomic\nclock, or NTP\n- \"genlock\": The tracking device has an external black/burst or\ntri-level analog sync signal that is triggering the capture of\ntracking samples\n- \"videoIn\": The tracking device has an external video signal that is\ntriggering the capture of tracking samples\n- \"ptp\": The tracking device is locked to a PTP leader\n- \"ntp\": The tracking device is locked to an NTP server\n",
8686
"properties": {
8787
"frequency": {
8888
"additionalProperties": false,
@@ -164,6 +164,14 @@
164164
],
165165
"type": "object"
166166
},
167+
"leaderTimeSource": {
168+
"enum": [
169+
"GNSS",
170+
"Atomic clock",
171+
"NTP"
172+
],
173+
"type": "string"
174+
},
167175
"meanPathDelay": {
168176
"minimum": 0.0,
169177
"type": "number"
@@ -176,14 +184,6 @@
176184
],
177185
"type": "string"
178186
},
179-
"timeSource": {
180-
"enum": [
181-
"GNSS",
182-
"Atomic clock",
183-
"NTP"
184-
],
185-
"type": "string"
186-
},
187187
"vlan": {
188188
"maximum": 4294967295,
189189
"minimum": 0,

0 commit comments

Comments
 (0)