using com.andoutomo.kybernetes.data.accessor;\r
using com.andoutomo.kybernetes.data.DAO;\r
using com.andoutomo.kybernetes.data;\r
+using com.andoutomo.kybernetes.view;\r
+using System.Drawing;\r
\r
namespace com.andoutomo.kybernetes.command.reference\r
{\r
protected override bool execute()\r
{\r
EstimateCommandArg param = (EstimateCommandArg)argument;\r
- string targetDate=string.Empty;\r
- bool isToday;\r
\r
+ if (estimateToday(param) == false)\r
+ {\r
+ return false;\r
+ }\r
+ return getTotal();\r
+\r
+ }\r
+ /// <summary>\r
+ /// Estimateウィンドウの処理を実施します。\r
+ /// </summary>\r
+ /// <param name="param"></param>\r
+ /// <returns></returns>\r
+ private bool estimateToday(EstimateCommandArg param)\r
+ { \r
//タスクリストを取得\r
+ string targetDate = string.Empty;\r
+ bool isToday;\r
List<TaskData> taskList;\r
if (param.targetDate == null)\r
{\r
taskList = TaskDataAccessor.getObject.getToDayTaskList();\r
- targetDate="本日";\r
+ targetDate = "本日";\r
isToday = true;\r
}\r
else\r
area.ForcastMin += taskData.ForecastMin;\r
// 実績時間\r
area.ActualMin += taskData.RealMin;\r
- \r
+\r
\r
// 終了していないタスクの時間\r
if (taskData.isComplete == false)\r
}\r
}\r
\r
- List<string> msgList = new List<string>();\r
- msgList.Add(targetDate + "の作業見積もり及び実績");\r
- msgList.Add(string.Empty);\r
- msgList.Add(" @ FROM-TO Span Forecast REAL REMAIN ");\r
+ List<EstTextSet> msgList = new List<EstTextSet>();\r
+ msgList.Add(new EstTextSet(targetDate + "の作業見積もり及び実績"));\r
+ msgList.Add(new EstTextSet());\r
+ msgList.Add(new EstTextSet(" @ FROM-TO Span Forecast REAL REMAIN "));\r
+ msgList.Add(new EstTextSet());\r
+\r
foreach (TimeAreaCalcData area_ in timeAreaList)\r
{\r
// image: @ FROM-TO Span Forecast REAL REMAIN \r
// image: A 09:00-12:00 3:00 2:40 3:20 1:10 \r
- string estimateStr = " " + area_.AreaStr;\r
- estimateStr += " ";\r
- estimateStr += getFiveLengthTimeStr(area_.StartTime);\r
- estimateStr += "-";\r
- estimateStr += getFiveLengthTimeStr(area_.EndTime);\r
- estimateStr += " ";\r
- estimateStr += new TimeComponent(area_.Span).ToString();\r
- estimateStr += " ";\r
- estimateStr += new TimeComponent(area_.ForcastMin).ToString();\r
- estimateStr += " ";\r
- estimateStr += new TimeComponent(area_.ActualMin).ToString();\r
- estimateStr += " ";\r
- estimateStr += new TimeComponent(area_.RemainMin).ToString();\r
- //estimateStr += " ";\r
- //estimateStr += area_.Indicator;\r
- msgList.Add(estimateStr);\r
+ msgList.Add(new EstTextSet(" " + area_.AreaStr + " "));\r
+ //タイムエリアの初期情報を設定\r
+ msgList.Add(new EstTextSet(getFiveLengthTimeStr(area_.StartTime) + "-" + getFiveLengthTimeStr(area_.EndTime) + " "));\r
+ //改行\r
+ msgList.Add(new EstTextSet(new TimeComponent(area_.Span).ToString() + " "));\r
+\r
+ //予測時間\r
+ EstTextSet forcast;\r
+ if (area_.Span < area_.ForcastMin)\r
+ {\r
+ forcast = new EstTextSet(new TimeComponent(area_.ForcastMin).ToString(), Color.LightPink);\r
+ }\r
+ else if (area_.Span > area_.ForcastMin)\r
+ {\r
+ forcast = new EstTextSet(new TimeComponent(area_.ForcastMin).ToString(), Color.LightBlue);\r
+ }\r
+ else\r
+ {\r
+ forcast = new EstTextSet(new TimeComponent(area_.ForcastMin).ToString());\r
+ }\r
+ msgList.Add(forcast);\r
+ msgList.Add(new EstTextSet(" "));\r
+ //実時間\r
+ EstTextSet actual;\r
+ if (area_.Span < area_.ActualMin)\r
+ {\r
+ actual = new EstTextSet(new TimeComponent(area_.ActualMin).ToString(), Color.LightPink);\r
+ }\r
+ else if (area_.Span > area_.ActualMin)\r
+ {\r
+ actual = new EstTextSet(new TimeComponent(area_.ActualMin).ToString(), Color.LightBlue);\r
+ }\r
+ else\r
+ {\r
+ actual = new EstTextSet(new TimeComponent(area_.ActualMin).ToString());\r
+ }\r
+ msgList.Add(actual);\r
+ msgList.Add(new EstTextSet(" "));\r
+\r
+ //残り時間\r
+ EstTextSet remain;\r
+ if ((area_.RemainMin + area_.ActualMin) > area_.ForcastMin)\r
+ {\r
+ remain = new EstTextSet(new TimeComponent(area_.RemainMin).ToString(), Color.LightPink);\r
+ }\r
+ else if ((area_.RemainMin + area_.ActualMin) < area_.ForcastMin)\r
+ {\r
+ remain = new EstTextSet(new TimeComponent(area_.RemainMin).ToString(), Color.LightBlue);\r
+ }\r
+ else\r
+ {\r
+ remain = new EstTextSet(new TimeComponent(area_.RemainMin).ToString());\r
+ }\r
+ msgList.Add(remain);\r
+ msgList.Add(new EstTextSet(" "));\r
+ msgList.Add(new EstTextSet());\r
}\r
- msgList.Add(string.Empty);\r
+ msgList.Add(new EstTextSet());\r
//本日分だけ予想終了時刻を算出する\r
if (isToday)\r
{\r
- msgList.Add("現在時刻 : " + TimeComponent.justNow().ToString());\r
- msgList.Add("残り作業 : " + new TimeComponent(minuteRemains).ToString());\r
- msgList.Add("予想終了時刻: " + TimeComponent.justNow().add(minuteRemains).ToString());\r
+ msgList.Add(new EstTextSet("現在時刻 : " + TimeComponent.justNow().ToString()));\r
+ msgList.Add(new EstTextSet());\r
+ msgList.Add(new EstTextSet("残り作業 : " + new TimeComponent(minuteRemains).ToString()));\r
+ msgList.Add(new EstTextSet());\r
+ msgList.Add(new EstTextSet("予想終了時刻: " + TimeComponent.justNow().add(minuteRemains).ToString()));\r
+ msgList.Add(new EstTextSet());\r
//msgList.Add(string.Empty);\r
}\r
- form.showOnSubConsole(msgList);\r
+ form.showOnEstConsole(msgList);\r
+ return true;\r
+\r
+ }\r
+ /// <summary>\r
+ /// 向こう一週間の予実を計測してサブコンソールに出力します。\r
+ /// </summary>\r
+ /// <returns></returns>\r
+ private bool getTotal()\r
+ {\r
+ List<EstTextSet> totalList = new List<EstTextSet>();\r
+ List<TotalCountData> dataList = TotalViewAccessor.getObject.getTotalList();\r
+ DateComponent today =SettingDataAccessor.getObject.getToday();\r
+\r
+ totalList.Add(new EstTextSet("1週間の予想と実績"));\r
+ totalList.Add(new EstTextSet());\r
+ //日 付 予 想 実 績\r
+ //07/14(月) 08:00 09:15\r
+ totalList.Add(new EstTextSet("日 付 予 想 実 績 "));\r
+ totalList.Add(new EstTextSet());\r
+ \r
+ foreach (TotalCountData data in dataList)\r
+ {\r
+ string wkStr = string.Empty;\r
+ wkStr += data.Dodate.getDateString();\r
+ wkStr += "(" + data.Dodate.getDowStr() + ")";\r
+ wkStr += " ";\r
+ wkStr += data.ForecastTime.ToString();\r
+ wkStr += " ";\r
+ wkStr += data.RealTime.ToString() + " ";\r
+ //今日だった場合\r
+ if (data.Dodate.calculateDateDiff(today) == 0)\r
+ {\r
+ totalList.Add(new EstTextSet(wkStr, Color.LightBlue));\r
+ }\r
+ else\r
+ {\r
+ totalList.Add(new EstTextSet(wkStr));\r
+ }\r
+ totalList.Add(new EstTextSet());\r
+ }\r
+\r
+ form.showOnTotalConsole(totalList);\r
+\r
+ \r
return true;\r
}\r
\r