From 60631c7711d3167be47b7e7dd83fe1b2213f6d65 Mon Sep 17 00:00:00 2001 From: Shawn Yama Date: Wed, 7 Aug 2024 09:56:20 -0400 Subject: [PATCH 01/10] read only config view --- .../model-parts/tera-model-part-entry.vue | 21 ++++- .../model/model-parts/tera-parameters.vue | 9 +- .../model-config/model-config-operation.ts | 3 +- .../tera-model-config-drilldown.vue | 89 ++++++++++++++----- .../ops/model-config/tera-petrinet-tables.vue | 0 packages/client/hmi-client/src/types/Model.ts | 4 +- 6 files changed, 96 insertions(+), 30 deletions(-) delete mode 100644 packages/client/hmi-client/src/components/workflow/ops/model-config/tera-petrinet-tables.vue diff --git a/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue b/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue index 90cdd689db..7285945d35 100644 --- a/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue +++ b/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue @@ -62,6 +62,11 @@ @update:model-value="$emit('update-item', { key: 'description', value: $event })" /> + @@ -106,7 +111,8 @@ section { grid-template-areas: 'symbol name unit . concept' 'expression expression expression expression expression' - 'description description description description description'; + 'description description description description description' + 'type mean std . .'; grid-template-columns: max-content max-content max-content auto max-content; gap: var(--gap-2); align-items: center; @@ -137,6 +143,7 @@ h6 { .description { grid-area: description; + color: var(--text-color-subdued); } .unit { @@ -158,6 +165,18 @@ h6 { gap: var(--gap-1); } +.type { + grid-area: type; +} + +.mean { + grid-area: mean; +} + +.std { + grid-area: std; +} + :deep(.p-autocomplete-input) { padding: var(--gap-1) var(--gap-2); } diff --git a/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue b/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue index 790fa6d788..4fce0376b0 100644 --- a/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue +++ b/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue @@ -22,7 +22,7 @@ import { ref, computed } from 'vue'; import { StratifiedMatrix } from '@/types/Model'; import type { ModelPartItem } from '@/types/Model'; -import { Model } from '@/types/Types'; +import { Model, InferredParameterSemantic } from '@/types/Types'; import { MiraModel, MiraTemplateParams } from '@/model-representation/mira/mira-common'; import { getParameters } from '@/model-representation/service'; import { collapseParameters } from '@/model-representation/mira/mira'; @@ -35,6 +35,7 @@ const props = defineProps<{ mmt: MiraModel; mmtParams: MiraTemplateParams; featureConfig: FeatureConfig; + inferredParameters?: InferredParameterSemantic[]; }>(); const emit = defineEmits(['update-parameter']); @@ -60,7 +61,8 @@ const parameterList = computed< name: p.name, description: p.description, grounding: p.grounding, - unitExpression: p.units?.expression + unitExpression: p.units?.expression, + distribution: props.inferredParameters?.find((i) => i.referenceId === childId)?.distribution }; }) .filter(Boolean) as ModelPartItem[]; @@ -74,7 +76,8 @@ const parameterList = computed< name: baseParameter.name, description: baseParameter.description, grounding: baseParameter.grounding, - unitExpression: baseParameter.units?.expression + unitExpression: baseParameter.units?.expression, + distribution: props.inferredParameters?.find((i) => i.referenceId === id)?.distribution }; return { base, children, isParent }; diff --git a/packages/client/hmi-client/src/components/workflow/ops/model-config/model-config-operation.ts b/packages/client/hmi-client/src/components/workflow/ops/model-config/model-config-operation.ts index b7ecdcb7c4..3cd33d48fb 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/model-config/model-config-operation.ts +++ b/packages/client/hmi-client/src/components/workflow/ops/model-config/model-config-operation.ts @@ -24,7 +24,8 @@ export const blankModelConfig: ModelConfiguration = { simulationId: '', observableSemanticList: [], parameterSemanticList: [], - initialSemanticList: [] + initialSemanticList: [], + inferredParameterList: [] }; export const ModelConfigOperation: Operation = { diff --git a/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-model-config-drilldown.vue b/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-model-config-drilldown.vue index c3f3194a37..6ab5561aae 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-model-config-drilldown.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-model-config-drilldown.vue @@ -97,30 +97,61 @@ - - Some metadata is missing from these values. This information can be added manually to the attached model. - - - - + @@ -251,6 +282,8 @@ import TeraSliderPanel from '@/components/widgets/tera-slider-panel.vue'; import { useConfirm } from 'primevue/useconfirm'; import Dropdown from 'primevue/dropdown'; import TeraToggleableEdit from '@/components/widgets/tera-toggleable-edit.vue'; +import TeraStates from '@/components/model/model-parts/tera-states.vue'; +import TeraParameters from '@/components/model/model-parts/tera-parameters.vue'; import TeraModelConfigurationItem from './tera-model-configuration-item.vue'; import { ModelConfigOperation, ModelConfigOperationState, blankModelConfig } from './model-config-operation'; @@ -569,6 +602,7 @@ const onSelectConfiguration = (config: ModelConfiguration) => { const applyConfigValues = (config: ModelConfiguration) => { const state = cloneDeep(props.node.state); knobs.value.transientModelConfig = cloneDeep(config); + console.log(config); // Update output port: if (!config.id) { @@ -675,6 +709,13 @@ onUnmounted(() => { background-color: var(--surface-0) !important; } +.artifact-amount { + font-size: var(--font-caption); + color: var(--text-color-subdued); + margin-left: var(--gap-1); + margin-right: auto; +} + #notebook-section:deep(main) { gap: var(--gap-small); position: relative; diff --git a/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-petrinet-tables.vue b/packages/client/hmi-client/src/components/workflow/ops/model-config/tera-petrinet-tables.vue deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/client/hmi-client/src/types/Model.ts b/packages/client/hmi-client/src/types/Model.ts index c490d595a3..8a7e8e9ba5 100644 --- a/packages/client/hmi-client/src/types/Model.ts +++ b/packages/client/hmi-client/src/types/Model.ts @@ -1,4 +1,4 @@ -import { ModelGrounding } from '@/types/Types'; +import { ModelGrounding, ModelDistribution } from '@/types/Types'; import { CONCEPT_FACETS_DISPLAY_NAME, CONCEPT_FACETS_FIELD } from './Concept'; import { Filters } from './Filter'; @@ -22,6 +22,8 @@ export type ModelPartItem = { templateId?: string; input?: string; output?: string; + // Calibrated config + distribution?: ModelDistribution; }; export enum StratifiedMatrix { From 57221d82dadf4482e2b49c99be00e55b86e8fb8c Mon Sep 17 00:00:00 2001 From: Shawn Yama Date: Wed, 7 Aug 2024 11:51:55 -0400 Subject: [PATCH 02/10] use whats already here --- .../model-parts/tera-model-part-entry.vue | 8 +- .../model/model-parts/tera-parameters.vue | 9 +- .../model/petrinet/tera-initial-entry.vue | 43 +++--- .../model/petrinet/tera-initial-table.vue | 2 +- .../model/petrinet/tera-parameter-entry.vue | 129 +++++++++++------- .../model/petrinet/tera-parameter-table.vue | 4 +- .../tera-model-config-drilldown.vue | 77 ++++------- 7 files changed, 135 insertions(+), 137 deletions(-) diff --git a/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue b/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue index 7285945d35..da57a5869c 100644 --- a/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue +++ b/packages/client/hmi-client/src/components/model/model-parts/tera-model-part-entry.vue @@ -62,11 +62,6 @@ @update:model-value="$emit('update-item', { key: 'description', value: $event })" /> - @@ -111,8 +106,7 @@ section { grid-template-areas: 'symbol name unit . concept' 'expression expression expression expression expression' - 'description description description description description' - 'type mean std . .'; + 'description description description description description'; grid-template-columns: max-content max-content max-content auto max-content; gap: var(--gap-2); align-items: center; diff --git a/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue b/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue index 4fce0376b0..790fa6d788 100644 --- a/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue +++ b/packages/client/hmi-client/src/components/model/model-parts/tera-parameters.vue @@ -22,7 +22,7 @@ import { ref, computed } from 'vue'; import { StratifiedMatrix } from '@/types/Model'; import type { ModelPartItem } from '@/types/Model'; -import { Model, InferredParameterSemantic } from '@/types/Types'; +import { Model } from '@/types/Types'; import { MiraModel, MiraTemplateParams } from '@/model-representation/mira/mira-common'; import { getParameters } from '@/model-representation/service'; import { collapseParameters } from '@/model-representation/mira/mira'; @@ -35,7 +35,6 @@ const props = defineProps<{ mmt: MiraModel; mmtParams: MiraTemplateParams; featureConfig: FeatureConfig; - inferredParameters?: InferredParameterSemantic[]; }>(); const emit = defineEmits(['update-parameter']); @@ -61,8 +60,7 @@ const parameterList = computed< name: p.name, description: p.description, grounding: p.grounding, - unitExpression: p.units?.expression, - distribution: props.inferredParameters?.find((i) => i.referenceId === childId)?.distribution + unitExpression: p.units?.expression }; }) .filter(Boolean) as ModelPartItem[]; @@ -76,8 +74,7 @@ const parameterList = computed< name: baseParameter.name, description: baseParameter.description, grounding: baseParameter.grounding, - unitExpression: baseParameter.units?.expression, - distribution: props.inferredParameters?.find((i) => i.referenceId === id)?.distribution + unitExpression: baseParameter.units?.expression }; return { base, children, isParent }; diff --git a/packages/client/hmi-client/src/components/model/petrinet/tera-initial-entry.vue b/packages/client/hmi-client/src/components/model/petrinet/tera-initial-entry.vue index 1d18e3a803..656270cd3e 100644 --- a/packages/client/hmi-client/src/components/model/petrinet/tera-initial-entry.vue +++ b/packages/client/hmi-client/src/components/model/petrinet/tera-initial-entry.vue @@ -9,26 +9,28 @@ {{ unit }} - {{ description }} + {{ description }} -
- +