Esempio n. 1
0
        public void SetLoopsAmountBySpecifiedController()
        {
            List <string> lstLoopsCode = new List <string>();

            if (ProjectManager.GetInstance.Project != null && TheController != null)
            {
                SCA.Interface.IControllerConfig controllerConfig = ControllerConfigManager.GetConfigObject(TheController.Type);
                short maxLoopAmount = controllerConfig.GetMaxLoopAmountValue();
                for (int i = 1; i <= maxLoopAmount; i++)
                {
                    lstLoopsCode.Add(i.ToString().PadLeft(TheController.LoopAddressLength, '0'));
                }
            }
            LoopsCode = lstLoopsCode;
        }
Esempio n. 2
0
        public List <string> GetPrimaryControllerLoopsAmount()
        {
            List <string> lstLoopsCode = new List <string>();

            if (ProjectManager.GetInstance.Project != null)
            {
                SCA.Model.ControllerModel       controller       = ProjectManager.GetInstance.GetPrimaryController();
                SCA.Interface.IControllerConfig controllerConfig = ControllerConfigManager.GetConfigObject(controller.Type);
                short maxLoopAmount = controllerConfig.GetMaxLoopAmountValue();

                for (int i = 1; i <= maxLoopAmount; i++)
                {
                    lstLoopsCode.Add(i.ToString().PadLeft(controller.LoopAddressLength, '0'));
                }
            }
            LoopsCode = lstLoopsCode;
            return(lstLoopsCode);
        }