Control Panel¶
              ControlPanel(theme_manager=None)
¶
    
              Bases: QWidget
Main control panel widget for managing plot axes and curves.
This widget provides the primary interface for adding, configuring, and managing plot axes and their associated curves. It includes functionality for PV search, formula creation, and curve management.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                theme_manager
             | 
            
                  ThemeManager
             | 
            
               The theme manager for handling UI theming  | 
            
                  None
             | 
          
Source code in trace/widgets/control_panel.py
                    39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101  |  | 
            plot
  
      property
      writable
  
¶
    Get the associated plot widget.
            curve_dict
  
      property
  
¶
    Return dictionary of curves with PV keys.
            curve_item_dict
  
      property
  
¶
    Returns dictionary of curves on plot with associated pvname, axisItem, and curveItem
            update_icons()
¶
    Update all icons based on current theme.
Source code in trace/widgets/control_panel.py
              103 104 105 106 107 108 109 110 111  |  | 
            on_theme_changed(theme)
¶
    Handle theme changes by updating icons.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                theme
             | 
            
                  Theme
             | 
            
               The new theme, unused  | 
            required | 
Source code in trace/widgets/control_panel.py
              113 114 115 116 117 118 119 120 121  |  | 
            minimumSizeHint()
¶
    Return the minimum size hint for the control panel.
Source code in trace/widgets/control_panel.py
              123 124 125 126 127  |  | 
            add_curve_from_line_edit()
¶
    Add a curve from the PV line edit input.
Source code in trace/widgets/control_panel.py
              129 130 131 132 133  |  | 
            search_pv()
¶
    Show or activate the PV search widget.
Source code in trace/widgets/control_panel.py
              156 157 158 159 160 161 162  |  | 
            show_formula_dialog()
¶
    Show the formula dialog pop-up.
Source code in trace/widgets/control_panel.py
              164 165 166 167 168 169 170  |  | 
            handle_formula_accepted(formula)
¶
    Handle the formula accepted from the formula dialog.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                formula
             | 
            
                  str
             | 
            
               The accepted formula string  | 
            required | 
Source code in trace/widgets/control_panel.py
              172 173 174 175 176 177 178 179 180 181 182  |  | 
            cleanup_duplicate_curves()
¶
    Remove duplicate entries in curve dictionary.
Source code in trace/widgets/control_panel.py
              184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200  |  | 
            add_curves(pvs)
¶
    Add multiple curves from a list of PV names.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                pvs
             | 
            
                  list[str]
             | 
            
               List of PV names to add as curves  | 
            required | 
Source code in trace/widgets/control_panel.py
              229 230 231 232 233 234 235 236 237 238  |  | 
            add_axis_item(axis)
¶
    Add an existing AxisItem to the plot.
Source code in trace/widgets/control_panel.py
              253 254 255 256 257 258 259 260 261 262  |  | 
            match_axis_tick_font(axis)
¶
    Matches the axis' tick font to the X-Axis of the plot. Only necessary if the user has changed the tick font of the plot's axes.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                axis
             | 
            
                  BasePlotAxisItem
             | 
            
               The axis to match the tick font for.  | 
            required | 
Source code in trace/widgets/control_panel.py
              264 265 266 267 268 269 270 271 272 273 274  |  | 
            get_axis_item(axis_name)
¶
    Get an AxisItem by its name.
Source code in trace/widgets/control_panel.py
              276 277 278 279 280 281 282  |  | 
            get_last_axis_item()
¶
    Get the last AxisItem in the list.
Source code in trace/widgets/control_panel.py
              284 285 286 287 288 289 290  |  | 
            set_curve_palette(palette_name, apply=False)
¶
    Set the default palette for new curves.
Parameters: palette_name (str): name of selected palette apply (bool): If true, apply palette to exiting curves
Source code in trace/widgets/control_panel.py
              292 293 294 295 296 297 298 299 300 301 302 303 304 305  |  | 
            clear_all()
¶
    Clear all axes and curves from the plot and control panel.
