Ejemplo n.º 1
0
        /*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/

        /// <summary> タイムラインデータモデルを生成します。
        /// </summary>
        /// <param name="pCommonDM"> 共通データモデル </param>
        /// <param name="pTimelineDM"> 作成データを格納するタイムラインデータモデル </param>
        /// <param name="pTimerDM"> タイマーデータモデル </param>
        //public void CreateTimelineDataModel(CommonDataModel pCommonDM, TimelineDataModel pTimelineDM, TimerDataModel pTimerDM)
        public void CreateTimelineDataModel(CommonDataModel pCommonDM, TimelineObjectModel pTimelineOM)
        {
            switch (pCommonDM.AppStatusData.TimelineLoadStatus)
            {
            case TimelineLoadStatus.NowLoading:
                return;
            }

            this.TimelineDataClear(pCommonDM, pTimelineOM);

            pCommonDM.AppStatusData.TimelineLoadStatus = TimelineLoadStatus.NowLoading;
            this.TimelineFunctionEnabledChange(pCommonDM);

            Globals.SoundFilesRoot = pCommonDM.PluginSettingsData.SoundResourceDirectory;

            if (pCommonDM.SelectedTimelineFileData == null)
            {
                pCommonDM.AppStatusData.TimelineLoadStatus = TimelineLoadStatus.Failure;
                this.TimelineFunctionEnabledChange(pCommonDM);
                return;
            }

            try
            {
                TimelineLoader.LoadFromFile(pTimelineOM, pCommonDM.SelectedTimelineFileData.TimelineFileFullPath);
            }
            catch (Exception e)
            {
                pCommonDM.LogDataCollection.Add(Globals.SysLogger.WriteSystemLog.Failure.ERROR.Write(e.Message, Globals.ProjectName));
                Globals.ErrLogger.WriteStackTrace(e);
                pCommonDM.AppCommonData.TimelineLoadErrorMsg = "LoadError: " + e.Message;
                pCommonDM.AppStatusData.TimelineLoadStatus   = TimelineLoadStatus.Failure;
                this.TimelineFunctionEnabledChange(pCommonDM);

                pCommonDM.SelectedTimelineFileData.TimelineFileName     = string.Empty;
                pCommonDM.SelectedTimelineFileData.TimelineFileFullPath = string.Empty;

                return;
            }
            finally
            {
            }

            // タイムラインアイテムコレクションの生成
            foreach (var data in pTimelineOM.ActivityCollection)
            {
                // タイムラインタイプとジョブを設定
                this.timelineItemAnalyzProcess.SetTimelineType(data);
                this.timelineItemAnalyzProcess.SetTimelineJob(data);
            }

            // 最終ロードファイルの変更
            pCommonDM.PluginSettingsData.LastLoadTimelineFileName = pCommonDM.SelectedTimelineFileData.TimelineFileName;
            pCommonDM.PluginSettingsData.LastLoadTimelineFullPath = pCommonDM.SelectedTimelineFileData.TimelineFileFullPath;

            pCommonDM.ViewRefresh();
            pCommonDM.AppStatusData.TimelineLoadStatus = TimelineLoadStatus.Success;
            this.TimelineFunctionEnabledChange(pCommonDM);
        }
 public void TestIncludedTimelineFiles()
 {
     Globals.ResourceRoot = ".";
     foreach (var filepath in Globals.TimelineTxtsInResourcesDir)
     {
         TimelineLoader.LoadFromFile(filepath);
     }
 }