public void GetGates()
        {
            var gates = dataFile
                        .Channels[SelectedChannelIndex + 1]
                        .Beams[SelectedBeamIndex + 1]
                        .Gates;

            for (int i = 1; i <= gates.Count; i++)
            {
                var gate = gates[i];
                GateList.Add(gate.Name);
            }

            // set first gate by default
            SelectedGateIndex = 0;

            // Beam index starts from 1
            GetGateInfo(SelectedGateIndex + 1);
        }
        /// <summary>
        /// Adds gate with coords in work area; 'registers' all its pins to allow selection and connection.
        /// </summary>
        /// <param name="gvmwc"></param>
        public void AddGate(GateViewModelWithCoordinates gvmwc)
        {
            if (gvmwc.gateViewModel.Name == "SOURCE" || gvmwc.gateViewModel.Name == "READER")
            {
                gvmwc.gateViewModel.ShowBottomLabels   = true;
                gvmwc.gateViewModel.NumberLabelVisible = true;
            }

            GateList.Add(gvmwc);

            if (gvmwc.gateViewModel.Name == "SOURCE" || gvmwc.gateViewModel.Name == "READER")
            {
                Renumber();
            }

            foreach (PinViewModel p in gvmwc.gateViewModel.inputPins)
            {
                InputPins.Add(p);
            }

            OutputPins.Add(gvmwc.gateViewModel.outputPin);
        }
示例#3
0
 /// <summary>
 /// Add a gate in the circuit to the list.
 /// </summary>
 /// <param name="gate">The gate to be added to the list</param>
 public void AddGate(Gate gate)
 {
     GateList.Add(gate);
 }