52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
using Aurora.Api;
|
|
using Aurora.View;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
|
|
namespace VisionCommonUI {
|
|
public class SegDiagramManager {
|
|
private static Logger _Logger = new Logger("SegDiagramManager");
|
|
private static readonly object _Lock = new object();
|
|
|
|
public static WinSequenceDiagram SeqDiagram { get; set; }
|
|
|
|
public static void Show(string seqName, object seqParam) {
|
|
lock (_Lock) {
|
|
Application.Current.Dispatcher.Invoke(
|
|
System.Windows.Threading.DispatcherPriority.Normal,
|
|
new System.Action(() => {
|
|
ShowSeqDiagrams(seqName, seqParam);
|
|
})
|
|
);
|
|
}
|
|
}
|
|
|
|
private static void ShowSeqDiagrams(string seqName, object seqParam) {
|
|
try {
|
|
SeqDiagram = new WinSequenceDiagram(seqName);
|
|
SeqDiagram.SetParam(new SeqDrawerParam() {
|
|
SequenceId = seqName,
|
|
DiagramType = eDiagramType.Tree,
|
|
LineType = eLineType.Curved,
|
|
IsShowSubSequence = false,
|
|
VisibleKeys = new List<string>()
|
|
});
|
|
//SeqDiagram.Closed += SeqDiagram_Closed;
|
|
SeqDiagram.Owner = Application.Current.MainWindow;
|
|
SeqDiagram.SequenceParam = seqParam;
|
|
SeqDiagram.Width = 600;
|
|
SeqDiagram?.Show();
|
|
}
|
|
catch (Exception e) {
|
|
_Logger.FuncE(e.Message);
|
|
}
|
|
}
|
|
|
|
protected void SeqDiagram_Closed(object sender, EventArgs e) {
|
|
//WinSequenceDiagram seqDiagram = sender as WinSequenceDiagram;
|
|
//string seqName = seqDiagram.SequenceName;
|
|
//_IsDiagramLoadeds[seqName] = false;
|
|
}
|
|
}
|
|
} |