public async Task <bool> ImportModel() { string message = "Importing analog measurements started..."; Logger.LogInfo(message); Console.WriteLine(message); bool analogImportSuccess = await ImportAnalog(); message = $"Importing analog measurements finished. ['success' value: {analogImportSuccess}]"; Logger.LogInfo(message); Console.WriteLine(message); message = "Importing discrete measurements started..."; Logger.LogInfo(message); Console.WriteLine(message); bool discreteImportSuccess = await ImportDiscrete(); message = $"Importing discrete measurements finished. ['success' value: {discreteImportSuccess}]"; Logger.LogInfo(message); Console.WriteLine(message); isSCADAModelImported = analogImportSuccess && discreteImportSuccess; if (isSCADAModelImported && SignalIncomingModelConfirmation != null) { SignalIncomingModelConfirmation.Invoke(new List <long>(CurrentScadaModel.Keys)); } return(isSCADAModelImported); }
public void Commit() { currentScadaModel = IncomingScadaModel; incomingScadaModel = null; currentAddressToGidMap = IncomingAddressToGidMap; incomingAddressToGidMap = null; modelChanges.Clear(); CommandedValuesCache.Clear(); string message = $"Incoming SCADA model is confirmed."; Console.WriteLine(message); Logger.LogInfo(message); SignalIncomingModelConfirmation.Invoke(new List <long>(CurrentScadaModel.Keys)); }