/// <summary> /// Called by Alteryx to send each data record to the tool. /// </summary> /// <param name="pRecord">The new record</param> /// <returns>True if Ok</returns> public bool II_PushRecord(RecordData pRecord) { var args = new RecordPushedEventArgs(pRecord); this.RecordPushed?.Invoke(this, args); return(args.Success); }
/// <summary> /// Called by Alteryx to send each data record to the tool. /// </summary> /// <param name="pRecord">The new record</param> /// <returns>True if Ok</returns> public bool II_PushRecord(AlteryxRecordInfoNet.RecordData pRecord) { var args = new RecordPushedEventArgs(pRecord); this.RecordPushed(this, args); return(args.Success); }
private void BreakerOnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { if (this._failed) { args.Success = false; return; } this._failed = true; this.ExecutionComplete(); }
private void OnRecordPushed(object sender, RecordPushedEventArgs args) { args.Success = true; var record = this.Output.Record; record.Reset(); this.Input.Copier.Copy(record, args.RecordData); var point = this._inputReader(args.RecordData); if (!point.Item1.HasValue || double.IsNaN(point.Item1.Value) || !point.Item2.HasValue || double.IsNaN(point.Item2.Value)) { this._outputBinXFieldBase.SetNull(record); this._outputBinYFieldBase.SetNull(record); this.Output.Push(record); return; } var dy = 2 * 0.86602540378443864676372317075294 * this.ConfigObject.Radius; // 2 * Sin(π/3) var dx = 1.5 * this.ConfigObject.Radius; var px = point.Item1.Value / dx; var pi = (int)Math.Round(px); var mod2 = (pi & 1) == 1; var py = point.Item2.Value / dy - (mod2 ? 0.5 : 0); var pj = Math.Round(py); var px1 = (px - pi) * dx; if (Math.Abs(px1) * 3 > 1) { var py1 = (py - pj) * dy; var pj2 = pj + (py < pj ? -1 : 1) / 2.0; var pi2 = pi + (px < pi ? -1 : 1); var px2 = (px - pi2) * dx; var py2 = (py - pj2) * dy; if (px1 * px1 + py1 * py1 > px2 * px2 + py2 * py2) { pj = pj2 + (mod2 ? 1 : -1) / 2.0; pi = pi2; mod2 = (pi & 1) == 1; } } this._outputBinYFieldBase.SetFromDouble(record, (pj + (mod2 ? 0.5 : 0)) * dy); this._outputBinXFieldBase.SetFromDouble(record, pi * dx); this.Output.Push(record); }
private void OnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { var record = this.Output.Record; record.Reset(); this.Input.Copier.Copy(record, args.RecordData); var val = this._nextValue(); this._outputFieldBase.SetFromDouble(record, val); this.Output.Push(record); args.Success = true; }
private void OnRecordPushed(object sender, RecordPushedEventArgs args) { var record = this.Output.Record; record.Reset(); this._copier.Copy(record, args.RecordData); var input = this._inputFieldBase.GetAsString(args.RecordData); if (double.TryParse(input, NumberStyles.Any, this.ConfigObject.CultureObject.Value, out double value)) { this._outputFieldBase.SetFromDouble(record, value); } this.Output.Push(record); args.Success = true; }
private void OnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { this.Output.Record.Reset(); this._copier.Copy(this.Output.Record, args.RecordData); var input = this._inputFieldBase.GetAsString(args.RecordData); var result = this._parser(input); if (result.HasValue) { this._outputFieldBase.SetFromString( this.Output.Record, result.Value.ToString( this._outputFieldBase.FieldType == FieldType.E_FT_Time ? "HH:mm:ss" : "yyyy-MM-dd HH:mm:ss")); } this.Output.Push(this.Output.Record, false, 0); args.Success = true; }
private void InputOnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { if (this._failed) { args.Success = false; return; } var record = this.Input.RecordInfo.CreateRecord(); this.Input.Copier.Copy(record, args.RecordData); if (this.Breaker.State == ConnectionState.Closed) { this.Output?.Push(record); } else { this._inputRecords.Enqueue(record); } }
private void OnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { var record = this.Output.Record; record.Reset(); this._copier.Copy(record, args.RecordData); var result = this._formatter(args.RecordData); if (result != null) { this._outputFieldBase.SetFromString(record, result); } else { this._outputFieldBase.SetNull(record); } this.Output?.Push(record); }
private void OnRecordPushed(object sender, RecordPushedEventArgs args) { var record = this.Output.Record; record.Reset(); this.Input.Copier.Copy(record, args.RecordData); var input = this._inputFieldBase.GetAsString(args.RecordData); var bytes = this._hashAlgorithm.ComputeHash(Encoding.UTF8.GetBytes(input)); var sb = new StringBuilder(); foreach (var b in bytes) { sb.Append(b.ToString("X2")); } this._outputFieldBase.SetFromString(record, sb.ToString()); this.Output.Push(record); args.Success = true; }
private void OnRecordPushed(IInputProperty sender, RecordPushedEventArgs args) { var xml = this._inputField.GetAsString(args.RecordData); var nodes = this.ReadNodes(xml); var record = this.Output.Record; if (nodes == null) { record.Reset(); this._copier.Copy(record, args.RecordData); this._xpathField.SetNull(record); this._innerTextField.SetNull(record); this._innerXmlField.SetNull(record); this.Output?.Push(record); this._recordCount++; if (this._recordCount % 100 == 0) { this.Output.PushCountAndSize(); } } else { foreach (var nodeData in nodes) { record.Reset(); this._copier.Copy(record, args.RecordData); if (nodeData?.XPath == null) { this._xpathField.SetNull(record); } else { this._xpathField.SetFromString(record, nodeData.XPath); } if (nodeData?.InnerText == null) { this._innerTextField.SetNull(record); } else { this._innerTextField.SetFromString(record, nodeData.InnerText); } if (nodeData?.InnerXml == null) { this._innerXmlField.SetNull(record); } else { this._innerXmlField.SetFromString(record, nodeData.InnerXml); } this.Output?.Push(record); this._recordCount++; if (this._recordCount % 100 == 0) { this.Output.PushCountAndSize(); } } } }