2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-11-19 07:43:07 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
/* Dependencies
|
|
|
|
|
*****************************************************************************/
|
2014-11-19 09:04:58 -05:00
|
|
|
#include "Engine.h"
|
2014-11-19 07:43:07 -05:00
|
|
|
#include "Messaging.h"
|
|
|
|
|
#include "ModuleManager.h"
|
|
|
|
|
#include "SlateBasics.h"
|
|
|
|
|
#include "SlateStyle.h"
|
2014-11-19 09:04:58 -05:00
|
|
|
#include "EditorStyle.h"
|
2015-06-11 09:51:31 -04:00
|
|
|
#include "SDockTab.h"
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
/* Private includes
|
|
|
|
|
*****************************************************************************/
|
2015-01-15 06:19:24 -05:00
|
|
|
#include "ILogVisualizer.h"
|
2014-11-19 07:43:07 -05:00
|
|
|
#include "VisualLogger/VisualLogger.h"
|
2014-12-18 08:37:06 -05:00
|
|
|
#include "LogVisualizerSettings.h"
|
|
|
|
|
#include "LogVisualizerSessionSettings.h"
|
2015-08-27 05:21:28 -04:00
|
|
|
#include "VisualLoggerDatabase.h"
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_OneParam(FOnFiltersSearchChanged, const FText&);
|
2015-08-27 05:21:28 -04:00
|
|
|
|
|
|
|
|
//DECLARE_DELEGATE(FOnFiltersChanged);
|
|
|
|
|
DECLARE_MULTICAST_DELEGATE(FOnFiltersChanged);
|
|
|
|
|
|
|
|
|
|
DECLARE_DELEGATE_ThreeParams(FOnLogLineSelectionChanged, TSharedPtr<struct FLogEntryItem> /*SelectedItem*/, int64 /*UserData*/, FName /*TagName*/);
|
2015-06-11 09:51:31 -04:00
|
|
|
DECLARE_DELEGATE_RetVal_TwoParams(FReply, FOnKeyboardEvent, const FGeometry& /*MyGeometry*/, const FKeyEvent& /*InKeyEvent*/);
|
2015-08-27 05:21:28 -04:00
|
|
|
DECLARE_DELEGATE_RetVal(float, FGetAnimationOutlinerFillPercentageFunc);
|
2014-11-19 07:43:07 -05:00
|
|
|
|
|
|
|
|
struct FVisualLoggerEvents
|
|
|
|
|
{
|
|
|
|
|
FOnFiltersChanged OnFiltersChanged;
|
2015-04-24 07:10:23 -04:00
|
|
|
FOnLogLineSelectionChanged OnLogLineSelectionChanged;
|
2015-06-11 09:51:31 -04:00
|
|
|
FOnKeyboardEvent OnKeyboardEvent;
|
2015-08-27 05:21:28 -04:00
|
|
|
FGetAnimationOutlinerFillPercentageFunc GetAnimationOutlinerFillPercentageFunc;
|
2014-11-19 07:43:07 -05:00
|
|
|
};
|
|
|
|
|
|
2015-01-29 19:21:24 -05:00
|
|
|
class FVisualLoggerTimeSliderController;
|
2015-01-15 06:19:24 -05:00
|
|
|
struct LOGVISUALIZER_API FLogVisualizer
|
|
|
|
|
{
|
|
|
|
|
/** LogVisualizer interface*/
|
2015-08-27 05:21:28 -04:00
|
|
|
void Reset();
|
2015-01-15 06:19:24 -05:00
|
|
|
|
|
|
|
|
FLinearColor GetColorForCategory(int32 Index) const;
|
|
|
|
|
FLinearColor GetColorForCategory(const FString& InFilterName) const;
|
2015-01-29 19:21:24 -05:00
|
|
|
TSharedPtr<FVisualLoggerTimeSliderController> GetTimeSliderController() { return TimeSliderController; }
|
2015-01-15 06:19:24 -05:00
|
|
|
UWorld* GetWorld(UObject* OptionalObject = nullptr);
|
2015-08-27 05:21:28 -04:00
|
|
|
FVisualLoggerEvents& GetEvents() { return VisualLoggerEvents; }
|
2015-01-15 06:19:24 -05:00
|
|
|
|
|
|
|
|
void SetCurrentVisualizer(TSharedPtr<class SVisualLogger> Visualizer) { CurrentVisualizer = Visualizer; }
|
|
|
|
|
|
2015-08-27 05:21:28 -04:00
|
|
|
void SetAnimationOutlinerFillPercentage(float FillPercentage) { AnimationOutlinerFillPercentage = FillPercentage; }
|
|
|
|
|
float GetAnimationOutlinerFillPercentage()
|
|
|
|
|
{
|
|
|
|
|
if (VisualLoggerEvents.GetAnimationOutlinerFillPercentageFunc.IsBound())
|
|
|
|
|
{
|
|
|
|
|
SetAnimationOutlinerFillPercentage(VisualLoggerEvents.GetAnimationOutlinerFillPercentageFunc.Execute());
|
|
|
|
|
}
|
|
|
|
|
return AnimationOutlinerFillPercentage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32 GetNextItem(FName RowName, int32 MoveDistance = 1);
|
|
|
|
|
int32 GetPreviousItem(FName RowName, int32 MoveDistance = 1);
|
|
|
|
|
|
|
|
|
|
void GotoNextItem(FName RowName, int32 MoveDistance = 1);
|
|
|
|
|
void GotoPreviousItem(FName RowName, int32 MoveDistance = 1);
|
|
|
|
|
void GotoFirstItem(FName RowName);
|
|
|
|
|
void GotoLastItem(FName RowName);
|
|
|
|
|
|
|
|
|
|
void UpdateCameraPosition(FName Rowname, int32 ItemIndes);
|
2015-01-15 06:19:24 -05:00
|
|
|
|
|
|
|
|
/** Static access */
|
|
|
|
|
static void Initialize();
|
|
|
|
|
static void Shutdown();
|
|
|
|
|
static FLogVisualizer& Get();
|
|
|
|
|
protected:
|
|
|
|
|
static TSharedPtr< struct FLogVisualizer > StaticInstance;
|
|
|
|
|
|
2015-01-29 19:21:24 -05:00
|
|
|
TSharedPtr<FVisualLoggerTimeSliderController> TimeSliderController;
|
2015-01-15 06:19:24 -05:00
|
|
|
FVisualLoggerEvents VisualLoggerEvents;
|
|
|
|
|
TWeakPtr<class SVisualLogger> CurrentVisualizer;
|
2015-08-27 05:21:28 -04:00
|
|
|
float AnimationOutlinerFillPercentage;
|
2015-01-15 06:19:24 -05:00
|
|
|
};
|
2014-11-19 07:43:07 -05:00
|
|
|
|
2015-06-11 09:51:31 -04:00
|
|
|
class SVisualLoggerTab : public SDockTab
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual bool SupportsKeyboardFocus() const override { return true; }
|
|
|
|
|
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override
|
|
|
|
|
{
|
2015-08-27 05:21:28 -04:00
|
|
|
return FLogVisualizer::Get().GetEvents().OnKeyboardEvent.Execute(MyGeometry, InKeyEvent);
|
2015-06-11 09:51:31 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SVisualLoggerBaseWidget : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual bool SupportsKeyboardFocus() const override { return true; }
|
|
|
|
|
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override
|
|
|
|
|
{
|
2015-08-27 05:21:28 -04:00
|
|
|
return FLogVisualizer::Get().GetEvents().OnKeyboardEvent.Execute(MyGeometry, InKeyEvent);
|
2015-06-11 09:51:31 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2014-11-19 07:43:07 -05:00
|
|
|
#include "LogVisualizerStyle.h"
|
|
|
|
|
#include "SVisualLogger.h"
|
|
|
|
|
#include "SVisualLoggerToolbar.h"
|
|
|
|
|
#include "VisualLoggerCommands.h"
|
|
|
|
|
#include "SVisualLoggerFilters.h"
|
|
|
|
|
#include "SVisualLoggerView.h"
|
|
|
|
|
#include "SVisualLoggerLogsList.h"
|
|
|
|
|
#include "SVisualLoggerStatusView.h"
|
|
|
|
|
#include "STimeline.h"
|