Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 97fc96b

Browse files
committed
feat: fix FPS to 20
1 parent a2b8b80 commit 97fc96b

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
None
1111

12+
## 24.4.0
13+
14+
### Changed
15+
16+
- Remove FPS displaying
17+
- Fixed FPS to 20
18+
19+
## 24.4.3
20+
21+
### Fixed
22+
23+
- Crash when a COM port is corrupted
24+
1225
## 24.4.2
1326

1427
### Changed

Source/MainWindow.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ public Dictionary<CampType, SerialPort> SerialPortDict
168168
private ConfigType _config = MainWindow.DefaultConfig;
169169
private OpenCvSharp.Size _courtSize;
170170
private CoordinateConverter _coordinateConverter;
171-
private decimal _fps = 30; // Just a magic number.
172171
private Game _game = new Game();
173172
private Dictionary<CampType, Locator> _locatorDict = new Dictionary<CampType, Locator>();
174173
private Point2f[] _monitorCorners = new Point2f[4];
@@ -248,7 +247,7 @@ public MainWindow()
248247
);
249248

250249
// Setup the timer
251-
this.timer.Interval = 1;
250+
this.timer.Interval = 50;
252251
this.timer.Start();
253252

254253
// Setup the locators
@@ -721,20 +720,6 @@ private void Draw(ref Mat image)
721720
);
722721
}
723722
}
724-
725-
// Draw frame rate information.
726-
this._fps = this._fps * (1 - MainWindow.FpsUpdateDecay) + (1000M / this._game.LastTickDuration) * MainWindow.FpsUpdateDecay;
727-
Cv2.PutText(
728-
image,
729-
text: $"FPS: {(int)this._fps}",
730-
org: new Point2i(5, 30),
731-
fontFace: HersheyFonts.HersheySimplex,
732-
fontScale: 1,
733-
color: new Scalar(255, 0, 255),
734-
thickness: 2,
735-
bottomLeftOrigin: false,
736-
lineType: LineTypes.AntiAlias
737-
);
738723
}
739724

740725
/// <summary>

0 commit comments

Comments
 (0)