Source code in trace/widgets/control_panel.py
              341 342 343 344 345 346  |  | 
            clear_curves()
¶
    Clear all curves from the plot and control panel.
Source code in trace/widgets/control_panel.py
              348 349 350 351 352 353  |  | 
            set_axes(axes=None)
¶
    Given a list of dictionaries containing axis data, clear the plot's axes, and set all new axes based on the provided axis data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                axes
             | 
            
                  List[Dict]
             | 
            
               Axis properties to be set for all new axes on the plot  | 
            
                  None
             | 
          
Source code in trace/widgets/control_panel.py
              355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383  |  | 
            set_curves(curves=None)
¶
    Given a list of dictionaries containing curve data, clear the plot's curves, and set all new curves based on the provided curve data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curves
             | 
            
                  List[Dict]
             | 
            
               Curve properties to be set for all new curves on the plot  | 
            
                  None
             | 
          
Source code in trace/widgets/control_panel.py
              385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408  |  | 
            move_curve_to_axis(curve_item, target_axis_name)
¶
    Remove a given CurveItem from its current AxisItem and add it to the AxisItem with the given target axis name. If no such AxisItem exists, a new one will be created. Intended to be used for Axes named after a curve's unit.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curve_item
             | 
            
                  CurveItem
             | 
            
               CurveItem to be moved to a new axis.  | 
            required | 
                target_axis_name
             | 
            
                  str
             | 
            
               Name of the target axis to move the CurveItem to.  | 
            required | 
Source code in trace/widgets/control_panel.py
              410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429  |  | 
              AxisItem(plot_axis_item, control_panel=None, theme_manager=None)
¶
    
              Bases: QWidget
Widget for managing a single plot axis and its associated curves.
This widget provides controls for axis configuration including name, range, auto-scaling, and curve management. It supports drag-and-drop for curve reordering and moving curves between axes.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                plot_axis_item
             | 
            
                  BasePlotAxisItem
             | 
            
               The plot axis item to manage  | 
            required | 
                control_panel
             | 
            
                  ControlPanel
             | 
            
               Reference to the parent control panel  | 
            
                  None
             | 
          
                theme_manager
             | 
            
                  ThemeManager
             | 
            
               The theme manager for UI theming  | 
            
                  None
             | 
          
Source code in trace/widgets/control_panel.py
                    447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528  |  | 
            name
  
      property
  
¶
    Get the name of the axis.
            update_icons()
¶
    Update all icons based on current theme
Source code in trace/widgets/control_panel.py
              530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547  |  | 
            on_theme_changed(theme)
¶
    Handle theme changes by updating icons
Source code in trace/widgets/control_panel.py
              549 550 551 552 553 554 555  |  | 
            make_curve_widget(plot_curve_item)
¶
    Create a CurveItem widget for the given plot curve item and add it to this AxisItem.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                plot_curve_item
             | 
            
                  ArchivePlotCurveItem | FormulaCurveItem
             | 
            
               The plot curve item to create a CurveItem for.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  CurveItem
             | 
            
               The created CurveItem widget.  | 
          
Source code in trace/widgets/control_panel.py
              566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590  |  | 
            add_curve(pv, channel_args=None)
¶
    Create a new ArchivePlotCurveItem for the given PV and add it to this AxisItem. Also creates a CurveItem widget for it.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                pv
             | 
            
                  str
             | 
            
               The process variable name to create the curve for.  | 
            required | 
                channel_args
             | 
            
                  dict
             | 
            
               The arguments to pass to the ArchivePlotCurveItem constructor, by default None  | 
            
                  None
             | 
          
Returns:
| Type | Description | 
|---|---|
                  CurveItem
             | 
            
               The created CurveItem widget.  | 
          
Source code in trace/widgets/control_panel.py
              592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623  |  | 
            add_formula_curve(formula)
¶
    Create a new FormulaCurveItem for the given formula and add it to this AxisItem. Also creates a CurveItem widget for it.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                formula
             | 
            
                  str
             | 
            
               The formula to create the curve for. Must start with "f://".  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  CurveItem
             | 
            
               The created CurveItem widget.  | 
          
