Skip to content

Commit

Permalink
remove runType (#4916)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey authored Sep 25, 2024
1 parent ec2f327 commit 747f272
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { ref, computed, watch, onMounted } from 'vue';
import MultiSelect from 'primevue/multiselect';
import Button from 'primevue/button';
import Chart from 'primevue/chart';
import { ChartConfig, DataseriesConfig, RunResults, RunType } from '@/types/SimulateConfig';
import { ChartConfig, DataseriesConfig, RunResults } from '@/types/SimulateConfig';
import type { CsvAsset } from '@/types/Types';
import { getGraphDataFromDatasetCSV } from '@/components/workflow/util';
Expand All @@ -51,7 +51,6 @@ const props = defineProps<{
colorByRun?: boolean;
initialData?: CsvAsset;
mapping?: { [key: string]: string }[];
runType?: RunType;
size?: { width: number; height: number };
showRemoveButton?: boolean;
}>();
Expand Down Expand Up @@ -259,12 +258,7 @@ const renderGraph = () => {
});
if (props.initialData) {
const dataset: DataseriesConfig | null = getGraphDataFromDatasetCSV(
props.initialData,
variable,
props.mapping,
props.runType
);
const dataset: DataseriesConfig | null = getGraphDataFromDatasetCSV(props.initialData, variable, props.mapping);
if (dataset) {
datasets.push(dataset);
}
Expand Down
14 changes: 4 additions & 10 deletions packages/client/hmi-client/src/components/workflow/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { DataseriesConfig, RunType, ChartConfig } from '@/types/SimulateConfig';
import { DataseriesConfig, ChartConfig } from '@/types/SimulateConfig';
import type { CsvAsset, TimeSpan } from '@/types/Types';
import type { WorkflowNode } from '@/types/workflow';
import type { CalibrateMap } from '@/services/calibrate-workflow';
Expand Down Expand Up @@ -90,17 +90,11 @@ export function getTimespan(params: GetTimespanParams): TimeSpan {
export const getGraphDataFromDatasetCSV = (
dataset: CsvAsset,
columnVar: string,
mapping?: { [key: string]: string }[],
runType?: RunType
mapping?: { [key: string]: string }[]
): DataseriesConfig | null => {
// TA3 quirks, adjust variable names - FIXME
const selectedVariableLookup = runType === RunType.Julia ? columnVar.slice(0, -3) : columnVar;
// runType === RunType.Julia ? columnVar.slice(0, -3) : columnVar.slice(0, -6);
const timeVariableLookup = 'timestamp';

// Default
let selectedVariable = selectedVariableLookup;
let timeVariable = timeVariableLookup;
let selectedVariable = columnVar;
let timeVariable = 'timestamp';

// Map variable names to dataset column names
if (mapping) {
Expand Down
5 changes: 0 additions & 5 deletions packages/client/hmi-client/src/types/SimulateConfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
export const enum RunType {
Julia = 'julia',
Ciemss = 'ciemss'
}

export type ChartConfig = {
selectedVariable: string[];
selectedRun: string;
Expand Down

0 comments on commit 747f272

Please sign in to comment.