Exemplo n.º 1
0
 internal SmcSettings(SmcSettingsStruct s)
 {
     // [Add-new-settings-here]
     this.neverSuspend         = s.neverSuspend;
     this.uartResponseDelay    = s.uartResponseDelay;
     this.useFixedBaudRate     = s.useFixedBaudRate;
     this.disableSafeStart     = s.disableSafeStart;
     this.fixedBaudRateBps     = Smc.convertBaudRegisterToBps(s.fixedBaudRateRegister);
     this.speedUpdatePeriod    = s.speedUpdatePeriod;
     this.commandTimeout       = s.commandTimeout;
     this.serialDeviceNumber   = s.serialDeviceNumber;
     this.crcMode              = s.crcMode;
     this.overTempMin          = s.overTempMin;
     this.overTempMax          = s.overTempMax;
     this.inputMode            = s.inputMode;
     this.pwmMode              = s.pwmMode;
     this.pwmPeriodFactor      = s.pwmPeriodFactor;
     this.mixingMode           = s.mixingMode;
     this.minPulsePeriod       = s.minPulsePeriod;
     this.maxPulsePeriod       = s.maxPulsePeriod;
     this.rcTimeout            = s.rcTimeout;
     this.ignorePotDisconnect  = s.ignorePotDisconnect;
     this.tempLimitGradual     = s.tempLimitGradual;
     this.consecGoodPulses     = s.consecGoodPulses;
     this.motorInvert          = s.motorInvert;
     this.speedZeroBrakeAmount = s.speedZeroBrakeAmount;
     this.ignoreErrLineHigh    = s.ignoreErrLineHigh;
     this.vinMultiplierOffset  = s.vinMultiplierOffset;
     this.lowVinShutoffTimeout = s.lowVinShutoffTimeout;
     this.lowVinShutoffMv      = s.lowVinShutoffMv;
     this.lowVinStartupMv      = s.lowVinStartupMv;
     this.highVinShutoffMv     = s.highVinShutoffMv;
     this.serialMode           = s.serialMode;
     this.rc1           = new SmcChannelSettings(s.rc1);
     this.rc2           = new SmcChannelSettings(s.rc2);
     this.analog1       = new SmcChannelSettings(s.analog1);
     this.analog2       = new SmcChannelSettings(s.analog2);
     this.forwardLimits = new SmcMotorLimits(s.forwardLimits);
     this.reverseLimits = new SmcMotorLimits(s.reverseLimits);
 }
Exemplo n.º 2
0
 internal SmcSettings(SmcSettingsStruct s)
 {
     // [Add-new-settings-here]
     this.neverSuspend = s.neverSuspend;
     this.uartResponseDelay = s.uartResponseDelay;
     this.useFixedBaudRate = s.useFixedBaudRate;
     this.disableSafeStart = s.disableSafeStart;
     this.fixedBaudRateBps = Smc.convertBaudRegisterToBps(s.fixedBaudRateRegister);
     this.speedUpdatePeriod = s.speedUpdatePeriod;
     this.commandTimeout = s.commandTimeout;
     this.serialDeviceNumber = s.serialDeviceNumber;
     this.crcMode = s.crcMode;
     this.overTempMin = s.overTempMin;
     this.overTempMax = s.overTempMax;
     this.inputMode = s.inputMode;
     this.pwmMode = s.pwmMode;
     this.pwmPeriodFactor = s.pwmPeriodFactor;
     this.mixingMode = s.mixingMode;
     this.minPulsePeriod = s.minPulsePeriod;
     this.maxPulsePeriod = s.maxPulsePeriod;
     this.rcTimeout = s.rcTimeout;
     this.ignorePotDisconnect = s.ignorePotDisconnect;
     this.tempLimitGradual = s.tempLimitGradual;
     this.consecGoodPulses = s.consecGoodPulses;
     this.motorInvert = s.motorInvert;
     this.speedZeroBrakeAmount = s.speedZeroBrakeAmount;
     this.ignoreErrLineHigh = s.ignoreErrLineHigh;
     this.vinMultiplierOffset = s.vinMultiplierOffset;
     this.lowVinShutoffTimeout = s.lowVinShutoffTimeout;
     this.lowVinShutoffMv = s.lowVinShutoffMv;
     this.lowVinStartupMv = s.lowVinStartupMv;
     this.highVinShutoffMv = s.highVinShutoffMv;
     this.serialMode = s.serialMode;
     this.rc1 = new SmcChannelSettings(s.rc1);
     this.rc2 = new SmcChannelSettings(s.rc2);
     this.analog1 = new SmcChannelSettings(s.analog1);
     this.analog2 = new SmcChannelSettings(s.analog2);
     this.forwardLimits = new SmcMotorLimits(s.forwardLimits);
     this.reverseLimits = new SmcMotorLimits(s.reverseLimits);
 }