• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル


Commit MetaInfo

修訂61f5ff9bd36a871fd9fca272c05952ca02553c1b (tree)
時間2021-06-27 05:07:21
作者yoshy <yoshy@user...>
Commiteryoshy

Log Message

temp_20210627_0507

Change Summary

差異

--- a/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
+++ b/App/Adaptor/Gateway/ViewModel/Dto/UmaRaceRowDto.cs
@@ -55,6 +55,10 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
5555
5656 CourseName = TurfDirtName + Race?.Kyori;
5757
58+ TrackShapeName = CodeHelper.GetInstance().GetTrackShapeName(Race?.Trackcd, "不明");
59+
60+ bool isFlatRace = Race?.Trackcd.CompareTo("50") < 0;
61+
5862 TosuFormatted = FormatHelper.FormatTosu(Race);
5963
6064 BabaJyotaiFormatted = FormatHelper.FormatBabaJyotai(Race);
@@ -67,29 +71,52 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
6771
6872 Kimete = CodeHelper.GetInstance().GetName(CodeHelper.KYAKUSITU_KUBUN, Kyakusitukubun, "不明");
6973
70- PCIRatioFormatted = FormatHelper.FormatPCIRatio(Harontimel3, Stat?.Harontimel3Avg, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
74+ if (isFlatRace)
75+ {
76+ PCIRatioFormatted = FormatHelper.FormatPCIRatio(Harontimel3, Stat?.Harontimel3Avg, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
7177
72- HaronTimeL3Formatted = FormatHelper.FormatTimeSSF(Harontimel3);
78+ HaronTimeL3Formatted = FormatHelper.FormatTimeSSF(Harontimel3);
7379
74- HaronTimeL3DevFormatted = FormatHelper.FormatHaronTimeL3Dev(Harontimel3, Stat?.Harontimel3Avg, Stat?.Harontimel3Dev);
80+ HaronTimeL3DevFormatted = FormatHelper.FormatHaronTimeL3Dev(Harontimel3, Stat?.Harontimel3Avg, Stat?.Harontimel3Dev);
7581
76- PCIFormatted = FormatHelper.FormatPCI(Harontimel3, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
82+ PCIFormatted = FormatHelper.FormatPCI(Harontimel3, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
7783
78- AvgHaronTimeMinus3Formatted = FormatHelper.FormatAvgHaronTimeMinus3(Time, Harontimel3, Race?.Kyori);
84+ AvgHaronTimeMinus3Formatted = FormatHelper.FormatAvgHaronTimeMinus3(Time, Harontimel3, Race?.Kyori);
7985
80- AvgHaronTimeMinus3DevFormatted = FormatHelper.FormatAvgHaronTimeMinus3Dev(Time, Harontimel3, Race?.Kyori, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
86+ AvgHaronTimeMinus3DevFormatted = FormatHelper.FormatAvgHaronTimeMinus3Dev(Time, Harontimel3, Race?.Kyori, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
8187
82- TimeFormatted = FormatHelper.FormatTimeMSSF(Time);
88+ StatPCIFormatted = FormatHelper.FormatPCI(Stat?.Harontimel3Avg, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
8389
84- FutanFormatted = FormatHelper.ToNumber(Futan, 3, 1);
90+ StatHaronTimeL3Formatted = FormatHelper.FormatTimeSSF(Stat?.Harontimel3Avg);
8591
86- BataijyuFormatted = FormatHelper.FormatBataijyu(Bataijyu, Zogenfugo, Zogensa);
92+ StatAvgHaronTimeMinus3Formatted = FormatHelper.FormatTimeSSF(Stat?.Avgharontimeminus3Avg);
93+ }
94+ else
95+ {
96+ PCIRatioFormatted = FormatHelper.NODATA;
97+
98+ HaronTimeL3Formatted = FormatHelper.NODATA;
99+
100+ HaronTimeL3DevFormatted = FormatHelper.NODATA;
101+
102+ PCIFormatted = FormatHelper.NODATA;
103+
104+ AvgHaronTimeMinus3Formatted = FormatHelper.FormatAvgHaronTime3(Time, Race?.Kyori);
87105
88- StatPCIFormatted = FormatHelper.FormatPCI(Stat?.Harontimel3Avg, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
106+ AvgHaronTimeMinus3DevFormatted = FormatHelper.FormatAvgHaronTime3Dev(Time, Race?.Kyori, Stat?.Avgharontimeminus3Avg, Stat?.Avgharontimeminus3Dev);
89107
90- StatHaronTimeL3Formatted = FormatHelper.FormatTimeSSF(Stat?.Harontimel3Avg);
108+ StatPCIFormatted = FormatHelper.NODATA;
91109
92- StatAvgHaronTimeMinus3Formatted = FormatHelper.FormatTimeSSF(Stat?.Avgharontimeminus3Avg);
110+ StatHaronTimeL3Formatted = FormatHelper.NODATA;
111+
112+ StatAvgHaronTimeMinus3Formatted = FormatHelper.FormatTimeSSF(Stat?.Avgharontimeminus3Avg);
113+ }
114+
115+ TimeFormatted = FormatHelper.FormatTimeMSSF(Time);
116+
117+ FutanFormatted = FormatHelper.ToNumber(Futan, 3, 1);
118+
119+ BataijyuFormatted = FormatHelper.FormatBataijyu(Bataijyu, Zogenfugo, Zogensa);
93120 }
94121
95122 public string YearMonthDay { get; private set; }
@@ -108,6 +135,8 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
108135
109136 public string CourseName { get; private set; }
110137
138+ public string TrackShapeName { get; private set; }
139+
111140 public string TosuFormatted { get; private set; }
112141
113142 public string BabaJyotaiFormatted { get; private set; }
--- a/App/Domain/Model/Repository/Database/Dto/UmaRaceStat.cs
+++ b/App/Domain/Model/Repository/Database/Dto/UmaRaceStat.cs
@@ -8,7 +8,7 @@ using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
88
99 namespace UmaTest.App.Domain.Model.Repository.Database.Dto
1010 {
11- public class UmaRaceStat : AppUmaRaceStddev
11+ public class UmaRaceStat : AppUmaRaceStat
1212 {
1313 [Ignore]
1414 public string Key => $"{Jyocd}-{Kyori}-{Trackcd}-{Gradecd}-{Syubetucd}-{Kaishudate}";
--- a/App/Domain/Model/Repository/Database/Entity/EveryDB2.cs
+++ b/App/Domain/Model/Repository/Database/Entity/EveryDB2.cs
@@ -34,11 +34,11 @@ namespace UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2
3434 }
3535 }
3636
37- [TableName("\"public\".\"app_uma_race_stddev\"")]
37+ [TableName("\"public\".\"app_uma_race_stat\"")]
3838 [PrimaryKey("kaishudate", AutoIncrement = false)]
3939 [ExplicitColumns]
40- public partial class AppUmaRaceStddev
41- : Record<AppUmaRaceStddev>
40+ public partial class AppUmaRaceStat
41+ : Record<AppUmaRaceStat>
4242 {
4343 [Column(Name = "jyocd")]
4444 public string Jyocd
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -562,6 +562,11 @@ namespace UmaTest.App.Presentation.View
562562 },
563563 new DataGridViewTextBoxColumn
564564 {
565+ DataPropertyName = "TrackShapeName",
566+ Name = "形状",
567+ },
568+ new DataGridViewTextBoxColumn
569+ {
565570 DataPropertyName = "GradeName",
566571 Name = "G",
567572 },
@@ -704,6 +709,7 @@ namespace UmaTest.App.Presentation.View
704709 //dataGridView2.Columns["コース"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
705710 //dataGridView2.Columns["馬体重"].HeaderCell.Style.WrapMode = DataGridViewTriState.False;
706711
712+ dataGridView2.Columns["形状"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
707713 dataGridView2.Columns["G"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
708714 dataGridView2.Columns["頭数"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
709715 dataGridView2.Columns["馬場"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
@@ -925,8 +931,9 @@ namespace UmaTest.App.Presentation.View
925931 DataGridViewCell cellGrade = row.Cells["G"];
926932 DataGridViewCell cellBasyo = row.Cells["場所"];
927933 DataGridViewCell cellCourse = row.Cells["コース"];
934+ DataGridViewCell cellShape = row.Cells["形状"];
928935
929- ColorizeGradeBasyoCourse(row, cellGrade, cellBasyo, cellCourse);
936+ ColorizeGradeBasyoCourse(row, cellGrade, cellBasyo, cellCourse, cellShape);
930937
931938 DataGridViewCell cellNinki = row.Cells["人気"];
932939 DataGridViewCell cellJyuni = row.Cells["着順"];
@@ -948,7 +955,8 @@ namespace UmaTest.App.Presentation.View
948955 }
949956 }
950957
951- private void ColorizeGradeBasyoCourse(DataGridViewRow row, DataGridViewCell cellGrade, DataGridViewCell cellBasyo, DataGridViewCell cellCourse)
958+ private void ColorizeGradeBasyoCourse(DataGridViewRow row, DataGridViewCell cellGrade,
959+ DataGridViewCell cellBasyo, DataGridViewCell cellCourse, DataGridViewCell cellShape)
952960 {
953961 NRace race = null;
954962
@@ -963,12 +971,20 @@ namespace UmaTest.App.Presentation.View
963971 return;
964972 }
965973
966- ColorizeGradeBasyoCourse(race, cellGrade, cellBasyo, cellCourse);
974+ ColorizeGradeBasyoCourse(race, cellGrade, cellBasyo, cellCourse, cellShape);
967975 }
968976
969- private void ColorizeGradeBasyoCourse(NRace race, DataGridViewCell cellGrade, DataGridViewCell cellBasyo, DataGridViewCell cellCourse)
977+ private void ColorizeGradeBasyoCourse(NRace race, DataGridViewCell cellGrade,
978+ DataGridViewCell cellBasyo, DataGridViewCell cellCourse)
970979 {
971- if ( (race == null) || (cellGrade?.Value == null) || (cellBasyo?.Value == null) || (cellCourse?.Value == null) )
980+ ColorizeGradeBasyoCourse(race, cellGrade, cellBasyo, cellCourse, null);
981+ }
982+
983+ private void ColorizeGradeBasyoCourse(NRace race, DataGridViewCell cellGrade,
984+ DataGridViewCell cellBasyo, DataGridViewCell cellCourse, DataGridViewCell cellShape)
985+ {
986+ if ( (race == null) || (cellGrade?.Value == null)
987+ || (cellBasyo?.Value == null) || (cellCourse?.Value == null))
972988 {
973989 return;
974990 }
@@ -996,18 +1012,15 @@ namespace UmaTest.App.Presentation.View
9961012 bool isNearCourse = isRowEqualTurfDirt && isRowNearKyori;
9971013 bool isEqualCourse = isNearCourse && isRowEqualKyori && isRowEqualTrackCd;
9981014
1015+ bool isNearShape = isRowEqualTurfDirt && isRowNearKyori && isRowEqualTrackCd;
1016+ bool isEqualShape = isNearShape && isRowEqualKyori;
1017+
9991018 bool isNearBasyoCourse = isNearCourse && isRowEqualJyoCd;
10001019 bool isEqualBasyoCourse = isNearBasyoCourse && isEqualCourse;
10011020
10021021 bool isNearGrade = isNearCourse && isRowEqualGrade;
10031022 bool isEqualGrade = isNearGrade && isEqualBasyoCourse;
10041023
1005- (Color, Color) colorGrade = isNearGrade
1006- ? isEqualGrade
1007- ? AppConst.COLOR_FIRST
1008- : AppConst.COLOR_SECOND
1009- : AppConst.COLOR_NONE;
1010-
10111024 (Color, Color) colorBasyo = isNearBasyoCourse
10121025 ? isEqualBasyoCourse
10131026 ? AppConst.COLOR_FIRST
@@ -1020,10 +1033,17 @@ namespace UmaTest.App.Presentation.View
10201033 : AppConst.COLOR_SECOND
10211034 : AppConst.COLOR_NONE;
10221035
1023- if (colorGrade != AppConst.COLOR_NONE)
1024- {
1025- ChangeCellBackColor(cellGrade, colorGrade);
1026- }
1036+ (Color, Color) colorShape = isNearShape
1037+ ? isEqualShape
1038+ ? AppConst.COLOR_FIRST
1039+ : AppConst.COLOR_SECOND
1040+ : AppConst.COLOR_NONE;
1041+
1042+ (Color, Color) colorGrade = isNearGrade
1043+ ? isEqualGrade
1044+ ? AppConst.COLOR_FIRST
1045+ : AppConst.COLOR_SECOND
1046+ : AppConst.COLOR_NONE;
10271047
10281048 if (colorBasyo != AppConst.COLOR_NONE)
10291049 {
@@ -1034,6 +1054,16 @@ namespace UmaTest.App.Presentation.View
10341054 {
10351055 ChangeCellBackColor(cellCourse, colorCourse);
10361056 }
1057+
1058+ if ( (cellShape != null) && (colorShape != AppConst.COLOR_NONE) )
1059+ {
1060+ ChangeCellBackColor(cellShape, colorShape);
1061+ }
1062+
1063+ if (colorGrade != AppConst.COLOR_NONE)
1064+ {
1065+ ChangeCellBackColor(cellGrade, colorGrade);
1066+ }
10371067 }
10381068
10391069 private static void ColorizeKankaku(DataGridViewCell cellKankaku)
--- a/Infra/Helper/CodeHelper.cs
+++ b/Infra/Helper/CodeHelper.cs
@@ -26,7 +26,7 @@ namespace UmaTest.Infra.Helper
2626 public static readonly string KYAKUSITU_KUBUN = "9201";
2727 public static readonly string RACE_DATA_KUBUN = "9202";
2828
29- public const string TRACK_NAME_TURF_AND_DIRT = "芝ダ";
29+ public const string TRACK_NAME_TURF_TO_DIRT = "芝ダ";
3030 public const string TRACK_NAME_TURF = "芝";
3131 public const string TRACK_NAME_DIRT = "ダ";
3232 public const string TRACK_NAME_SAND = "砂";
@@ -40,6 +40,7 @@ namespace UmaTest.Infra.Helper
4040 public static readonly string RACE_CLASS_THREE_WINS = "3勝";
4141
4242 private const string NODATA = "-";
43+ private const string NODETAIL = "―";
4344 private const string NA = "NA";
4445 private const string UNKNOWN = "?";
4546 private const string ERROR_VALUE = "#ERROR";
@@ -66,15 +67,15 @@ namespace UmaTest.Infra.Helper
6667
6768 public string GetRaceName(NRace race, string errorValue)
6869 {
69- return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, errorValue) : string.Empty;
70+ return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, race.Kigocd, errorValue) : string.Empty;
7071 }
7172
7273 public string GetRaceName(NTokuRace race, string errorValue)
7374 {
74- return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, errorValue) : string.Empty;
75+ return race != null ? GetRaceName(race.Hondai, race.Gradecd, race.Jyokencd5, race.Kigocd, errorValue) : string.Empty;
7576 }
7677
77- private string GetRaceName(string hondai, string gradeCd, string jyokenCd, string errorValue)
78+ private string GetRaceName(string hondai, string gradeCd, string jyokenCd, string kigoCd, string errorValue)
7879 {
7980 if (!String.IsNullOrEmpty(hondai))
8081 {
@@ -92,30 +93,49 @@ namespace UmaTest.Infra.Helper
9293
9394 //Logger.Debug($"条件CD:{jyokenCd}");
9495
96+ string winClass = string.Empty;
97+
9598 if (jyokenCd.CompareTo("100") <= 0)
9699 {
97100 if (int.TryParse(jyokenCd, out int shokin))
98101 {
99102 if (shokin <= 5)
100103 {
101- return "1勝クラス";
104+ winClass = "1勝クラス";
102105 }
103106 else if (shokin <= 10)
104107 {
105- return "2勝クラス";
108+ winClass = "2勝クラス";
106109 }
107110 else if (shokin <= 16)
108111 {
109- return "3勝クラス";
112+ winClass = "3勝クラス";
110113 }
111114 else if (shokin <= 100)
112115 {
113- return "オープン戦";
116+ winClass = "オープン戦";
114117 }
115118 }
116119 }
117120
118- return GetName(CodeHelper.JYOKEN_CODE, jyokenCd, errorValue);
121+ if (string.IsNullOrEmpty(winClass))
122+ {
123+ winClass = GetName(CodeHelper.JYOKEN_CODE, jyokenCd, errorValue);
124+ }
125+
126+ string himba = GetHimbaName(kigoCd);
127+
128+ if (!string.IsNullOrEmpty(himba))
129+ {
130+ return $"{winClass} ({himba})";
131+ }
132+
133+ return winClass;
134+ }
135+
136+ public string GetHimbaName(string kigoCd)
137+ {
138+ return (!string.IsNullOrEmpty(kigoCd) && (kigoCd.Length == 3) && (kigoCd[1] == '2')) ? "牝" : string.Empty;
119139 }
120140
121141 public string GetGradeName(NRace race, string errorValue)
@@ -187,13 +207,18 @@ namespace UmaTest.Infra.Helper
187207
188208 string trackEngName = GetName(TRACK_CODE, trackCd, 2, errorValue);
189209
210+ if (trackEngName == errorValue)
211+ {
212+ return trackEngName;
213+ }
214+
190215 if (trackCd.CompareTo("50") < 0)
191216 {
192217 return ExtractTurfDartName(trackEngName);
193218 }
194219 else
195220 {
196- string turfDartKbn = (trackCd != "52") ? ExtractTurfDartName(trackEngName) : TRACK_NAME_TURF_AND_DIRT;
221+ string turfDartKbn = (trackCd != "52") ? ExtractTurfDartName(trackEngName) : TRACK_NAME_TURF_TO_DIRT;
197222 return TRACK_NAME_HURDLE + turfDartKbn;
198223 }
199224 }
@@ -225,6 +250,57 @@ namespace UmaTest.Infra.Helper
225250 return turfDartKbn;
226251 }
227252
253+ public string GetTrackShapeName(string trackCd, string errorValue)
254+ {
255+ if (string.IsNullOrEmpty(trackCd))
256+ {
257+ return string.Empty;
258+ }
259+
260+ string trackName = GetName(TRACK_CODE, trackCd, 1, errorValue);
261+
262+ if (trackName == errorValue)
263+ {
264+ return trackName;
265+ }
266+
267+ if (trackCd.CompareTo("50") < 0)
268+ {
269+ return ExtractFlagTrackShapeName(trackName, errorValue);
270+ }
271+ else
272+ {
273+ return ExtractJumpTrackShapeName(trackName, errorValue);
274+ }
275+ }
276+
277+ private string ExtractFlagTrackShapeName(string trackName, string errorValue)
278+ {
279+ string[] raceTypeAndTrackShape = trackName.Split('・');
280+
281+ if (raceTypeAndTrackShape.Length != 2)
282+ {
283+ return errorValue;
284+ }
285+
286+ return raceTypeAndTrackShape[1];
287+ }
288+
289+ private string ExtractJumpTrackShapeName(string trackName, string errorValue)
290+ {
291+ if (!trackName.StartsWith("芝・"))
292+ {
293+ if (trackName == "芝")
294+ {
295+ return NODETAIL;
296+ }
297+
298+ return trackName;
299+ }
300+
301+ return trackName.Substring(2);
302+ }
303+
228304 public string GetName(string code, string value, string errorValue = ERROR_VALUE)
229305 {
230306 return GetName(code, value, 0, errorValue);
--- a/Infra/Helper/FormatHelper.cs
+++ b/Infra/Helper/FormatHelper.cs
@@ -330,6 +330,95 @@ namespace UmaTest.Infra.Helper
330330 return ((decimal)(time - haronTimeL3)) * (600 / divider) / (kyori - 600);
331331 }
332332
333+ public static string FormatAvgHaronTime3(string time, string kyori)
334+ {
335+ if (string.IsNullOrEmpty(time) || string.IsNullOrEmpty(kyori))
336+ {
337+ return string.Empty;
338+ }
339+
340+ if (time == INIT_DATA_0000)
341+ {
342+ return NODATA;
343+ }
344+
345+ try
346+ {
347+ // unit: 100[msec.]
348+ int nTime = int.Parse(time.Substring(0, 1)) * 600 + int.Parse(time.Substring(1, 3));
349+
350+ int nKyori = int.Parse(kyori);
351+
352+ return FormatAvgHaronTime3(nTime, nKyori);
353+ }
354+ catch (Exception)
355+ {
356+ return NA;
357+ }
358+ }
359+
360+ public static string FormatAvgHaronTime3(int time, int kyori)
361+ {
362+ if (time == -1)
363+ {
364+ return NODATA;
365+ }
366+
367+ // unit: 1[sec.]
368+ decimal avgHaronTime3 = CalcAvgHaronTime3(time, kyori, 10);
369+
370+ return Math.Round(avgHaronTime3, 2, MidpointRounding.AwayFromZero).ToString("0.00");
371+ }
372+
373+ public static string FormatAvgHaronTime3Dev(string time, string kyori, decimal? avgAvgHaronTime3F, decimal? stdDevtAvgHaronTime3)
374+ {
375+ if (string.IsNullOrEmpty(time) || string.IsNullOrEmpty(kyori)
376+ || !avgAvgHaronTime3F.HasValue || !stdDevtAvgHaronTime3.HasValue)
377+ {
378+ return string.Empty;
379+ }
380+
381+ if (time == INIT_DATA_0000)
382+ {
383+ return NODATA;
384+ }
385+
386+ try
387+ {
388+ // unit: 100[msec.]
389+ int nTime = int.Parse(time.Substring(0, 1)) * 600 + int.Parse(time.Substring(1, 3));
390+
391+ int nKyori = int.Parse(kyori);
392+
393+ return FormatAvgHaronTime3Dev(nTime, nKyori, avgAvgHaronTime3F, stdDevtAvgHaronTime3);
394+ }
395+ catch (Exception)
396+ {
397+ return NA;
398+ }
399+ }
400+
401+ public static string FormatAvgHaronTime3Dev(int time, int kyori, decimal? avgAvgHaronTime3F, decimal? stdDevtAvgHaronTime3)
402+ {
403+ if (time == -1)
404+ {
405+ return NODATA;
406+ }
407+
408+ // unit: 100[msec.]
409+ decimal avgHaronTime3 = CalcAvgHaronTime3(time, kyori, 1);
410+
411+ decimal dev = CalcScoreByStdDevReverse(avgHaronTime3, avgAvgHaronTime3F.Value, stdDevtAvgHaronTime3.Value, 100, 20);
412+
413+ return Math.Round(dev, 1, MidpointRounding.AwayFromZero).ToString("#0.0");
414+ }
415+
416+ private static decimal CalcAvgHaronTime3(int time, int kyori, int divider)
417+ {
418+ // unit: 1[sec.] / divider
419+ return ((decimal)time) * (600 / divider) / kyori;
420+ }
421+
333422 public static string FormatPCI(string haronTimeL3, decimal? avgAvgHaronTimeMinus3F, decimal? stdDevtAvgHaronTimeMinus3)
334423 {
335424 if (string.IsNullOrEmpty(haronTimeL3))
@@ -496,19 +585,7 @@ namespace UmaTest.Infra.Helper
496585 string sibaJyotai = CodeHelper.GetInstance().GetName(CodeHelper.BABA_JYOTAI_CODE, race.Sibababacd, string.Empty);
497586 string dirtJyotai = CodeHelper.GetInstance().GetName(CodeHelper.BABA_JYOTAI_CODE, race.Dirtbabacd, string.Empty);
498587
499- string turfDirtName = CodeHelper.GetInstance().GetTurfDurtName(race.Trackcd, string.Empty);
500-
501- switch(turfDirtName)
502- {
503- case CodeHelper.TRACK_NAME_TURF:
504- return sibaJyotai;
505- case CodeHelper.TRACK_NAME_DIRT:
506- return dirtJyotai;
507- case CodeHelper.TRACK_NAME_TURF_AND_DIRT:
508- return !string.IsNullOrEmpty(sibaJyotai) && !string.IsNullOrEmpty(dirtJyotai) ? sibaJyotai + "・" + dirtJyotai : string.Empty;
509- }
510-
511- return string.Empty;
588+ return sibaJyotai + (!string.IsNullOrEmpty(sibaJyotai) && !string.IsNullOrEmpty(dirtJyotai) ? "/" : string.Empty) + dirtJyotai;
512589 }
513590
514591 public static string FormatTosu(NTokuRace race)
--- a/Resources/Sql/NUmaRaceDao_FindAllRacesByKettoNumListAsync.sql
+++ b/Resources/Sql/NUmaRaceDao_FindAllRacesByKettoNumListAsync.sql
@@ -45,7 +45,7 @@ from
4545 left join n_course c
4646 using(jyocd, kyori, trackcd)
4747 )
48-SELECT ur.*, r.*, k.*, c.*, ot.*, h1.*, h5.*, urdev.*
48+SELECT ur.*, r.*, k.*, c.*, ot.*, h1.*, h5.*, urstat.*
4949 FROM n_uma_race ur
5050 INNER JOIN n_race r USING(year, jyocd, kaiji, nichiji, racenum)
5151 LEFT JOIN n_uma u USING(kettonum)
@@ -75,12 +75,12 @@ AND vur.gradecd = case r.gradecd
7575 else r.gradecd
7676 end
7777 AND r.syubetucd = vur.syubetucd
78-LEFT JOIN app_uma_race_stddev urdev
79- ON vur.jyocd = urdev.jyocd
80-AND vur.kyori = urdev.kyori
81-AND vur.trackcd = urdev.trackcd
82-AND vur.gradecd = urdev.gradecd
83-AND vur.syubetucd = urdev.syubetucd
84-AND vur.kaishudate = urdev.kaishudate
78+LEFT JOIN app_uma_race_stat urstat
79+ ON vur.jyocd = urstat.jyocd
80+AND vur.kyori = urstat.kyori
81+AND vur.trackcd = urstat.trackcd
82+AND vur.gradecd = urstat.gradecd
83+AND vur.syubetucd = urstat.syubetucd
84+AND vur.kaishudate = urstat.kaishudate
8585 WHERE ur.kettonum in (@KettoNums)
8686 ORDER BY ur.kettonum, ur.year desc, ur.monthday desc
\ No newline at end of file
--- a/Resources/Sql/uma_race_stddev2.sql
+++ b/Resources/Sql/uma_race_stddev2.sql
@@ -1,4 +1,4 @@
1-create table app_uma_race_stddev as
1+create table app_uma_race_stat as
22 with v_uma_race_base1 as (
33 select
44 r.jyocd
@@ -62,12 +62,15 @@ select
6262 + to_number(substring(ur.time, 2, 2), '00') * 10
6363 + to_number(substring(ur.time, 4, 1), '0')
6464 end as time
65- , case ur.harontimel3
66- when '000' then null
67- when '999' then null
68- when ' ' then null
69- else to_number(substring(ur.harontimel3, 1, 2), '00') * 10
70- + to_number(substring(ur.harontimel3, 3, 1), '0')
65+ , case
66+ when ur.trackcd >= '50' then null
67+ else case ur.harontimel3
68+ when '000' then null
69+ when '999' then null
70+ when ' ' then null
71+ else to_number(substring(ur.harontimel3, 1, 2), '00') * 10
72+ + to_number(substring(ur.harontimel3, 3, 1), '0')
73+ end
7174 end as harontimel3
7275 from
7376 v_uma_race_base2 ur
@@ -81,9 +84,12 @@ select
8184 , ur.kaishudate
8285 , ur.time
8386 , ur.harontimel3
84- , case ur.harontimel3
85- when null then null
86- else (ur.time - ur.harontimel3) * 600 / (ur.kyori - 600)
87+ , case
88+ when ur.trackcd >= '50' then ur.time * 600 / ur.kyori
89+ else case ur.harontimel3
90+ when null then null
91+ else (ur.time - ur.harontimel3) * 600 / (ur.kyori - 600)
92+ end
8793 end as avgharontimeminus3
8894 from
8995 v_uma_race_base3 ur
@@ -125,7 +131,7 @@ order by
125131 , ur.syubetucd
126132 , ur.kaishudate
127133 ;
128-alter table app_uma_race_stddev add constraint pk_app_uma_race_stddev primary key (jyocd, kyori, trackcd, gradecd, syubetucd, kaishudate)
134+alter table app_uma_race_stat add constraint pk_app_uma_race_stat primary key (jyocd, kyori, trackcd, gradecd, syubetucd, kaishudate)
129135 ;
130-drop table app_uma_race_stddev
136+drop table app_uma_race_stat
131137 ;