/// <summary> /// Constructor /// </summary> /// <param name="efsSystem">The system for which this frame is built</param> public TestReport(EFSSystem efsSystem) { InitializeComponent(); reportHandler = new TestsCoverageReportHandler((Dictionary) null); TxtB_Path.Text = reportHandler.FileName; EFSSystem = efsSystem; }
/// <summary> /// Constructor /// </summary> /// <param name="efsSystem"></param> public ResetTimeStamps(DataDictionary.EFSSystem efsSystem) { foreach (DataDictionary.Dictionary dictionary in efsSystem.Dictionaries) { visit(dictionary, true); } }
/// <summary> /// Configures the filtering dialog /// </summary> /// <param name="efsSystem"></param> /// <param name="filterConfiguration"></param> public void Configure(EFSSystem efsSystem, FilterConfiguration filterConfiguration) { ruleActivationCheckBox.Checked = filterConfiguration.RuleFired; expectationsCheckBox.Checked = filterConfiguration.Expect; variableUpdateCheckBox.Checked = filterConfiguration.VariableUpdate; List<Dictionary> dictionaries = new List<Dictionary>(efsSystem.Dictionaries); dictionaries.Sort(compare); foreach (Dictionary dictionary in dictionaries) { NamableTreeNode dictionaryTreeNode = new NamableTreeNode(dictionary); nameSpaceTreeView.Nodes.Add(dictionaryTreeNode); List<NameSpace> nameSpaces = new List<NameSpace>(); foreach (NameSpace nameSpace in dictionary.NameSpaces) { nameSpaces.Add(nameSpace); } nameSpaces.Sort(); foreach (NameSpace nameSpace in nameSpaces) { GatherNamespaces(dictionaryTreeNode, nameSpace, filterConfiguration); } } regExpTextBox.Text = filterConfiguration.RegExp; }
/// <summary> /// Constructor /// </summary> /// <param name="efsSystem">The system for which this frame is built</param> public TestReport(DataDictionary.EFSSystem efsSystem) { InitializeComponent(); reportHandler = new TestsCoverageReportHandler((Dictionary)null); TxtB_Path.Text = reportHandler.FileName; EFSSystem = efsSystem; }
/// <summary> /// Constructor /// </summary> /// <param name="system"></param> public TestsCoverageReportHandler(EFSSystem system) : base(null) { __efsSystem = system; init(); }
/// <summary> /// Constructor /// </summary> /// <param name="efsSystem">The EFSSystem for which this rule set selector is created</param> /// <param name="Options">The options used to filter the selection</param> public DictionarySelector(EFSSystem efsSystem, FilterOptions Options = FilterOptions.None, Dictionary UpdatedDictionary = null) { InitializeComponent(); options = Options; updatedDictionary = UpdatedDictionary; EFSSystem = efsSystem; }
/// <summary> /// Consctructor: creates a report for a selected test case /// </summary> /// <param name="aTestCase"></param> public TestReport(DataDictionary.Tests.TestCase aTestCase) { InitializeComponent(); EFSSystem = aTestCase.EFSSystem; reportHandler = new TestsCoverageReportHandler(aTestCase.Dictionary); reportHandler.TestCase = aTestCase; InitializeCheckBoxes(3); TxtB_Path.Text = reportHandler.FileName; }
/// <summary> /// Constructor: creates a report for the selected sub sequence /// </summary> /// <param name="aSubSequence"></param> public TestReport(DataDictionary.Tests.SubSequence aSubSequence) { InitializeComponent(); EFSSystem = aSubSequence.EFSSystem; reportHandler = new TestsCoverageReportHandler(aSubSequence.Dictionary); reportHandler.SubSequence = aSubSequence; InitializeCheckBoxes(2); TxtB_Path.Text = reportHandler.FileName; }
/// <summary> /// Constructor: creates a report for the dictionary /// </summary> /// <param name="aDictionary"></param> public TestReport(DataDictionary.Dictionary aDictionary) { InitializeComponent(); EFSSystem = aDictionary.EFSSystem; reportHandler = new TestsCoverageReportHandler(aDictionary); reportHandler.Dictionary = aDictionary; InitializeCheckBoxes(1); TxtB_Path.Text = reportHandler.FileName; }
/// <summary> /// Sets the settings according to the application data /// </summary> /// <param name="syste"></param> public static void setSettings(EFSSystem system) { Settings settings = Settings.Default; system.DisplayEnclosingMessages = settings.DisplayEnclosingMessages; system.DisplayRequirementsAsList = settings.DisplayRequirementsAsList; system.CheckParentRelationship = settings.CheckParentRelationship; system.CacheFunctions = settings.CacheFunctions; Util.PleaseLockFiles = settings.LockOpenedFiles; settings.Save(); }
/// <summary> /// Constructor /// </summary> /// <param name="fileName">The file path of the file to load</param> /// <param name="system">The EFS system for which the load is performed</param> /// <param name="allowErrors">Indicates that errors are allowed during load</param> /// <param name="updateGuid">Indicates that the GUID should be set during load</param> public OpenFileOperation(string fileName, EFSSystem system, bool allowErrors, bool updateGuid) { FileName = fileName; System = system; if (allowErrors) { ErrorsDuringLoad = new List<ElementLog>(); } else { ErrorsDuringLoad = null; } UpdateGuid = updateGuid; PleaseLockFiles = Util.PleaseLockFiles; }
/// <summary> /// Constructor /// </summary> /// <param name="dictionary"></param> public DictionaryWatcher(EFSSystem system, Dictionary dictionary) { System = system; Dictionary = dictionary; LastChange = DateTime.Now; DeltaTime = new TimeSpan(0, 0, 2); CriticalRegion = new Mutex(false, "Critical region"); string path = Path.GetDirectoryName(dictionary.FilePath) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(dictionary.FilePath); path = Path.GetFullPath(path); Directory.CreateDirectory(path); Watcher = new FileSystemWatcher(path, "*.*") { IncludeSubdirectories = true, NotifyFilter = NotifyFilters.LastWrite }; Watcher.Changed += Watcher_Changed; Watcher.Created += Watcher_Changed; Watcher.Deleted += Watcher_Changed; StartWatching(); }
/// <summary> /// Loads a dictionary and lock the file /// </summary> /// <param name="filePath">The path of the file which holds the dictionary data</param> /// <param name="efsSystem">The system for which this dictionary is loaded</param> /// <returns></returns> public static Dictionary load(String filePath, EFSSystem efsSystem) { Dictionary retVal = DocumentLoader <Dictionary> .loadFile(filePath); if (retVal != null) { retVal.FilePath = filePath; efsSystem.AddDictionary(retVal); // Loads the dependancies for this .efs file LoadDepends loadDepends = new LoadDepends(retVal.BasePath); loadDepends.visit(retVal); // Updates the contents of this .efs file Updater updater = new Updater(); updater.visit(retVal); if (retVal.Specifications != null) { retVal.Specifications.ManageTypeSpecs(); } } return(retVal); }
/// <summary> /// Constructor used to save to complete system /// </summary> /// <param name="mainWindow"></param> /// <param name="system"></param> public SaveOperation(MainWindow mainWindow, DataDictionary.EFSSystem system) { MainWindow = mainWindow; System = system; }
/// <summary> /// Constructor used to save a single dictionary /// </summary> /// <param name="mainWindow"></param> /// <param name="dictionary"></param> public SaveOperation(MainWindow mainWindow, DataDictionary.Dictionary dictionary) { MainWindow = mainWindow; Dictionary = dictionary; System = Dictionary.EFSSystem; }
/// <summary> /// Constructor /// </summary> /// <param name="fileName"></param> public OpenFileOperation(string fileName, DataDictionary.EFSSystem system) { FileName = fileName; System = system; }
/// <summary> /// Initialises the dialog /// </summary> /// <param name="efsSystem"></param> public void Initialise(EFSSystem efsSystem) { EFSSystem = efsSystem; searchTextBox.KeyUp += new KeyEventHandler(searchTextBox_KeyUp); }
public GetSlowest(EFSSystem efsSystem) { Rules = new List<Rule>(); foreach (Dictionary dictionary in efsSystem.Dictionaries) { visit(dictionary, true); } }
/// <summary> /// Constructor /// </summary> /// <param name="efsSystem"></param> public RulesPerformances(EFSSystem efsSystem) { EFSSystem = efsSystem; InitializeComponent(); Refresh(); }
/// <summary> /// Provides all the function calls related to this namespace /// </summary> /// <param name="system">The system in which the calls should be gathered</param> /// <param name="container">If provided, indicates that the calls should be limited to a given container</param> /// <returns></returns> public static List<AccessMode> getAccesses(EFSSystem system, IEnclosesNameSpaces container = null) { SortedSet<ProcedureOrFunctionCall> procedureCalls = new SortedSet<ProcedureOrFunctionCall>(); SortedSet<AccessToVariable> accessesToVariables = new SortedSet<AccessToVariable>(); foreach (Usage usage in system.FindReferences(IsCallableOrIsVariable.INSTANCE)) { ModelElement target = (ModelElement) usage.Referenced; ModelElement source = usage.User; NameSpace sourceNameSpace = getCorrespondingNameSpace(source, container, true); NameSpace targetNameSpace = getCorrespondingNameSpace(target, container, false); if (IsCallable.Predicate(usage.Referenced)) { if (considerCall(usage, container, sourceNameSpace, targetNameSpace)) { procedureCalls.Add(new ProcedureOrFunctionCall(sourceNameSpace, targetNameSpace, (ICallable) target)); } } else { // IsVariable(usage.Referenced) if (considerVariableReference(usage, container, sourceNameSpace, targetNameSpace)) { Usage.ModeEnum mode = (Usage.ModeEnum) usage.Mode; // Find a corresponding access to variable (same source and target namespaces, and same variable AccessToVariable otherAccess = null; foreach (AccessToVariable access in accessesToVariables) { if (access.Target == usage.Referenced && access.Source == sourceNameSpace && access.Target == targetNameSpace) { otherAccess = access; break; } } if (otherAccess != null) { if (otherAccess.AccessMode != mode) { // Since the access mode is different, one of them is either Read or ReadWrite and the other is ReadWrite or Write. // So, in any case, the resulting access mode is ReadWrite accessesToVariables.Remove(otherAccess); accessesToVariables.Add(new AccessToVariable(sourceNameSpace, targetNameSpace, (IVariable) target, Usage.ModeEnum.ReadAndWrite)); } else { // Already exists, do nothing } } else { // Does not already exists, insert it in the list accessesToVariables.Add(new AccessToVariable(sourceNameSpace, targetNameSpace, (IVariable) target, mode)); } } } } // Build the results based on the intermediate results List<AccessMode> retVal = new List<AccessMode>(); retVal.AddRange(procedureCalls); retVal.AddRange(accessesToVariables); return retVal; }
/// <summary> /// Constructor /// </summary> /// <param name="system"></param> public NamableChangeListener(EFSSystem system) { System = system; }