public Categories() { InitializeComponent(); NavigationPage.SetBackButtonTitle(this, ""); knowledgeBaseVM = new KnowledgeBaseVM(); BindingContext = knowledgeBaseVM; listView.ItemsSource = knowledgeBaseVM.knowledgeBaseList; Title = "All Categories"; }
private void Reset(bool newFile) { if (newFile) { this.Text = Resources.MainFormPrincipalTitle; this._emotionalAppraisalAsset = new EmotionalAppraisalAsset(DEFAULT_PERSPECTIVE); } else { this.Text = Resources.MainFormPrincipalTitle + Resources.TitleSeparator + _saveFileName; } //Emotional State Tab _emotionalStateVM = new EmotionalStateVM(_emotionalAppraisalAsset); this.textBoxPerspective.Text = _emotionalStateVM.Perspective; this.richTextBoxDescription.Text = _emotionalAppraisalAsset.Description; this.moodValueLabel.Text = Math.Round(_emotionalStateVM.Mood).ToString(MOOD_FORMAT); this.moodTrackBar.Value = (int)float.Parse(this.moodValueLabel.Text); this.textBoxStartTick.Text = _emotionalStateVM.Start.ToString(); this.emotionsDataGridView.DataSource = _emotionalStateVM.Emotions; //Emotion Dispositions _emotionDispositionsVM = new EmotionDispositionsVM(_emotionalAppraisalAsset); comboBoxDefaultDecay.SelectedIndex = comboBoxDefaultDecay.FindString(_emotionDispositionsVM.DefaultDecay.ToString()); comboBoxDefaultThreshold.SelectedIndex = comboBoxDefaultThreshold.FindString(_emotionDispositionsVM.DefaultThreshold.ToString()); dataGridViewEmotionDispositions.DataSource = _emotionDispositionsVM.EmotionDispositions; //Appraisal Rule _appraisalRulesVM = new AppraisalRulesVM(_emotionalAppraisalAsset); dataGridViewAppraisalRules.DataSource = _appraisalRulesVM.AppraisalRules; dataGridViewAppraisalRules.Columns[PropertyUtil.GetName <BaseDTO>(dto => dto.Id)].Visible = false; dataGridViewAppraisalRules.Columns[PropertyUtil.GetName <AppraisalRuleDTO>(dto => dto.Conditions)].Visible = false; dataGridViewAppraisalRules.Columns[PropertyUtil.GetName <AppraisalRuleDTO>(dto => dto.QuantifierType)].Visible = false; dataGridViewAppRuleConditions.DataSource = _appraisalRulesVM.CurrentRuleConditions; dataGridViewAppRuleConditions.Columns[PropertyUtil.GetName <BaseDTO>(dto => dto.Id)].Visible = false; comboBoxQuantifierType.DataSource = _appraisalRulesVM.QuantifierTypes; //KB _knowledgeBaseVM = new KnowledgeBaseVM(_emotionalAppraisalAsset); dataGridViewBeliefs.DataSource = _knowledgeBaseVM.Beliefs; dataGridViewBeliefs.Columns[PropertyUtil.GetName <BaseDTO>(dto => dto.Id)].Visible = false; //AM _autobiographicalMemoryVM = new AutobiographicalMemoryVM(_emotionalAppraisalAsset); dataGridViewAM.DataSource = _autobiographicalMemoryVM.Events; }
public void OnAssetDataLoaded() { _emotionalStateVM = new EmotionalStateVM(Asset); _autobiographicalMemoryVM = new AutobiographicalMemoryVM(Asset); _knowledgeBaseVM = new KnowledgeBaseVM(Asset); textBoxCharacterName.Text = Asset.CharacterName == null ? string.Empty : Asset.CharacterName.ToString(); textBoxCharacterBody.Text = Asset.BodyName; textBoxCharacterVoice.Text = Asset.VoiceName; this.moodValueLabel.Text = Math.Round(_emotionalStateVM.Mood).ToString(MOOD_FORMAT); this.moodTrackBar.Value = (int)float.Parse(this.moodValueLabel.Text); this.StartTickField.Value = _emotionalStateVM.Start; this.emotionsDataGridView.DataSource = _emotionalStateVM.Emotions; this.dataGridViewAM.DataSource = _autobiographicalMemoryVM.Events; this.dataGridViewBeliefs.DataSource = _knowledgeBaseVM.Beliefs; dataGridViewGoals.DataSource = new BindingListView <GoalDTO>(Asset.GetAllGoals().ToList()); }
public AddOrEditBeliefForm(KnowledgeBaseVM kbVM, BeliefDTO beliefToEdit = null) { InitializeComponent(); //DefaultValues beliefNameTextBox.Value = WellFormedNames.Name.BuildName("Bel(A)"); perspectiveTextBox.Value = WellFormedNames.Name.SELF_SYMBOL; beliefValueTextBox.Value = WellFormedNames.Name.BuildName("True"); certaintyTextBox.Value = 1; //Restrictions certaintyTextBox.HasBounds = true; certaintyTextBox.MaxValue = 1; certaintyTextBox.MinValue = 0; beliefNameTextBox.AllowLiteral = false; beliefNameTextBox.AllowNil = false; beliefNameTextBox.AllowUniversal = false; beliefNameTextBox.AllowVariable = false; beliefValueTextBox.AllowComposedName = false; beliefValueTextBox.AllowNil = false; beliefValueTextBox.AllowUniversal = false; beliefValueTextBox.AllowVariable = false; perspectiveTextBox.AllowNil = true; _knowledgeBaseVm = kbVM; _beliefToEdit = beliefToEdit; if (beliefToEdit != null) { this.Text = "Edit Belief"; this.addOrEditBeliefButton.Text = "Update"; beliefNameTextBox.Value = (WellFormedNames.Name)beliefToEdit.Name; beliefValueTextBox.Value = (WellFormedNames.Name)beliefToEdit.Value; perspectiveTextBox.Value = (WellFormedNames.Name)beliefToEdit.Perspective; certaintyTextBox.Value = beliefToEdit.Certainty; } }
public AddOrEditBeliefForm(KnowledgeBaseVM kbVM, BeliefDTO beliefToEdit = null) { InitializeComponent(); _knowledgeBaseVm = kbVM; _beliefToEdit = beliefToEdit; //Default Values beliefVisibilityComboBox.DataSource = _knowledgeBaseVm.GetKnowledgeVisibilities(); beliefVisibilityComboBox.SelectedIndex = 0; if (beliefToEdit != null) { this.Text = Resources.AddOrEditBeliefForm_AddOrEditBeliefForm_Edit_Belief; this.addOrEditBeliefButton.Text = Resources.AddOrEditBeliefForm_AddOrEditBeliefForm_Update; beliefNameTextBox.Text = beliefToEdit.Name; beliefValueTextBox.Text = beliefToEdit.Value; beliefVisibilityComboBox.Text = beliefToEdit.Perspective; } }
protected override void OnAssetDataLoaded(RolePlayCharacterAsset asset) { textBoxCharacterName.Text = asset.CharacterName == null ? string.Empty : asset.CharacterName.ToString(); textBoxCharacterBody.Text = asset.BodyName; textBoxCharacterVoice.Text = asset.VoiceName; _emotionalStateVM = new EmotionalStateVM(this); _autobiographicalMemoryVM = new AutobiographicalMemoryVM(this); this.moodValueLabel.Text = Math.Round(_emotionalStateVM.Mood).ToString(MOOD_FORMAT); this.moodTrackBar.Value = (int)float.Parse(this.moodValueLabel.Text); this.StartTickField.Value = _emotionalStateVM.Start; this.emotionsDataGridView.DataSource = _emotionalStateVM.Emotions; this.dataGridViewAM.DataSource = _autobiographicalMemoryVM.Events; //EA ASSET if (string.IsNullOrEmpty(asset.EmotionalAppraisalAssetSource)) { _eaForm.Hide(); } else { this.pathTextBoxEA.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.EmotionalAppraisalAssetSource); var ea = EmotionalAppraisalAsset.LoadFromFile(asset.EmotionalAppraisalAssetSource); _eaForm.LoadedAsset = ea; FormHelper.ShowFormInContainerControl(this.panelEA, _eaForm); } //EDM ASSET if (string.IsNullOrEmpty(asset.EmotionalDecisionMakingSource)) { _edmForm.Hide(); } else { this.textBoxPathEDM.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.EmotionalDecisionMakingSource); var edm = EmotionalDecisionMakingAsset.LoadFromFile(asset.EmotionalDecisionMakingSource); _edmForm.LoadedAsset = edm; FormHelper.ShowFormInContainerControl(this.panelEDM, _edmForm); } //SI ASSET if (string.IsNullOrEmpty(asset.SocialImportanceAssetSource)) { _siForm.Hide(); } else { this.textBoxPathSI.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.SocialImportanceAssetSource); var si = SocialImportanceAsset.LoadFromFile(asset.SocialImportanceAssetSource); _siForm.LoadedAsset = si; FormHelper.ShowFormInContainerControl(this.panelSI, _siForm); } //CIF ASSET if (string.IsNullOrEmpty(asset.CommeillFautAssetSource)) { _cifForm.Hide(); } else { this.textBoxPathCIF.Text = LoadableAsset <EmotionalDecisionMakingAsset> .ToRelativePath(LoadedAsset.AssetFilePath, asset.CommeillFautAssetSource); var cif = CommeillFautAsset.LoadFromFile(asset.CommeillFautAssetSource); _cifForm.LoadedAsset = cif; FormHelper.ShowFormInContainerControl(this.panelCIF, _cifForm); } //KB _knowledgeBaseVM = new KnowledgeBaseVM(this); dataGridViewBeliefs.DataSource = _knowledgeBaseVM.Beliefs; }