* @brief Register csvPlayer.open + csvPlayer.close commands. */
| 45 | * @brief Register csvPlayer.open + csvPlayer.close commands. |
| 46 | */ |
| 47 | void API::Handlers::CSVPlayerHandler::registerFileCommands() |
| 48 | { |
| 49 | auto& registry = CommandRegistry::instance(); |
| 50 | |
| 51 | QJsonObject emptySchema; |
| 52 | emptySchema.insert(QStringLiteral("type"), QStringLiteral("object")); |
| 53 | emptySchema.insert(QStringLiteral("properties"), QJsonObject()); |
| 54 | |
| 55 | QJsonObject openFilePathProp; |
| 56 | openFilePathProp.insert(QStringLiteral("type"), QStringLiteral("string")); |
| 57 | openFilePathProp.insert(QStringLiteral("description"), |
| 58 | QStringLiteral("Path to the CSV file to open")); |
| 59 | |
| 60 | QJsonObject openProps; |
| 61 | openProps.insert(QStringLiteral("filePath"), openFilePathProp); |
| 62 | |
| 63 | QJsonArray openRequired; |
| 64 | openRequired.append(QStringLiteral("filePath")); |
| 65 | |
| 66 | QJsonObject openSchema; |
| 67 | openSchema.insert(QStringLiteral("type"), QStringLiteral("object")); |
| 68 | openSchema.insert(QStringLiteral("properties"), openProps); |
| 69 | openSchema.insert(QStringLiteral("required"), openRequired); |
| 70 | |
| 71 | registry.registerCommand(QStringLiteral("csvPlayer.open"), |
| 72 | QStringLiteral("Open CSV file (params: filePath)"), |
| 73 | openSchema, |
| 74 | &open); |
| 75 | |
| 76 | registry.registerCommand( |
| 77 | QStringLiteral("csvPlayer.close"), QStringLiteral("Close CSV file"), emptySchema, &close); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @brief Register csvPlayer.setPaused/step/setProgress/getStatus commands. |
nothing calls this directly
no test coverage detected