| 17 | namespace winrt::FastCopy::implementation |
| 18 | { |
| 19 | struct SpeedGraph : SpeedGraphT<SpeedGraph> |
| 20 | { |
| 21 | SpeedGraph(); |
| 22 | |
| 23 | void SetTotal(uint64_t bytes) { m_total = bytes; } |
| 24 | void AddPoint(uint64_t progressBytes, uint64_t speed); |
| 25 | void SetSpeed(uint64_t speed); |
| 26 | void SetSpeed(double percent, uint64_t speed); |
| 27 | |
| 28 | void Pause(); |
| 29 | void Error(); |
| 30 | private: |
| 31 | uint64_t m_total{}; |
| 32 | uint64_t m_currentMax = 1024; |
| 33 | |
| 34 | winrt::Windows::Foundation::Size m_graphSize{}; |
| 35 | |
| 36 | float getX(uint64_t progressBytes); |
| 37 | float getY(uint64_t speed); |
| 38 | |
| 39 | /** |
| 40 | * @brief Recaculate graph point because of the speed scale changed |
| 41 | */ |
| 42 | void resizeGraphPoint(float ratio); |
| 43 | float m_ratio = 1.0f; |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | * @brief Make animation when the scale is changed |
| 48 | */ |
| 49 | void makeAnimation(); |
| 50 | |
| 51 | void makeAnimation(float y); |
| 52 | std::chrono::steady_clock::time_point m_start{}; |
| 53 | constexpr static auto BackgroundCircleDistance = 6; |
| 54 | public: |
| 55 | void CanvasControl_Draw(winrt::Microsoft::Graphics::Canvas::UI::Xaml::CanvasControl const& sender, winrt::Microsoft::Graphics::Canvas::UI::Xaml::CanvasDrawEventArgs const& args); |
| 56 | void UserControl_SizeChanged(winrt::Windows::Foundation::IInspectable const& sender, winrt::Microsoft::UI::Xaml::SizeChangedEventArgs const& e); |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | namespace winrt::FastCopy::factory_implementation |
no outgoing calls
no test coverage detected