public static void Test( SlamPackage package, IEnumerable <SlamPoint> objects, string messageTemplate) { var objArray = objects.ToArray(); if (objArray.Length != 0) { ElektronikLogger.Log(package.ToString(), "", LogType.Error); foreach (var obj in objArray) { string msg = String.Format(messageTemplate, obj.id, obj.isNew, obj.isRemoved); ElektronikLogger.Log(msg, "", LogType.Error); } } }
public static void TestNonExistent( this SlamPackage package, Func <SlamPoint, bool> filter, ICloudObjectsContainer <SlamPoint> pointsContainer, ICloudObjectsContainer <SlamObservation> graph) { #if DEBUG if (package.Points != null) { var existentPoints = SlamObjectQuery(package.Points.Where(p => filter(p)), id => !pointsContainer.Exists(id)); ElektronikLogger.WrapDebug(() => Test(package, existentPoints, "Point id {0} doesn't exists. New: '{1}'. Removed: '{2}'")); } if (package.Observations != null) { var existentObs = SlamObjectQuery(package.Observations.Select(o => (SlamPoint)o).Where(o => filter(o)), id => !graph.Exists(id)); ElektronikLogger.WrapDebug(() => Test(package, existentObs, "Observation id {0} doesn't exists. New: '{1}'. Removed: '{2}'")); } #endif }
private IEnumerator ProcessEvents() { ElektronikLogger.OpenLog(); Application.logMessageReceived += ElektronikLogger.Log; Debug.Log("ANALYSIS STARTED"); m_packages = m_dataSource.Parse(SettingsBag.Current[SettingName.Path].As <string>()); Debug.Log("PROCESSING FINISHED"); for (int i = 0; i < m_packages.Length; ++i) { Debug.Log(m_packages[i]); LinkedList <IPackageViewUpdateCommand> pkgCommands = null; try { pkgCommands = m_commander.GetCommands(m_packages[i]); } catch (Exception e) { Debug.LogWarning(e.Message); break; } foreach (var pkgCommand in pkgCommands) { m_extendedEvents[pkgCommand] = m_packages[i]; } m_commands.MoveFrom(pkgCommands); if (i % 10 == 0) { yield return(null); } } Debug.Log("PROCESSING FINISHED"); Clear(); Repaint(); ReadyToPlay = true; Application.logMessageReceived -= ElektronikLogger.Log; ElektronikLogger.CloseLog(); yield return(null); }