mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
rdm update every 2 seconds
This commit is contained in:
parent
1cd06e3267
commit
4337b65f52
3 changed files with 18 additions and 2 deletions
|
@ -23,6 +23,7 @@ namespace Slic3r {
|
|||
namespace GUI {
|
||||
|
||||
std::vector<DriveData> RemovableDriveManager::m_current_drives;
|
||||
long RemovableDriveManager::m_last_update = 0;
|
||||
|
||||
#if _WIN32
|
||||
void RemovableDriveManager::search_for_drives()
|
||||
|
@ -215,8 +216,20 @@ bool RemovableDriveManager::is_path_on_removable_drive(const std::string &path)
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
bool RemovableDriveManager::update()
|
||||
bool RemovableDriveManager::update(long time)
|
||||
{
|
||||
if(time != 0) //time = 0 is forced update
|
||||
{
|
||||
long diff = m_last_update - time;
|
||||
if(diff <= -2)
|
||||
{
|
||||
m_last_update = time;
|
||||
}else
|
||||
{
|
||||
return false; // return value shouldnt matter if update didnt run
|
||||
}
|
||||
}
|
||||
std::cout << "RDM update " << m_last_update <<"\n";
|
||||
search_for_drives();
|
||||
return !m_current_drives.empty();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue