コード例 #1
0
 public void LoadInfo()
 {
     _genParams  = mProject.GenerationParams.Clone();
     _projParams = mProject.Params.Clone();
     generationParametersBindingSource.DataSource = _genParams;
     projectParametersBindingSource.DataSource    = _projParams;
 }
コード例 #2
0
ファイル: DataRepository.cs プロジェクト: bastare/TaskApi
        public async Task <PagedList <object> > GetDataAsync(long id, ProjectParameters projectParams)
        {
            var result = await System.Threading.Tasks.Task.Run(() =>
                                                               from p in Context.Set <Project>()

                                                               join u in Context.Set <User>() on p.User.Id equals u.Id into joinData
                                                               from leftUser in joinData.DefaultIfEmpty()

                                                               where p.User.Id == id

                                                               select new
            {
                UserId      = leftUser.Id,
                ProjectId   = p.Id,
                ProjectName = p.Name,

                Tasks = p.Tasks.Select(x => new
                {
                    x.Id,
                    x.Name,
                    x.Priority,
                    x.Deadline,
                    x.Status
                })
            }
                                                               );

            return(await PagedList <object> .CreateAsync(result, projectParams.PageNumber, projectParams.PageSize));
        }
コード例 #3
0
        public MsgUpdateTreeNode(MessageStatisticsItem message, ProjectParameters parameters)
        {
            _message                    = message;
            _parameters                 = parameters;
            Name                        = "updatedTreeViewItem1";
            Text                        = string.Empty;
            SelectedImageKey            = ImageKey = @"watch16";
            TimerService.Instance.Tick += new EventHandler(Timer_Tick);
            EventAggregator.Instance.Subscribe <StorageAppEvent>(e1 =>
            {
                if (e1.Details.DataObjects == DataObjects.ParameterProperty &&
                    e1.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e1.Storage.Parameters.TimestampFormat))
                {
                    Text = CultureService.Instance.GetString(CultureText.node_Time_Text) + @": ";

                    if (_message.Timestamp != null)
                    {
                        Text += _message.Timestamp.Value.ToString(e1.Storage.Parameters.TimestampFormat, System.Globalization.CultureInfo.InvariantCulture);
                    }
                    else
                    {
                        Text += AppConstants.ValueNotAvailable2;
                    }
                }
            });
            message.DefaultStateComplete += (o, e) => Timer_Tick(null, EventArgs.Empty);
        }
コード例 #4
0
        public void CopyTo(ProjectParameters target)
        {
            /*ha valami nem jelenik meg a projectfájlból akkr itt a probléma...*/
            target.ProductName    = ProductName;
            target.ProductVersion = ProductVersion;
            target.ProductCode    = ProductCode;
            target.CustomerName   = CustomerName;
            target.CustomerCode   = CustomerCode;
            target.Comment        = Comment;

            target.DeviceName  = DeviceName;
            target.Baudrate    = Baudrate;
            target.Loopback    = Loopback;
            target.Termination = Termination;
            target.ListenOnly  = ListenOnly;
            target.NonAutoReTx = NonAutoReTx;

            target.FiltersEnabled                = FiltersEnabled;
            target.LogEnabled                    = LogEnabled;
            target.TraceEnabled                  = TraceEnabled;
            target.PlayHistoryClearEnabled       = PlayHistoryClearEnabled;
            target.AdapterStatisticsEnabled      = AdapterStatisticsEnabled;
            target.MessageStatisticsEnabled      = MessageStatisticsEnabled;
            target.RxMsgResolvingBySenderEnabled = RxMsgResolvingBySenderEnabled;

            target.TimestampFormat     = TimestampFormat;
            target.ArbitrationIdFormat = ArbitrationIdFormat;
            target.DataFormat          = DataFormat;
        }
コード例 #5
0
        public TerminationCommand()
        {
            Text         = CultureService.Instance.GetString(CultureText.menuItem_Termination_Text);
            ToolTipText  = CultureService.Instance.GetString(CultureText.menuItem_Termination_ToolTip);
            Image        = Resources.Resistor16;
            CheckOnClick = true;
            Checked      = false;
            DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;

            EventAggregator.Instance.Subscribe <StorageAppEvent>(e =>
            {
                if (e.ChangingType == FileChangingType.LoadComplete)
                {
                    _parmeters = e.Storage.Parameters;
                    Checked    = e.Storage.Parameters.Termination;
                }
            });

            EventAggregator.Instance.Subscribe <StorageAppEvent>(e =>
            {
                if (e.ChangingType == FileChangingType.ContentChanged)
                {
                    if (e.Details.DataObjects == DataObjects.ParameterProperty &&
                        e.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e.Storage.Parameters.Termination))
                    {
                        Checked = e.Storage.Parameters.Termination;
                    }
                }
            });

            EventAggregator.Instance.Subscribe <StopAppEvent>(e => Enabled = true);
            EventAggregator.Instance.Subscribe <PlayAppEvent>(e => Enabled = false);
        }
コード例 #6
0
        public static string Convert(this string name)
        {
            Project = LocalUtils.GetActiveProjectNode();
            ProjectParameters.Contruct();
            MetaModelProviders = ServiceLocator.GetService(typeof(IMetaModelProviders)) as IMetaModelProviders;
            MetaModelService   = MetaModelProviders.CurrentMetaModelService;

            var extension = ProjectParameters.Instance.Extension;

            var englishLabelFile =
                MetaModelService.GetLabelFileNames()
                .FirstOrDefault(
                    lableFileName => lableFileName.StartsWith(extension) && lableFileName.Contains("en-US"));

            var lableFile = MetaModelService.GetLabelFile(englishLabelFile);
            var labelKey  = name.Replace(extension, "");

            var lableTxt = Regex.Replace(labelKey, "((?<=[a-z])[A-Z]|[A-Z](?=[a-z]))", " $1").Trim().ToLower().UppercaseFirst();

            LabelControllerFactory factory = new LabelControllerFactory();
            LabelEditorController  labelEditorController = factory.GetOrCreateLabelController(lableFile, LocalUtils.Context);

            //CoreUtility.DisplayInfo(labelKey);

            if (!labelEditorController.Exists(labelKey))
            {
                labelEditorController.Insert(labelKey, lableTxt, string.Empty);
                labelEditorController.Save();
            }

            return($"@{extension}Labels:{labelKey}");
        }
コード例 #7
0
        public void sendVnutrDocument()
        {
            ActionClient client = new ActionClient();

            ProjectParameters param = new ProjectParameters();

            param.author         = "Askarbai Kaskirbai";
            param.date_letter    = "12.12.2013";
            param.id_letter_obk  = "111";
            param.letter_Subject = "Zin zin kozderi oni";
            param.letter_text    = "Text koi";
            List <Attachment> list = new List <Attachment>();
            Attachment        at   = new Attachment();

            at.content = "sdsdsdsd";
            at.name    = "Darhan.city";
            at.sign    = "xml";
            list.Add(at);
            param.attachments = list.ToArray();;

            var datas = client.sendProjectDocument(param);

            if (datas)
            {
            }
        }
コード例 #8
0
        public StatisticalEngineDetails GetStatisticalEngineDetails(string name, string version)
        {
            try
            {
                var       projectParam        = ProjectParameters.GetProjectParameters(projectDBManager, name, version);
                DataTable dtStatEngineDetails = projectDBManager.GetDataTable("SELECT schema, template,uischema,defaultformdata FROM project.get_enginedetails(@name, @version)", CommandType.Text, projectParam.ToArray());

                var statisticalEngineDetails = new StatisticalEngineDetails();

                if (dtStatEngineDetails.Rows.Count > 0)
                {
                    DataRow row = dtStatEngineDetails.Rows[0];

                    statisticalEngineDetails.Schema          = JsonConvert.DeserializeObject(row["Schema"].ToString());
                    statisticalEngineDetails.Template        = JsonConvert.DeserializeObject(row["Template"].ToString());
                    statisticalEngineDetails.UiSchema        = JsonConvert.DeserializeObject(row["UiSchema"].ToString());
                    statisticalEngineDetails.DefaultFormData = JsonConvert.DeserializeObject(row["DefaultFormData"].ToString());
                }

                return(statisticalEngineDetails);
            }
            catch (Exception getStatisticalEngineDatailsException)
            {
                throw new Exception(ExceptionMessages.GET_STAT_ENGINE_DETAILS_DATA_ACCESS_ERROR_MSG, getStatisticalEngineDatailsException);
            }
        }
コード例 #9
0
 public ModelSettingsVM()
 {
     AddSettingCommand  = new RelayCommand(OnAddSetting);
     AddNewModelCommand = new RelayCommand(OnAddNewModel);
     SaveModelCommand   = new RelayCommand(OnSaveModel);
     LoadModelCommand   = new RelayCommand(OnLoadModel);
     CollModelSettings1 = new ObservableCollection <ProjectParameters>();
     SettingDetails     = new ProjectParameters();
 }
コード例 #10
0
        internal void LoadInfo()
        {
            _genParams  = project.GenerationParams.Clone();
            _projParams = project.Params.Clone();
            generationParametersBindingSource.DataSource = _genParams;
            projectParametersBindingSource.DataSource    = _projParams;

            NotYetImplemented();
        }
コード例 #11
0
ファイル: DataController.cs プロジェクト: bastare/TaskApi
        public async Task <IActionResult> GetData(long id, [FromQuery] ProjectParameters projectParameters)
        {
            var result = await _unit.DataRepository.GetDataAsync(id, projectParameters);

            Response.AddPagination(result.CurrentPage, result.PageSize,
                                   result.TotalCount, result.TotalPages);

            return(Ok(result));
        }
コード例 #12
0
 public void DTMTest()
 {
     ProjectParameters target = new ProjectParameters(); // TODO: Initialize to an appropriate value
     ProjectParametersDTM expected = null; // TODO: Initialize to an appropriate value
     ProjectParametersDTM actual;
     target.DTM = expected;
     actual = target.DTM;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
コード例 #13
0
ファイル: TestCases.cs プロジェクト: DaneBoers/UI
        public static double tolerance = 0.01; // <1% error to pass

        public static bool TestCase1()         //Completely Random Parameters
        {
            //Set-up Project
            ProjectParameters PRJ1 = new ProjectParameters()
            {
                Projectinterval = 100, Projectlife = 87600
            };

            //Add a Failure Mode
            var FM = new Failuremode()
            {
                Name = "Test", ID = "FM001", Eta = 70762, Beta = 3.92, Gamma = 14227, Initialage = 0, ProjectParams = PRJ1
            };

            //Stopwatch
            var sw = Stopwatch.StartNew();

            //Adding Tasks
            FM.CorrectiveTask = new FMTask()
            {
                Description = "CR1", TaskCost = 1819, TaskDuration = 0, Agereductionfactor = 1
            };
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR1", FixedInterval = true, TaskInterval = 8760, TaskCost = 2385, TaskDuration = 13, Secondary = false, Agereductionfactor = 1
            });
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR2", TaskInterval = 10000, TaskCost = 110, TaskDuration = 13, Secondary = true, Agereductionfactor = 1
            });
            FM.InspectionTasks.Add(new FMTask()
            {
                TaskCost = 4430, TaskDuration = 0, TaskInterval = 448, PFInterval = 3130, DetectionProbability = 1
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Environmental Risk", EffectCost = 7738, EffectProbability = .2, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Solve();

            //Expected Results
            double failures        = 0;
            double correctivecosts = 0;
            double plannedcosts    = 21465;
            double inspectioncosts = 863850;
            double totalcosts      = 885315;
            double effectscosts    = 0;

            //Test results vs expectations
            Testresults(FM, failures, correctivecosts, plannedcosts, inspectioncosts, totalcosts, effectscosts);

            Debug.WriteLine("****Solver Execution Time = {0} seconds\n", sw.Elapsed.TotalSeconds);

            return(true); //success
        }
コード例 #14
0
ファイル: TestCases.cs プロジェクト: DaneBoers/UI
        public static bool TestCase4() //Random Test #2
        {
            //Set-up Project
            ProjectParameters PRJ1 = new ProjectParameters()
            {
                Projectinterval = 100, Projectlife = 87600
            };

            //Add a Failure Mode
            var FM = new Failuremode()
            {
                Name = "Test", ID = "FM001", Eta = 81081, Beta = .56, Gamma = 8898, Initialage = 0, ProjectParams = PRJ1
            };

            //Stopwatch
            var sw = Stopwatch.StartNew();

            //Adding Tasks
            FM.CorrectiveTask = new FMTask()
            {
                Description = "CR1", TaskCost = 3775, TaskDuration = 23, Agereductionfactor = 1
            };
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR1", FixedInterval = true, TaskInterval = 1785, TaskCost = 1785, TaskDuration = 4, Secondary = false, Agereductionfactor = 1
            });
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR2", TaskInterval = 1234, TaskCost = 3346, TaskDuration = 5, Secondary = true, Agereductionfactor = 1
            });
            FM.InspectionTasks.Add(new FMTask()
            {
                TaskCost = 3422, TaskDuration = 0, TaskInterval = 2290, PFInterval = 4342, DetectionProbability = 1
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Environmental Risk", EffectCost = 2429, EffectProbability = .1, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Solve();

            //Expected Results
            double failures        = 0;
            double correctivecosts = 0;
            double plannedcosts    = 87465; //This is out by about 1.1% at max AvailabilityWB settings but is attenuating toward this calc.
            double inspectioncosts = 130036;
            double totalcosts      = 217501;
            double effectscosts    = 0;

            //Test results vs expectations
            Testresults(FM, failures, correctivecosts, plannedcosts, inspectioncosts, totalcosts, effectscosts);

            Debug.WriteLine("****Solver Execution Time = {0} seconds\n", sw.Elapsed.TotalSeconds);

            return(true); //success
        }
コード例 #15
0
ファイル: TestCases.cs プロジェクト: DaneBoers/UI
        public static bool TestCase2() //Typical Basic Config
        {
            //Set-up Project
            ProjectParameters PRJ1 = new ProjectParameters()
            {
                Projectinterval = 100, Projectlife = 87600
            };

            //Add a Failure Mode
            var FM = new Failuremode()
            {
                Name = "Test", ID = "FM001", Eta = 8760, Beta = 5, Gamma = 0, Initialage = 0, ProjectParams = PRJ1
            };

            //Stopwatch
            var sw = Stopwatch.StartNew();

            //Adding Tasks
            FM.CorrectiveTask = new FMTask()
            {
                Description = "CR1", TaskCost = 10000, TaskDuration = 24, Agereductionfactor = 1
            };
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR1", FixedInterval = true, TaskInterval = 8760, TaskCost = 5000, TaskDuration = 10, Secondary = false, Agereductionfactor = 1
            });
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR2", TaskInterval = 10000, TaskCost = 100, TaskDuration = 1, Secondary = true, Agereductionfactor = 1
            });
            FM.InspectionTasks.Add(new FMTask()
            {
                TaskCost = 10, TaskDuration = 1, TaskInterval = 738, PFInterval = 438, DetectionProbability = .3
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Environmental Risk", EffectCost = 2000, EffectProbability = .11, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Solve();

            //Expected Results
            double failures        = 5.188;
            double correctivecosts = 51887.2;
            double plannedcosts    = 45112.911;
            double inspectioncosts = 1180;
            double totalcosts      = 99321.6294;
            double effectscosts    = 1141.5184;

            //Test results vs expectations
            Testresults(FM, failures, correctivecosts, plannedcosts, inspectioncosts, totalcosts, effectscosts);

            Debug.WriteLine("****Solver Execution Time = {0} seconds\n", sw.Elapsed.TotalSeconds);

            return(true); //success
        }
コード例 #16
0
ファイル: Editors.cs プロジェクト: mengtest/BerryMatchThree
    public override void OnInspectorGUI()
    {
        if (!AudioAssistant.main)
        {
            AudioAssistant.main = FindObjectOfType <AudioAssistant>();
        }
        if (!AudioAssistant.main)
        {
            EditorGUILayout.HelpBox("AudioAssistant is missing", MessageType.Error);
            return;
        }

        if (!metaTarget)
        {
            EditorGUILayout.HelpBox("SessionAssistant is missing", MessageType.Error);
            return;
        }

        ProjectParameters main = (ProjectParameters)metaTarget;

        Undo.RecordObject(main, "");

        List <string> sounds = AudioAssistant.main.sounds.Select(x => x.name).ToList();

        EditorGUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.Label("Text", EditorStyles.centeredGreyMiniLabel, GUILayout.Width(150));
        GUILayout.Label("Clip name", EditorStyles.centeredGreyMiniLabel, GUILayout.Width(150));
        EditorGUILayout.EndHorizontal();

        foreach (ComboFeedback.Feedback feedback in main.feedbacks)
        {
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("X", GUILayout.Width(30)))
            {
                main.feedbacks.Remove(feedback);
                break;
            }
            feedback.text = GUILayout.TextField(feedback.text, GUILayout.Width(150));
            int id = sounds.IndexOf(feedback.audioClipName);
            if (id < 0)
            {
                id = 0;
            }
            id = EditorGUILayout.Popup(id, sounds.ToArray(), GUILayout.Width(150));
            feedback.audioClipName = sounds[id];
            EditorGUILayout.EndHorizontal();
        }

        if (GUILayout.Button("Add", GUILayout.Width(70)))
        {
            main.feedbacks.Add(new ComboFeedback.Feedback());
        }
    }
