epics-containers / pvi

EPICS PV Interface described in YAML
https://epics-containers.github.io/pvi
Apache License 2.0
4 stars 3 forks source link

Split up mixedWidgets #98

Open evalott100 opened 8 months ago

evalott100 commented 8 months ago

@GDYendell

Currently all the file formatters use the same

class WidgetFormatterFactory(BaseModel, Generic[T]):
    header_formatter_cls: Type[LabelWidgetFormatter[T]]
    label_formatter_cls: Type[LabelWidgetFormatter[T]]
    led_formatter_cls: Type[PVWidgetFormatter[T]]
    progress_bar_formatter_cls: Type[PVWidgetFormatter[T]]
    text_read_formatter_cls: Type[PVWidgetFormatter[T]]
    check_box_formatter_cls: Type[PVWidgetFormatter[T]]
    combo_box_formatter_cls: Type[PVWidgetFormatter[T]]
    text_write_formatter_cls: Type[PVWidgetFormatter[T]]
    table_formatter_cls: Type[PVWidgetFormatter[T]]
    action_formatter_cls: Type[ActionWidgetFormatter[T]]
    sub_screen_formatter_cls: Type[SubScreenWidgetFormatter[T]]
    bitfield_formatter_cls: Type[PVWidgetFormatter[T]]
    array_trace_formatter_cls: Type[PVWidgetFormatter[T]]
    button_panel_formatter_cls: Type[PVWidgetFormatter[T]]
    image_read_formatter_cls: Type[PVWidgetFormatter[T]]

despite the fact that they don't all support the same widgets.

This has been circumvented so far by changing the specific <widget>_formatter_cls to make a label instead if that <widget> isn't supported. We should instead fail.

In https://github.com/epics-containers/pvi/pull/83/commits/76862ea52ed83d89e2656447cd569c3778f46f9a , we added new widgets to the mixedWidgets test. All of the different file fomatters use the same mixedWidgets to test, so part of this issue will be giving each different file formatter its own mixedWidgets with only the supported widgets, rather than all three using the same yaml.

GDYendell commented 4 months ago

Actually I meant split into a test for each individual widget, which will enable only testing the widgets that each formatter supports and also make it easier to see differences in the bob files when things break.