|
196 | 196 | 'Position', [0.3 1-height 0.6 height], ... |
197 | 197 | 'FontUnits', 'normalized', ... |
198 | 198 | 'FontSize', 0.8, ... |
199 | | - 'String', sprintf('%.3f', T6(1,4)), ... |
| 199 | + 'String', sprintf('%.3f ', T6(1,4)), ... |
200 | 200 | 'TooltipString', 'End-effector x-coordinate', ... |
| 201 | + 'HorizontalAlignment', 'right', ... |
201 | 202 | 'Tag', 'T6'); |
202 | 203 |
|
203 | 204 | % Y |
|
216 | 217 | 'FontUnits', 'normalized', ... |
217 | 218 | 'FontSize', 0.8, ... |
218 | 219 | 'TooltipString', 'End-effector y-coordinate', ... |
219 | | - 'String', sprintf('%.3f', T6(2,4))); |
| 220 | + 'HorizontalAlignment', 'right', ... |
| 221 | + 'String', sprintf('%.3f ', T6(2,4))); |
220 | 222 |
|
221 | 223 | if ~opt.d_2d |
222 | 224 | % Z |
|
235 | 237 | 'FontUnits', 'normalized', ... |
236 | 238 | 'FontSize', 0.8, ... |
237 | 239 | 'TooltipString', 'End-effector z-coordinate', ... |
238 | | - 'String', sprintf('%.3f', T6(3,4))); |
| 240 | + 'HorizontalAlignment', 'right', ... |
| 241 | + 'String', sprintf('%.3f ', T6(3,4))); |
239 | 242 | end |
240 | 243 |
|
241 | 244 | % Orientation |
|
290 | 293 | 'FontUnits', 'normalized', ... |
291 | 294 | 'FontSize', 0.8, ... |
292 | 295 | 'TooltipString', tips{1}, ... |
293 | | - 'String', sprintf('%.3f', 0)); |
| 296 | + 'HorizontalAlignment', 'right', ... |
| 297 | + 'String', sprintf("%.1f ", 0)); |
294 | 298 |
|
295 | 299 | % AY |
296 | 300 | uicontrol(panel, 'Style', 'text', ... |
|
308 | 312 | 'FontUnits', 'normalized', ... |
309 | 313 | 'FontSize', 0.8, ... |
310 | 314 | 'TooltipString', tips{2}, ... |
311 | | - 'String', sprintf('%.3f', 0)); |
| 315 | + 'HorizontalAlignment', 'right', ... |
| 316 | + 'String', sprintf("%.1f ", 0)); |
312 | 317 |
|
313 | 318 | % AZ |
314 | 319 | uicontrol(panel, 'Style', 'text', ... |
|
317 | 322 | 'Position', [0.05 1-7*height 0.2 height], ... |
318 | 323 | 'FontUnits', 'normalized', ... |
319 | 324 | 'FontSize', 0.9, ... |
| 325 | + 'HorizontalAlignment', 'r', ... |
320 | 326 | 'HorizontalAlignment', 'left', ... |
321 | 327 | 'String', labels(3)); |
322 | 328 |
|
|
326 | 332 | 'FontUnits', 'normalized', ... |
327 | 333 | 'FontSize', 0.8, ... |
328 | 334 | 'TooltipString', tips{3}, ... |
329 | | - 'String', sprintf('%.3f', 0)); |
| 335 | + 'HorizontalAlignment', 'right', ... |
| 336 | + 'String', sprintf("%.1f ", 0)); |
330 | 337 | end |
331 | 338 | %---- add buttons |
332 | 339 | uicontrol(panel, 'Style', 'pushbutton', ... |
@@ -400,7 +407,7 @@ function teach_callback(src, name, j, teachhandles) |
400 | 407 | case 'slider' |
401 | 408 | % slider changed, get value and reflect it to edit box |
402 | 409 | newval = get(src, 'Value'); |
403 | | - set(teachhandles.edit(j), 'String', num2str(qscale(j)*newval, 3)); |
| 410 | + set(teachhandles.edit(j), 'String', sprintf("%.1f", qscale(j)*newval)); |
404 | 411 | case 'edit' |
405 | 412 | % edit box changed, get value and reflect it to slider |
406 | 413 | newval = str2double(get(src, 'String')) / qscale(j); |
@@ -462,8 +469,8 @@ function teach_callback(src, name, j, teachhandles) |
462 | 469 | set(teachhandles.t6.r(1), 'String', sprintf('%.3f', orient(1))); |
463 | 470 | else |
464 | 471 | for i=1:3 |
465 | | - set(teachhandles.t6.t(i), 'String', sprintf('%.3f', T6(i,4))); |
466 | | - set(teachhandles.t6.r(i), 'String', sprintf('%.3f', orient(i))); |
| 472 | + set(teachhandles.t6.t(i), 'String', sprintf("%.3f ", T6(i,4))); |
| 473 | + set(teachhandles.t6.r(i), 'String', sprintf("%.1f ", orient(i))); |
467 | 474 | end |
468 | 475 | end |
469 | 476 |
|
|
0 commit comments