67 lines
2.2 KiB
C++
67 lines
2.2 KiB
C++
|
|
#include "DataPanelFactory.h"
|
||
|
|
#include "DataPanel.h"
|
||
|
|
#include "CurvePanel.h"
|
||
|
|
#include "common/SpdLogger.h"
|
||
|
|
|
||
|
|
// Forward declarations for future panel types
|
||
|
|
// #include "SurfacePanel.h"
|
||
|
|
// #include "TablePanel.h"
|
||
|
|
// #include "LightPanel.h"
|
||
|
|
|
||
|
|
DataPanel* DataPanelFactory::CreatePanel(int index, FileEntryType fileType, const QString& filePath, QWidget* parent)
|
||
|
|
{
|
||
|
|
switch (fileType) {
|
||
|
|
case FileEntryType::Curve:
|
||
|
|
// For now, create CurvePanel which should inherit from DataPanel
|
||
|
|
// TODO: Update CurvePanel to inherit from DataPanel
|
||
|
|
return new CurvePanel(index, filePath, parent);
|
||
|
|
|
||
|
|
case FileEntryType::Surface:
|
||
|
|
// TODO: Implement SurfacePanel
|
||
|
|
LOG_WARN("SurfacePanel not implemented yet, creating base DataPanel");
|
||
|
|
return new DataPanel(index, fileType, filePath, parent);
|
||
|
|
|
||
|
|
case FileEntryType::Table:
|
||
|
|
// TODO: Implement TablePanel
|
||
|
|
LOG_WARN("TablePanel not implemented yet, creating base DataPanel");
|
||
|
|
return new DataPanel(index, fileType, filePath, parent);
|
||
|
|
|
||
|
|
case FileEntryType::Light:
|
||
|
|
// TODO: Implement LightPanel
|
||
|
|
LOG_WARN("LightPanel not implemented yet, creating base DataPanel");
|
||
|
|
return new DataPanel(index, fileType, filePath, parent);
|
||
|
|
|
||
|
|
default:
|
||
|
|
LOG_ERROR("Unsupported file type: {}", static_cast<int>(fileType));
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
bool DataPanelFactory::IsTypeSupported(FileEntryType fileType)
|
||
|
|
{
|
||
|
|
switch (fileType) {
|
||
|
|
case FileEntryType::Curve:
|
||
|
|
case FileEntryType::Surface:
|
||
|
|
case FileEntryType::Table:
|
||
|
|
case FileEntryType::Light:
|
||
|
|
return true;
|
||
|
|
default:
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
QString DataPanelFactory::GetTypeDisplayName(FileEntryType fileType)
|
||
|
|
{
|
||
|
|
switch (fileType) {
|
||
|
|
case FileEntryType::Curve:
|
||
|
|
return "Curve";
|
||
|
|
case FileEntryType::Surface:
|
||
|
|
return "Surface";
|
||
|
|
case FileEntryType::Table:
|
||
|
|
return "Table";
|
||
|
|
case FileEntryType::Light:
|
||
|
|
return "Light";
|
||
|
|
default:
|
||
|
|
return "Unknown";
|
||
|
|
}
|
||
|
|
}
|