Add fingerprints reset on first start
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Akari.Provider.WaveshareUART.Views
|
|||||||
private Label _serialPortLabel;
|
private Label _serialPortLabel;
|
||||||
private Label _comparisonLevelLabel;
|
private Label _comparisonLevelLabel;
|
||||||
private Label _userCountLabel;
|
private Label _userCountLabel;
|
||||||
|
private bool _needToClear;
|
||||||
|
|
||||||
public TUIManager()
|
public TUIManager()
|
||||||
{
|
{
|
||||||
@@ -105,11 +106,23 @@ namespace Akari.Provider.WaveshareUART.Views
|
|||||||
// Init Sensor
|
// Init Sensor
|
||||||
if (!File.Exists(SettingsFilePath))
|
if (!File.Exists(SettingsFilePath))
|
||||||
{
|
{
|
||||||
|
_needToClear = true;
|
||||||
|
|
||||||
Application.Run(new SettingsDisplay());
|
Application.Run(new SettingsDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
Provider.InitSensor();
|
Provider.InitSensor();
|
||||||
|
|
||||||
|
if (_needToClear)
|
||||||
|
{
|
||||||
|
if (!Provider.FingerprintSensor.DeleteAllUsers())
|
||||||
|
{
|
||||||
|
MessageBox.ErrorQuery("Provider", "Can't clear registered fingerprints, check if the sensor is working correctly", "Ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
_needToClear = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Update gui
|
// Update gui
|
||||||
UpdateSerialPort();
|
UpdateSerialPort();
|
||||||
UpdateUserCount();
|
UpdateUserCount();
|
||||||
|
|||||||
Reference in New Issue
Block a user