Exemplo n.º 1
0
 public ConfigManager(
     ILogger <ConfigManager> logger,
     IOptions <ClashOptions> options,
     SubscriptionManager subscriptionManager
     )
 {
     _logger              = logger;
     _options             = options.Value;
     _subscriptionManager = subscriptionManager;
     _fileProvider        = new Lazy <IFileProvider>(() => new PhysicalFileProvider(Directory.GetCurrentDirectory()));
     ConfigReadyEvent     = new ManualResetEventSlim();
 }
Exemplo n.º 2
0
        public Clash(
            ILogger <Clash> logger,
            Lazy <ClashApi> api,
            IOptions <ClashOptions> options,
            ConfigManager configManager)
        {
            this.logger = logger;
            this.api    = api;

            _options       = options.Value;
            _configManager = configManager;
        }
        public static void Run()
        {
            //
            // Spatial Maps
            //
            // Check spatial maps for every DB
            Db[] dbChk = MDB.CurrentMDB.GetDBArray(DbType.Design);
            foreach (Db db in dbChk)
            {
                SpatialMapStatus stat = SpatialMap.Instance.CheckSpatialMap(db);
            }

            // Build spatial maps for MDB
            try
            {
                SpatialMap.Instance.BuildSpatialMap();
            }
            catch (Exception ex)
            {
            }

            //
            // Clasher
            //
            // CheckAll
            ClashOptions opt = ClashOptions.Create();

            opt.IncludeTouches = true;
            opt.Clearance      = 10.0;

            ObstructionList obst = ObstructionList.Create();
            ClashSet        cs   = ClashSet.Create();

            bool bResult = CLASHER.Instance.CheckAll(opt, obst, cs);

            if (bResult)
            {
                // inspect clashes
                Clash[] aClashes = cs.Clashes;
                for (int i = 0; i < aClashes.Length; i++)
                {
                    DbElement first  = aClashes[i].First;
                    DbElement second = aClashes[i].Second;
                    ClashType ctp    = aClashes[i].Type;
                    Position  pos    = aClashes[i].ClashPosition;
                }
            }
        }