public void AddSignalInput(SignalIN input)
 {
     if( _signalINs == null )
         _signalINs = new List<SignalIN>();
     _signalINs.Add(input);
     AddListViewObject(input);
 }
 public void addSignalInputs(SignalIN[] inputs)
 {
     foreach (SignalIN input in inputs)
     {
         addSignalInput(input);
     }
 }
Пример #3
0
 public SignalInputForm(List<SignalIN> signalInputList)
 {
     this.signalInputList = signalInputList;
     signalInput = new SignalIN();
     InitializeComponent();
     BackColor = ATMLContext.COLOR_FORM;
     panel1.BackColor = ATMLContext.COLOR_PANEL;
     Validating += SignalInputForm_Validating;
     signalInputControl.SignalInput = signalInput;
 }
 public int addSignalInput(SignalIN input)
 {
     var item = new ListViewItem(input.name);
     item.SubItems.Add(input.In == null ? "" : input.In.ToString());
     item.SubItems.Add("" + input.maxChannels);
     item.Tag = input;
     item = Items.Add(item);
     if (item.Index%2 == 0)
     {
         item.BackColor = AltColor1;
     }
     else
     {
         item.BackColor = AltColor2;
     }
     return item.Index;
 }
Пример #5
0
 private void ControlsToData()
 {
     signalInput = signalInputControl.SignalInput;
 }
Пример #6
0
 public static bool LoadFromFile(string fileName, out SignalIN obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
Пример #7
0
 /// <summary>
 /// Deserializes xml markup from file into an SignalIN object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output SignalIN object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out SignalIN obj, out System.Exception exception)
 {
     exception = null;
     obj = default(SignalIN);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #8
0
 public static bool Deserialize(string input, out SignalIN obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }
Пример #9
0
 /// <summary>
 /// Deserializes workflow markup into an SignalIN object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output SignalIN object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out SignalIN obj, out System.Exception exception)
 {
     exception = null;
     obj = default(SignalIN);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #10
0
        private void btnSelectIns_Click(object sender, EventArgs e)
        {
            if (_availableIns != null)
            {
                //----------------------------------------------------------------------------------//
                //--- Pass in "name" as the property name from the port to use as the list value ---//
                //----------------------------------------------------------------------------------//
                var form = new CheckedListForm("name");
                foreach (Port port in _availableIns)
                {
                    if (port.direction == PortDirection.Input
                        || port.direction == PortDirection.BiDirectional)
                    {
                        form.AddListItem(port, edtIn.Text.Contains(port.name) /* TODO: Or is in signalInputList */);
                    }
                }

                if (DialogResult.OK == form.ShowDialog())
                {
                    List<object> selectedList = form.SelectedIems;
                    //---------------------------------//
                    //--- Clear any existing inputs ---//
                    //---------------------------------//
                    if (signalInputList.SignalINs != null )
                        signalInputList.SignalINs.Clear();
                    edtIn.Text = "";

                    //------------------------------------------------------//
                    //--- Walk each checked input from checked list form ---//
                    //------------------------------------------------------//
                    foreach (object item in selectedList)
                    {
                        var port = (Port) item;
                        //---------------------------------------------------------------------------------//
                        //--- Add input items to in line separated by a space (backwards compatability) ---//
                        //---------------------------------------------------------------------------------//
                        edtIn.Text += port.name + " ";
                        //-------------------------------//
                        //--- Add input to input list ---//
                        //-------------------------------//
                        var sin = new SignalIN();
                        sin.name = port.name;
                        sin.In = SignalININ.In;
                        signalInputList.AddSignalInput(sin);
                    }
                }
            }
        }