/****************************************************************************
 *
 *   Copyright (c) 2024 PX4 Development Team. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name PX4 nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/**
 * @file offline_task_manager_params.c
 *
 * Parameters for offline_task_manager module
 */

#include <px4_platform_common/module_params.h>
#include <parameters/param.h>

/**
 * Offline Task Manager Enable
 *
 * Enable the offline task manager module.
 *
 * @boolean
 * @group Offline Task Manager
 */
PARAM_DEFINE_INT32(OTM_ENABLE, 0);

/**
 * Offline Task Manager Start
 *
 * Set to 1 to trigger offline task execution.
 * Module will read tasks, plan, write mission and start execution.
 *
 * @boolean
 * @group Offline Task Manager
 */
PARAM_DEFINE_INT32(OTM_START, 0);

/**
 * Task Point Hold Time
 *
 * Time to loiter at each task point after reaching it.
 *
 * @unit s
 * @min 0
 * @max 300
 * @decimal 1
 * @group Offline Task Manager
 */
PARAM_DEFINE_FLOAT(OTM_HOLD_T, 10.0f);

/**
 * Task Point Acceptance Radius
 *
 * Radius within which a task point is considered reached.
 *
 * @unit m
 * @min 0.5
 * @max 50
 * @decimal 1
 * @group Offline Task Manager
 */
PARAM_DEFINE_FLOAT(OTM_ACC_RAD, 2.0f);

/**
 * Simulated Battery Initial Percentage
 *
 * Initial battery percentage for simulation mode.
 *
 * @unit %
 * @min 0
 * @max 100
 * @decimal 1
 * @group Offline Task Manager
 */
PARAM_DEFINE_FLOAT(OTM_BATT_INIT, 100.0f);

/**
 * Battery Simulation Mode
 *
 * Use simulated battery instead of real battery status.
 * 0: Use real battery
 * 1: Use simulated battery
 *
 * @boolean
 * @group Offline Task Manager
 */
PARAM_DEFINE_INT32(OTM_BATT_SIM, 1);

/**
 * Simulated Battery Drain Rate
 *
 * Battery percentage drained per second in simulation.
 *
 * @min 0
 * @max 10
 * @decimal 3
 * @group Offline Task Manager
 */
PARAM_DEFINE_FLOAT(OTM_BATT_DRAIN, 0.1f);

/**
 * Low Battery Threshold
 *
 * Battery percentage below which only urgent tasks are executed.
 *
 * @unit %
 * @min 0
 * @max 100
 * @decimal 1
 * @group Offline Task Manager
 */
PARAM_DEFINE_FLOAT(OTM_LOW_BATT, 20.0f);

/**
 * Maximum Number of Tasks
 *
 * Maximum number of tasks to load from JSON file.
 *
 * @min 1
 * @max 100
 * @group Offline Task Manager
 */
PARAM_DEFINE_INT32(OTM_MAX_TASKS, 32);
