Ejemplo n.º 1
0
 public MIKProperty(List <double> Values, double Weight, MMIStandard.MEndeffectorType Target, MIKOperationType OperationType) : this()
 {
     this.Values        = Values;
     this.Weight        = Weight;
     this.Target        = Target;
     this.OperationType = OperationType;
 }
Ejemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_Values        = false;
                bool   isset_Weight        = false;
                bool   isset_Target        = false;
                bool   isset_OperationType = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.List)
                        {
                            {
                                Values = new List <double>();
                                TList _list4 = iprot.ReadListBegin();
                                for (int _i5 = 0; _i5 < _list4.Count; ++_i5)
                                {
                                    double _elem6;
                                    _elem6 = iprot.ReadDouble();
                                    Values.Add(_elem6);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_Values = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Double)
                        {
                            Weight       = iprot.ReadDouble();
                            isset_Weight = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I32)
                        {
                            Target       = (MMIStandard.MEndeffectorType)iprot.ReadI32();
                            isset_Target = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.I32)
                        {
                            OperationType       = (MIKOperationType)iprot.ReadI32();
                            isset_OperationType = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_Values)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Values not set");
                }
                if (!isset_Weight)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Weight not set");
                }
                if (!isset_Target)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Target not set");
                }
                if (!isset_OperationType)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field OperationType not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }