public List <string> GetOutputFields() { OutputFields of = FORIS.Interbilling.NTS.Mediation.Configurations.Configuration.GetNotCashedConfiguration <OutputFields>(); var output = of.OutputFieldsList; return(output); }
public void UpdateConfiguration() { Contract.Requires(IsConnected); Contract.Requires(Mode == DeviceMode.Command); var response = SendGetCommand(new Packet(1, Command.GetConfiguration)); var config = response.ReadUInt32(); streamFrequency = streamFrequencyTable[config & 0x00000007]; outputFields = (OutputFields)(config & (uint)OutputFields.All); options = (OperationOptions)(config & (uint)OperationOptions.All); response = SendGetCommand(new Packet(1, Command.GetFilterMode)); var filterMode = response.ReadUInt32(); this.filterMode = (FilterMode)filterMode; response = SendGetCommand(new Packet(1, Command.GetFilterPreset)); var magCorrection = response.ReadUInt32(); this.magnetometerCorrection = (MagnetometerCorrection)magCorrection; response = SendGetCommand(new Packet(1, Command.GetLowPassStrength)); this.temporalFilterAlpha = response.ReadSingle(); NeedUpdateConfiguration = false; ComputeDataPacketLayout(); }
public void InsertOutputField(string outputField) { OutputFields of = FORIS.Interbilling.NTS.Mediation.Configurations.Configuration.GetNotCashedConfiguration <OutputFields>(); of.OutputFieldsList.Add(outputField); FORIS.Interbilling.NTS.Mediation.Configurations.Configuration.SaveConfiguration(of.GetType(), of); }
protected void Enqueue(PublishedEvent evt) { if (xeadapter == null) { xeadapter = new XEventDataTableAdapter(EventsTable); xeadapter.Filter = this.Filter; xeadapter.OutputColumns = new List <OutputColumn>( OutputFields.Select(col => new OutputColumn(col) { ColumnType = OutputColumn.ColType.Field }) .Union(OutputTags.Select(col => new OutputColumn(col) { ColumnType = OutputColumn.ColType.Tag })) ); xeadapter.OutputColumns.Add(new OutputColumn("collection_time") { ColumnType = OutputColumn.ColType.Column }); } xeadapter.ReadEvent(evt); WriteToStdOut(); }
private OutputFields AddPricingInfoToBOMLine(OutputFields o, PricingInfo[] p) { OutputFields res = o; try { for (int i = 0; i < quantities.Count(); i++) { foreach (PricingInfo price in p) { if ((quantities[i] >= price.minqty) && (quantities[i] <= price.maxqty)) { if (price.CallForPricing) { res.unitprices[i] = -1.0; res.extprices[i] = -1.0; } else { // use this price value res.unitprices[i] = price.DestCost; res.extprices[i] = price.DestCost * res.bomqty; } } } } return(res); } catch (Exception ex) { ErrorCount++; throw ex; } }
/// <summary> /// Gets the size of the raw data in each data packet according to /// current output fields settings. /// </summary> /// <returns></returns> private void ComputeDataPacketLayout() { Contract.Requires(!NeedUpdateConfiguration); var test = new Packet(1, Command.GetSensorData, 1024); // timestamp test.WriteSingle(0f); rawDataOffset = test.DataOffset; if (OutputFields.HasFlag(OutputFields.Gyroscope)) { test.WriteVector3d(Vector3d.Zero); } if (OutputFields.HasFlag(OutputFields.Accelerometer)) { test.WriteVector3d(Vector3d.Zero); } if (OutputFields.HasFlag(OutputFields.Magnetometer)) { test.WriteVector3d(Vector3d.Zero); } if (OutputFields.HasFlag(OutputFields.AngularVelocity)) { test.WriteVector3d(Vector3d.Zero); } quaternionOffset = -1; if (OutputFields.HasFlag(OutputFields.Quaternion)) { quaternionOffset = test.DataOffset; test.WriteQuaternion(Quaternion.Zero); } if (OutputFields.HasFlag(OutputFields.EulerAngles)) { test.WriteVector3d(Vector3d.Zero); } if (OutputFields.HasFlag(OutputFields.LinearAcceleration)) { test.WriteVector3d(Vector3d.Zero); } if (OutputFields.HasFlag(OutputFields.Pressure)) { test.ReadSingle(); } if (OutputFields.HasFlag(OutputFields.Altitude)) { test.ReadSingle(); } if (OutputFields.HasFlag(OutputFields.Temperature)) { test.ReadSingle(); } if (OutputFields.HasFlag(OutputFields.HeaveMotion)) { test.ReadSingle(); } dataPacketSize = test.DataSize; }
/// <summary> /// Get the output field. /// </summary> /// <param name="outputFieldName">Output field name.</param> /// <returns>Output field.</returns> public object GetOutputField(string outputFieldName) { if (OutputFields.ContainsKey(outputFieldName)) { return(OutputFields[outputFieldName]); } return(null); }
public InsertCommandBuilder Clear() { CommandParameters.Clear(); FieldNames.Clear(); OutputFields.Clear(); FieldValues.Clear(); Table = string.Empty; TemporaryTable = string.Empty; return(this); }
public void Clear() { _schema = null; Path.Clear(); Variables.Clear(); Fragments.Clear(); UsedVariables.Clear(); UnusedVariables.Clear(); DeclaredVariables.Clear(); Names.Clear(); Types.Clear(); Directives.Clear(); OutputFields.Clear(); InputFields.Clear(); Errors.Clear(); IsInError = false; }
public void AddConnection(Field a, Field b, Connection.Creator createdBy) { //Find out which is the input field and which is the output field Field input, output; if (InputFields.Contains(a) && OutputFields.Contains(b)) { input = a; output = b; } else if (InputFields.Contains(b) && OutputFields.Contains(a)) { input = b; output = a; } else { //Only connect inputs with outputs return; } // Remove any existing connections to a newly connected output. // There should never be more than one input connected to any given output var conflictingConnections = Connections.Where(conn => conn.Output == output).ToList(); foreach (var conn in conflictingConnections) { RemoveConnection(conn); } SelectionStatus selectionStatus; if (Selection.Contains(input) || Selection.Contains(output)) { selectionStatus = SelectionStatus.ConnectionSelected; } else { selectionStatus = SelectionStatus.NotSelected; } Connections.Add(new Connection(input, output, createdBy, selectionStatus)); input.IsConnected = true; output.IsConnected = true; }
private void ProcessPart(List <OutputFields> BOMOut, string unique_id, string[] cols, int qty, int number_of_parts, string refdesignators) { try { partspurchasedata ppd = GetPurchaseInfo(unique_id); WriteStatus("Purchase info: id=" + ppd.id.ToString() + ", " + "comment=" + ppd.comment + ", " + "digikeypn=" + ppd.digikey_pn + ", " + "digikeymoq=" + ppd.digikeymoq.ToString() + ", " + "rs_pn=" + ppd.rs_pn + ", " + "rs_url=" + ppd.rs_url + ", " + "mouser_pn=" + ppd.mouser_pn + ", " + "farnellpn=" + ppd.farnell_pn + ", " + "rfdesignpn=" + ppd.rfdesign_pn + ", " + "mantechpn=" + ppd.mantech_pn + ", " + "ottopn=" + ppd.ottopn + ", " + "otherpn=" + ppd.otherpn + ", " + "notes=" + ppd.notes); bool fSupplierFound = false; PricingInfo[] dk_prices = new PricingInfo[0]; PricingInfo[] rfd_prices = new PricingInfo[0]; PricingInfo[] mt_prices = new PricingInfo[0]; PricingInfo[] om_prices = new PricingInfo[0]; PricingInfo[] rs_prices = new PricingInfo[0]; PricingInfo[] ms_prices = new PricingInfo[0]; PricingInfo[] other_prices = new PricingInfo[0]; // **** DIGIKEY ***** DigikeyTools dkt = new DigikeyTools(); if (ppd.digikey_pn != "") { if (ppd.digikey_pn.Contains("PIC18")) { ppd.digikey_pn = ppd.digikey_pn.Trim(); } //dkt.LoadPageData(webBrowser1,ppd.digikey_pn); dkt.LoadPageData(geckoWebBrowser1, ppd.digikey_pn); dk_prices = dkt.GetPricingInfo(); WriteStatus("Digikey Prices:"); WriteStatus("----------------"); if (dk_prices.Count() > 0) { foreach (PricingInfo p in dk_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no digikey prices!"); } WriteStatus("*"); } // **** RS COMPONENTS ***** rswebtools rswt = new rswebtools(ppd.rs_url); if (ppd.rs_pn != "") { rswt.LoadPageData(ppd.rs_pn); rs_prices = rswt.GetPricingInfo(); WriteStatus("RS prices Prices:"); WriteStatus("----------------"); if (rs_prices.Count() > 0) { foreach (PricingInfo p in rs_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no Rs component prices!"); } WriteStatus("*"); } // **** MOUSER ***** MouserWebtools mswt = new MouserWebtools(); if (ppd.mouser_pn != "") { mswt.LoadPageData(ppd.mouser_pn); ms_prices = mswt.GetPricingInfo(); WriteStatus("Mouser Prices:"); WriteStatus("----------------"); if (ms_prices.Count() > 0) { foreach (PricingInfo p in ms_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no Mouser component prices!"); } WriteStatus("*"); } // **** FARNELL ***** // **** RF Design **** RFDesignWebTools rfdwt = new RFDesignWebTools(); if (ppd.rfdesign_pn != "") { rfdwt.LoadPageData(ppd.rfdesign_pn); rfd_prices = rfdwt.GetPricingInfo(); WriteStatus("RF Design Prices:"); WriteStatus("----------------"); if (rfd_prices.Count() > 0) { foreach (PricingInfo p in rfd_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no RF Design prices!"); } WriteStatus("*"); } // **** Mantech electronics **** MantechWebTools mtwt = new MantechWebTools(); if (ppd.mantech_pn != "") { mtwt.LoadPageData(ppd.mantech_pn); mt_prices = mtwt.GetPricingInfo(); WriteStatus("Mantech Prices:"); WriteStatus("----------------"); if (mt_prices.Count() > 0) { foreach (PricingInfo p in mt_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no Mantech prices!"); } WriteStatus("*"); } // **** Otto Marketing **** OttoMarketingWebTools omwt = new OttoMarketingWebTools(); if (ppd.ottopn != "") { omwt.LoadPageData(ppd.ottopn); om_prices = omwt.GetPricingInfo(); WriteStatus("Otto marketing Prices:"); WriteStatus("----------------"); if (om_prices.Count() > 0) { foreach (PricingInfo p in om_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no Otto marketing prices!"); } WriteStatus("*"); } other_comp_tools ocdbt = new other_comp_tools(); if (ppd.otherpn != "") { ocdbt.LoadPricingInfo(ppd.otherpn, conn); other_prices = ocdbt.GetPricingInfo(); WriteStatus("Other sources Prices:"); WriteStatus("---------------------"); if (other_prices.Count() > 0) { foreach (PricingInfo p in other_prices) { WriteStatus("Price: " + p.SrcCost.ToString("#0.000") + p.srcCurr + "(" + p.DestCost.ToString("#0.000") + p.destCurr + ") (" + p.minqty.ToString() + "-" + p.maxqty.ToString() + ")"); } fSupplierFound = true; } else { WriteStatus("INFO: no other sources prices!"); } WriteStatus("*"); } if (PartsToIgnoreList.Contains(unique_id)) { fSupplierFound = true; } if (!fSupplierFound) { throw new Exception("No supplier found for part (will not be included on BOM!): " + ppd.comment); } // AJTODO: choose lowest cost supplier OutputFields of = new OutputFields(); of.Comment = unique_id; of.Descr = cols[1].Replace("\"", "").Trim(); of.bomqty = qty; of.Designators = refdesignators; if (ppd.digikey_pn != "") { // only add to order if digikey has it! WriteStatus("Using Digikey as supplier"); of.Manufacturer = dkt.GetManufacturer(); of.Manuf_pn = dkt.GetManufacturerPartNo(); of.supplier = "Digikey"; of.suppliercode = ppd.digikey_pn; of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, dk_prices); dk_order.AddToOrder(of.suppliercode, of.Manufacturer, of.Manuf_pn, of.bomqty * number_of_parts, of.Comment, ppd.digikeymoq); } else if (ppd.rs_pn != "") { // add to rs order WriteStatus("Using RS Components as supplier"); of.Manufacturer = rswt.GetManufacturer(); of.Manuf_pn = rswt.GetManufacturerPartNo(); of.supplier = "RS Components"; of.suppliercode = ppd.rs_pn; of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, rs_prices); rs_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else if (ppd.rfdesign_pn != "") { // add rfdesign order WriteStatus("Using RF Design as supplier"); of.Manufacturer = rfdwt.GetManufacturer(); of.Manuf_pn = rfdwt.GetManufacturerPartNo(); of.supplier = "RF Design"; of.suppliercode = ppd.rfdesign_pn; of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, rfd_prices); rfd_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else if (ppd.mantech_pn != "") { // add mantech order WriteStatus("Using Mantech Electronics as supplier"); of.Manufacturer = mtwt.GetManufacturer(); of.Manuf_pn = mtwt.GetManufacturerPartNo(); of.supplier = "Mantech Electronics"; of.suppliercode = ppd.mantech_pn; of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, mt_prices); mt_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else if (ppd.ottopn != "") { // add otto marketing order WriteStatus("Using Otto Marketing as supplier"); of.Manufacturer = omwt.GetManufacturer(); of.Manuf_pn = omwt.GetManufacturerPartNo(); of.supplier = "Otto Marketing"; of.suppliercode = ppd.comment; // NOTE: we take a shortcut here! of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, om_prices); om_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else if (ppd.otherpn != "") { // add to other orders WriteStatus("Using other supplier"); of.Manufacturer = ocdbt.GetManufacturer(); of.Manuf_pn = ocdbt.GetManufacturerPartNo(); of.supplier = ocdbt.GetSupplier(); of.suppliercode = ocdbt.GetSupplierCode(); of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, other_prices); other_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else if (ppd.mouser_pn != "") { // add to mouser orders WriteStatus("Using Mouser as supplier"); of.Manufacturer = mswt.GetManufacturer(); of.Manuf_pn = mswt.GetManufacturerPartNo(); of.supplier = "Mouser Electronics"; of.suppliercode = ppd.mouser_pn; // NOTE: we take a shortcut here! of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; of = AddPricingInfoToBOMLine(of, ms_prices); ms_order.AddToOrder(of.suppliercode, of.bomqty * number_of_parts); } else { WriteStatus("Unknown supplier"); of.Manufacturer = "Unknown"; of.Manuf_pn = "Unknown"; of.supplier = "Unknown"; of.suppliercode = "Unknown"; of.unitprices = new double[quantities.Count()]; of.extprices = new double[quantities.Count()]; } WriteStatus("Writing output BOM"); BOMOut.Add(of); } catch (Exception ex) { if (PartsToIgnoreList.Contains(unique_id)) { WriteStatus("Purchase pricing info for " + unique_id + " ignored"); } else { ErrorCount++; WriteStatus("ERROR: Cannot get purchase info for " + unique_id + " - " + ex.ToString()); } } }
public InsertCommandBuilder AddOutputFields(params string[] outputFields) => this.Chain(() => OutputFields.AddRange(outputFields));
public InsertCommandBuilder AddOutputFields(IEnumerable <string> outputFields) => this.Chain(() => OutputFields.AddRange(outputFields));
public bool IsConnectable(Field a, Field b) { return(a != null && b != null && ((InputFields.Contains(a) && OutputFields.Contains(b)) || (InputFields.Contains(b) && OutputFields.Contains(a)))); }