Example #1
0
        public void AddPin(dbConnectorPin pin)
        {
            var cpin = new ConnectorPin();

            cpin.ID   = pin.pinIdx.ToString();
            cpin.name = pin.pinName;
            //------------------------------------------------------------------------------------------------------------//
            //--- Note: The description is intentially left out from this update due to a poor schema design for ATML. ---//
            //---       The Definition (ItemDescription) is for the manufacturer pin description and should not be     ---//
            //---       part of a pin instance.                                                                        ---//
            //------------------------------------------------------------------------------------------------------------//
            AddPin(cpin);
        }
Example #2
0
        private void ConnectorConfigurationForm_Saved(object sender, EventArgs e)
        {
            bool         added = false;
            Guid?        uuid  = _connector.ID;
            EquipmentDAO dao   = new EquipmentDAO();

            _configuration = dao.getConnectorConfiguration(uuid, edtConfigurationName.Text);
            if (_configuration == null)
            {
                _configuration                    = new dbConnectorConfiguration();
                _configuration.ID                 = Guid.NewGuid();
                _configuration.connectorId        = uuid;
                _configuration.configName         = edtConfigurationName.Text;
                _configuration.DataState          = BASEBean.eDataState.DS_ADD;
                _configuration.IncludeKeyOnInsert = true;
                added = true;
            }
            Configuration.Pins.Clear();
            int i = 1;

            if (_pins != null)
            {
                foreach (ConnectorPin connectorPin in _pins)
                {
                    dbConnectorPin pin = new dbConnectorPin();
                    pin.configId = _configuration.ID;
                    pin.pinIdx   = i++;
                    pin.pinName  = connectorPin.name;
                    if (connectorPin.Definition != null)
                    {
                        pin.pinDescription = connectorPin.Definition.Description;
                    }
                    Configuration.Pins.Add(pin);
                }
            }
            Configuration.save();
            LogManager.Info("Connector Pin Configuration \"{0}\" has been {1}", _configuration.configName, added ? "Added" : "Saved");
        }