Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Skye Yu
jensen
Commits
ad38a3a4
Commit
ad38a3a4
authored
Jan 10, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: added compatibility with eason file list
parent
15ce97f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
index.tsx
src/index.tsx
+6
-0
jensen.js
src/utils/jensen.js
+13
-3
No files found.
src/index.tsx
View file @
ad38a3a4
...
@@ -78,6 +78,11 @@ export function Home() {
...
@@ -78,6 +78,11 @@ export function Home() {
alert
(
JSON
.
stringify
(
time
));
alert
(
JSON
.
stringify
(
time
));
}
}
const
listFiles
=
async
()
=>
{
let
files
=
await
jensen
.
listFiles
();
console
.
log
(
files
);
}
return
(
return
(
<>
<>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
}
}
>
...
@@ -90,6 +95,7 @@ export function Home() {
...
@@ -90,6 +95,7 @@ export function Home() {
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
getTime
}
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
getTime
}
>
Get Time
Get Time
</
button
>
</
button
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
listFiles
}
>
List Files
</
button
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
bluetoothScan
}
>
Bluetooth Scan
</
button
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
bluetoothScan
}
>
Bluetooth Scan
</
button
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
disconnectBTDevice
}
>
Bluetooth Disconnect
</
button
>
<
button
style=
{
{
width
:
'200px'
,
height
:
'50px'
}
}
onClick=
{
disconnectBTDevice
}
>
Bluetooth Disconnect
</
button
>
</
div
>
</
div
>
...
...
src/utils/jensen.js
View file @
ad38a3a4
...
@@ -648,17 +648,26 @@ Jensen.prototype.listFiles = async function () {
...
@@ -648,17 +648,26 @@ Jensen.prototype.listFiles = async function () {
ftime
=
ftime
.
replace
(
/^
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})
REC.*$/gi
,
'$1-$2-$3 $4:$5:$6'
);
ftime
=
ftime
.
replace
(
/^
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})
REC.*$/gi
,
'$1-$2-$3 $4:$5:$6'
);
ftime
=
new
Date
(
ftime
);
ftime
=
new
Date
(
ftime
);
duration
=
flen
/
32
;
duration
=
flen
/
32
;
}
else
if
(
ftime
.
match
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.
hda
$/gi
))
{
}
else
if
(
ftime
.
match
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.
(
hda|wav
)
$/gi
))
{
// 2024Mar19-110932-Rec00.hda
// 2024Mar19-110932-Rec00.hda
ftime
=
ftime
.
replace
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.
hda
$/gi
,
'20$2 $3 $4 $5:$6:$7'
);
ftime
=
ftime
.
replace
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.
(
hda|wav
)
$/gi
,
'20$2 $3 $4 $5:$6:$7'
);
ftime
=
new
Date
(
ftime
);
ftime
=
new
Date
(
ftime
);
duration
=
(
flen
/
32
)
*
4
;
duration
=
(
flen
/
32
)
*
4
;
}
else
{
}
else
{
ftime
=
null
;
ftime
=
null
;
}
}
if
(
ver
==
1
)
{
if
(
ver
==
1
)
{
duration
=
duration
*
2
;
duration
=
duration
*
2
;
}
}
else
if
(
ver
==
2
)
{
duration
=
(
flen
-
44
)
/
48
/
2
;
}
else
if
(
ver
==
3
)
{
duration
=
(
flen
-
44
)
/
48
/
2
/
2
;
}
let
createDate
=
''
;
let
createDate
=
''
;
let
createTime
=
''
;
let
createTime
=
''
;
if
(
ftime
)
{
if
(
ftime
)
{
...
@@ -671,6 +680,7 @@ Jensen.prototype.listFiles = async function () {
...
@@ -671,6 +680,7 @@ Jensen.prototype.listFiles = async function () {
createTime
:
createTime
,
createTime
:
createTime
,
time
:
ftime
,
time
:
ftime
,
duration
:
duration
,
duration
:
duration
,
version
:
ver
,
length
:
flen
,
length
:
flen
,
signature
:
sign
.
join
(
''
)
signature
:
sign
.
join
(
''
)
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment