001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenixpro.configs;
008
009import com.ctre.phoenix6.StatusCode;
010import com.ctre.phoenix6.configs.jni.ConfigJNI;
011import com.ctre.phoenix6.spns.*;
012
013/**
014 *  Configs that directly affect motor-output.
015 * <p>
016 *  Includes Motor Invert and various limit features.
017 *
018 * @deprecated Classes in the phoenixpro package will be removed in 2024.
019 *             Users should instead use classes from the phoenix6 package.
020 */
021@Deprecated(forRemoval = true)
022public class OpenLoopRampsConfigs implements ParentConfiguration
023{
024    /**
025     * If non-zero, this determines how much time to ramp from 0% output
026     * to 100% during open-loop modes.
027     *
028     *  <ul>
029     *  <li> <b>Minimum Value:</b> 0
030     *  <li> <b>Maximum Value:</b> 1
031     *  <li> <b>Default Value:</b> 0
032     *  <li> <b>Units:</b> sec
033     *  </ul>
034     */
035    public double DutyCycleOpenLoopRampPeriod = 0;
036    /**
037     * If non-zero, this determines how much time to ramp from 0V output
038     * to 12V during open-loop modes.
039     *
040     *  <ul>
041     *  <li> <b>Minimum Value:</b> 0
042     *  <li> <b>Maximum Value:</b> 1
043     *  <li> <b>Default Value:</b> 0
044     *  <li> <b>Units:</b> sec
045     *  </ul>
046     */
047    public double VoltageOpenLoopRampPeriod = 0;
048    /**
049     * If non-zero, this determines how much time to ramp from 0A output
050     * to 300A during open-loop modes.
051     *
052     *  <ul>
053     *  <li> <b>Minimum Value:</b> 0
054     *  <li> <b>Maximum Value:</b> 10
055     *  <li> <b>Default Value:</b> 0
056     *  <li> <b>Units:</b> sec
057     *  </ul>
058     */
059    public double TorqueOpenLoopRampPeriod = 0;
060
061    @Override
062    public String toString()
063    {
064        String ss = "Config Group: OpenLoopRamps\n";
065        ss += "Name: \"DutyCycleOpenLoopRampPeriod\" Value: \"" + DutyCycleOpenLoopRampPeriod + "sec\"" + "\n";
066        ss += "Name: \"VoltageOpenLoopRampPeriod\" Value: \"" + VoltageOpenLoopRampPeriod + "sec\"" + "\n";
067        ss += "Name: \"TorqueOpenLoopRampPeriod\" Value: \"" + TorqueOpenLoopRampPeriod + "sec\"" + "\n";
068        return ss;
069    }
070
071    /**
072     *
073     */
074    public StatusCode deserialize(String string)
075    {
076        DutyCycleOpenLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_DutyCycleOpenLoopRampPeriod.value, string);
077        VoltageOpenLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_VoltageOpenLoopRampPeriod.value, string);
078        TorqueOpenLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_TorqueOpenLoopRampPeriod.value, string);
079        return  StatusCode.OK;
080    }
081
082    /**
083     *
084     */
085    public String serialize()
086    {
087        String ss = "";
088        ss += ConfigJNI.Serializedouble(1443, DutyCycleOpenLoopRampPeriod);
089        ss += ConfigJNI.Serializedouble(1444, VoltageOpenLoopRampPeriod);
090        ss += ConfigJNI.Serializedouble(1445, TorqueOpenLoopRampPeriod);
091        return ss;
092    }
093}
094