Skip to content

Commit

Permalink
ho-dev#1064 TODO training intensity planning
Browse files Browse the repository at this point in the history
  • Loading branch information
wsbrenk committed Jan 23, 2025
1 parent 715a588 commit e042fb7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/main/java/module/tsforecast/ForecastCurve.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/module/tsforecast/TSForecast.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/module/tsforecast/TSPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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);
Expand Down

0 comments on commit e042fb7

Please sign in to comment.