Source code in trace/widgets/control_panel.py
              625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662  |  | 
            auto_hide_invalid_formula(formula_curve=None)
¶
    Automatically hide a formula when it becomes invalid
Source code in trace/widgets/control_panel.py
              664 665 666 667 668 669 670 671 672 673 674 675  |  | 
            find_curve_item_for_curve(target_curve)
¶
    Find the CurveItem widget that corresponds to a given curve
Source code in trace/widgets/control_panel.py
              741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756  |  | 
            set_curve_palette(palette_name, apply=True)
¶
    Set colors of all curves on this axisItem according to selected palette
Source code in trace/widgets/control_panel.py
              790 791 792 793 794 795 796 797 798 799  |  | 
            remove_curve_item(curve_item, delete_curve=False)
¶
    Removes the given CurveItem from the AxisItem and plot's axis. This is required for moving a CurveItem to a new AxisItem. Can delete the CurveItem and curve if specified. This will remove it from the plot.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curve_item
             | 
            
                  CurveItem
             | 
            
               The CurveItem to be removed from the axis.  | 
            required | 
                delete_curve
             | 
            
                  bool
             | 
            
               If True, the CurveItem will be deleted and the curve removed from the plot entirely. If False, it will just be unlinked from this axis., by default False.  | 
            
                  False
             | 
          
Source code in trace/widgets/control_panel.py
              829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850  |  | 
            add_curve_item(curve_item)
¶
    Add an existing CurveItem to this AxisItem.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curve_item
             | 
            
                  CurveItem
             | 
            
               The CurveItem to be added to this axis.  | 
            required | 
Source code in trace/widgets/control_panel.py
              852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875  |  | 
            clear_curves()
¶
    Clear all curves from this axis item.
Source code in trace/widgets/control_panel.py
              877 878 879 880 881 882  |  | 
              CurveItem(axis_item, source)
¶
    
              Bases: QWidget
Widget for managing a single curve on the plot.
This widget provides controls for curve configuration including name, color, visibility, and connection status. It supports drag-and-drop for moving curves between axes and formula editing for formula curves.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                axis_item
             | 
            
                  AxisItem
             | 
            
               The parent axis item  | 
            required | 
                source
             | 
            
                  ArchivePlotCurveItem or FormulaCurveItem
             | 
            
               The plot curve item to manage  | 
            required | 
Source code in trace/widgets/control_panel.py
                    933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956  |  | 
            plot
  
      property
  
¶
    Get the PlotWidget that this CurveItem belongs to.
            axis_item
  
      property
  
¶
    Get the AxisItem that this CurveItem belongs to.
            setup_layout()
¶
    Setup the layout and widgets for the CurveItem.
Source code in trace/widgets/control_panel.py
              971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026  |  | 
            setup_line_edit()
¶
    Set up the line edit with appropriate behavior for formula vs regular curves
Source code in trace/widgets/control_panel.py
              1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041  |  | 
            update_icons()
¶
    Update all icons based on current theme
Source code in trace/widgets/control_panel.py
              1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057  |  | 
            show_invalid_icon(show=True)
¶
    Show or hide the invalid formula icon overlaid on the line edit
Source code in trace/widgets/control_panel.py
              1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087  |  | 
            on_color_changed(color)
¶
    Handle color change from settings modal
Source code in trace/widgets/control_panel.py
              1108 1109 1110 1111  |  | 
            update_color_toggle()
¶
    Update the color toggle when the curve color changes
Source code in trace/widgets/control_panel.py
              1113 1114 1115 1116 1117  |  | 
            is_formula_curve()
¶
    Check if this is a formula curve.
Returns:
| Type | Description | 
|---|---|
                  bool
             | 
            
               True if this is a formula curve, False otherwise  | 
          
Source code in trace/widgets/control_panel.py
              1129 1130 1131 1132 1133 1134 1135 1136 1137  |  | 
            update_formula()
¶
    Handle formula updates when user edits the formula text.
Source code in trace/widgets/control_panel.py
              1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200  |  |