Move export snapshot target support to app core
This commit is contained in:
@@ -193,6 +193,7 @@ struct PlanExportMenuArgs {
|
||||
|
||||
struct PlanExportSnapshotRouteArgs {
|
||||
std::string kind = "equirectangular";
|
||||
std::string target_path;
|
||||
std::uint32_t captured_face_payloads = 6;
|
||||
std::uint32_t pending_face_payloads = 6;
|
||||
bool target_supported = true;
|
||||
@@ -2475,7 +2476,7 @@ void print_help()
|
||||
<< " plan-document-session-prompt --kind close-unsaved|save-before-workflow|new-document-overwrite|file-overwrite|save-error [--name NAME]\n"
|
||||
<< " plan-export-start [--requires-license] [--demo] [--no-canvas]\n"
|
||||
<< " plan-export-menu --kind jpeg|png|layers|cube-faces|depth|animation-frames|animation-mp4|timelapse [--demo] [--no-canvas]\n"
|
||||
<< " plan-export-snapshot-route --kind equirectangular|layers-collection|layers-stem|animation-frames-collection|animation-frames-stem|cube-faces|depth [--captured-face-payloads N] [--pending-face-payloads N] [--unsupported-target] [--unsupported-platform]\n"
|
||||
<< " plan-export-snapshot-route --kind equirectangular|layers-collection|layers-stem|animation-frames-collection|animation-frames-stem|cube-faces|depth [--target-path FILE] [--captured-face-payloads N] [--pending-face-payloads N] [--unsupported-target] [--unsupported-platform]\n"
|
||||
<< " plan-export-target --kind file|collection|stem|cube-faces|name --doc-name NAME [--work-dir DIR] [--directory DIR] [--extension EXT] [--suffix SUFFIX]\n"
|
||||
<< " plan-export-message --kind equirectangular|layers|animation-frames|depth|cube-faces|animation-mp4|timelapse --destination photos|pictures|files|work|path|success|suppressed [--detail TEXT]\n"
|
||||
<< " plan-export-report --kind license-disabled|equirectangular|layers|animation-frames|depth|cube-faces|animation-mp4|timelapse [--message TEXT]\n"
|
||||
@@ -3847,6 +3848,11 @@ pp::foundation::Status parse_plan_export_snapshot_route_args(
|
||||
return pp::foundation::Status::invalid_argument("missing value for option");
|
||||
}
|
||||
args.kind = argv[++i];
|
||||
} else if (key == "--target-path") {
|
||||
if (i + 1 >= argc) {
|
||||
return pp::foundation::Status::invalid_argument("missing value for option");
|
||||
}
|
||||
args.target_path = argv[++i];
|
||||
} else if (key == "--captured-face-payloads") {
|
||||
if (i + 1 >= argc) {
|
||||
return pp::foundation::Status::invalid_argument("missing value for option");
|
||||
@@ -3898,18 +3904,22 @@ int plan_export_snapshot_route(int argc, char** argv)
|
||||
report.payload_complete = args.captured_face_payloads >= args.pending_face_payloads;
|
||||
report.can_export_ppi = report.payload_complete;
|
||||
|
||||
const bool target_supported = args.target_supported
|
||||
&& (args.target_path.empty()
|
||||
|| pp::app::document_export_snapshot_target_supported(kind.value(), args.target_path));
|
||||
const auto plan = pp::app::plan_document_export_snapshot_route(
|
||||
kind.value(),
|
||||
report,
|
||||
args.target_supported,
|
||||
target_supported,
|
||||
args.platform_supported);
|
||||
|
||||
std::cout << "{\"ok\":true,\"command\":\"plan-export-snapshot-route\""
|
||||
<< ",\"state\":{\"kind\":\"" << json_escape(args.kind)
|
||||
<< "\",\"targetPath\":\"" << json_escape(args.target_path)
|
||||
<< "\",\"capturedFacePayloads\":" << args.captured_face_payloads
|
||||
<< ",\"pendingFacePayloads\":" << args.pending_face_payloads
|
||||
<< ",\"payloadComplete\":" << json_bool(report.payload_complete)
|
||||
<< ",\"targetSupported\":" << json_bool(args.target_supported)
|
||||
<< ",\"targetSupported\":" << json_bool(target_supported)
|
||||
<< ",\"platformSupported\":" << json_bool(args.platform_supported)
|
||||
<< "},\"plan\":{\"kind\":\"" << document_export_execution_kind_name(plan.kind)
|
||||
<< "\",\"action\":\"" << document_export_snapshot_route_action_name(plan.action)
|
||||
|
||||
Reference in New Issue
Block a user