모바일 디자인 업데이트 및 quick test 에서 start 와 length 를 직접 입력할 수 있게 함
This commit is contained in:
14
App.tsx
14
App.tsx
@@ -46,7 +46,15 @@ const App: React.FC = () => {
|
||||
// Quick Action Config (Persisted in localStorage)
|
||||
const [quickTestConfig, setQuickTestConfig] = useState<QuickTestConfig>(() => {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user