Beispiel #1
0
        /// <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();
            }
        }
Beispiel #2
0
        /// <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);
        }
        /// <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);
        }
 internal static eLength FromCSi(CSiProgram.eLength enumValue)
 {
     return((eLength)enumValue);
 }