Beispiel #1
0
        public IOAddressManager(string projectPath)
        {
            this.ProjectPath = projectPath;

            ListOfAvailableIOAddress = new IOAddressList();
            ListOfIOConnections      = new IOConnectionList();

            proxyOfHWConfig = new HWConfigurationProxy(ProjectPath);

            #region Get Hardware Config File of Project

            string hwConfigFile = null;

            // Search in project file
            try
            {
                string[] files = System.IO.Directory.GetFiles(projectPath, @"*.VAR");
                if (files != null && files.Count() > 0)
                {
                    IniFile iniFile = new IniFile(files[0]);
                    hwConfigFile = iniFile.GetValueS("STATION", "FILE0");
                    if (!string.IsNullOrEmpty(hwConfigFile))
                    {
                        hwConfigFile = projectPath.PathCombine(hwConfigFile + ".hwconfig");
                    }
                }
            }
            catch (Exception)
            {
            }

            // Search .hwconfig file
            if (string.IsNullOrEmpty(hwConfigFile))
            {
                try
                {
                    string[] files = System.IO.Directory.GetFiles(projectPath, @"*.hwconfig");
                    if (files != null && files.Count() > 0)
                    {
                        hwConfigFile = files[0];
                    }
                }
                catch (Exception)
                {
                }
            }

            #endregion

            this.SetHWConfigFile(hwConfigFile);

            // reset dirty flag
            Dirty = false;
        }
Beispiel #2
0
 public void GetIOConnectionList(ref IOConnectionList list)
 {
     list = ListOfIOConnections;
 }