using System.Collections.Generic;
using QC.CTDS.DM.ApplicationsManager;
using QC.CTDS.DM.DataStructures;
using QC.CTDS.DM.DataStructures.InputDataStructure;

namespace QC.DataminerController;

public class QsprSuiteLogToDataminerInputDataBuilder : IDataminerInputDataBuilder
{
	private ReportGenerator dataminerReportGenerator;

	public InputData GetDataminerInputData()
	{
		return null;
	}

	public void LoadDataFromFolder(string folderPath, bool includeSubFolders)
	{
		FileSystemItemsGroupingCollection fileSystemItemsGroupingCollection = new FileSystemItemsGroupingCollection();
		FolderItem folderItem = new FolderItem();
		folderItem.IncludeSubFolders = includeSubFolders;
		folderItem.FullPath = folderPath;
		FolderItem item = folderItem;
		FileSystemItemsGroup fileSystemItemsGroup = new FileSystemItemsGroup();
		fileSystemItemsGroup.FileSystemItemsList.Add(item);
		fileSystemItemsGroupingCollection.FileSystemItemsGroupList.Add(fileSystemItemsGroup);
		LoadData(fileSystemItemsGroupingCollection);
	}

	public void LoadDataFromFiles(List<string> files)
	{
		FileSystemItemsGroupingCollection fileSystemItemsGroupingCollection = new FileSystemItemsGroupingCollection();
		FileSystemItemsGroup fileSystemItemsGroup = new FileSystemItemsGroup();
		foreach (string file in files)
		{
			fileSystemItemsGroup.FileSystemItemsList.Add(new FileSystemItem
			{
				FullPath = file
			});
		}
		fileSystemItemsGroupingCollection.FileSystemItemsGroupList.Add(fileSystemItemsGroup);
		LoadData(fileSystemItemsGroupingCollection);
	}

	public void LoadData(FileSystemItemsGroupingCollection fileSystemItemsGroupingCollection)
	{
		dataminerReportGenerator.LoadSourceData(fileSystemItemsGroupingCollection);
	}

	public void SetReportGenerator(ReportGenerator dataminerReportGenerator)
	{
		this.dataminerReportGenerator = dataminerReportGenerator;
		this.dataminerReportGenerator.SetInputFormat("SuiteSchemaInputPlugin");
	}
}
