Exemplo n.º 1
0
        public void loadSettings(string filename)
        {
            ProjectConfigFile defFile = new ProjectConfigFile(filename);

            DefinitionFile = filename;
            SplashScreen.SetStatus("Loading project file " + DefinitionFile);
            defFile.LoadObject(this);

            // If any of the GlobalValues within the Project are Retentive, then load the retentive file
            // TODO: need to check if any TestSequence values are retentive???  investigate...
            foreach (GlobalValue globalValue in mGlobalValues)
            {
                if (globalValue.IsRetentive)
                {
                    mDataValueRetentionFile.LoadDataFromFile();
                    break; // only load it once
                }
            }


            foreach (TestSequence seq in mTestSequences)
            {
                seq.SetFullyInitialized();
            }
            SetFullyInitialized();

            mWindow.logMessage("Settings loaded successfully");
        }
Exemplo n.º 2
0
        public void saveSettings()
        {
            ProjectConfigFile defFile = new ProjectConfigFile(mDefinitionFile);

            defFile.OpenFileForWriting();

            if (globalTNDReader != null)
            {
                defFile.AddObject(globalTNDReader);                           // TestSequences are dependent on these, so they must come first
            }
            if (globalTNDWriter != null)
            {
                defFile.AddObject(globalTNDWriter);
            }
            if (globalModbusSlave != null)
            {
                defFile.AddObject(globalModbusSlave);
            }

            foreach (Camera anObject in cameras)
            {
                defFile.AddObject(anObject);
            }

            foreach (GlobalValue anObject in mGlobalValues)
            {
                defFile.AddObject(anObject);
            }

            foreach (TestSequence anObject in mTestSequences)
            {
                defFile.AddObject(anObject);
            }

            defFile.AddObject(this);

            defFile.CloseFileFromWriting();

            mWindow.logMessage("Settings saved successfully");
        }