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 CustomParamsConfigs implements ParentConfiguration 023{ 024 /** 025 * Custom parameter 0. This is provided to allow end-applications to 026 * store persistent information in the device. 027 * 028 * <ul> 029 * <li> <b>Minimum Value:</b> -32768 030 * <li> <b>Maximum Value:</b> 32767 031 * <li> <b>Default Value:</b> 0 032 * <li> <b>Units:</b> 033 * </ul> 034 */ 035 public int CustomParam0 = 0; 036 /** 037 * Custom parameter 1. This is provided to allow end-applications to 038 * store persistent information in the device. 039 * 040 * <ul> 041 * <li> <b>Minimum Value:</b> -32768 042 * <li> <b>Maximum Value:</b> 32767 043 * <li> <b>Default Value:</b> 0 044 * <li> <b>Units:</b> 045 * </ul> 046 */ 047 public int CustomParam1 = 0; 048 049 @Override 050 public String toString() 051 { 052 String ss = "Config Group: CustomParams\n"; 053 ss += "Name: \"CustomParam0\" Value: \"" + CustomParam0 + "\"" + "\n"; 054 ss += "Name: \"CustomParam1\" Value: \"" + CustomParam1 + "\"" + "\n"; 055 return ss; 056 } 057 058 /** 059 * 060 */ 061 public StatusCode deserialize(String string) 062 { 063 CustomParam0 = ConfigJNI.Deserializeint(SpnValue.CustomParam0.value, string); 064 CustomParam1 = ConfigJNI.Deserializeint(SpnValue.CustomParam1.value, string); 065 return StatusCode.OK; 066 } 067 068 /** 069 * 070 */ 071 public String serialize() 072 { 073 String ss = ""; 074 ss += ConfigJNI.Serializeint(816, CustomParam0); 075 ss += ConfigJNI.Serializeint(817, CustomParam1); 076 return ss; 077 } 078} 079