コード例 #17
0
 public bool IsProtocolIDExists(string protocolID)
 {
     try
     {
         var param = ProjectParameters.GetProtocolIDParameter(projectDBManager, protocolID);
         return(Convert.ToBoolean(projectDBManager.GetScalarValue("SELECT project.is_protocol_id_exists(@protocol_id)", CommandType.Text, param.ToArray())));
     }
     catch (Exception isProtocolIDExistsException)
     {
         throw new Exception(ExceptionMessages.IS_PROTOCOL_ID_EXISTS_DATA_ACCESS_ERROR_MSG, isProtocolIDExistsException);
     }
 }
コード例 #18
0
 public bool IsProjectIDExistsForResourceID(int projectID, int resourceID)
 {
     try
     {
         var param = ProjectParameters.GetProjectIDResourceIDParameter(projectDBManager, projectID, resourceID);
         return(Convert.ToBoolean(projectDBManager.GetScalarValue("SELECT project.is_project_id_exists_for_resource_id(@project_id, @resource_id)", CommandType.Text, param.ToArray())));
     }
     catch (Exception isProjectIDExistsForResourceIDException)
     {
         throw new Exception(ExceptionMessages.IS_PROJECT_ID_EXISTS_FOR_RESOURCE_ID_DATA_ACCESS_ERROR_MSG, isProjectIDExistsForResourceIDException);
     }
 }
