/// <summary> /// Runs simulation /// </summary> /// <param name="sender"></param> /// <param name="s"></param> private void Simulate(object sender, EventArgs s) { if (!this.simExecuted) { this.simExecuted = true; if (this.cySimulator == null) { if (cyDfbAsm != null /*&& this.ErrorsCount() <= 0*/) { int[] values = GetBusInValues(cyParameters.Bus1_data); int[] values2 = GetBusInValues(cyParameters.Bus2_data); this.cySimulator = new CySimulator(); bool flag = this.cySimulator.InitializeSimulator(values, values2, cyDfbAsm.GetRamStringArrays()); if (sender != null && flag) { this.cySimulator.SimulateAllSteps(this.TryEndSimulation); } this.simExecuted = false; return; } this.simExecuted = false; return; } this.TryEndSimulation(); this.simExecuted = false; return; } return; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { for (int i = 0; i < simulatorHistory.Count; i++) { this.simulatorHistory[i] = null; } this.cySimulator = null; this.cyCodeTab = null; } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }