Esempio n. 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (roomType_ != null)
            {
                hash ^= RoomType.GetHashCode();
            }
            if (dateRange_ != null)
            {
                hash ^= DateRange.GetHashCode();
            }
            if (sourceChannelInfo_ != null)
            {
                hash ^= SourceChannelInfo.GetHashCode();
            }
            if (guest_ != null)
            {
                hash ^= Guest.GetHashCode();
            }
            if (NumberAdults != 0)
            {
                hash ^= NumberAdults.GetHashCode();
            }
            if (NumberChildren != 0)
            {
                hash ^= NumberChildren.GetHashCode();
            }
            hash ^= reservationTags_.GetHashCode();
            return(hash);
        }
Esempio n. 2
0
 public void MergeFrom(BookGenesisReservationRequest other)
 {
     if (other == null)
     {
         return;
     }
     if (other.roomType_ != null)
     {
         if (roomType_ == null)
         {
             roomType_ = new global::HOLMS.Types.Supply.RoomTypes.RoomTypeIndicator();
         }
         RoomType.MergeFrom(other.RoomType);
     }
     if (other.dateRange_ != null)
     {
         if (dateRange_ == null)
         {
             dateRange_ = new global::HOLMS.Types.Primitive.PbInclusiveOpsdateRange();
         }
         DateRange.MergeFrom(other.DateRange);
     }
     if (other.sourceChannelInfo_ != null)
     {
         if (sourceChannelInfo_ == null)
         {
             sourceChannelInfo_ = new global::HOLMS.Types.Booking.Channels.ChannelInfo();
         }
         SourceChannelInfo.MergeFrom(other.SourceChannelInfo);
     }
     if (other.guest_ != null)
     {
         if (guest_ == null)
         {
             guest_ = new global::HOLMS.Types.CRM.Guests.GuestIndicator();
         }
         Guest.MergeFrom(other.Guest);
     }
     if (other.NumberAdults != 0)
     {
         NumberAdults = other.NumberAdults;
     }
     if (other.NumberChildren != 0)
     {
         NumberChildren = other.NumberChildren;
     }
     reservationTags_.Add(other.reservationTags_);
 }
        public IChannel BaseChannelConvert(I_BaseChannelInfo t_channel)
        {
            #region IEPEChannelInfo
            if (t_channel is T1_IEPEChannelInfo)
            {
                T1_IEPEChannelInfo channel          = t_channel as T1_IEPEChannelInfo;
                IEPEChannelInfo    i_channel        = new IEPEChannelInfo();
                CalibrationlInfo   calibrationlInfo = JsonConvert.DeserializeObject <CalibrationlInfo>(channel.CalibrationlInfo);
                i_channel.VelocityCalibration     = calibrationlInfo.VelocityCalibration;
                i_channel.DisplacementCalibration = calibrationlInfo.DisplacementCalibration;
                OtherInfo otherInfo = JsonConvert.DeserializeObject <OtherInfo>(channel.OtherInfo);
                i_channel.RPMCardNum        = otherInfo.RPMCardNum;
                i_channel.RPMSlotNum        = otherInfo.RPMSlotNum;
                i_channel.RPMCHNum          = otherInfo.RPMCHNum;
                i_channel.IsMultiplication  = otherInfo.IsMultiplication;
                i_channel.MultiplicationCor = otherInfo.MultiplicationCor;
                i_channel.IsSaveWaveToSD    = otherInfo.IsSaveWaveToSD;
                i_channel.IsUploadWave      = otherInfo.IsUploadWave;
                i_channel.DefaultRPM        = otherInfo.DefaultRPM;
                VibrationAddition vibrationAddition = JsonConvert.DeserializeObject <VibrationAddition>(channel.VibrationAddition);
                i_channel.TPDirCategory = vibrationAddition.TPDirCategory;
                i_channel.TPDirCode     = vibrationAddition.TPDirCode;
                i_channel.BiasVoltHigh  = vibrationAddition.BiasVoltHigh;
                i_channel.BiasVoltLow   = vibrationAddition.BiasVoltLow;
                i_channel.Sensitivity   = vibrationAddition.Sensitivity;

                i_channel.T_IEPEChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region EddyCurrentDisplacementChannelInfo
            if (t_channel is T1_EddyCurrentDisplacementChannelInfo)
            {
                T1_EddyCurrentDisplacementChannelInfo channel   = t_channel as T1_EddyCurrentDisplacementChannelInfo;
                EddyCurrentDisplacementChannelInfo    i_channel = new EddyCurrentDisplacementChannelInfo();
                OtherInfo otherInfo = JsonConvert.DeserializeObject <OtherInfo>(channel.OtherInfo);
                i_channel.RPMCardNum        = otherInfo.RPMCardNum;
                i_channel.RPMSlotNum        = otherInfo.RPMSlotNum;
                i_channel.RPMCHNum          = otherInfo.RPMCHNum;
                i_channel.IsMultiplication  = otherInfo.IsMultiplication;
                i_channel.MultiplicationCor = otherInfo.MultiplicationCor;
                i_channel.IsSaveWaveToSD    = otherInfo.IsSaveWaveToSD;
                i_channel.IsUploadWave      = otherInfo.IsUploadWave;
                i_channel.DefaultRPM        = otherInfo.DefaultRPM;
                VibrationAddition vibrationAddition = JsonConvert.DeserializeObject <VibrationAddition>(channel.VibrationAddition);
                i_channel.TPDirCategory = vibrationAddition.TPDirCategory;
                i_channel.TPDirCode     = vibrationAddition.TPDirCode;
                i_channel.BiasVoltHigh  = vibrationAddition.BiasVoltHigh;
                i_channel.BiasVoltLow   = vibrationAddition.BiasVoltLow;
                i_channel.Sensitivity   = vibrationAddition.Sensitivity;

                i_channel.T_EddyCurrentDisplacementChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region EddyCurrentKeyPhaseChannelInfo
            if (t_channel is T1_EddyCurrentKeyPhaseChannelInfo)
            {
                T1_EddyCurrentKeyPhaseChannelInfo channel   = t_channel as T1_EddyCurrentKeyPhaseChannelInfo;
                EddyCurrentKeyPhaseChannelInfo    i_channel = new EddyCurrentKeyPhaseChannelInfo();
                ThresholdInfo thresholdInfo = JsonConvert.DeserializeObject <ThresholdInfo>(channel.ThresholdInfo);
                i_channel.ThresholdVolt         = thresholdInfo.ThresholdVolt;
                i_channel.HysteresisVolt        = thresholdInfo.HysteresisVolt;
                i_channel.ThresholdModeCategory = thresholdInfo.ThresholdModeCategory;
                i_channel.ThresholdModeCode     = thresholdInfo.ThresholdModeCode;
                VibrationAddition vibrationAddition = JsonConvert.DeserializeObject <VibrationAddition>(channel.VibrationAddition);
                i_channel.TPDirCategory = vibrationAddition.TPDirCategory;
                i_channel.TPDirCode     = vibrationAddition.TPDirCode;
                i_channel.BiasVoltHigh  = vibrationAddition.BiasVoltHigh;
                i_channel.BiasVoltLow   = vibrationAddition.BiasVoltLow;
                i_channel.Sensitivity   = vibrationAddition.Sensitivity;
                RPMChannelInfo rPMChannelInfo = JsonConvert.DeserializeObject <RPMChannelInfo>(channel.RPMChannelInfo);
                i_channel.CalibrationCor = rPMChannelInfo.CalibrationCor;
                i_channel.IsNotch        = rPMChannelInfo.IsNotch;
                i_channel.AverageNumber  = rPMChannelInfo.AverageNumber;
                i_channel.TeethNumber    = rPMChannelInfo.TeethNumber;

                i_channel.T_EddyCurrentKeyPhaseChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region EddyCurrentTachometerChannelInfo
            if (t_channel is T1_EddyCurrentTachometerChannelInfo)
            {
                T1_EddyCurrentTachometerChannelInfo channel   = t_channel as T1_EddyCurrentTachometerChannelInfo;
                EddyCurrentTachometerChannelInfo    i_channel = new EddyCurrentTachometerChannelInfo();
                ThresholdInfo thresholdInfo = JsonConvert.DeserializeObject <ThresholdInfo>(channel.ThresholdInfo);
                i_channel.ThresholdVolt         = thresholdInfo.ThresholdVolt;
                i_channel.HysteresisVolt        = thresholdInfo.HysteresisVolt;
                i_channel.ThresholdModeCategory = thresholdInfo.ThresholdModeCategory;
                i_channel.ThresholdModeCode     = thresholdInfo.ThresholdModeCode;
                VibrationAddition vibrationAddition = JsonConvert.DeserializeObject <VibrationAddition>(channel.VibrationAddition);
                i_channel.TPDirCategory = vibrationAddition.TPDirCategory;
                i_channel.TPDirCode     = vibrationAddition.TPDirCode;
                i_channel.BiasVoltHigh  = vibrationAddition.BiasVoltHigh;
                i_channel.BiasVoltLow   = vibrationAddition.BiasVoltLow;
                i_channel.Sensitivity   = vibrationAddition.Sensitivity;
                RPMChannelInfo rPMChannelInfo = JsonConvert.DeserializeObject <RPMChannelInfo>(channel.RPMChannelInfo);
                i_channel.CalibrationCor = rPMChannelInfo.CalibrationCor;
                i_channel.IsNotch        = rPMChannelInfo.IsNotch;
                i_channel.AverageNumber  = rPMChannelInfo.AverageNumber;
                i_channel.TeethNumber    = rPMChannelInfo.TeethNumber;
                RPMCouplingInfo rPMCouplingInfo = JsonConvert.DeserializeObject <RPMCouplingInfo>(channel.RPMCouplingInfo);
                i_channel.RPMCouplingCategory = rPMCouplingInfo.RPMCouplingCategory;
                i_channel.RPMCouplingCode     = rPMCouplingInfo.RPMCouplingCode;

                i_channel.T_EddyCurrentTachometerChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region DigitTachometerChannelInfo
            if (t_channel is T1_DigitTachometerChannelInfo)
            {
                T1_DigitTachometerChannelInfo channel   = t_channel as T1_DigitTachometerChannelInfo;
                DigitTachometerChannelInfo    i_channel = new DigitTachometerChannelInfo();
                RPMChannelInfo rPMChannelInfo           = JsonConvert.DeserializeObject <RPMChannelInfo>(channel.RPMChannelInfo);
                i_channel.CalibrationCor = rPMChannelInfo.CalibrationCor;
                i_channel.IsNotch        = rPMChannelInfo.IsNotch;
                i_channel.AverageNumber  = rPMChannelInfo.AverageNumber;
                i_channel.TeethNumber    = rPMChannelInfo.TeethNumber;

                i_channel.T_DigitTachometerChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region AnalogRransducerInChannelInfo
            if (t_channel is T1_AnalogRransducerInChannelInfo)
            {
                T1_AnalogRransducerInChannelInfo channel   = t_channel as T1_AnalogRransducerInChannelInfo;
                AnalogRransducerInChannelInfo    i_channel = new AnalogRransducerInChannelInfo();
                TransformMethod transformMethod            = JsonConvert.DeserializeObject <TransformMethod>(channel.TransformMethod);
                i_channel.EquationCategory = transformMethod.EquationCategory;
                i_channel.EquationCode     = transformMethod.EquationCode;

                i_channel.T_AnalogRransducerInChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region RelayChannelInfo
            if (t_channel is T1_RelayChannelInfo)
            {
                T1_RelayChannelInfo channel   = t_channel as T1_RelayChannelInfo;
                RelayChannelInfo    i_channel = new RelayChannelInfo();

                i_channel.T_RelayChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region DigitRransducerInChannelInfo
            if (t_channel is T1_DigitRransducerInChannelInfo)
            {
                T1_DigitRransducerInChannelInfo channel   = t_channel as T1_DigitRransducerInChannelInfo;
                DigitRransducerInChannelInfo    i_channel = new DigitRransducerInChannelInfo();
                TransformMethod transformMethod           = JsonConvert.DeserializeObject <TransformMethod>(channel.TransformMethod);
                i_channel.EquationCategory = transformMethod.EquationCategory;
                i_channel.EquationCode     = transformMethod.EquationCode;
                DigitRransducerInfo digitRransducerInfo = JsonConvert.DeserializeObject <DigitRransducerInfo>(channel.DigitRransducerInfo);
                digitRransducerInfo.SwitchCategory    = digitRransducerInfo.SwitchCategory;
                digitRransducerInfo.SwitchCode        = digitRransducerInfo.SwitchCode;
                digitRransducerInfo.ModBusFunCategory = digitRransducerInfo.ModBusFunCategory;
                digitRransducerInfo.ModBusFunCode     = digitRransducerInfo.ModBusFunCode;

                i_channel.T_DigitRransducerInChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region DigitRransducerOutChannelInfo
            if (t_channel is T1_DigitRransducerOutChannelInfo)
            {
                T1_DigitRransducerOutChannelInfo channel   = t_channel as T1_DigitRransducerOutChannelInfo;
                DigitRransducerOutChannelInfo    i_channel = new DigitRransducerOutChannelInfo();
                TransformMethod transformMethod            = JsonConvert.DeserializeObject <TransformMethod>(channel.TransformMethod);
                i_channel.EquationCategory = transformMethod.EquationCategory;
                i_channel.EquationCode     = transformMethod.EquationCode;
                DigitRransducerInfo digitRransducerInfo = JsonConvert.DeserializeObject <DigitRransducerInfo>(channel.DigitRransducerInfo);
                digitRransducerInfo.SwitchCategory    = digitRransducerInfo.SwitchCategory;
                digitRransducerInfo.SwitchCode        = digitRransducerInfo.SwitchCode;
                digitRransducerInfo.ModBusFunCategory = digitRransducerInfo.ModBusFunCategory;
                digitRransducerInfo.ModBusFunCode     = digitRransducerInfo.ModBusFunCode;
                SourceChannelInfo sourceChannelInfo = JsonConvert.DeserializeObject <SourceChannelInfo>(channel.SourceChannelInfo);
                i_channel.SourceCardNum  = sourceChannelInfo.SourceCardNum;
                i_channel.SourceSlotNum  = sourceChannelInfo.SourceSlotNum;
                i_channel.SourceCHNum    = sourceChannelInfo.SourceCHNum;
                i_channel.SourceSubCHNum = sourceChannelInfo.SourceSubCHNum;

                i_channel.T_DigitRransducerOutChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region AnalogRransducerOutChannelInfo
            if (t_channel is T1_AnalogRransducerOutChannelInfo)
            {
                T1_AnalogRransducerOutChannelInfo channel   = t_channel as T1_AnalogRransducerOutChannelInfo;
                AnalogRransducerOutChannelInfo    i_channel = new AnalogRransducerOutChannelInfo();
                TransformMethod transformMethod             = JsonConvert.DeserializeObject <TransformMethod>(channel.TransformMethod);
                i_channel.EquationCategory = transformMethod.EquationCategory;
                i_channel.EquationCode     = transformMethod.EquationCode;
                SourceChannelInfo sourceChannelInfo = JsonConvert.DeserializeObject <SourceChannelInfo>(channel.SourceChannelInfo);
                i_channel.SourceCardNum  = sourceChannelInfo.SourceCardNum;
                i_channel.SourceSlotNum  = sourceChannelInfo.SourceSlotNum;
                i_channel.SourceCHNum    = sourceChannelInfo.SourceCHNum;
                i_channel.SourceSubCHNum = sourceChannelInfo.SourceSubCHNum;

                i_channel.T_AnalogRransducerOutChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region WirelessScalarChannelInfo
            if (t_channel is T1_WirelessScalarChannelInfo)
            {
                T1_WirelessScalarChannelInfo channel   = t_channel as T1_WirelessScalarChannelInfo;
                WirelessScalarChannelInfo    i_channel = new WirelessScalarChannelInfo();
                TransformMethod transformMethod        = JsonConvert.DeserializeObject <TransformMethod>(channel.TransformMethod);
                i_channel.EquationCategory = transformMethod.EquationCategory;
                i_channel.EquationCode     = transformMethod.EquationCode;

                i_channel.T_WirelessScalarChannelInfo = channel;
                return(i_channel);
            }
            #endregion

            #region WirelessVibrationChannelInfo
            if (t_channel is T1_WirelessVibrationChannelInfo)
            {
                T1_WirelessVibrationChannelInfo channel   = t_channel as T1_WirelessVibrationChannelInfo;
                WirelessVibrationChannelInfo    i_channel = new WirelessVibrationChannelInfo();
                CalibrationlInfo calibrationlInfo         = JsonConvert.DeserializeObject <CalibrationlInfo>(channel.CalibrationlInfo);
                i_channel.VelocityCalibration     = calibrationlInfo.VelocityCalibration;
                i_channel.DisplacementCalibration = calibrationlInfo.DisplacementCalibration;
                OtherInfo otherInfo = JsonConvert.DeserializeObject <OtherInfo>(channel.OtherInfo);
                i_channel.RPMCardNum        = otherInfo.RPMCardNum;
                i_channel.RPMSlotNum        = otherInfo.RPMSlotNum;
                i_channel.RPMCHNum          = otherInfo.RPMCHNum;
                i_channel.IsMultiplication  = otherInfo.IsMultiplication;
                i_channel.MultiplicationCor = otherInfo.MultiplicationCor;
                i_channel.IsSaveWaveToSD    = otherInfo.IsSaveWaveToSD;
                i_channel.IsUploadWave      = otherInfo.IsUploadWave;
                i_channel.DefaultRPM        = otherInfo.DefaultRPM;
                VibrationAddition vibrationAddition = JsonConvert.DeserializeObject <VibrationAddition>(channel.VibrationAddition);
                i_channel.TPDirCategory = vibrationAddition.TPDirCategory;
                i_channel.TPDirCode     = vibrationAddition.TPDirCode;
                i_channel.BiasVoltHigh  = vibrationAddition.BiasVoltHigh;
                i_channel.BiasVoltLow   = vibrationAddition.BiasVoltLow;
                i_channel.Sensitivity   = vibrationAddition.Sensitivity;

                i_channel.T_WirelessVibrationChannelInfo = channel;
                return(i_channel);
            }
            #endregion
            return(null);
        }