diff options
feat(LEDVideoWall): Change panel and wall size input format
1 files changed, 12 insertions, 20 deletions
| -rw-r--r-- | src/LEDVideoWall.cpp | 32 |
diff --git a/src/LEDVideoWall.cpp b/src/LEDVideoWall.cpp index fc447bc..3097290 100644 --- a/src/LEDVideoWall.cpp +++ b/src/LEDVideoWall.cpp @@ -23,17 +23,13 @@ enum class LEDVideoWallType { }; LEDVideoWall* LEDVideoWall::fromCommandLine() { - mm ipanel_width = 0; - cli::readUserInput( + mm ipanel_width = 0, ipanel_height = 0; + cli::scanTwoValues( + "%dx%d", ipanel_width, - "Enter width for a single panel (in mm): ", - "Invalid panel width, try again!"); - - mm ipanel_height = 0; - cli::readUserInput( ipanel_height, - "Enter height for a single panel (in mm): ", - "Invalid panel height, try again!"); + "Enter panel size (in the format 'WIDTHxHEIGHT'): ", + "Invalid size, try again!"); unsigned int itype = 2; cli::readUserInputMax( @@ -45,17 +41,13 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() { LEDVideoWallType type = static_cast<LEDVideoWallType>(itype); switch (type) { case LEDVideoWallType::Freeform: { - mm iwall_max_width = 0; - cli::readUserInput( - iwall_max_width, - "Enter width for a single wall_max (in mm): ", - "Invalid wall_max width, try again!"); - - mm iwall_max_height = 0; - cli::readUserInput( - iwall_max_height, - "Enter height for a single wall_max (in mm): ", - "Invalid wall_max height, try again!"); + mm iwall_max_width = 0, iwall_max_height = 0; + cli::scanTwoValues( + "%dx%d", + ipanel_width, + ipanel_height, + "Enter singe wall size (in the format 'WIDTHxHEIGHT'): ", + "Invalid size, try again!"); return LEDVideoWall::Freeform(ipanel_width, ipanel_height, iwall_max_width, iwall_max_height); }; |