private void FillSettings(AutoGeneratorSettings value)
        {
            if (value == null)
            {
                return;
            }
            ckIsOuputGXD.Checked       = value.IsOutputGxd;
            ckIsOuputPng.Checked       = value.IsOutputPng;
            ckIsCopyToFolder.Checked   = string.IsNullOrEmpty(value.FolderOfCopyTo);
            rdOpenAfteFinisehd.Checked = value.OpenFileAfterFinished;
            cmIsMemSettings.Checked    = value.NeedSaveSettings;
            switch (value.ActionOfExisted)
            {
            case AutoGeneratorSettings.enumActionOfExisted.Overide:
                rdOveride.Checked = true;
                break;

            case AutoGeneratorSettings.enumActionOfExisted.ReName:
                rdRename.Checked = true;
                break;

            case AutoGeneratorSettings.enumActionOfExisted.Skip:
                rdSkip.Checked = true;
                break;
            }
        }
        private AutoGeneratorSettings CollectSettings()
        {
            AutoGeneratorSettings settings = new AutoGeneratorSettings();

            settings.IsOutputGxd = ckIsOuputGXD.Checked;
            settings.IsOutputPng = ckIsOuputPng.Checked;
            if (ckIsCopyToFolder.Checked)
            {
                settings.FolderOfCopyTo = txtCopyFolder.Text;
            }
            settings.OpenFileAfterFinished = rdOpenAfteFinisehd.Checked;
            settings.NeedSaveSettings      = cmIsMemSettings.Checked;
            if (rdOveride.Checked)
            {
                settings.ActionOfExisted = AutoGeneratorSettings.enumActionOfExisted.Overide;
            }
            else if (rdRename.Checked)
            {
                settings.ActionOfExisted = AutoGeneratorSettings.enumActionOfExisted.ReName;
            }
            else if (rdSkip.Checked)
            {
                settings.ActionOfExisted = AutoGeneratorSettings.enumActionOfExisted.Skip;
            }
            return(settings);
        }
Beispiel #3
0
 public PointTest()
 {
     md       = new AlgoMetaData("Point test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Radius1", GenerationStrategy.Random, 10, 30),
         new VariableGeneratorMetadata("Radius2", GenerationStrategy.Random, 10, 30)
     });
 }
 public PointSegmentTest()
 {
     md       = new AlgoMetaData("PointSegment test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Point", GenerationStrategy.Random, 20, 50),
         new VariableGeneratorMetadata("Length", GenerationStrategy.Random, 0, 40)
     });
 }
Beispiel #5
0
 public SegmentCircleTest()
 {
     md       = new AlgoMetaData("SegmentCircle test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Length", GenerationStrategy.Random, 0, 30),
         new VariableGeneratorMetadata("Radius", GenerationStrategy.Random, 0, 20)
     });
 }
Beispiel #6
0
 public SegmentTest()
 {
     md       = new AlgoMetaData("Segments test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Angle1", GenerationStrategy.Random, 45),
         new VariableGeneratorMetadata("Angle2", GenerationStrategy.Random, 45),
         new VariableGeneratorMetadata("Length", GenerationStrategy.Random, 10, 30)
     });
 }
Beispiel #7
0
 public CircleTest()
 {
     md       = new AlgoMetaData("Circle test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Radius1", GenerationStrategy.Random, 10, 30),
         new VariableGeneratorMetadata("Radius2", GenerationStrategy.Random, 10, 30),
         new VariableGeneratorMetadata("Center1", GenerationStrategy.Random, 10, 20),
         new VariableGeneratorMetadata("Center2", GenerationStrategy.Random, 20, 30)
     });
 }
 public PointPolygonTest()
 {
     md       = new AlgoMetaData("PointPolygon test", this);
     settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
     {
         new VariableGeneratorMetadata("Angle", GenerationStrategy.Random, 45),
         new VariableGeneratorMetadata("Length", GenerationStrategy.Random, 10, 30),
         new VariableGeneratorMetadata("minX", GenerationStrategy.Random, 10, 29),
         new VariableGeneratorMetadata("maxX", GenerationStrategy.Random, 30, 60),
         new VariableGeneratorMetadata("minY", GenerationStrategy.Random, 10, 29),
         new VariableGeneratorMetadata("maxY", GenerationStrategy.Random, 30, 60)
     });
 }
Beispiel #9
0
        public PolygonTest()
        {
            md       = new AlgoMetaData("PolygonTest", this);
            settings = new AutoGeneratorSettings(new List <VariableGeneratorMetadata>()
            {
                new VariableGeneratorMetadata("Angle", GenerationStrategy.Random, 45),

                new VariableGeneratorMetadata("minX1", GenerationStrategy.Random, 10, 20),
                new VariableGeneratorMetadata("maxX1", GenerationStrategy.Random, 40, 60),
                new VariableGeneratorMetadata("minY1", GenerationStrategy.Random, 10, 20),
                new VariableGeneratorMetadata("maxY1", GenerationStrategy.Random, 40, 60),


                new VariableGeneratorMetadata("minX2", GenerationStrategy.Random, 0, 10),
                new VariableGeneratorMetadata("maxX2", GenerationStrategy.Random, 30, 50),
                new VariableGeneratorMetadata("minY2", GenerationStrategy.Random, 0, 10),
                new VariableGeneratorMetadata("maxY2", GenerationStrategy.Random, 30, 50),
            });
        }
        public static void AutoGenrate(ISmartSession session, string beginSubproduct, CustomVarSetterHandler customVarSetter)
        {
            ICommand cmd = session.CommandEnvironment.Get(9006);

            if (cmd != null)
            {
                cmd.Execute();
            }
            try
            {
                //处理过程中不允许关系系统
                session.CloseActionLocker.Lock("监测产品快速生成操作");
                //
                AutoGeneratorSettings settings = GetAutoGeneratorSettings();
                if (settings == null)
                {
                    return;
                }
                AutoGeneratorSettings.CurrentSettings = settings;
                AutoGeneratorSettings.CurrentSettings.GeneratedFileNames = new List <string>();
                AutoGeneratorSettings.CurrentSettings.GxdFileNames       = new List <string>();
                AutoGeneratorSettings.CurrentSettings.Session            = session;
                //
                DoAutoGenerate(session, beginSubproduct, customVarSetter);
            }
            finally
            {
                if (AutoGeneratorSettings.CurrentSettings != null)
                {
                    AutoGeneratorSettings.CurrentSettings.CopyFileToCopyFolder();
                    AutoGeneratorSettings.CurrentSettings.ExportImageOfGxdFiles();
                }
                AutoGeneratorSettings.CurrentSettings = null;
                //
                session.CloseActionLocker.Unlock();
            }
        }