コード例 #19
0
        public static string Convert(this string name, string alternative = null)
        {
            Project = GetActiveProjectNode();
            ProjectParameters.Contruct();

            MetaModelProviders = CoreUtility.ServiceProvider.GetService(typeof(IMetaModelProviders)) as IMetaModelProviders;
            if (MetaModelProviders != null)
            {
                MetaModelService = MetaModelProviders.CurrentMetaModelService;
            }

            var extension             = ProjectParameters.Instance.Extension;
            var defaultLablesFileName = ProjectParameters.Instance.DefaultLabelsFileName;

            if (string.IsNullOrEmpty(defaultLablesFileName))
            {
                throw new System.Exception(
                          "Label file name not specified in the Settings: Dynamics 365 > Addins > Ninja DevTools Settings");
            }

            var lableFile = MetaModelService.GetLabelFile(defaultLablesFileName);

            if (lableFile == null)
            {
                throw new Exception("Labels file not found");
            }

            var    labelKey = name.Replace(extension, "");
            string lableTxt;

            if (alternative != null && !alternative.StartsWith("@"))
            {
                lableTxt = alternative;
            }
            else
            {
                lableTxt = Regex.Replace(labelKey, "((?<=[a-z])[A-Z]|[A-Z](?=[a-z]))", " $1").Trim().ToLower().UppercaseFirst();
            }

            LabelControllerFactory factory = new LabelControllerFactory();
            LabelEditorController  labelEditorController = factory.GetOrCreateLabelController(lableFile, LocalUtils.Context);

            if (!labelEditorController.Exists(labelKey))
            {
                labelEditorController.Insert(labelKey, lableTxt, string.Empty);
                labelEditorController.Save();
            }

            return($"@{extension}Labels:{labelKey}");
        }
コード例 #20
0
 public IEnumerable <Project> GetProjects(int resourceID, int projectID = 0, bool listAllProjects = true)
 {
     try
     {
         var            projectParam = ProjectParameters.GetProjectParameters(projectDBManager, projectID, resourceID, listAllProjects);
         DataTable      dtProject    = projectDBManager.GetDataTable("SELECT * FROM project.get_project_list(@project_id,@resource_id,@list_all_projects)", CommandType.Text, projectParam.ToArray());
         List <Project> projects     = dtProject.AsEnumerable()
                                       .Select(x => new Project()
         {
             ID         = x.Field <int>("projectid"),
             Name       = x.Field <string>("projectname"),
             ProtocolID = x.Field <string>("protocolid"),
             Phase      = x.Field <Int16>("phase"),
             CreatedBy  = x.Field <string>("createdby"),
             ResourceID = x.Field <int>("resourceid"),
             Program    = new Program
             {
                 ID   = x.Field <int>("programid"),
                 Name = x.Field <string>("programname")
             },
             Status = new Status
             {
                 ID    = x.Field <Int16>("statusid"),
                 Value = x.Field <string>("projectstatus")
             },
             Indication = new Indication
             {
                 ID    = x.Field <Int16>("indicationid"),
                 Value = x.Field <string>("indicationname")
             },
             ProjectTimeUnit = new ProjectTimeUnit
             {
                 ID    = x.Field <Int16>("timeunitid"),
                 Value = x.Field <string>("timeunit")
             },
             Currency = new Currency
             {
                 ID    = x.Field <Int16>("currencyid"),
                 Value = x.Field <string>("currencyname")
             },
             LastModified = x.Field <DateTime>("modifiedtimestamp"),
             CreatedDate  = x.Field <DateTime>("createdtimestamp"),
         }).ToList();
         return(projects);
     }
     catch (Exception getProjectsException)
     {
         throw new Exception(ExceptionMessages.GET_PROJECTS_DATA_ACCESS_ERROR_MSG, getProjectsException);
     }
 }
