コード例 #1
0
ファイル: CSiModel.cs プロジェクト: uzbekdev1/MPT.Tools
        /// <summary>
        /// Sets the units presently specified for the model.
        /// </summary>
        /// <returns></returns>
        public void SetPresentUnits(eForce forceUnits,
                                    eLength lengthUnits,
                                    eTemperature temperatureUnits)
        {
            CSiProgram.eForce       csiForceUnits       = CSiProgram.eForce.NotApplicable;
            CSiProgram.eLength      csiLengthUnits      = CSiProgram.eLength.NotApplicable;
            CSiProgram.eTemperature csiTemperatureUnits = CSiProgram.eTemperature.NotApplicable;

            _callCode = _sapModel.SetPresentUnits_2(csiForceUnits, csiLengthUnits, csiTemperatureUnits);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException();
            }
        }
コード例 #2
0
ファイル: CSiModel.cs プロジェクト: uzbekdev1/MPT.Tools
        /// <summary>
        /// Returns the units presently specified for the model.
        /// </summary>
        /// <returns></returns>
        public void GetPresentUnits(ref eForce forceUnits,
                                    ref eLength lengthUnits,
                                    ref eTemperature temperatureUnits)
        {
            CSiProgram.eForce       csiForceUnits       = CSiProgram.eForce.NotApplicable;
            CSiProgram.eLength      csiLengthUnits      = CSiProgram.eLength.NotApplicable;
            CSiProgram.eTemperature csiTemperatureUnits = CSiProgram.eTemperature.NotApplicable;

            _callCode = _sapModel.GetPresentUnits_2(ref csiForceUnits, ref csiLengthUnits, ref csiTemperatureUnits);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException();
            }

            forceUnits       = EnumLibrary.Convert(csiForceUnits, forceUnits);
            lengthUnits      = EnumLibrary.Convert(csiLengthUnits, lengthUnits);
            temperatureUnits = EnumLibrary.Convert(csiTemperatureUnits, temperatureUnits);
        }
コード例 #3
0
        /// <summary>
        /// Returns the database units for the model.
        /// All data is internally stored in the model in these units and converted to the present units as needed.
        /// </summary>
        /// <returns></returns>
        public void GetDatabaseUnits(out eForce forceUnits,
                                     out eLength lengthUnits,
                                     out eTemperature temperatureUnits)
        {
            forceUnits       = 0;
            lengthUnits      = 0;
            temperatureUnits = 0;

            CSiProgram.eForce       csiForceUnits       = CSiProgram.eForce.NotApplicable;
            CSiProgram.eLength      csiLengthUnits      = CSiProgram.eLength.NotApplicable;
            CSiProgram.eTemperature csiTemperatureUnits = CSiProgram.eTemperature.NotApplicable;

            _callCode = _sapModel.GetDatabaseUnits_2(ref csiForceUnits, ref csiLengthUnits, ref csiTemperatureUnits);
            if (throwCurrentApiException(_callCode))
            {
                throw new CSiException(API_DEFAULT_ERROR_CODE);
            }

            forceUnits       = EnumLibrary.Convert(csiForceUnits, forceUnits);
            lengthUnits      = EnumLibrary.Convert(csiLengthUnits, lengthUnits);
            temperatureUnits = EnumLibrary.Convert(csiTemperatureUnits, temperatureUnits);
        }
コード例 #4
0
 internal static eTemperature FromCSi(CSiProgram.eTemperature enumValue)
 {
     return((eTemperature)enumValue);
 }