diff --git a/App.tsx b/App.tsx index 47e9d2a..e5e5da7 100644 --- a/App.tsx +++ b/App.tsx @@ -46,7 +46,15 @@ const App: React.FC = () => { // Quick Action Config (Persisted in localStorage) const [quickTestConfig, setQuickTestConfig] = useState(() => { const saved = localStorage.getItem('quickTestConfig'); - return saved ? JSON.parse(saved) : { length: 3, format: 'ascii' }; + if (saved) { + const parsed = JSON.parse(saved); + return { + length: parsed.length || 3, + format: parsed.format || 'ascii', + startAddress: parsed.startAddress !== undefined ? parsed.startAddress : 2 + }; + } + return { length: 3, format: 'ascii', startAddress: 2 }; }); // Quick Action State @@ -136,14 +144,14 @@ const App: React.FC = () => { setTimeout(() => { if (action === 'read') { addLog('INFO', `Quick Read detected tag: ${targetTag.epc}`); - handleMemoryRead(MemoryBank.EPC, 2, quickTestConfig.length, "00000000", targetTag.epc); + handleMemoryRead(MemoryBank.EPC, quickTestConfig.startAddress, quickTestConfig.length, "00000000", targetTag.epc); } else if (action === 'write') { // Set Flag to trigger verification read on success performingQuickWriteRef.current = true; verificationRetriesRef.current = 0; // Reset retries addLog('INFO', `Quick Write detected tag: ${targetTag.epc}`); - handleMemoryWrite(MemoryBank.EPC, 2, dataToWrite, "00000000", targetTag.epc); + handleMemoryWrite(MemoryBank.EPC, quickTestConfig.startAddress, dataToWrite, "00000000", targetTag.epc); } }, 200); } diff --git a/components/QuickTestPanel.tsx b/components/QuickTestPanel.tsx index 65b9c03..969d4df 100644 --- a/components/QuickTestPanel.tsx +++ b/components/QuickTestPanel.tsx @@ -29,12 +29,12 @@ export const QuickTestPanel: React.FC = ({ return (
-
+

Quick Test Mode

-

+

필드 내의 첫 번째 태그를 자동으로 감지하여 읽기 또는 쓰기 작업을 수행합니다.

@@ -114,7 +114,7 @@ export const QuickTestPanel: React.FC = ({
{/* Info / Config Card */} -
+

@@ -127,7 +127,7 @@ export const QuickTestPanel: React.FC = ({

Start Address - 2 (User Data) + {config.startAddress} (User Data)
Data Length @@ -146,7 +146,7 @@ export const QuickTestPanel: React.FC = ({ Note

- 설정(길이, 포맷)을 변경하려면 Settings 탭으로 이동하세요. + 설정(시작주소, 길이, 포맷)을 변경하려면 Settings 탭으로 이동하세요.

diff --git a/components/SettingsPanel.tsx b/components/SettingsPanel.tsx index 3912b63..b94cc82 100644 --- a/components/SettingsPanel.tsx +++ b/components/SettingsPanel.tsx @@ -38,7 +38,8 @@ export const SettingsPanel: React.FC = ({ const [band, setBand] = useState(FrequencyBand.US); // Quick Test Local State - const [qtLength, setQtLength] = useState<3 | 4>(4); + const [qtLength, setQtLength] = useState(3); + const [qtStartAddress, setQtStartAddress] = useState(2); const [qtFormat, setQtFormat] = useState<'hex' | 'ascii'>('hex'); // Initialize form with reader info when available @@ -58,6 +59,7 @@ export const SettingsPanel: React.FC = ({ useEffect(() => { setQtLength(quickTestConfig.length); setQtFormat(quickTestConfig.format); + setQtStartAddress(quickTestConfig.startAddress); }, [quickTestConfig]); const handleApplyReaderSettings = () => { @@ -74,7 +76,8 @@ export const SettingsPanel: React.FC = ({ const handleSaveLocalSettings = () => { onSaveQuickTestConfig({ length: qtLength, - format: qtFormat + format: qtFormat, + startAddress: qtStartAddress }); }; @@ -309,28 +312,26 @@ export const SettingsPanel: React.FC = ({ 이 설정은 브라우저의 로컬 저장소에 저장되며 "Quick Test" 탭의 동작을 제어합니다.

+
+ + setQtStartAddress(parseInt(e.target.value) || 0)} + className="w-full bg-white border border-slate-300 rounded-lg px-3 py-2 text-slate-900 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none transition-all" + /> +
+
-
- - -
+ setQtLength(parseInt(e.target.value) || 1)} + className="w-full bg-white border border-slate-300 rounded-lg px-3 py-2 text-slate-900 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 outline-none transition-all" + />
diff --git a/types.ts b/types.ts index 6692e5a..3c7a806 100644 --- a/types.ts +++ b/types.ts @@ -46,7 +46,8 @@ export interface LogEntry { } export interface QuickTestConfig { - length: 3 | 4; + startAddress: number; + length: number; format: 'hex' | 'ascii'; }