コード例 #21
0
 public int CreateProject(Project project)
 {
     try
     {
         int projectID  = 0;
         var parameters = ProjectParameters.GetCreateProjectParameters(projectDBManager, project);
         projectDBManager.Insert("CALL project.create_project(@project_name,@protocol_id,@program_id,@indication_id,@phase_id,@time_unit_id,@currency_id,@resource_id,@created_by,@project_id)", CommandType.Text, parameters.ToArray(), out projectID);
         return(projectID);
     }
     catch (Exception createProjectException)
     {
         throw new Exception(ExceptionMessages.CREATE_PROJECT_DATA_ACCESS_ERROR_MSG, createProjectException);
     }
 }
コード例 #22
0
ファイル: MainForm.cs プロジェクト: DaneBoers/UI
        private void button3_Click(object sender, EventArgs e)
        {
            //Set-up Project
            ProjectParameters PRJ1 = new ProjectParameters()
            {
                Projectinterval = 100, Projectlife = 87600
            };

            //Add a Failure Mode
            var FM = new Failuremode()
            {
                Name = "Test", ID = "FM001", Eta = 8760, Beta = 3, Gamma = 1000, Initialage = 2000, ProjectParams = PRJ1
            };

            //Adding Tasks to the Failure Mode
            FM.CorrectiveTask = new FMTask()
            {
                Description = "CR1", TaskCost = 10000, TaskDuration = 24, Agereductionfactor = 1
            };
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR1", FixedInterval = true, TaskInterval = 8760, TaskCost = 50, TaskDuration = 10, Secondary = false, Agereductionfactor = 1
            });
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR2", TaskInterval = 10000, TaskCost = 100, TaskDuration = 1, Secondary = true, Agereductionfactor = 1
            });
            FM.InspectionTasks.Add(new FMTask()
            {
                Description = "IN1", TaskCost = 10, TaskDuration = 1, TaskInterval = 738, PFInterval = 438, DetectionProbability = .3
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Environmental Risk", EffectCost = 2000, EffectProbability = .11, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Safety Risk", EffectCost = 50000, EffectProbability = .01, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Network Performance Risk", EffectCost = 200, EffectProbability = 1, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Reputational Risk", EffectCost = 1000, EffectProbability = .3, EffectType = "Environmental", ApplyToCorrective = true, ApplyToPlanned = true
            });

            FM.OptimiseIntervals(true, 168, 1, 20000);
        }
コード例 #23
0
ファイル: WSProject.cs プロジェクト: fparaggio/WindSimBattery
        // Constructors
        public WSProject(string file_path)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(ProjectParameters));
            TextReader textReader = new StreamReader(file_path);
            parameters = (ProjectParameters)deserializer.Deserialize(textReader);
            textReader.Close();
            file = new FileInfo(file_path);
            // inizializzo i phifile
            this.load_windfields();

            //inizializzo il layout
            layout = new Layout[1];
            layout[0] = new Layout("Layout 1.lws", file.Directory);
        }
コード例 #24
0
        public MessagesTreeNode(MessageStatistics statistics, IAdapterService adapter, ProjectParameters parameters)
        {
            _statistics      = statistics;
            _adapter         = adapter;
            _parameters      = parameters;
            Text             = CultureService.Instance.GetString(CultureText.node_MessagesStatistics_Text);
            SelectedImageKey = ImageKey = @"mails16";


            EventAggregator.Instance.Subscribe <StorageAppEvent>(e1 =>
            {
                switch (e1.ChangingType)
                {
                case FileChangingType.LoadComplete:
                    {
                        if (e1.Storage.Parameters.MessageStatisticsEnabled)
                        {
                            Text = CultureService.Instance.GetString(CultureText.node_MessagesStatistics_Text);
                        }
                        else
                        {
                            Text  = CultureService.Instance.GetString(CultureText.node_MessagesStatistics_Text);
                            Text += string.Format(" [{0}] ", CultureService.Instance.GetString(CultureText.text_DISABLED));
                        }
                        break;
                    }

                case FileChangingType.ContentChanged:
                    {
                        if (e1.Details.DataObjects == DataObjects.ParameterProperty &&
                            e1.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e1.Storage.Parameters.MessageStatisticsEnabled))
                        {
                            if (e1.Storage.Parameters.MessageStatisticsEnabled)
                            {
                                Text = CultureService.Instance.GetString(CultureText.node_MessagesStatistics_Text);
                            }
                            else
                            {
                                Text  = CultureService.Instance.GetString(CultureText.node_MessagesStatistics_Text);
                                Text += string.Format(" [{0}] ", CultureService.Instance.GetString(CultureText.text_DISABLED));
                            }
                        }
                        break;
                    };
                }
            });

            _statistics.Messages.ListChanged += new ListChangedEventHandler(Messages_ListChanged);
        }
