예제 #1
0
        public override void Check()
        {
            int inputRowNo = InPortList[0].RowNo;
            int inputColNo = InPortList[0].ColNo;

            if (inputRowNo < 0 && inputColNo < 0)
            {
                if (rowNo < 0 && colNo < 0)
                {
                    rowNo = 0;
                    colNo = 0;
                }
                else
                {
                    InPortList[0].RowNo = rowNo;
                    InPortList[0].ColNo = colNo;
                }
            }
            else if (rowNo < 0 && colNo < 0)
            {
                rowNo = inputRowNo;
                colNo = inputColNo;
            }
            else if (inputColNo != colNo)
            {
                throw logger.Error(new ModelException(this, $"Column number inconsistent, got {inputColNo}, but {colNo} expected."));
            }
            else if (inputRowNo != rowNo)
            {
                throw logger.Error(new ModelException(this, $"Row number inconsistent, got {inputRowNo}, but {rowNo} expected."));
            }
            handle = ControlInput.CreateInput(varName ?? Name, rowNo, colNo);
            OutPortList[0].SetShape(rowNo, colNo);
        }