예제 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainVM()
        {
            connections    = new ObservableCollection <ConnectionVM>();
            ideaStatiCaDir = Properties.Settings.Default.IdeaStatiCaDir;
            if (Directory.Exists(ideaStatiCaDir))
            {
                string ideaConnectionFileName = Path.Combine(ideaStatiCaDir, "IdeaConnection.exe");
                if (File.Exists(ideaConnectionFileName))
                {
                    IsIdea        = true;
                    StatusMessage = string.Format("IdeaStatiCa installation was found in '{0}'", ideaStatiCaDir);
                    CalcFactory   = new ConnHiddenClientFactory(ideaStatiCaDir);
                }
            }

            if (!IsIdea)
            {
                StatusMessage = string.Format("ERROR IdeaStatiCa doesn't exist in '{0}'", ideaStatiCaDir);
            }

            OpenProjectCmd          = new OpenProjectCommand(this);
            ImportIOMCmd            = new ImportIOMCommand(this);
            CloseProjectCmd         = new CloseProjectCommand(this);
            CalculateConnectionCmd  = new CalculateConnectionCommand(this);
            ConnectionGeometryCmd   = new ConnectionGeometryCommand(this);
            SaveAsProjectCmd        = new SaveAsProjectCommand(this);
            ConnectionToTemplateCmd = new ConnectionToTemplateCommand(this);
            ApplyTemplateCmd        = new ApplyTemplateCommand(this);
        }
예제 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainVM()
        {
            NewBoltAssemblyName = "M12 4.6";
            SupportingMember    = 1;
            AttachedMember      = 2;
            connections         = new ObservableCollection <ConnectionVM>();
            ideaStatiCaDir      = Properties.Settings.Default.IdeaStatiCaDir;
            if (Directory.Exists(ideaStatiCaDir))
            {
                ideaConnExeFileName = Path.Combine(ideaStatiCaDir, "IdeaConnection.exe");
                if (File.Exists(ideaConnExeFileName))
                {
                    IsIdea        = true;
                    StatusMessage = string.Format("IdeaStatiCa installation was found in '{0}'", ideaStatiCaDir);
                    CalcFactory   = new ConnHiddenClientFactory(ideaStatiCaDir);
                }
            }

            if (!IsIdea)
            {
                StatusMessage = string.Format("ERROR IdeaStatiCa doesn't exist in '{0}'", ideaStatiCaDir);
            }

            OpenProjectCmd          = new OpenProjectCommand(this);
            ImportIOMCmd            = new ImportIOMCommand(this);
            CloseProjectCmd         = new CloseProjectCommand(this);
            CalculateConnectionCmd  = new CalculateConnectionCommand(this);
            ApplySimpleTemplateCmd  = new ApplySimpleTemplateCommand(this);
            ConnectionGeometryCmd   = new ConnectionGeometryCommand(this);
            SaveAsProjectCmd        = new SaveAsProjectCommand(this);
            ConnectionToTemplateCmd = new ConnectionToTemplateCommand(this);
            ApplyTemplateCmd        = new ApplyTemplateCommand(this);

            GetMaterialsCmd             = new GetMaterialsCommand(this);
            GetCrossSectionsCmd         = new GetCrossSectionsCommand(this);
            GetBoltAssembliesCmd        = new GetBoltAssembliesCommand(this);
            CreateBoltAssemblyCmd       = new CreateBoltAssemblyCommand(this);
            GetParametersCmd            = new GetParametersCommand(this);
            GetLoadingCmd               = new GetLoadingCommand(this);
            GetConnCheckResultsCmd      = new GetConnCheckResults(this);
            GetAllConnectionDataCmd     = new GetAllConnDataCommand(this);
            ShowConHiddenCalcLogFileCmd = new ShowConHiddenCalcLogFileCommand();
            OpenTempProjectCmd          = new CustomCommand(CanRunIdeaConnection, RunIdeaConnection);

            ShowConHiddenCalcLogFileCmd = new ShowConHiddenCalcLogFileCommand();

            TemplateSetting = new IdeaRS.OpenModel.Connection.ApplyConnTemplateSetting()
            {
                DefaultBoltAssemblyID = 1, DefaultCleatCrossSectionID = 1, DefaultConcreteMaterialID = 1, DefaultStiffMemberCrossSectionID = 1
            };

            jsonSerializerSettings = new JsonSerializerSettings {
                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(), Culture = CultureInfo.InvariantCulture
            };

            var jsonFormating = Formatting.Indented;

            this.templateSettingString = JsonConvert.SerializeObject(TemplateSetting, jsonFormating, jsonSerializerSettings);
        }