Example #1
0
        /// <summary>
        /// Get the location of the input from the element and the index of the input
        /// </summary>
        /// <param name="element">The element with inputs</param>
        /// <param name="inputNo">Index of the input (0-indexed)</param>
        /// <returns></returns>
        private Point getInpoint(CircuitSimLib.CircuitElement element, int inputNo)
        {
            Point location = ConvertPointToLogisimPoint(element.OutPoint());

            if (element is CircuitSimLib.INPUT || element is CircuitSimLib.OUTPUT)
            {
                return(location);
            }
            else if (element is CircuitSimLib.NOT)
            {
                return(new Point(location.X - 30, location.Y));
            }
            else
            {
                int locX = (int)location.X - 50;
                int locY = (int)location.Y + (inputNo - 2) * 10;
                return(new Point(locX, locY));
            }
        }
Example #2
0
 /// <summary>
 /// Get the location of the output from the element and the index of the output
 /// </summary>
 /// <param name="element">The element which has outputs</param>
 /// <param name="outputNo">The index of the output (0-indexed) </param>
 /// <returns></returns>
 private Point getOutpoint(CircuitSimLib.CircuitElement element, int outputNo)
 {
     // Currently just returns the location of the output
     return(element.OutPoint(outputNo));
 }