Data Insight Tool¶
              CAGetThread(parent=None, address='')
¶
    
              Bases: QThread
Thread for making a CA get request to the given address. This is used to get the description of the curve.
Source code in trace/widgets/data_insight_tool.py
                    62 63 64 65  |  | 
            run()
¶
    Get the value for the given address. Interruptable via the stop_flag. Does not attempt to emit the PV Value if interrupted.
Source code in trace/widgets/data_insight_tool.py
              67 68 69 70 71 72 73 74 75 76 77 78 79  |  | 
            stop()
¶
    Set the stop flag
Source code in trace/widgets/data_insight_tool.py
              81 82 83  |  | 
              DataVisualizationModel(parent=None)
¶
    
              Bases: QAbstractTableModel
Table Model for fetching and storing the data for a given curve on the model. Gathers live data directly from the curve, but makes an HTTP request to the Archiver Appliance
Source code in trace/widgets/data_insight_tool.py
                    95 96 97 98 99 100 101 102 103 104 105  |  | 
            rowCount(index=QModelIndex())
¶
    Return the row count of the table
Source code in trace/widgets/data_insight_tool.py
              107 108 109 110 111  |  | 
            columnCount(index=QModelIndex())
¶
    Return the column count of the table
Source code in trace/widgets/data_insight_tool.py
              113 114 115 116 117  |  | 
            data(index, role=Qt.DisplayRole)
¶
    Return the data for the associated role. Currently only supporting DisplayRole.
Source code in trace/widgets/data_insight_tool.py
              119 120 121 122 123 124 125 126  |  | 
            headerData(section, orientation, role=Qt.DisplayRole)
¶
    Return data associated with the header
Source code in trace/widgets/data_insight_tool.py
              128 129 130 131  |  | 
            set_description(description)
¶
    Set the description of the curve. This is called when the CAGetThread emits a result_ready signal.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                description
             | 
            
                  str
             | 
            
               The description of the curve  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              133 134 135 136 137 138 139 140 141 142 143  |  | 
            set_all_data(curve_item, x_range)
¶
    Set the model's data for the given curve and the given time range. This function determines what kind of data should be saved and prompts the methods for setting live or archived data as necessary. This also saves the meta data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curve_item
             | 
            
                  TimePlotCurveItem
             | 
            
               The curve for the model to collect and store data on  | 
            required | 
                x_range
             | 
            
                  list[int] | tuple[int, int]
             | 
            
               The time range to collect and store data between  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184  |  | 
            set_live_data(curve_item, x_range)
¶
    Set the live data for the given curve in the given time range. Appends rows within the time range to the end of the model's dataframe.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                curve_item
             | 
            
                  TimePlotCurveItem
             | 
            
               The curve for the model to collect and store data on  | 
            required | 
                x_range
             | 
            
                  list[int] | tuple[int, int]
             | 
            
               The time range to collect and store data between  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215  |  | 
            request_archive_data(pv_name, x_range)
¶
    Request data from the Archiver Appliance for the given PV and time range. Only gets raw data, never optimized. Ends early if there is no environment variable PYDM_ARCHIVER_URL, which would contain the url for the Archiver Appliance.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                pv_name
             | 
            
                  str
             | 
            
               The PV address to request data for  | 
            required | 
                x_range
             | 
            
                  list[int] | tuple[int, int]
             | 
            
               The time range to collect and store data between  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249  |  | 
            recieve_archive_reply(reply)
¶
    Process the recieved reply to the request made in request_archive_data. Unpack the data and call set_archive_data. Mostly checks if the reply contains an error.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                reply
             | 
            
                  QNetworkReply
             | 
            
               Reply to the network request made in request_archive_data  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274  |  | 
            set_archive_data(data_dict)
¶
    Set the live data for the given curve in the given time range. Appends rows within the time range to the end of the model's dataframe.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                data_dict
             | 
            
                  dict
             | 
            
               Dictionary containing all data to be added to the model's dataframe  | 
            required | 
Source code in trace/widgets/data_insight_tool.py
              276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302  |  | 
            export_data(file_path, extension)
¶
    Export the model's data to the given file. Adds metadata to the top of the exported file with the curve's address, unit (if any), and description.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                file_path
             | 
            
                  Path
             | 
            
               The path of the file to be (over)written with the exported data  | 
            required | 
                extension
             | 
            
                  str
             | 
            
               The extension of the file to be (over)written  | 
            required | 
Raises:
| Type | Description | 
|---|---|
                  ValueError
             | 
            
               Raised when export is requested without data in the model, or when an invalid file format is requested for export  | 
          
                  IsADirectoryError
             | 
            
               Raised when the provided filepath is a directory  | 
          
Source code in trace/widgets/data_insight_tool.py
              304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349  |  | 
              DataInsightTool(parent, plot=None)
¶
    
              Bases: QWidget
The Data Insight Tool is a standalone widget that allows users to display all archive and live data on the plot for any given curve. Users are also able to export the raw data from this tool.
Source code in trace/widgets/data_insight_tool.py
                    358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373  |  | 
            plot
  
      property
      writable
  
¶
    Return the plot associated with this widget
            layout_init()
¶
    Initialize the layout of the Data Insight Tool widget.
Source code in trace/widgets/data_insight_tool.py
              388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420  |  | 
            set_meta_data()
¶
    Populate the meta_data_label with the curve's unit (if any) and description.
Source code in trace/widgets/data_insight_tool.py
              422 423 424 425 426 427 428 429  |  | 
            combobox_to_curve(combobox_ind)
¶
    Convert an index for the pv_select_box combobox to the corresponding curve item from the curves model.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                combobox_ind
             | 
            
                  int
             | 
            
               The index for pv_select_box  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  ArchivePlotCurveItem
             | 
            
               The curve item that corresponds to the PV chosen on the combobox  | 
          
Source code in trace/widgets/data_insight_tool.py
              431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447  |  | 
            update_pv_select_box()
¶
    Populate the pv_select_box with all curves in the plot. This is called when the plot is updated.
Source code in trace/widgets/data_insight_tool.py
              449 450 451 452 453 454 455 456 457 458  |  | 
            export_data_to_file()
¶
    Prompt the user to select a file to export data to then prompt the DataVisualizationModel to export its data to the selected file.
Source code in trace/widgets/data_insight_tool.py
              460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480  |  | 
            get_data(combobox_index=-1)
¶
    Prompt the DataVisualizationModel to fetch and save the data for the curve chosen by the user for the time range on the associated plot.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                combobox_index
             | 
            
                  int
             | 
            
               The index in the pv_select_box for the user selected curve, by default -1  | 
            
                  -1
             | 
          
Source code in trace/widgets/data_insight_tool.py
              482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502  |  |