コード例 #1
0
ファイル: Strategy.cs プロジェクト: fafa-code/SlabAssembler
        public Strategy(SlabProperties properties, IPartRepository repo, AcEnvironment environment)
        {
            Properties     = properties;
            Environment    = environment;
            PartRepository = repo;
            StartPoint     = properties.StartPoint.Add(StartVector);
            _acad          = new AutoCadManager();

            ResetX();
            ResetY();
        }
コード例 #2
0
        public SlabAssembler(IPartRepository partRepository, SlabProperties properties)
        {
            Document       = AcApplication.DocumentManager.MdiActiveDocument;
            Properties     = properties;
            PartRepository = partRepository;
            Environment    = new AcEnvironment(properties.Parts.SelectedOutline)
            {
                GirdersLayer  = properties.Parts.SelectedGirdersLayer,
                CollumnsLayer = properties.Parts.SelectedColumnsLayer,
                EmptiesLayer  = properties.Parts.SelectedEmptiesLayer,
            };

            _lock = Document.LockDocument();
        }
コード例 #3
0
ファイル: Plugin.cs プロジェクト: fafa-code/SlabAssembler
        public static void ShowPallet()
        {
            if (_mainPallet != null)
            {
                return;
            }
            _mainPallet = InitializeMainPallet();
            _mainPallet.StateChanged += _mainPallet_StateChanged;
            _algorythimRepository     = new AlgorythimRepository();
            _partRepository           = new PartRepository();

            var especificationsView = new Views.EspecificationsControl(_partRepository);
            var algorythimView      = new Views.AlgorythimControl(_partRepository, _algorythimRepository);
            var partsView           = new Views.PartsListControl(_partRepository);
            var helper = new BuildingProcessHelper();
            var prop   = new SlabProperties {
                Algorythim = algorythimView.ViewModel, Parts = especificationsView.ViewModel
            };

            especificationsView.ViewModel.WhenAnyValue(x => x.SelectedModulation).Subscribe(m => algorythimView.ViewModel.SelectedModulation = m);
            especificationsView.ViewModel.DrawSlab.Subscribe(async _ =>
            {
                try
                {
                    prop.MaxPoint   = helper.GetMaxPoint(especificationsView.ViewModel.SelectedOutline);
                    prop.StartPoint = helper.GetStartPoint(especificationsView.ViewModel.SelectedOutline, especificationsView.ViewModel.SpecifyStartPoint);

                    using (var builder = new SlabBuilder(_partRepository, prop))
                        await builder.Start();
                }
                catch (OperationCanceledException) { }
                catch (Autodesk.AutoCAD.Runtime.Exception e)
                {
                    MessageBox.Show($"{e.Message}\n\n{e.StackTrace}");
                }
            });

            especificationsView.ViewModel.SelectOutline.Subscribe(_ =>
            {
                try
                {
                    especificationsView.ViewModel.SelectedOutline = helper.SelectOutline();
                } catch (ArgumentException) { MessageBox.Show("Selecione um contorno válido. (Polilinha fechada)"); }
            });

            _mainPallet.Add("Especificações", GetElementHost(especificationsView));
            _mainPallet.Add("Algoritmo", GetElementHost(algorythimView));
            _mainPallet.Add("Peças", GetElementHost(partsView));
        }
コード例 #4
0
 /// <summary>
 /// Adds an area section to the application.
 /// </summary>
 /// <param name="uniqueName">Name of the unique area.</param>
 /// <param name="properties">The properties.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
 public bool AddSlab(string uniqueName, SlabProperties properties)
 {
     return(add(uniqueName, properties, Slab.Add));
 }
コード例 #5
0
 public HorizontalSlabAssembler(IPartRepository partRepository, SlabProperties properties)
     : base(partRepository, properties)
 {
 }
コード例 #6
0
 public VerticalLDStrategy(SlabProperties prop, IPartRepository repo, AcEnvironment env)
     : base(new Point3dCollection(), prop, repo, env)
 {
 }
コード例 #7
0
 public LDStrategy(Point3dCollection ldsPoints, SlabProperties properties, IPartRepository repo, AcEnvironment env) : base(properties, repo, env)
 {
     MainPart   = Properties.Parts.SelectedLd;
     _ldsPoints = ldsPoints;
 }
コード例 #8
0
 public HorizontalLDStrategy(Point3dCollection ldsPoints, SlabProperties prop, IPartRepository repo, AcEnvironment env)
     : base(ldsPoints, prop, repo, env)
 {
 }
コード例 #9
0
        public void SlabProperties()
        {
            SlabProperties sample = new SlabProperties(this);

            sample.Run();
        }