13 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:46:03.267118+00:00 | zai-org/GLM-5-FP8 | 1 | ebe4edb1e9d5ba50 |
DataPRO Controls Module Documentation
1. Purpose
This module contains WPF UserControls for the DataPRO application's UI layer, providing specialized controls for fullscreen display, test setup selection, channel code editing, user management, realtime chart display, graph selection, status feedback, and data entry forms. These controls implement the IPageContent interface for page lifecycle management and INotifyPropertyChanged for data binding, serving as the primary UI components within the application's page-based navigation system.
2. Public Interface
GridFullScreen
public partial class GridFullScreen : UserControl, INotifyPropertyChanged
GridFullScreen()- Initializes the control.object MyFullscreenObject- Gets/sets the content displayed in fullscreen mode.event PropertyChangedEventHandler PropertyChanged- Property change notification.void closeButton_Click(object sender, RoutedEventArgs e)- Closes fullscreen and navigates to previous page viaMainWindow.GoToPreviousPage().
CollectSelectControl
public partial class CollectSelectControl : UserControl, IPageContent, INotifyPropertyChanged
CollectSelectControl()- Initializes the control.bool Validate()- Returnstrue(no validation logic implemented).void IPageContent.OnSetActive()- Empty implementation.object GetPageContent()- Loads test setups from database table[tblTestSetups]on first call; returnsthis.bool NextStepButtonFocus- Property for button focus state.bool NextStepFocusLost- Property for focus lost state.
TestSetupInfo class:
public class TestSetupInfo
{
public string TestSetupName { get; set; }
public string Description { get; set; }
public string SamplesPerSecond { get; set; }
public DataModel.TestTemplate.RecordingModes Mode { get; set; }
}
EditChannelCodesControl
public partial class EditChannelCodesControl : UserControl, IPageContent, INotifyPropertyChanged
const string MY_ID = "Prepare_AdditionalDetails_Page_ChannelCodeDetails"- Page identifier constant.EditChannelCodesControl()- Initializes the control.bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow)- Delegates to_vm.Validate(displayWindow).void OnSetActive()- Initializes ViewModels and activates the channel codes list.object GetPageContent()- Returnsthis.void Delete()- Deletes selected channel codes with confirmation dialog.void Save()- Saves changes via_vm.Save().void Reset()- Empty implementation.DataPROPage Page- Sets the parent page reference.
UserListControl
public class UserListControl : GenericTable2
UserListControl(ContentControl parentControl, DataPROPage page)- Initializes with multi-row selection mode and creates columns.void UpdateList()- Clears and repopulates the user list fromUserCollection.GetAllUsers(), applying filters fromApp.FilterUsers().User SelectedUser- Gets/sets the currently selected user.User[] SelectedUsers- Gets/sets the currently selected users (multi-select).
TableColumns enum:
public enum TableColumns
{
DisplayName, UserName, Role, LastModified, LastModifiedBy, DatabaseId
}
RealtimeFullScreen
public partial class RealtimeFullScreen : UserControl, INotifyPropertyChanged
RealtimeFullScreen()- Initializes the control.void OnSetActive(RealtimeChart myChart)- Sets the active chart for display.RealtimeChart MyChart- Gets/sets the displayed chart.RunTestBase RTB- Gets/sets the run test base reference.SubControls.Realtime RealtimePage- Sets the realtime page reference.void EnableRealtimePrevious(bool bEnable)- Enables/disables back button.void EnableRealtimeNext(bool bEnable)- Enables/disables next button.Visibility BackButtonVisibility/NextButtonVisibility- Controls button visibility.bool HasBackButton/HasNextButton- Controls button presence.
ViewGraphSelectControlDelete
public partial class ViewGraphSelectControlDelete : UserControl, IPageContent, INotifyPropertyChanged
ViewGraphSelectControlDelete()- Initializes with emptyTestInfoarray.bool Validate()- Returnstrue.void IPageContent.OnSetActive()- Empty implementation.object GetPageContent()- Returnsthis(most logic commented out).TestInfo[] FileNameList- Gets/sets the list of test files.DataModel.TestTemplate SelectedTest- Gets/sets selected test.bool BrowseFocusLost- Focus tracking property.string TestItemLongString- Test item identifier string.
StatusRibbon
public partial class StatusRibbon : UserControl, INotifyPropertyChanged
StatusRibbon()- Initializes the control.string Prepend- Dependency property for status text resource lookup prefix.string Status- Sets status text (triggers resource lookup viaPrepend_Status).string AggregateStatusText- Gets the resolved status text.int ProgressBarValue- Gets/sets progress bar value (0-100).Visibility ProgressBarVisibility- Gets/sets progress bar visibility.Color AggregateStatusColor- Gets/sets the ribbon background color.SolidColorBrush TextColor- Gets/sets the text color.void SetProgressValue(int value)- Thread-safe progress setter; normalizes values to 0-100.void SetProgressBarVisibility(Visibility v)- Thread-safe visibility setter.void SetStatusTextNoTranslate(string s)- Sets status text directly without resource lookup.void SetAggregateStatusColor(Color c)- Thread-safe color setter.void SetAlert(bool set)- Thread-safe alert mode toggle; changes text color and alert visibility.
EditTestEngineerDetailsControl
public partial class EditTestEngineerDetailsControl : UserControl, IPageContent, INotifyPropertyChanged
EditTestEngineerDetailsControl()- Initializes the control.bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow)- Validates engineer names for blanks and duplicates.void OnSetActive()- Loads engineers fromDataModel.TestEngineerDetailsList.TestEngineerList.TestEngineers.object GetPageContent()- Returnsthis.void Save()- Persists changes toTestEngineerDetailsList.void Delete()- Deletes selected engineers with confirmation dialog.void Reset()- Empty implementation.DataPROPage Page- Sets the parent page reference.DataModel.TestEngineerDetails[] TestEngineers- Gets/sets the engineer list.ObservableCollection<DataModel.TestEngineerDetails> SelectedEngineerItems- Selected items collection.
EditUserInfoControl
public partial class EditUserInfoControl : IPageContent, INotifyPropertyChanged
EditUserInfoControl()- Initializes the control.bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow)- Validates display name, role selection, and username uniqueness (for new users).void OnSetActive()- Triggers property change notifications for allTagsenum values.object GetPageContent()- Returnsthis.void Reset()- Clears validation markers on all input fields.User CurrentUser- Gets/sets the user being edited.bool IsAdd- Indicates if this is a new user creation.bool IsNotDefaultUser- Returnstrueif user is not a default system user.string UserName- Gets/sets the username.string DisplayName- Gets/sets the display name.int UserRoleIndex- Gets/sets the role index.UserRoleData[] UserRoles- Gets available roles.bool LocalOnly- Gets/sets local-only flag.string LastModified/LastModifiedBy- Gets modification metadata.string UserTags- Gets/sets comma-separated user tags.
UserRoleData nested class:
public class UserRoleData
{
public User.DefaultRoles Role { get; }
public override string ToString() // Returns localized role name
}
3. Invariants
- IPageContent contract: All controls implementing
IPageContentmust provideValidate(),OnSetActive(),GetPageContent(),Reset(), andUnSet()methods. - Property change notification: All
INotifyPropertyChangedimplementations use theSetProperty<T>pattern that returnsfalseif the value equals the current value (no change). - Thread affinity: WPF controls require UI thread access;
StatusRibbonprovides explicit thread-safe methods (SetProgressValue,SetProgressBarVisibility,SetAggregateStatusColor,SetAlert) that useDispatcher.CheckAccess()andDispatcher.BeginInvoke(). - DatabaseId column visibility: In
UserListControl, theDatabaseIdcolumn is alwaysVisibility.Collapsedand is used internally to distinguish duplicate default user names. - Password sentinel:
EditUserInfoControlusesUNCHANGED_SENTINEL = "***THISHASNTCHANGED***"to detect if password fields were modified. - Blank engineer record:
EditTestEngineerDetailsControlalways maintains a blankTestEngineerDetailsat the end of the list for new entries. - Progress bar range:
StatusRibbon.SetProgressValue()normalizes values to 0-100 range.
4. Dependencies
External Dependencies (from imports):
- WPF assemblies:
System.Windows.*(Controls, Data, Input, Media, Navigation, Shapes) - Prism framework:
Prism.Events,Prism.Ioc(used inEditChannelCodesControl) - Unity container:
Unity(used inEditChannelCodesControl) - C1.WPF.DataGrid: ComponentOne DataGrid (used in
UserListControlforDataGridSelectionMode.MultiRow) - C1.WPF.FlexGrid: ComponentOne FlexGrid (used in
ViewGraphSelectControlDelete)
Internal Dependencies:
DTS.Storage.DbOperations- Database operations (CollectSelectControl)DTS.Common.Interface.Channels.ChannelCodes- Channel code interfaces (EditChannelCodesControl)DTS.Common.SharedResource.Strings- Localized string resources (EditChannelCodesControl,StatusRibbon,EditTestEngineerDetailsControl,EditUserInfoControl)DTS.Common.Utilities.Logging- Logging viaAPILogger(UserListControl)DTS.Slice.Users- User management types (UserListControl,EditUserInfoControl)DTS.Common.Storage- Storage operations (EditUserInfoControl)DTS.Common.Events- Prism events (EditTestEngineerDetailsControl)DTS.Common.ISO- ISO data types (EditTestEngineerDetailsControl)DataModelnamespace - Data model types (TestSetupInfo,TestEngineerDetails,TestTemplate)MainWindow- Main application window for navigationApp- Application class for message boxes and user filteringGenericTable2- Base class forUserListControlRunTestBase,RealtimeChart- Realtime testing componentsDataPROPage,IPageContent,PageButton- Page framework types
Consumers:
MainWindow- CallsGoToPreviousPage(),RemoveFullScreenPlotInfo(),GoToSmallScreenRealtime()App- ProvidesDoMessageBox(),FilterUsers(),GetAllIUIItems()
5. Gotchas
-
Class naming inconsistency:
ViewGraphSelectControlDeletehas "Delete" in the class name but appears to be a functional control, not a deleted/deprecated one. The filename isViewGraphSelectControl.xaml.cs. -
Commented-out code:
ViewGraphSelectControlDelete.GetPageContent()contains extensive commented-out logic that may represent incomplete refactoring or dead code paths. -
Hardcoded SQL:
CollectSelectControluses a raw SQL string"SELECT * from [tblTestSetups]"without parameterization. -
Refresh flag pattern:
CollectSelectControluses abool refreshing = truefield that is set tofalseafter first load and never reset, meaningGetPageContent()only loads data once per control instance. -
Null-conditional navigation:
RealtimeFullScreen.closeButton_Click()uses both(Application.Current.MainWindow as MainWindow)?.RemoveFullScreenPlotInfo()and((MainWindow)Application.Current.MainWindow)?.GoToSmallScreenRealtime()- mixing null-conditional with cast patterns. -
Password sentinel exposure: The
UNCHANGED_SENTINELconstant value"***THISHASNTCHANGED***"is visible in source; if users type this exact string as a password, behavior is undefined. -
Thread-safety inconsistency: Only
StatusRibbonprovides thread-safe wrappers; other controls withINotifyPropertyChangeddo not appear to handle cross-thread property changes. -
Validation stubs:
CollectSelectControl.Validate()andViewGraphSelectControlDelete.Validate()always returntruewithout performing validation. -
Implicit dependencies on Application.Current: Multiple controls cast
Application.Current.MainWindowtoMainWindowandApplication.CurrenttoApp, creating tight coupling to the specific application instance.