コード例 #25
0
        private void CreateProject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var @params = new ProjectParameters(ctrNameTB.Text,
                                                    Convert.ToDouble(ctrVersionTB.Text, CultureInfo.InvariantCulture));

                ProjectService.CreateProject(@params);
                (Window.GetWindow(this) as MainWindow).OpenPage(new ProjectPage(@params.Name));
            }
            catch (Exception exp)
            {
                ErrorBox.Show(exp.Message);
            }
        }
コード例 #26
0
 private void OnAddSetting()
 {
     //CollModelSettings = new ObservableCollection<ProjectParameters>();
     if (SettingDetails.ProjectName != null)
     {
         CollModelSettings1.Add(new ProjectParameters {
             ProjectName = SettingDetails.ProjectName, Projectinterval = SettingDetails.Projectinterval, Projectlife = SettingDetails.Projectlife
         });
         SettingDetails = new ProjectParameters();
     }
     else
     {
         MessageBox.Show("Please enter project name");
     }
 }
コード例 #27
0
ファイル: TestCases.cs プロジェクト: DaneBoers/UI
        public static bool TestCase3() //Verifying the Secondary Costs from Corrective only
        {
            //Set-up Project
            ProjectParameters PRJ1 = new ProjectParameters()
            {
                Projectinterval = 100, Projectlife = 87600
            };

            //Add a Failure Mode
            var FM = new Failuremode()
            {
                Name = "Test", ID = "FM001", Eta = 8760, Beta = 5, Gamma = 0, Initialage = 0, ProjectParams = PRJ1
            };

            //Stopwatch
            var sw = Stopwatch.StartNew();

            //Adding Tasks
            FM.CorrectiveTask = new FMTask()
            {
                Description = "CR1", TaskCost = 2000, TaskDuration = 24, Agereductionfactor = 1
            };
            FM.PlannedTasks.Add(new FMTask()
            {
                Description = "PR1", FixedInterval = false, TaskInterval = 8760, TaskCost = 1000, TaskDuration = 10, Secondary = false, Agereductionfactor = 1
            });
            FM.Effects.Add(new Effect()
            {
                Name = "Environmental Risk", EffectCost = 2000, EffectProbability = 1, EffectType = "Environmental", ApplyToCorrective = true
            });
            FM.Solve();

            //Expected Results
            double failures        = 6.999843;
            double correctivecosts = 13999.686;
            double plannedcosts    = 3983.109; //This is out by about 1.1% at max AvailabilityWB settings but is attenuating toward this calc.
            double inspectioncosts = 0;
            double totalcosts      = 31982.481;
            double effectscosts    = 13999.686;

            //Test results vs expectations
            Testresults(FM, failures, correctivecosts, plannedcosts, inspectioncosts, totalcosts, effectscosts);

            Debug.WriteLine("****Solver Execution Time = {0} seconds\n", sw.Elapsed.TotalSeconds);

            return(true); //success
        }
コード例 #28
0
        public ActionResult AddBestIdea([FromBody] IdeaRequest req)
        {
            Project proj = _context.Project.Where(p => p.Uid == req.ProjectUid).FirstOrDefault <Project>();

            ProjectParameters param = new ProjectParameters
            {
                Uid       = Guid.NewGuid().ToString(),
                Type      = "b",
                Content   = req.Idea,
                ProjectId = proj.Id
            };

            _context.ProjectParameters.Add(param);
            _context.SaveChanges();

            return(Ok(new { message = "Success!" }));
        }
