Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUIによる変換エラーの修正 #698

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/src/lib/components/TransformerOptions.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import { isBooleanConfig, isSelectionConfig } from '$lib/transformer';

export let transformerRegistry;
export let transformerSettings;
</script>

{#if transformerRegistry && transformerRegistry.configs.length > 0}
{#each transformerRegistry.configs as config}
{#if transformerSettings && transformerSettings.configs.length > 0}
{#each transformerSettings.configs as config}
{#if isBooleanConfig(config.parameter)}
<div class="flex gap-2 w-80 items-center">
<label for={config.key} class="w-3/4 pointer-events-none">
Expand Down
7 changes: 4 additions & 3 deletions app/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
let isConvertButtonDisabled = true;

$: isConvertButtonDisabled = !inputPaths.length || !outputPath || isRunning;
let transformerRegistry: TransformerSettings;
let transformerSettings: TransformerSettings;


async function convertAndSave() {
isRunning = true;
Expand All @@ -35,7 +36,7 @@
filetype,
epsg,
rulesPath,
transformerRegistry,
transformerSettings,
sinkParameters
});

Expand Down Expand Up @@ -75,7 +76,7 @@
bind:epsg
bind:rulesPath
bind:sinkParameters
bind:transformerRegistry
bind:transformerSettings
/>

<OutputSelector {filetype} bind:outputPath />
Expand Down
12 changes: 6 additions & 6 deletions app/src/routes/SettingSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as dialog from "@tauri-apps/plugin-dialog"
export let epsg: number = 4979;
export let rulesPath: string;
export let sinkParameters: SinkParameters;
export let transformerRegistry: TransformerSettings;
export let transformerSettings: TransformerSettings;

$: epsgOptions = filetypeOptions[filetype]?.epsg || [];
$: disableEpsgOptions = epsgOptions.length < 2;
Expand Down Expand Up @@ -42,13 +42,13 @@ import * as dialog from "@tauri-apps/plugin-dialog"
rulesPath = Array.isArray(res) ? res[0] : res;
}

async function getTransformerRegistry(filetype: string) {
async function getTransformerSettings(filetype: string) {
const registry = (await invoke('get_transform', { filetype })) as any;

transformerRegistry = registry;
transformerSettings = registry;
}

$: getTransformerRegistry(filetype);
$: getTransformerSettings(filetype);

let sinkOptionKeys: string[] = [];

Expand Down Expand Up @@ -115,11 +115,11 @@ import * as dialog from "@tauri-apps/plugin-dialog"
</select>
</div>

{#if (transformerRegistry && transformerRegistry.configs.length > 0) || sinkOptionKeys.length > 0}
{#if (transformerSettings && transformerSettings.configs.length > 0) || sinkOptionKeys.length > 0}
<div class="flex flex-col">
<label for="transform-select" class="font-bold mb-1.5">出力の詳細設定</label>
<div class="flex flex-col gap-2">
<TransformerOptions bind:transformerRegistry />
<TransformerOptions bind:transformerSettings />
<SinkOptions bind:sinkOptionKeys bind:sinkParameters />
</div>
</div>
Expand Down