public AddOrEditAutobiographicalEventForm(AutobiographicalMemoryVM amVM, EventDTO eventToEdit = null)
        {
            InitializeComponent();

            _autobiographicalMemoryVm = amVM;
            _eventToEdit = eventToEdit;

            comboBoxEventType.DataSource = _autobiographicalMemoryVm.EventTypes;

            if (eventToEdit != null)
            {
                this.Text = Resources.EditAutobiographicalEventFormTitle;
                this.addOrEditButton.Text = Resources.UpdateButtonLabel;

                _eventToEdit = _autobiographicalMemoryVm.RetrieveEventRecord(_eventToEdit.Id);
                var propertyEvent = _eventToEdit as PropertyChangeEventDTO;
                if (propertyEvent != null)
                {
                    comboBoxEventType.Text = Constants.PROPERTY_CHANGE_EVENT.ToString();
                    textBoxSubject.Text    = propertyEvent.Subject;
                    textBoxObject.Text     = propertyEvent.Property;
                    textBoxTarget.Text     = propertyEvent.NewValue;
                    textBoxTime.Text       = propertyEvent.Time.ToString();
                }
                var actionEvent = _eventToEdit as ActionEventDTO;
                if (actionEvent != null)
                {
                    textBoxSubject.Text = actionEvent.Subject;
                    textBoxObject.Text  = actionEvent.Action;
                    textBoxTarget.Text  = actionEvent.Target;
                    textBoxTime.Text    = actionEvent.Time.ToString();
                }
            }
        }
コード例 #2
0
        public AddOrEditAutobiographicalEventForm(AutobiographicalMemoryVM amVM, EventDTO eventToEdit = null)
        {
            InitializeComponent();

            textBoxSubject.Value = amVM.CharName;

            //Restrictions
            textBoxSubject.AllowNil       = false;
            textBoxSubject.AllowUniversal = false;
            textBoxSubject.AllowVariable  = false;

            textBoxTarget.AllowUniversal = false;
            textBoxTarget.AllowVariable  = false;

            textBoxObject.AllowVariable  = false;
            textBoxObject.AllowUniversal = false;
            textBoxObject.AllowNil       = false;

            _autobiographicalMemoryVm = amVM;
            _eventToEdit = eventToEdit;

            textBoxObject.Value = WellFormedNames.Name.BuildName("A(P1)");

            comboBoxEventType.DataSource = AutobiographicalMemoryVM.EventTypes;

            if (eventToEdit != null)
            {
                this.Text = "Edit Event Record";
                this.addOrEditButton.Text = "Update";

                _eventToEdit = _autobiographicalMemoryVm.RetrieveEventRecord(_eventToEdit.Id);
                var propertyEvent = _eventToEdit as PropertyChangeEventDTO;
                if (propertyEvent != null)
                {
                    comboBoxEventType.Text = AMConsts.PROPERTY_CHANGE.ToString();
                    textBoxSubject.Value   = (WellFormedNames.Name)propertyEvent.Subject;
                    textBoxObject.Value    = (WellFormedNames.Name)propertyEvent.Property;
                    textBoxTarget.Value    = (WellFormedNames.Name)propertyEvent.NewValue;
                    textBoxTime.Value      = (int)propertyEvent.Time;
                }
                var actionEvent = _eventToEdit as ActionEventDTO;
                if (actionEvent != null)
                {
                    textBoxSubject.Value = (WellFormedNames.Name)actionEvent.Subject;
                    textBoxObject.Value  = (WellFormedNames.Name)actionEvent.Action;
                    textBoxTarget.Value  = (WellFormedNames.Name)actionEvent.Target;
                    textBoxTime.Value    = (int)actionEvent.Time;
                }
            }
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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;
        }