mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests
This commit is contained in:
@@ -35,6 +35,7 @@ public partial class DatasetExplorer
|
||||
|
||||
private readonly IAzaionApi _azaionApi;
|
||||
private readonly IConfigUpdater _configUpdater;
|
||||
private readonly IAnnotationPathResolver _pathResolver;
|
||||
|
||||
public bool ThumbnailLoading { get; set; }
|
||||
public string CurrentFilter { get; set; } = "";
|
||||
@@ -51,7 +52,8 @@ public partial class DatasetExplorer
|
||||
IDbFactory dbFactory,
|
||||
IMediator mediator,
|
||||
IAzaionApi azaionApi,
|
||||
IConfigUpdater configUpdater)
|
||||
IConfigUpdater configUpdater,
|
||||
IAnnotationPathResolver pathResolver)
|
||||
{
|
||||
InitializeComponent();
|
||||
_appConfig = appConfig.Value;
|
||||
@@ -61,6 +63,7 @@ public partial class DatasetExplorer
|
||||
_mediator = mediator;
|
||||
_azaionApi = azaionApi;
|
||||
_configUpdater = configUpdater;
|
||||
_pathResolver = pathResolver;
|
||||
|
||||
ShowWithObjectsOnlyChBox.IsChecked = _appConfig.UIConfig.ShowDatasetWithDetectionsOnly;
|
||||
var photoModes = Enum.GetValues(typeof(PhotoMode)).Cast<PhotoMode>().ToList();
|
||||
@@ -196,7 +199,7 @@ public partial class DatasetExplorer
|
||||
ThumbnailsView.SelectedIndex = index;
|
||||
|
||||
var ann = CurrentAnnotation.Annotation;
|
||||
var image = await ann.ImagePath.OpenImage();
|
||||
var image = await _pathResolver.GetImagePath(ann).OpenImage();
|
||||
ExplorerEditor.SetBackground(image);
|
||||
SelectedAnnotationName.Text = ann.Name;
|
||||
SwitchTab(toEditor: true);
|
||||
@@ -264,7 +267,11 @@ public partial class DatasetExplorer
|
||||
var annThumbnails = _annotationsDict[ExplorerEditor.CurrentAnnClass!.YoloId]
|
||||
.WhereIf(withDetectionsOnly, x => x.Value.Detections.Any())
|
||||
.WhereIf(!string.IsNullOrEmpty(CurrentFilter), x => x.Key.Contains(CurrentFilter, StringComparison.CurrentCultureIgnoreCase))
|
||||
.Select(x => new AnnotationThumbnail(x.Value, currentUser.Role.IsValidator()))
|
||||
.Select(x => new AnnotationThumbnail(
|
||||
x.Value,
|
||||
currentUser.Role.IsValidator(),
|
||||
_pathResolver.GetImagePath(x.Value),
|
||||
_pathResolver.GetThumbPath(x.Value)))
|
||||
.OrderBy(x => !x.IsSeed)
|
||||
.ThenByDescending(x =>x.Annotation.CreatedDate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user