Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
2d0d246b
Commit
2d0d246b
authored
Apr 13, 2023
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools: add estimated link length to wr_mon (and web interface)
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
3bc6a027
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
17 deletions
+40
-17
wr_mon.c
userspace/tools/wr_mon.c
+40
-17
No files found.
userspace/tools/wr_mon.c
View file @
2d0d246b
...
@@ -910,15 +910,6 @@ void show_servo(struct inst_servo_t *servo, int alive)
...
@@ -910,15 +910,6 @@ void show_servo(struct inst_servo_t *servo, int alive)
term_cprintf
(
C_WHITE
,
"%s
\n
"
,
optimized_pp_time_toString
(
delayMM
,
buf
));
term_cprintf
(
C_WHITE
,
"%s
\n
"
,
optimized_pp_time_toString
(
delayMM
,
buf
));
}
}
//term_cprintf(C_BLUE, "Estimated link length: ");
/* (RTT - deltas) / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4827
*/
//term_cprintf(C_WHITE, "%10.2f meters\n",
// crtt / 2 / 1e6 * 299.792458 / 1.4827);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"delayAsymmetry : "
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"delayAsymmetry : "
);
...
@@ -950,6 +941,17 @@ void show_servo(struct inst_servo_t *servo, int alive)
...
@@ -950,6 +941,17 @@ void show_servo(struct inst_servo_t *servo, int alive)
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Skew : "
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Skew : "
);
term_cprintf
(
C_WHITE
,
"%16.3f nsec
\n
"
,
wr_servo
->
skew_ps
/
1000
.
0
);
term_cprintf
(
C_WHITE
,
"%16.3f nsec
\n
"
,
wr_servo
->
skew_ps
/
1000
.
0
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Estimated link len: "
);
/* crtt / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4688.
For different wavelengths this value will be different
Please note that this value is just an estimation.
*/
term_cprintf
(
C_WHITE
,
"%10.3f meters
\n
"
,
wr_servo
->
delayMM_ps
/
2
/
1e6
*
299
.
792458
/
1
.
4688
);
}
}
if
(
l1e_servo
)
{
if
(
l1e_servo
)
{
...
@@ -958,6 +960,17 @@ void show_servo(struct inst_servo_t *servo, int alive)
...
@@ -958,6 +960,17 @@ void show_servo(struct inst_servo_t *servo, int alive)
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Skew : "
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Skew : "
);
term_cprintf
(
C_WHITE
,
"%16.3f nsec
\n
"
,
l1e_servo
->
skew_ps
/
1000
.
0
);
term_cprintf
(
C_WHITE
,
"%16.3f nsec
\n
"
,
l1e_servo
->
skew_ps
/
1000
.
0
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Estimated link len: "
);
/* crtt / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4688.
For different wavelengths this value will be different
Please note that this value is just an estimation.
*/
term_cprintf
(
C_WHITE
,
"%10.3f meters
\n
"
,
l1e_servo
->
delayMM_ps
/
2
/
1e6
*
299
.
792458
/
1
.
4688
);
}
}
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Update counter : "
);
term_cprintf
(
C_CYAN
,
" | "
);
term_cprintf
(
C_BLUE
,
"Update counter : "
);
term_cprintf
(
C_WHITE
,
"%16u times
\n
"
,
servo
->
servo_snapshot
.
update_count
);
term_cprintf
(
C_WHITE
,
"%16u times
\n
"
,
servo
->
servo_snapshot
.
update_count
);
...
@@ -999,21 +1012,31 @@ void show_servo(struct inst_servo_t *servo, int alive)
...
@@ -999,21 +1012,31 @@ void show_servo(struct inst_servo_t *servo, int alive)
printf
(
"drxm:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_rxm
,
buf
));
printf
(
"drxm:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_rxm
,
buf
));
printf
(
"dtxs:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_txs
,
buf
));
printf
(
"dtxs:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_txs
,
buf
));
printf
(
"drxs:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_rxs
,
buf
));
printf
(
"drxs:%s "
,
timeToString
(
&
wr_servo_ext
->
delta_rxs
,
buf
));
/* (RTT - deltas) / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4827
*/
//printf("ll:%d ",
// (int) (crtt / 2 / 1e6 * 299.792458 / 1.4827 * 100));
printf
(
"crtt:%lld "
,
wr_servo
->
delayMM_ps
);
printf
(
"crtt:%lld "
,
wr_servo
->
delayMM_ps
);
printf
(
"setp:%d "
,
wr_servo
->
cur_setpoint_ps
);
printf
(
"setp:%d "
,
wr_servo
->
cur_setpoint_ps
);
/* crtt / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4688.
For different wavelengths this value will be different
Please note that this value is just an estimation.
*/
printf
(
"ll:%.3f "
,
wr_servo
->
delayMM_ps
/
2
/
1e6
*
299
.
792458
/
1
.
4688
);
}
}
if
(
l1e_servo
)
{
if
(
l1e_servo
)
{
printf
(
"lock:%i "
,
l1e_servo
->
tracking_enabled
);
printf
(
"lock:%i "
,
l1e_servo
->
tracking_enabled
);
printf
(
"crtt:%lld "
,
l1e_servo
->
delayMM_ps
);
printf
(
"crtt:%lld "
,
l1e_servo
->
delayMM_ps
);
printf
(
"setp:%d "
,
l1e_servo
->
cur_setpoint_ps
);
printf
(
"setp:%d "
,
l1e_servo
->
cur_setpoint_ps
);
/* crtt / 2 * c / ri
c = 299792458 - speed of light in m/s
ri = 1.4682 - refractive index for fiber g.652. However,
experimental measurements using long (~5km) and
short (few m) fibers gave a value 1.4688.
For different wavelengths this value will be different
Please note that this value is just an estimation.
*/
printf
(
"ll:%.3f "
,
l1e_servo
->
delayMM_ps
/
2
/
1e6
*
299
.
792458
/
1
.
4688
);
}
}
printf
(
"asym:%s "
,
timeIntervalToString
(
servo
->
delayAsymmetry
,
buf
));
printf
(
"asym:%s "
,
timeIntervalToString
(
servo
->
delayAsymmetry
,
buf
));
printf
(
"cko:%s "
,
timeIntervalToString
(
servo
->
offsetFromMaster
,
buf
));
printf
(
"cko:%s "
,
timeIntervalToString
(
servo
->
offsetFromMaster
,
buf
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment