From e042fb7b3dc88b3f7e15f795f54415e75a668abb Mon Sep 17 00:00:00 2001 From: wsbrenk Date: Thu, 23 Jan 2025 22:56:06 +0100 Subject: [PATCH] #1064 TODO training intensity planning --- src/main/java/module/tsforecast/ForecastCurve.java | 9 ++++----- src/main/java/module/tsforecast/TSForecast.java | 1 + src/main/java/module/tsforecast/TSPanel.java | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/module/tsforecast/ForecastCurve.java b/src/main/java/module/tsforecast/ForecastCurve.java index 5494bec5a..606c18937 100644 --- a/src/main/java/module/tsforecast/ForecastCurve.java +++ b/src/main/java/module/tsforecast/ForecastCurve.java @@ -30,12 +30,9 @@ import core.model.misc.Basics; import core.model.series.Liga; import core.util.HODateTime; -import java.text.DateFormat; import java.time.temporal.ChronoUnit; import java.util.*; -import static java.lang.Integer.parseInt; - // Referenced classes of package hoplugins.tsforecast: // Curve @@ -95,6 +92,7 @@ public void addPoint(int i, Curve.Point point) { super.addPoint(i, point); } + // TODO: Add impact of training intensity settings public void forecast(int pos) throws Exception { if (m_clPoints.size() > pos) { Curve.Point point1 = m_clPoints.get(pos); @@ -129,6 +127,7 @@ else if (point2.m_dSpirit < 0.0D) protected abstract double forecastUpdate(Curve.Point point1, Curve.Point point2) throws Exception; + // TODO: Add training events (Intensity) private void readFutureMatches() { Basics ibasics = HOVerwaltung.instance().getModel().getBasics(); if (ibasics == null) return; @@ -166,9 +165,9 @@ private void readFutureMatches() { } } - var matchSorted = matches.stream().sorted(Comparator.comparing(MatchKurzInfo::getMatchSchedule)).toList(); + var matchesSorted = matches.stream().sorted(Comparator.comparing(MatchKurzInfo::getMatchSchedule)).toList(); var toDate = ibasics.getDatum().plus(7 * m_iNoWeeksForecast, ChronoUnit.DAYS); - for (var match : matchSorted) { + for (var match : matchesSorted) { var matchDate = match.getMatchSchedule(); if (matchDate.isAfter(toDate)) break; diff --git a/src/main/java/module/tsforecast/TSForecast.java b/src/main/java/module/tsforecast/TSForecast.java index 0701a5fde..4cefebbfc 100644 --- a/src/main/java/module/tsforecast/TSForecast.java +++ b/src/main/java/module/tsforecast/TSForecast.java @@ -303,6 +303,7 @@ private void createGamesPanel(JPanel jpanel) { boolean bshowCupMatches = ModuleConfig.instance().getBoolean(TS_SHOWCUPMATCHES); boolean bshowQualMatches = ModuleConfig.instance().getBoolean(TS_SHOWQUALIFICATIONMATCH); + // TODO: Add option to set future training intensity settings for (boolean flag = m_LoepiForecast.first() && m_LoepiForecast.next(); flag;) { if (m_LoepiForecast.getAttitude() != IMatchDetails.EINSTELLUNG_UNBEKANNT) { if (m_LoepiForecast.getMatchType() == MatchType.LEAGUE diff --git a/src/main/java/module/tsforecast/TSPanel.java b/src/main/java/module/tsforecast/TSPanel.java index f6361c874..87962955e 100644 --- a/src/main/java/module/tsforecast/TSPanel.java +++ b/src/main/java/module/tsforecast/TSPanel.java @@ -142,6 +142,7 @@ private void drawDiagram( Graphics2D graphics2d) { } + // TODO: Add tooltip and markers for each match (including friendlies) private void drawCurve( Graphics2D graphics2d, Curve curve) { graphics2d.setColor( curve.getColor()); if(curve.first()) { @@ -158,15 +159,17 @@ private void drawCurve( Graphics2D graphics2d, Curve curve) { x = (double)Duration.between(m_startDate.instant, curveDate.instant).toHours()/24D + dayOffset; iSpirit = (int)((curve.getSpirit() * (double)m_iMaxY) / m_dValues); + // TODO: Image of match type + tooltip of match information + if( curve.getPointType() == Curve.RESET_PT) { - graphics2d.drawString( "R", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - 2 - iSpirit); + graphics2d.drawString( "Reset", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - 2 - iSpirit); } else if( curve.getAttitude() != IMatchDetails.EINSTELLUNG_NORMAL && curve.getAttitude() != IMatchDetails.EINSTELLUNG_UNBEKANNT) { if( curve.getAttitude() == IMatchDetails.EINSTELLUNG_PIC) - graphics2d.drawString( "P", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - 2 - iSpirit); + graphics2d.drawString( "PIC", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame + UserParameter.instance().fontSize + 2 - iSpirit); else - graphics2d.drawString("M", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - 2 - iSpirit); + graphics2d.drawString("MOTS", (int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - 2 - iSpirit); } polygon1.addPoint((int)(x * m_dFactor + (double)m_iCoordX0), m_iMaxY + DYFrame - iSpirit);