コード例 #29
0
ファイル: Editors.cs プロジェクト: mengtest/BerryMatchThree
    public override void OnInspectorGUI()
    {
        if (!metaTarget)
        {
            EditorGUILayout.HelpBox("SessionAssistant is missing", MessageType.Error);
            return;
        }

        if (ProfileAssistant.main == null)
        {
            ProfileAssistant.main = FindObjectOfType <ProfileAssistant>();
        }
        if (ProfileAssistant.main == null)
        {
            EditorGUILayout.HelpBox("ProfileAssistant is missing", MessageType.Error);
            return;
        }

        ProjectParameters main = (ProjectParameters)metaTarget;

        Undo.RecordObject(main, "");

        main.square_combination = EditorGUILayout.Toggle("Square Combinations", main.square_combination);
        ProfileAssistant.main.firstStartMenuSkiping = EditorGUILayout.Toggle("Skip menu on first start", ProfileAssistant.main.firstStartMenuSkiping);

        EditorGUILayout.Space();
        main.chip_acceleration = EditorGUILayout.Slider("Chip Acceleration", main.chip_acceleration, 1f, 100f);
        main.chip_max_velocity = EditorGUILayout.Slider("Chip Velocity Limit", main.chip_max_velocity, 5f, 100f);
        main.swap_duration     = EditorGUILayout.Slider("Swap Duration", main.swap_duration, 0.01f, 1f);

        EditorGUILayout.Space();
        main.lifes_limit      = EditorGUILayout.IntField("Lifes Limit", Mathf.Clamp(main.lifes_limit, 1, 999));
        main.refilling_time   = Mathf.RoundToInt(EditorGUILayout.Slider("Life Refilling Hour (" + Mathf.FloorToInt(1f * main.refilling_time / 60).ToString("D2") + ":" + (main.refilling_time % 60).ToString("D2") + ")", main.refilling_time, 10, 24 * 60));
        main.dailyreward_hour = Mathf.RoundToInt(EditorGUILayout.Slider("Daily Reward Hour (" + main.dailyreward_hour.ToString("D2") + ":00)", main.dailyreward_hour, 00, 23));

        EditorGUILayout.Space();
        main.slot_offset = EditorGUILayout.Slider("Slot Offset", main.slot_offset, 0.01f, 2f);

        EditorGUILayout.Space();
        main.music_volume_max = EditorGUILayout.Slider("Max Music Volume", main.music_volume_max, 0f, 1f);

        EditorGUILayout.Space();
        main.ios_AppID = EditorGUILayout.TextField("iOS AppID", main.ios_AppID);

        EditorGUILayout.Space();
    }
コード例 #30
0
        public AdapterService(
            MessageTraceCollection tracer,
            ProjectParameters paramters,
            IAdapterStatistics adapterStat,
            MessageStatistics messageStat,
            Storage project,

            ToolTableCollection toolTables)
        {
            _messageTrace = tracer;
            _adapterStat  = adapterStat;
            _messageStat  = messageStat;
            _paramters    = paramters;
            _project      = project;

            _toolTables = toolTables;
            _txQueue    = new SafeQueue <CommonCanMessage>();
        }
コード例 #31
0
ファイル: WSProject.cs プロジェクト: fparaggio/WindSimBattery
        public WSProject(string file_path, string target_directory)
        {
            // create a new project given a reference project and a target directory
            // file_path : reference project file
            // target_directory : directory where the new project will be created

            //CopyAll(DirectoryInfo source, DirectoryInfo target);

            FileInfo source_file = new FileInfo(file_path);
            DirectoryInfo target = new DirectoryInfo(target_directory);
            Tools.CopyAll(source_file.Directory, target);
            XmlSerializer deserializer = new XmlSerializer(typeof(ProjectParameters));
            TextReader textReader = new StreamReader(target.FullName + "\\"+ source_file.Name);
            parameters = (ProjectParameters)deserializer.Deserialize(textReader);
            textReader.Close();
            file = new FileInfo(target.FullName + "\\" + source_file.Name);
            this.save();
        }
コード例 #32
0
    public override void OnInspectorGUI()
    {
        if (!metaTarget)
        {
            EditorGUILayout.HelpBox("SessionAssistant is missing", MessageType.Error);
            return;
        }

        ProjectParameters main = (ProjectParameters)metaTarget;

        Undo.RecordObject(main, "");



        EditorGUILayout.Space();
        main.ios_AppID = EditorGUILayout.TextField("iOS AppID", main.ios_AppID);


        EditorGUILayout.Space();
    }
コード例 #33
0
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Storage(ProjectParameters parameters)
        {
            FileName     = AppConstants.NewFileName;
            _fileStorage = new FileStorage();
            Parameters   = parameters;


            TraceGridLayout      = new ColumnLayoutCollection();
            LogGridLayout        = new ColumnLayoutCollection();
            StatisticsGridLayout = new ColumnLayoutCollection();
            FilterGridLayout     = new ColumnLayoutCollection();
            Tools = new ToolTableCollection();

            Parameters.PropertyChanged += new PropertyChangedEventHandler(Parameters_PropertyChanged);
            Tools.ListChanged          += Tables_ListChanged;
            Tools.TableChanged         += Tables_TableChanged;

            IsSaved   = false;
            IsChanged = false;
        }
コード例 #34
0
 public void ProjectParametersConstructorTest()
 {
     ProjectParameters target = new ProjectParameters();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }