ENH: update flush data for H2D

1.Alsoe set default flush from support to 700

jira: STUDIO-10595

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I0d0a85cdac5e63b787c16b35ed6c05afc885a715
(cherry picked from commit 5fea5e6696a28d7ec9edcde38c43700cb3b7f596)
This commit is contained in:
xun.zhang
2025-03-21 15:08:53 +08:00
committed by Noisyfox
parent 996da6eebe
commit 81382448eb
11 changed files with 304 additions and 75 deletions

View File

@@ -8,6 +8,14 @@
namespace FlushPredict
{
enum FlushMachineType
{
Standard,
DualStandard,
DualHighFlow
};
struct RGBColor
{
unsigned char r{ 0 };
@@ -35,25 +43,17 @@ namespace FlushPredict
}
class FlushVolPredictor;
// Singleton pattern
class FlushVolPredictor
class GenericFlushPredictor
{
using RGB = FlushPredict::RGBColor;
using MachineType = FlushPredict::FlushMachineType;
public:
bool predict(const RGB& from,const RGB& to , float& flush);
static FlushVolPredictor& get_instance();
explicit GenericFlushPredictor(const MachineType& type);
bool predict(const RGB& from, const RGB& to, float& flush);
private:
FlushVolPredictor(const std::string& data_file);
FlushVolPredictor(const FlushVolPredictor&) = delete;
FlushVolPredictor& operator=(const FlushVolPredictor&) = delete;
~FlushVolPredictor() = default;
uint64_t generate_hash_key(const RGB& from, const RGB& to);
private:
std::unordered_map<uint64_t, float> m_flush_map;
std::vector<RGB> m_colors;
bool m_valid;
FlushVolPredictor* predictor{ nullptr };
};