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 ClosedLoopRampsConfigs implements ParentConfiguration 023{ 024 /** 025 * If non-zero, this determines how much time to ramp from 0% output 026 * to 100% during closed-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 DutyCycleClosedLoopRampPeriod = 0; 036 /** 037 * If non-zero, this determines how much time to ramp from 0V output 038 * to 12V during closed-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 VoltageClosedLoopRampPeriod = 0; 048 /** 049 * If non-zero, this determines how much time to ramp from 0A output 050 * to 300A during closed-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 TorqueClosedLoopRampPeriod = 0; 060 061 @Override 062 public String toString() 063 { 064 String ss = "Config Group: ClosedLoopRamps\n"; 065 ss += "Name: \"DutyCycleClosedLoopRampPeriod\" Value: \"" + DutyCycleClosedLoopRampPeriod + "sec\"" + "\n"; 066 ss += "Name: \"VoltageClosedLoopRampPeriod\" Value: \"" + VoltageClosedLoopRampPeriod + "sec\"" + "\n"; 067 ss += "Name: \"TorqueClosedLoopRampPeriod\" Value: \"" + TorqueClosedLoopRampPeriod + "sec\"" + "\n"; 068 return ss; 069 } 070 071 /** 072 * 073 */ 074 public StatusCode deserialize(String string) 075 { 076 DutyCycleClosedLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_DutyCycleClosedLoopRampPeriod.value, string); 077 VoltageClosedLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_VoltageClosedLoopRampPeriod.value, string); 078 TorqueClosedLoopRampPeriod = ConfigJNI.Deserializedouble(SpnValue.Config_TorqueClosedLoopRampPeriod.value, string); 079 return StatusCode.OK; 080 } 081 082 /** 083 * 084 */ 085 public String serialize() 086 { 087 String ss = ""; 088 ss += ConfigJNI.Serializedouble(1446, DutyCycleClosedLoopRampPeriod); 089 ss += ConfigJNI.Serializedouble(1447, VoltageClosedLoopRampPeriod); 090 ss += ConfigJNI.Serializedouble(1448, TorqueClosedLoopRampPeriod); 091 return ss; 092 } 093} 094