Esempio n. 1
0
        //-------------------------------------------------------------------------------------------------//

        public bool ConfigureDCDriveMut(DCDriveMutConfigs dcDriveMutConfig)
        {
            const string STRLOG_MethodName = "ConfigureDCDriveMut";

            string logMessage = STRLOG_DCDriveMutConfig + dcDriveMutConfig.ToString();

            Logfile.WriteCalled(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage);

            this.lastError = null;
            bool success = false;

            try
            {
                //
                // Configure the DC drive
                //
                switch (dcDriveMutConfig)
                {
                case DCDriveMutConfigs.Default:

                    this.ConfigureDCDriveMut(
                        DCDriveMut.DEFAULT_MinSpeedLimit, DCDriveMut.DEFAULT_MaxSpeedLimit,
                        DCDriveMut.DEFAULT_MinTorqueLimit, DCDriveMut.DEFAULT_MaxTorqueLimit,
                        DCDriveMut.DEFAULT_SpeedRampTime);
                    break;

                case DCDriveMutConfigs.MinimumTorque:

                    this.ConfigureDCDriveMut(
                        DCDriveMut.DEFAULT_MinSpeedLimit, DCDriveMut.DEFAULT_MaxSpeedLimit,
                        DCDriveMut.MINIMUM_MinimumTorque, DCDriveMut.MINIMUM_MaximumTorque,
                        DCDriveMut.DEFAULT_SpeedRampTime);
                    break;
                }

                success = true;
            }
            catch (Exception ex)
            {
                this.lastError = ex.Message;
                Logfile.WriteError(ex.Message);
            }

            logMessage = STRLOG_Success + success.ToString();

            Logfile.WriteCompleted(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage);

            return(success);
        }
Esempio n. 2
0
        //-------------------------------------------------------------------------------------------------//
        public bool ConfigureDCDriveMut(DCDriveMutConfigs dcDriveMutConfig)
        {
            const string STRLOG_MethodName = "ConfigureDCDriveMut";

            string logMessage = STRLOG_DCDriveMutConfig + dcDriveMutConfig.ToString();

            Logfile.WriteCalled(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage);

            this.lastError = null;
            bool success = false;

            try
            {
                //
                // Configure the DC drive
                //
                switch (dcDriveMutConfig)
                {
                    case DCDriveMutConfigs.Default:

                        this.ConfigureDCDriveMut(
                            DCDriveMut.DEFAULT_MinSpeedLimit, DCDriveMut.DEFAULT_MaxSpeedLimit,
                            DCDriveMut.DEFAULT_MinTorqueLimit, DCDriveMut.DEFAULT_MaxTorqueLimit,
                            DCDriveMut.DEFAULT_SpeedRampTime);
                        break;

                    case DCDriveMutConfigs.MinimumTorque:

                        this.ConfigureDCDriveMut(
                            DCDriveMut.DEFAULT_MinSpeedLimit, DCDriveMut.DEFAULT_MaxSpeedLimit,
                            DCDriveMut.MINIMUM_MinimumTorque, DCDriveMut.MINIMUM_MaximumTorque,
                            DCDriveMut.DEFAULT_SpeedRampTime);
                        break;
                }

                success = true;
            }
            catch (Exception ex)
            {
                this.lastError = ex.Message;
                Logfile.WriteError(ex.Message);
            }

            logMessage = STRLOG_Success + success.ToString();

            Logfile.WriteCompleted(this.logLevel, STRLOG_ClassName, STRLOG_MethodName, logMessage);

            return success;
        }