public bool II_Init(RecordInfo recordInfo)
        {
            _incomingInfo = recordInfo;
            _info         = new RecordInfo();
            _copier       = new RecordCopier(_info, _incomingInfo, false);
            for (var index = 0; index < _incomingInfo.NumFields(); index++)
            {
                var field = _incomingInfo[index];
                if (field.FieldType != FieldType.E_FT_FixedDecimal)
                {
                    _info.AddField(field.GetFieldName(), field.FieldType, (int)field.Size, field.Scale, field.GetSource(), field.GetDescription());
                    _copier.Add(index, index);
                    continue;
                }

                var fieldType = FieldType.E_FT_Double;
                if (field.Scale == 0)
                {
                    fieldType = FieldType.E_FT_Int64;
                }
                _decimalMapping.Add(index, fieldType);
                _info.AddField(field.GetFieldName(), fieldType, 0, 0, field.GetSource(), field.GetDescription());
            }
            _copier.DoneAdding();
            _record = _info.CreateRecord();
            _parent.InitOutput(_info);
            return(true);
        }
示例#2
0
        private void prep()
        {
            // Exit if already done (safety)
            if (_recordInfoOut != null)
            {
                return;
            }

            _recordInfoOut = new AlteryxRecordInfoNet.RecordInfo(); // Make a new record

            //_recordInfoOut = new AlteryxRecordInfoNet.RecordInfo();

            /*
             * // Copy the fieldbase structure of the incoming record
             * uint countFields = _recordInfoIn.NumFields();
             * for (int i = 0; i < countFields; ++i)
             * {
             *  FieldBase fbIn = _recordInfoIn[i];
             *  var currentFieldName = fbIn.GetFieldName();
             *
             *  _recordInfoOut.AddField(currentFieldName, fbIn.FieldType, (int)fbIn.Size, fbIn.Scale, fbIn.GetSource(), fbIn.GetDescription());
             * }
             */

            // Add the output columns at the end
            _recordInfoOut.AddField("ConcaveHull_Polygon_Group", FieldType.E_FT_V_WString, Constants.LARGEOUTPUTFIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("ConcaveHull_Polygon_Sequence", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("ConcaveHull_Polygon_XCoord", FieldType.E_FT_Double, Constants.DOUBLE_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("ConcaveHull_Polygon_YCoord", FieldType.E_FT_Double, Constants.DOUBLE_FIELDSIZE, 0, "", "");


            //_recordCopier.DoneAdding();

            _outputHelper.Init(_recordInfoOut, "Output", null, _xmlProperties);
        }
示例#3
0
        private void populateRecordInfoOut()
        {
            _recordInfoOut = new AlteryxRecordInfoNet.RecordInfo();

            // Copy the fieldbase structure of the incoming record
            uint countFields = _recordInfoIn.NumFields();

            for (int i = 0; i < countFields; ++i)
            {
                FieldBase fbIn = _recordInfoIn[i];
                _recordInfoOut.AddField(fbIn.GetFieldName(), fbIn.FieldType, (int)fbIn.Size, fbIn.Scale, fbIn.GetSource(), fbIn.GetDescription());
            }

            // Add the output column at the end
            _recordInfoOut.AddField(_outputField, FieldType.E_FT_String, Constants.OUTPUTFIELDSIZE, 0, "", "");
        }
示例#4
0
        private void populateRecordInfoOut()
        {
            _recordInfoOut = new AlteryxRecordInfoNet.RecordInfo();

            // Copy the fieldbase structure of the incoming record
            uint countFields = _recordInfoIn.NumFields();

            for (int i = 0; i < countFields; ++i)
            {
                FieldBase fbIn             = _recordInfoIn[i];
                var       currentFieldName = fbIn.GetFieldName();

                _recordInfoOut.AddField(currentFieldName, fbIn.FieldType, (int)fbIn.Size, fbIn.Scale, fbIn.GetSource(), fbIn.GetDescription());
            }



            // Add the output columns at the end
            _recordInfoOut.AddField("XCoord", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("YCoord", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("RValue", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("GValue", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("BValue", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
            _recordInfoOut.AddField("AlphaValue", FieldType.E_FT_Int32, Constants.INT32_FIELDSIZE, 0, "", "");
        }
        private void populateRecordInfoOut()
        {
            _recordInfoOut = new AlteryxRecordInfoNet.RecordInfo();

            // Copy the fieldbase structure of the incoming record
            uint countFields = _recordInfoIn.NumFields();

            for (int i = 0; i < countFields; ++i)
            {
                FieldBase fbIn             = _recordInfoIn[i];
                var       currentFieldName = fbIn.GetFieldName();

                // Do not include the source data (selectedField) in the output
                if (!String.Equals(currentFieldName, _selectedField, StringComparison.OrdinalIgnoreCase))
                {
                    _recordInfoOut.AddField(currentFieldName, fbIn.FieldType, (int)fbIn.Size, fbIn.Scale, fbIn.GetSource(), fbIn.GetDescription());
                }
            }

            // Add the output columns at the end
            _recordInfoOut.AddField("Path", FieldType.E_FT_V_WString, Constants.LARGEOUTPUTFIELDSIZE, 0, "", ""); // Empty strings are source and description
            _recordInfoOut.AddField("Value", FieldType.E_FT_V_WString, Constants.LARGEOUTPUTFIELDSIZE, 0, "", "");
        }
        /// <summary>
        ///     Given a set of <see cref="FieldDescription" /> and existing RecordInfo, create a new RecordInfo with specified
        ///     fields replacing existing ones or being appended.
        /// </summary>
        /// <param name="inputRecordInfo">Existing RecordInfo object.</param>
        /// <param name="fields">Set of Field Descriptions.</param>
        /// <returns>A configured RecordInfo object.</returns>
        public static RecordInfo CreateRecordInfo(RecordInfo inputRecordInfo, params FieldDescription[] fields)
        {
            var fieldDict = fields.ToDictionary(f => f.Name, f => false);
            var output    = new RecordInfo();

            if (inputRecordInfo != null)
            {
                for (var i = 0; i < inputRecordInfo.NumFields(); i++)
                {
                    var fieldInfo = inputRecordInfo[i];
                    var fieldName = fieldInfo.GetFieldName();

                    if (fieldDict.ContainsKey(fieldName))
                    {
                        fieldDict[fieldName] = true;
                        var descr = fields.First(f => f.Name == fieldName);
                        output.AddField(
                            descr.Name,
                            descr.FieldType,
                            descr.ParsedSize,
                            descr.Scale,
                            descr.Source,
                            descr.Description);
                        continue;
                    }

                    output.AddField(fieldInfo);
                }
            }

            foreach (var descr in fields.Where(d => !fieldDict[d.Name]))
            {
                output.AddField(descr.Name, descr.FieldType, descr.ParsedSize, descr.Scale, descr.Source, descr.Description);
            }

            return(output);
        }
        public bool II_Init(RecordInfo recordInfo)
        {
            _info         = new RecordInfo();
            _incomingInfo = recordInfo;
            _copier       = new RecordCopier(_info, _incomingInfo, false);
            for (var i = 0; i < _incomingInfo.NumFields(); i++)
            {
                _info.AddField(_incomingInfo[i]);
                _copier.Add(i, i);
            }
            _copier.DoneAdding();
            _info.AddField(_parent.NewField, FieldType.E_FT_Int64);
            _newField = _info.GetFieldByName(_parent.NewField, false);

            _fields = new FieldBase[_parent.Fields.Length];
            for (var i = 0; i < _fields.Length; i++)
            {
                _fields[i] = _incomingInfo.GetFieldByName(_parent.Fields[i], false);
            }

            _record = _info.CreateRecord();
            _parent.Output.Init(_info, "Output", null, _parent.Config);
            return(true);
        }