// copy constructor public Threshold(HermesMiddleware.DataAcquisitionServiceServer.Threshold sourceThreshold) { this.oValue = sourceThreshold.value; this.bStrict = sourceThreshold.strict; this.type = sourceThreshold.type; this.sVariable = sourceThreshold.variable; }
HermesMiddleware.DataAcquisitionServiceProxy.Expression ConvertServer2Proxy(HermesMiddleware.DataAcquisitionServiceServer.Expression sourceExpression) { HermesMiddleware.DataAcquisitionServiceProxy.Expression targetExpression = null; HermesMiddleware.DataAcquisitionServiceProxy.Range targetRange = null; HermesMiddleware.DataAcquisitionServiceProxy.Threshold targetThreshold = null; HermesMiddleware.DataAcquisitionServiceProxy.Equals targetEquals = null; HermesMiddleware.DataAcquisitionServiceServer.Range sourceRange = null; HermesMiddleware.DataAcquisitionServiceServer.Threshold sourceThreshold = null; HermesMiddleware.DataAcquisitionServiceServer.Equals sourceEquals = null; switch (sourceExpression.GetType().Name) { case "Range": sourceRange = (HermesMiddleware.DataAcquisitionServiceServer.Range)sourceExpression; targetRange = new HermesMiddleware.DataAcquisitionServiceProxy.Range(); targetRange.max = sourceRange.max; targetRange.min = sourceRange.min; targetRange.strict = sourceRange.strict; targetRange.variable = sourceRange.variable; targetExpression = targetRange; break; case "Threshold": sourceThreshold = (HermesMiddleware.DataAcquisitionServiceServer.Threshold)sourceExpression; targetThreshold = new HermesMiddleware.DataAcquisitionServiceProxy.Threshold(); targetThreshold.value = sourceThreshold.value; targetThreshold.type = (HermesMiddleware.DataAcquisitionServiceProxy.ThresholdType)sourceThreshold.type; targetThreshold.strict = sourceThreshold.strict; targetThreshold.variable = sourceThreshold.variable; targetExpression = targetThreshold; break; case "Equals": sourceEquals = (HermesMiddleware.DataAcquisitionServiceServer.Equals)sourceExpression; targetEquals = new HermesMiddleware.DataAcquisitionServiceProxy.Equals(); targetEquals.value = sourceEquals.value; targetEquals.type = (HermesMiddleware.DataAcquisitionServiceProxy.EqualsType)sourceEquals.type; targetEquals.variable = sourceEquals.variable; targetExpression = targetEquals; break; } return(targetExpression); }