private void SaveGeneral(XmlDocument xmlDoc, GeneralConfigData generalConfigData, WmxmlConfigData wmxmlConfigData, DialogConfigData dialogConfigData)
        {
            XmlOldGeneral xmlGeneral = new XmlOldGeneral();

            xmlGeneral.LoginEnabled = generalConfigData.LoginEnabled;
            xmlGeneral.SystemType = generalConfigData.SystemType;
            xmlGeneral.LogLevel = generalConfigData.LogLevel;
            xmlGeneral.LongPauseEnabled = generalConfigData.LongPauseEnabled;
            xmlGeneral.LongPauseDelayTime = generalConfigData.LongPauseDelayTime;
            xmlGeneral.TowerLightEnabled = generalConfigData.TowerLightEnabled;
            xmlGeneral.TowerLightPort = generalConfigData.TowerLightPort;
            xmlGeneral.AlwaysSaveWaferMaps = wmxmlConfigData.AlwaysSaveWaferMaps;
            xmlGeneral.ErrorDialogContinueEnabled = dialogConfigData.ErrorDialogContinueEnabled;
            xmlGeneral.PauseDialogAfterWaferEnabled = dialogConfigData.PauseDialogAfterWaferEnabled;
            xmlGeneral.PauseDialogAfterWaferAutoRelease = dialogConfigData.PauseDialogAfterWaferAutoRelease;

            xmlGeneral.SaveConfig(xmlDoc);

            XmlOldDb xmlDb = new XmlOldDb();

            xmlDb.UseTrakLot = generalConfigData.UseTrakLot;

            xmlDb.SaveConfig(xmlDoc);
        }
        private void SaveDir(XmlDocument xmlDoc, DirConfigData dirConfigData, WmxmlConfigData wmxmlConfigData)
        {
            XmlOldDir xmlDir = new XmlOldDir();

            xmlDir.SetupDir = dirConfigData.SetupDir;
            xmlDir.LoggingDir = dirConfigData.LoggingDir;
            xmlDir.CacheDir = dirConfigData.CacheDir;
            xmlDir.WmxmlVersion = wmxmlConfigData.LocalWmxmlVersion;
            xmlDir.LocalFileFormat = wmxmlConfigData.LocalFileFormat;
            xmlDir.LocalOutputWmxmlEnabled = wmxmlConfigData.LocalOutputWmxmlEnabled;
            xmlDir.LocalWmxmlDir = wmxmlConfigData.LocalOutputWmxmlDir;
            xmlDir.LocalTempWmxmlDir = wmxmlConfigData.LocalTempWmxmlDir;
            xmlDir.LocalInputWmxmlEnabled = wmxmlConfigData.LocalInputWmxmlEnabled;
            xmlDir.LocalInputWmxmlDir = wmxmlConfigData.LocalInputWmxmlDir;
            xmlDir.SecsChangePassBin = wmxmlConfigData.SecsChangePassBin;
            xmlDir.SecsPassBin = wmxmlConfigData.SecsPassBin;
            xmlDir.LocalOutputSecsEnabled = wmxmlConfigData.LocalOutputSecsEnabled;
            xmlDir.LocalSecsDir = wmxmlConfigData.LocalOutputSecsDir;
            xmlDir.ServerFileFormat = wmxmlConfigData.ServerFileFormat;
            xmlDir.ServerOutputWmxmlEnabled = wmxmlConfigData.ServerOutputWmxmlEnabled;
            xmlDir.ServerOutputWmxmlDir = wmxmlConfigData.ServerOutputWmxmlDir;
            xmlDir.ServerUnsentWmxmlDir = wmxmlConfigData.ServerUnsentWmxmlDir;
            xmlDir.ServerInputWmxmlEnabled = wmxmlConfigData.ServerInputWmxmlEnabled;
            xmlDir.ServerInputWmxmlDir = wmxmlConfigData.ServerInputWmxmlDir;
            xmlDir.ServerOutputSecsEnabled = wmxmlConfigData.ServerOutputSecsEnabled;
            xmlDir.ServerOutputSecsDir = wmxmlConfigData.ServerOutputSecsDir;
            xmlDir.ServerUnsentSecsDir = wmxmlConfigData.ServerUnsentSecsDir;
            xmlDir.WebServiceFileFormat = wmxmlConfigData.VaultFileFormat;
            xmlDir.WebServiceOutputEnabled = wmxmlConfigData.VaultOutputEnabled;
            xmlDir.WebServiceInputEnabled = wmxmlConfigData.VaultInputEnabled;
            xmlDir.WebServicePrimaryUrl = wmxmlConfigData.WebServicePrimaryUrl;
            xmlDir.WebServiceSecondaryUrl = wmxmlConfigData.WebServiceSecondaryUrl;
            xmlDir.WebServiceUnsentWmxmlDir = wmxmlConfigData.VaultUnsentWmxmlDir;
            xmlDir.ExternalFileFormat = wmxmlConfigData.ExternalFileFormat;
            xmlDir.ExternalInputEnabled = wmxmlConfigData.ExternalInputEnabled;
            xmlDir.ExternalInputWmxmlDir = wmxmlConfigData.ExternalInputWmxmlDir;
            xmlDir.ExternalOutputEnabled = wmxmlConfigData.ExternalOutputEnabled;
            xmlDir.ExternalOutputWmxmlDir = wmxmlConfigData.ExternalOutputWmxmlDir;
            xmlDir.ExternalUnsentWmxmlDir = wmxmlConfigData.ExternalUnsentWmxmlDir;
            xmlDir.ManualCheckFileName = dirConfigData.ManualCheckFileName;
            xmlDir.ManualCheckLocalDir = dirConfigData.ManualCheckLocalDir;
            xmlDir.ManualCheckServerDir = dirConfigData.ManualCheckServerDir;

            xmlDir.SaveConfig(xmlDoc);
        }
        private string wsConfigVersion = "3.2.6"; // only default value... real value is defined in AssemblyInfo.cs

        #endregion Fields

        #region Constructors

        public ConfigData(string startupDir)
        {
            _childList = new List<IBaseConfigData>();

            DirectoryInfo di = new DirectoryInfo(startupDir);
            string rootMapperDir = di.Parent.FullName;

            _configConfigData = new ConfigConfigData(startupDir);
            _generalConfigData = new GeneralConfigData();
            _dirConfigData = new DirConfigData(rootMapperDir);
            _envGeneralConfigData = new EnvGeneralConfigData();
            _colorConfigData = new ColorConfigData();
            _dialogConfigData = new DialogConfigData();
            _eventConfigData = new EventConfigData(rootMapperDir);
            _wmxmlConfigData = new WmxmlConfigData(rootMapperDir);
            _genesisConfigData = new GenesisConfigData();
            _checkinConfigData = new CheckinConfigData();
            _lotSearchConfigData = new LotSearchConfigData();
            _processMethodConfigData = new ProcessMethodConfigData();
            _customScriptConfigData = new CustomScriptConfigData();
            _newtonConfigData = new NewtonConfigData(rootMapperDir);
            _rtmConfigData = new RtmConfigData(rootMapperDir);
            _probeInTempConfigData = new ProbeInTempConfigData();
            _hotKeysConfigData = new HotKeysConfigData();

            _consecutiveFailConfigData = new ConsecutiveFailConfigData();
            _cutoffConfigData = new CutoffConfigData();
            _kelvinDieConfigData = new KelvinDieConfigData();
            _laserscribeConfigData = new LaserscribeConfigData();
            _reprobeConfigData = new ReprobeConfigData();
            _incompleteProbeConfigData = new IncompleteProbeConfigData();
            _shiftedAlignmentConfigData = new ShiftedAlignmentConfigData();

            _proberConfigData = new ProberConfigData();
            _testerConfigData = new TesterConfigData();

            _lotInfoConfigData = new LotInfoConfigData();

            _childList.Add(_configConfigData as IBaseConfigData);
            _childList.Add(_generalConfigData as IBaseConfigData);
            _childList.Add(_wmxmlConfigData as IBaseConfigData);
            _childList.Add(_envGeneralConfigData as IBaseConfigData);
            _childList.Add(_colorConfigData as IBaseConfigData);
            _childList.Add(_dialogConfigData as IBaseConfigData);
            _childList.Add(_eventConfigData as IBaseConfigData);
            _childList.Add(_dirConfigData as IBaseConfigData);
            _childList.Add(_genesisConfigData as IBaseConfigData);
            _childList.Add(_checkinConfigData as IBaseConfigData);
            _childList.Add(_lotSearchConfigData as IBaseConfigData);
            _childList.Add(_processMethodConfigData as IBaseConfigData);
            _childList.Add(_customScriptConfigData as IBaseConfigData);
            _childList.Add(_newtonConfigData as IBaseConfigData);
            _childList.Add(_rtmConfigData as IBaseConfigData);
            _childList.Add(_probeInTempConfigData as IBaseConfigData);
            _childList.Add(_hotKeysConfigData as IBaseConfigData);

            _childList.Add(_consecutiveFailConfigData as IBaseConfigData);
            _childList.Add(_cutoffConfigData as IBaseConfigData);
            _childList.Add(_kelvinDieConfigData as IBaseConfigData);
            _childList.Add(_laserscribeConfigData as IBaseConfigData);
            _childList.Add(_reprobeConfigData as IBaseConfigData);
            _childList.Add(_incompleteProbeConfigData as IBaseConfigData);
            _childList.Add(_shiftedAlignmentConfigData as IBaseConfigData);
            _childList.Add(_proberConfigData as IBaseConfigData);
            _childList.Add(_testerConfigData as IBaseConfigData);

            _childList.Add(_lotInfoConfigData as IBaseConfigData);

            _configCache = new ConfigCache(this);
        }
        private void LoadDir(XmlDocument xmlDoc, DirConfigData dirConfigData, WmxmlConfigData wmxmlConfigData)
        {
            XmlOldDir xmlDir = new XmlOldDir();
            xmlDir.LoadConfig(xmlDoc);

            dirConfigData.SetupDir = xmlDir.SetupDir;
            dirConfigData.LoggingDir = xmlDir.LoggingDir;
            dirConfigData.CacheDir = xmlDir.CacheDir;
            wmxmlConfigData.LocalWmxmlVersion = xmlDir.WmxmlVersion;
            wmxmlConfigData.LocalFileFormat = xmlDir.LocalFileFormat;
            wmxmlConfigData.LocalOutputWmxmlEnabled = xmlDir.LocalOutputWmxmlEnabled;
            wmxmlConfigData.LocalOutputWmxmlDir = xmlDir.LocalWmxmlDir;
            wmxmlConfigData.LocalTempWmxmlDir = xmlDir.LocalTempWmxmlDir;
            wmxmlConfigData.LocalInputWmxmlEnabled = xmlDir.LocalInputWmxmlEnabled;
            wmxmlConfigData.LocalInputWmxmlDir = xmlDir.LocalInputWmxmlDir;
            wmxmlConfigData.SecsChangePassBin = xmlDir.SecsChangePassBin;
            wmxmlConfigData.SecsPassBin = xmlDir.SecsPassBin;
            wmxmlConfigData.LocalOutputSecsEnabled = xmlDir.LocalOutputSecsEnabled;
            wmxmlConfigData.LocalOutputSecsDir = xmlDir.LocalSecsDir;
            wmxmlConfigData.ServerWmxmlVersion = xmlDir.WmxmlVersion;
            wmxmlConfigData.ServerFileFormat = xmlDir.ServerFileFormat;
            wmxmlConfigData.ServerOutputWmxmlEnabled = xmlDir.ServerOutputWmxmlEnabled;
            wmxmlConfigData.ServerOutputWmxmlDir = xmlDir.ServerOutputWmxmlDir;
            wmxmlConfigData.ServerUnsentWmxmlDir = xmlDir.ServerUnsentWmxmlDir;
            wmxmlConfigData.ServerInputWmxmlEnabled = xmlDir.ServerInputWmxmlEnabled;
            wmxmlConfigData.ServerInputWmxmlDir = xmlDir.ServerInputWmxmlDir;
            wmxmlConfigData.ServerOutputSecsEnabled = xmlDir.ServerOutputSecsEnabled;
            wmxmlConfigData.ServerOutputSecsDir = xmlDir.ServerOutputSecsDir;
            wmxmlConfigData.ServerUnsentSecsDir = xmlDir.ServerUnsentSecsDir;
            wmxmlConfigData.VaultWmxmlVersion = xmlDir.WmxmlVersion;
            wmxmlConfigData.VaultFileFormat = xmlDir.WebServiceFileFormat;
            wmxmlConfigData.VaultOutputEnabled = xmlDir.WebServiceOutputEnabled;
            wmxmlConfigData.VaultInputEnabled = xmlDir.WebServiceInputEnabled;
            wmxmlConfigData.ClearWebServiceUrlList();
            wmxmlConfigData.AddToWebServiceUrlList(xmlDir.WebServicePrimaryUrl);
            wmxmlConfigData.AddToWebServiceUrlList(xmlDir.WebServiceSecondaryUrl);
            wmxmlConfigData.VaultUnsentWmxmlDir = xmlDir.WebServiceUnsentWmxmlDir;
            wmxmlConfigData.ExternalWmxmlVersion = xmlDir.WmxmlVersion;
            wmxmlConfigData.ExternalFileFormat = xmlDir.ExternalFileFormat;
            wmxmlConfigData.ExternalInputEnabled = xmlDir.ExternalInputEnabled;
            wmxmlConfigData.ExternalInputWmxmlDir = xmlDir.ExternalInputWmxmlDir;
            wmxmlConfigData.ExternalOutputEnabled = xmlDir.ExternalOutputEnabled;
            wmxmlConfigData.ExternalOutputWmxmlDir = xmlDir.ExternalOutputWmxmlDir;
            wmxmlConfigData.ExternalUnsentWmxmlDir = xmlDir.ExternalUnsentWmxmlDir;
            dirConfigData.ManualCheckFileName = xmlDir.ManualCheckFileName;
            dirConfigData.ManualCheckLocalDir = xmlDir.ManualCheckLocalDir;
            dirConfigData.ManualCheckServerDir = xmlDir.ManualCheckServerDir;
        }
        public void LoadWmxml(XmlDocument xmlDoc, WmxmlConfigData configData)
        {
            configData.AlwaysSaveWaferMaps = GetBool(xmlDoc, "WmxmlAlwaysSave", configData.AlwaysSaveWaferMaps);

            configData.LocalWmxmlVersion = GetEnum(xmlDoc, "WmxmlLocalVersion", configData.LocalWmxmlVersion);
            configData.LocalFileFormat = GetEnum(xmlDoc, "WmxmlLocalFormat", configData.LocalFileFormat);
            configData.LocalOutputWmxmlEnabled = GetBool(xmlDoc, "WmxmlLocalOutputEnabled", configData.LocalOutputWmxmlEnabled);
            configData.LocalInputWmxmlEnabled = GetBool(xmlDoc, "WmxmlLocalInputEnabled", configData.LocalInputWmxmlEnabled);
            configData.LocalOutputWmxmlDir = GetString(xmlDoc, "WmxmlLocalOutputDir", configData.LocalOutputWmxmlDir);
            configData.LocalInputWmxmlDir = GetString(xmlDoc, "WmxmlLocalInputDir", configData.LocalInputWmxmlDir);
            configData.LocalTempWmxmlDir = GetString(xmlDoc, "WmxmlLocalTempDir", configData.LocalTempWmxmlDir);

            configData.ServerWmxmlVersion = GetEnum(xmlDoc, "WmxmlServerVersion", configData.ServerWmxmlVersion);
            configData.ServerFileFormat = GetEnum(xmlDoc, "WmxmlServerFormat", configData.ServerFileFormat);
            configData.ServerOutputWmxmlEnabled = GetBool(xmlDoc, "WmxmlServerOutputEnabled", configData.ServerOutputWmxmlEnabled);
            configData.ServerInputWmxmlEnabled = GetBool(xmlDoc, "WmxmlServerInputEnabled", configData.ServerInputWmxmlEnabled);
            configData.ServerOutputWmxmlDir = GetString(xmlDoc, "WmxmlServerOutputDir", configData.ServerOutputWmxmlDir);
            configData.ServerInputWmxmlDir = GetString(xmlDoc, "WmxmlServerInputDir", configData.ServerInputWmxmlDir);
            configData.ServerUnsentWmxmlDir = GetString(xmlDoc, "WmxmlServerUnsentDir", configData.ServerUnsentWmxmlDir);

            configData.ExternalWmxmlVersion = GetEnum(xmlDoc, "WmxmlExternalVersion", configData.ExternalWmxmlVersion);
            configData.ExternalFileFormat = GetEnum(xmlDoc, "WmxmlExternalFormat", configData.ExternalFileFormat);
            configData.ExternalOutputEnabled = GetBool(xmlDoc, "WmxmlExternalOutputEnabled", configData.ExternalOutputEnabled);
            configData.ExternalInputEnabled = GetBool(xmlDoc, "WmxmlExternalInputEnabled", configData.ExternalInputEnabled);
            configData.ExternalOutputWmxmlDir = GetString(xmlDoc, "WmxmlExternalOutputDir", configData.ExternalOutputWmxmlDir);
            configData.ExternalInputWmxmlDir = GetString(xmlDoc, "WmxmlExternalInputDir", configData.ExternalInputWmxmlDir);
            configData.ExternalUnsentWmxmlDir = GetString(xmlDoc, "WmxmlExternalUnsentDir", configData.ExternalUnsentWmxmlDir);

            configData.VaultWmxmlVersion = GetEnum(xmlDoc, "WmxmlWebServiceVersion", configData.VaultWmxmlVersion);
            configData.VaultFileFormat = GetEnum(xmlDoc, "WmxmlWebServiceFormat", configData.VaultFileFormat);
            configData.VaultOutputEnabled = GetBool(xmlDoc, "WmxmlWebServiceOutputEnabled", configData.VaultOutputEnabled);
            configData.VaultInputEnabled = GetBool(xmlDoc, "WmxmlWebServiceInputEnabled", configData.VaultInputEnabled);
            configData.VaultUnsentWmxmlDir = GetString(xmlDoc, "WmxmlWebServiceUnsentDir", configData.VaultUnsentWmxmlDir);
            configData.VaultTimeoutSeconds = GetInt(xmlDoc, "WmxmlWebServiceTimeoutSeconds", configData.VaultTimeoutSeconds);
            List<string> urlList = GetUrlList(xmlDoc, "WmxmlWebServiceUrlItem");
            if (urlList.Count > 0)
            {
                configData.ClearWebServiceUrlList();
                configData.AddRangeToWebServiceUrlList(urlList);
            }

            configData.LocalOutputSecsEnabled = GetBool(xmlDoc, "SecsLocalOutputEnabled", configData.LocalOutputSecsEnabled);
            configData.LocalOutputSecsDir = GetString(xmlDoc, "SecsLocalOutputDir", configData.LocalOutputSecsDir);
            configData.ServerOutputSecsEnabled = GetBool(xmlDoc, "SecsServerOutputEnabled", configData.ServerOutputSecsEnabled);
            configData.ServerOutputSecsDir = GetString(xmlDoc, "SecsServerOutputDir", configData.ServerOutputSecsDir);
            configData.ServerUnsentSecsDir = GetString(xmlDoc, "SecsServerUnsentDir", configData.ServerUnsentSecsDir);
        }