Added Blank Delegate for split Sensors + Added Getters for Contest/Stage/Split rankings for 1 participant + Global Cleaning
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
#include "Widget/DTFluxAssetModelDetailsWidget.h"
|
||||
|
||||
#include "DTFluxAssetsEditorModule.h"
|
||||
#include "Widgets/Layout/SBorder.h"
|
||||
#include "Widgets/Layout/SBox.h"
|
||||
#include "Widgets/Text/STextBlock.h"
|
||||
@ -23,19 +24,19 @@ TSharedRef<SWidget> SHierarchicalTreeItemRow::GenerateWidgetForColumn(const FNam
|
||||
{
|
||||
if (!Item.IsValid())
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Invalid item for column %s"), *ColumnName.ToString());
|
||||
// UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Invalid item for column %s"), *ColumnName.ToString());
|
||||
return SNew(STextBlock).Text(FText::FromString("Invalid Item"));
|
||||
}
|
||||
|
||||
if (!ParentWidget)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Invalid ParentWidget for column %s"),
|
||||
*ColumnName.ToString());
|
||||
// UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Invalid ParentWidget for column %s"),
|
||||
// *ColumnName.ToString());
|
||||
return SNew(STextBlock).Text(FText::FromString("Invalid Parent"));
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, VeryVerbose, TEXT("GenerateWidgetForColumn: %s for item %s"),
|
||||
*ColumnName.ToString(), *Item->Name);
|
||||
// UE_LOG(logDTFluxAssetEditor, VeryVerbose, TEXT("GenerateWidgetForColumn: %s for item %s"),
|
||||
// *ColumnName.ToString(), *Item->Name);
|
||||
|
||||
if (ColumnName == "Name")
|
||||
{
|
||||
@ -93,7 +94,7 @@ TSharedRef<SWidget> SHierarchicalTreeItemRow::GenerateWidgetForColumn(const FNam
|
||||
.OverflowPolicy(ETextOverflowPolicy::Ellipsis);
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Warning, TEXT("GenerateWidgetForColumn: Unknown column %s"), *ColumnName.ToString());
|
||||
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("GenerateWidgetForColumn: Unknown column %s"), *ColumnName.ToString());
|
||||
return SNew(STextBlock).Text(FText::FromString(FString::Printf(TEXT("Unknown: %s"), *ColumnName.ToString())));
|
||||
}
|
||||
|
||||
@ -411,7 +412,7 @@ void SDTFluxAssetModelDetailsWidget::BuildContestHierarchy()
|
||||
RootItems.Add(ContestItem);
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("Built contest hierarchy with %d root contests"), RootItems.Num());
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Built contest hierarchy with %d root contests"), RootItems.Num());
|
||||
}
|
||||
|
||||
void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
||||
@ -420,11 +421,11 @@ void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
||||
|
||||
if (!ModelAsset)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("BuildParticipantList: ModelAsset is null!"));
|
||||
return;
|
||||
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("BuildParticipantList: ModelAsset is null!"));
|
||||
// return;
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: ModelAsset has %d participants"), ModelAsset->Participants.Num());
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: ModelAsset has %d participants"), ModelAsset->Participants.Num());
|
||||
|
||||
// Créer la liste des participants (pas de hiérarchie pour les participants)
|
||||
for (const auto& ParticipantPair : ModelAsset->Participants)
|
||||
@ -433,12 +434,12 @@ void SDTFluxAssetModelDetailsWidget::BuildParticipantList()
|
||||
auto ParticipantItem = FHierarchicalTreeItem::CreateParticipant(Participant);
|
||||
ParticipantItems.Add(ParticipantItem);
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: Added participant %s (Bib: %d)"),
|
||||
*ParticipantItem->Name, ParticipantItem->Bib);
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: Added participant %s (Bib: %d)"),
|
||||
// *ParticipantItem->Name, ParticipantItem->Bib);
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("BuildParticipantList: Built participant list with %d participants"),
|
||||
ParticipantItems.Num());
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("BuildParticipantList: Built participant list with %d participants"),
|
||||
// ParticipantItems.Num());
|
||||
}
|
||||
|
||||
// ===== CALLBACKS TREEVIEW =====
|
||||
@ -448,12 +449,12 @@ TSharedRef<ITableRow> SDTFluxAssetModelDetailsWidget::OnGenerateRowForTree(
|
||||
{
|
||||
if (!Item.IsValid())
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("OnGenerateRowForTree: Invalid item!"));
|
||||
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("OnGenerateRowForTree: Invalid item!"));
|
||||
return SNew(STableRow<FHierarchicalTreeItemPtr>, OwnerTable);
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("OnGenerateRowForTree: Generating row for %s (Type: %d)"),
|
||||
*Item->Name, (int32)Item->Type);
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("OnGenerateRowForTree: Generating row for %s (Type: %d)"),
|
||||
// *Item->Name, (int32)Item->Type);
|
||||
|
||||
return SNew(SHierarchicalTreeItemRow, OwnerTable)
|
||||
.Item(Item)
|
||||
@ -536,7 +537,7 @@ FReply SDTFluxAssetModelDetailsWidget::OnExpandAllClicked()
|
||||
}
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("Expanded all contests"));
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Expanded all contests"));
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
@ -550,14 +551,14 @@ FReply SDTFluxAssetModelDetailsWidget::OnCollapseAllClicked()
|
||||
}
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("Collapsed all contests"));
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Collapsed all contests"));
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
FReply SDTFluxAssetModelDetailsWidget::OnRefreshClicked()
|
||||
{
|
||||
RefreshData();
|
||||
UE_LOG(LogTemp, Log, TEXT("Data refreshed"));
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("Data refreshed"));
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
@ -567,21 +568,17 @@ void SDTFluxAssetModelDetailsWidget::RefreshData()
|
||||
{
|
||||
if (!ModelAsset)
|
||||
{
|
||||
UE_LOG(LogTemp, Warning, TEXT("ModelAsset is null!"));
|
||||
UE_LOG(logDTFluxAssetEditor, Warning, TEXT("ModelAsset is null!"));
|
||||
return;
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("RefreshData: Starting refresh for ModelAsset %s"), *ModelAsset->GetName());
|
||||
|
||||
// Nettoyer les données existantes
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("RefreshData: Starting refresh for ModelAsset %s"), *ModelAsset->GetName());
|
||||
RootItems.Empty();
|
||||
ParticipantItems.Empty();
|
||||
|
||||
// Construire la hiérarchie
|
||||
BuildContestHierarchy();
|
||||
BuildParticipantList();
|
||||
|
||||
// Refresh les vues
|
||||
if (ContestTreeView.IsValid())
|
||||
{
|
||||
ContestTreeView->RequestTreeRefresh();
|
||||
@ -591,9 +588,8 @@ void SDTFluxAssetModelDetailsWidget::RefreshData()
|
||||
{
|
||||
ParticipantTreeView->RequestTreeRefresh();
|
||||
}
|
||||
|
||||
UE_LOG(LogTemp, Log, TEXT("RefreshData: Completed successfully - %d contests, %d participants"), RootItems.Num(),
|
||||
ParticipantItems.Num());
|
||||
// UE_LOG(logDTFluxAssetEditor, Log, TEXT("RefreshData: Completed successfully - %d contests, %d participants"), RootItems.Num(),
|
||||
// ParticipantItems.Num());
|
||||
}
|
||||
|
||||
// ===== MÉTHODES UTILITAIRES =====
|
||||
@ -635,7 +631,6 @@ FText SDTFluxAssetModelDetailsWidget::GetStatsText() const
|
||||
{
|
||||
if (!ModelAsset)
|
||||
return FText::FromString("No data");
|
||||
|
||||
return FText::FromString(FString::Printf(
|
||||
TEXT("Contests: [%d] Participants: [%d] Persons: [%d]"),
|
||||
ModelAsset->Contests.Num(),
|
||||
|
||||
Reference in New Issue
Block a user