| 92 | } |
| 93 | |
| 94 | void MemoryLayout::UpdateElements() { |
| 95 | const auto sd_free_space = fs::GetFreeSpaceForPartition(fs::Partition::SdCard); |
| 96 | const auto sd_total_space = fs::GetTotalSpaceForPartition(fs::Partition::SdCard); |
| 97 | const auto nand_safe_free_space = fs::GetFreeSpaceForPartition(fs::Partition::NANDSafe); |
| 98 | const auto nand_safe_total_space = fs::GetTotalSpaceForPartition(fs::Partition::NANDSafe); |
| 99 | const auto nand_user_free_space = fs::GetFreeSpaceForPartition(fs::Partition::NANDUser); |
| 100 | const auto nand_user_total_space = fs::GetTotalSpaceForPartition(fs::Partition::NANDUser); |
| 101 | const auto nand_system_free_space = fs::GetFreeSpaceForPartition(fs::Partition::NANDSystem); |
| 102 | const auto nand_system_total_space = fs::GetTotalSpaceForPartition(fs::Partition::NANDSystem); |
| 103 | const auto nand_free_space = nand_safe_free_space + nand_user_free_space + nand_system_free_space; |
| 104 | const auto nand_total_space = nand_safe_total_space + nand_user_total_space + nand_system_total_space; |
| 105 | |
| 106 | const auto sd_space_percentage = ComputeSpacePercentage(sd_free_space, sd_total_space); |
| 107 | const auto nand_space_percentage = ComputeSpacePercentage(nand_free_space, nand_total_space); |
| 108 | const auto nand_safe_space_percentage = ComputeSpacePercentage(nand_safe_free_space, nand_safe_total_space); |
| 109 | const auto nand_user_space_percentage = ComputeSpacePercentage(nand_user_free_space, nand_user_total_space); |
| 110 | const auto nand_system_space_percentage = ComputeSpacePercentage(nand_system_free_space, nand_system_total_space); |
| 111 | |
| 112 | this->sd_space_bar->SetProgress(sd_space_percentage); |
| 113 | this->sd_free_text->SetText(MakeSizeInformation(sd_free_space, sd_total_space)); |
| 114 | |
| 115 | this->nand_space_bar->SetProgress(nand_space_percentage); |
| 116 | this->nand_free_text->SetText(MakeSizeInformation(nand_free_space, nand_total_space)); |
| 117 | |
| 118 | this->nand_safe_space_bar->SetProgress(nand_safe_space_percentage); |
| 119 | this->nand_safe_free_text->SetText(MakeSizeInformation(nand_safe_free_space, nand_safe_total_space)); |
| 120 | |
| 121 | this->nand_user_space_bar->SetProgress(nand_user_space_percentage); |
| 122 | this->nand_user_free_text->SetText(MakeSizeInformation(nand_user_free_space, nand_user_total_space)); |
| 123 | |
| 124 | this->nand_system_space_bar->SetProgress(nand_system_space_percentage); |
| 125 | this->nand_system_free_text->SetText(MakeSizeInformation(nand_system_free_space, nand_system_total_space)); |
| 126 | } |
| 127 | |
| 128 | } |
no test coverage detected