// Start is called before the first frame update
    public virtual void Initialize(IStreamGeneratorAction streamDataGenerator,
                                   IJointMangerAction jointManager,
                                   ITouchManagerAction touchManager,
                                   IPanelAction datasetPanel,
                                   string folderName,
                                   string csvFileName)
    {
        this.streamDataGenerator = streamDataGenerator;
        this.jointManager        = jointManager;
        this.datasetPanel        = datasetPanel;
        this.FolderName          = folderName;
        this.CSVFileName         = csvFileName;

        // Subscribe the event of touch manager
        touchManager.OnTouchCalcFinish += (sender, e) =>
        {
            IsValid    = e;
            Processing = false;
        };
    }
    public virtual StreamWriter CreateOrOpenFolderFile(string folderName, string csvFileName, IStreamGeneratorAction streamGenerator)
    {
        // Check whether the folder exists
        if (!Directory.Exists(folderName))
        {
            Directory.CreateDirectory(folderName);
        }

        string       csvName = Path.Combine(folderName, csvFileName);
        StreamWriter writer;

        if (File.Exists(csvName))
        {
            writer = new StreamWriter(csvName, true);
        }
        else
        {
            writer = new StreamWriter(csvName);
            writer.WriteLine(streamGenerator.GenerateStreamFileHeader());
        }
        return(writer);
    }