mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 18:06:39 +00:00
Errors sending to UI
notifying client of AI model conversion
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Azaion.Dataset;
|
||||
|
||||
public class DatasetExplorerEventHandler(
|
||||
DatasetExplorer datasetExplorer,
|
||||
AnnotationService annotationService) :
|
||||
IAnnotationService annotationService) :
|
||||
INotificationHandler<KeyEvent>,
|
||||
INotificationHandler<DatasetExplorerControlEvent>,
|
||||
INotificationHandler<AnnotationCreatedEvent>,
|
||||
@@ -26,7 +26,9 @@ public class DatasetExplorerEventHandler(
|
||||
{ Key.X, PlaybackControlEnum.RemoveAllAnns },
|
||||
{ Key.Escape, PlaybackControlEnum.Close },
|
||||
{ Key.Down, PlaybackControlEnum.Next },
|
||||
{ Key.PageDown, PlaybackControlEnum.Next },
|
||||
{ Key.Up, PlaybackControlEnum.Previous },
|
||||
{ Key.PageUp, PlaybackControlEnum.Previous },
|
||||
{ Key.V, PlaybackControlEnum.ValidateAnnotations},
|
||||
};
|
||||
|
||||
@@ -116,20 +118,23 @@ public class DatasetExplorerEventHandler(
|
||||
var annotation = notification.Annotation;
|
||||
var selectedClass = datasetExplorer.LvClasses.CurrentClassNumber;
|
||||
|
||||
//TODO: For editing existing need to handle updates
|
||||
datasetExplorer.AddAnnotationToDict(annotation);
|
||||
if (annotation.Classes.Contains(selectedClass) || selectedClass == -1)
|
||||
{
|
||||
var index = 0;
|
||||
var annThumb = new AnnotationThumbnail(annotation);
|
||||
if (datasetExplorer.SelectedAnnotationDict.ContainsKey(annThumb.Annotation.Name))
|
||||
{
|
||||
datasetExplorer.SelectedAnnotationDict.Remove(annThumb.Annotation.Name);
|
||||
var ann = datasetExplorer.SelectedAnnotations.FirstOrDefault(x => x.Annotation.Name == annThumb.Annotation.Name);
|
||||
if (ann != null)
|
||||
{
|
||||
index = datasetExplorer.SelectedAnnotations.IndexOf(ann);
|
||||
datasetExplorer.SelectedAnnotations.Remove(ann);
|
||||
}
|
||||
}
|
||||
|
||||
datasetExplorer.SelectedAnnotations.Insert(0, annThumb);
|
||||
datasetExplorer.SelectedAnnotations.Insert(index, annThumb);
|
||||
datasetExplorer.SelectedAnnotationDict.Add(annThumb.Annotation.Name, annThumb);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user