Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VR-Klassenzimmer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Container Registry
Model registry
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mm_vr
VR-Klassenzimmer
Commits
c4d32c00
Commit
c4d32c00
authored
2 months ago
by
scherlit
Browse files
Options
Downloads
Patches
Plain Diff
Update CoachRtc.cs
- handle incomping parameter values (EventLogger, "selectAll" and "logFileName")
parent
d41dbe99
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Packages/vr.teachr.webcommunication/Runtime/Scripts/CoachRtc.cs
+24
-20
24 additions, 20 deletions
...es/vr.teachr.webcommunication/Runtime/Scripts/CoachRtc.cs
with
24 additions
and
20 deletions
Packages/vr.teachr.webcommunication/Runtime/Scripts/CoachRtc.cs
+
24
−
20
View file @
c4d32c00
...
...
@@ -25,9 +25,8 @@ namespace TeachR.WebCommunication
private
static
readonly
List
<
Msg
>
InboundStack
=
new
();
public
static
bool
Active
{
get
;
private
set
;
}
private
static
UnityEvent
configurationEvent
;
private
static
UnityEvent
dataCollectionEvent
;
private
static
UnityEvent
speechtoolEvent
;
//private static UnityEvent configurationEvent;
//private static UnityEvent speechtoolEvent;
public
static
Action
<
List
<
ScriptInfo
>>
OnScriptInfoListChanged
;
...
...
@@ -55,7 +54,8 @@ namespace TeachR.WebCommunication
WebsocketDelegateHooks
.
OnFixedUpdate
+=
RunEventLoop
;
RegisterFunctionCheckResultHandler
(
HandleFunctionCheckResult
);
RegisterScriptInfoListHandler
(
HandleScriptInfoListRequest
);
RegisterDataCollectionHandler
(
HandleManageScriptInfo
);
RegisterScriptInfoHandler
(
HandleScriptInfoUpdate
);
RegisterDataCollectionHandler
(
HandleDataCollectionParameter
);
EventLogger
.
Instance
.
OnScriptInfoListChanged
+=
HandleScriptInfoListEntryChanged
;
return
Task
.
CompletedTask
;
...
...
@@ -92,14 +92,19 @@ namespace TeachR.WebCommunication
Persistent
.
On
(
"requestScriptInfoList"
,
handler
);
}
private
static
void
Register
DataCollection
Handler
(
Action
<
JsonMsg
>
handler
)
private
static
void
Register
ScriptInfo
Handler
(
Action
<
JsonMsg
>
handler
)
{
Persistent
.
On
(
"manageScriptInfo"
,
handler
);
}
private
static
void
RegisterDataCollectionHandler
(
Action
<
JsonMsg
>
handler
)
{
Persistent
.
On
(
"dataCollectionParameters"
,
handler
);
}
private
static
void
HandleFunctionCheckResult
(
JsonMsg
msg
)
{
Debug
.
Log
(
$"Function check result received:
{
msg
.
content
}
DoTo: Do something with this information"
);
Debug
.
Log
(
$"
[Debug]
Function check result received:
{
msg
.
content
}
DoTo: Do something with this information"
);
}
private
static
void
HandleScriptInfoListRequest
(
JsonMsg
msg
)
...
...
@@ -109,7 +114,19 @@ namespace TeachR.WebCommunication
EventLogger
.
Instance
.
AddEventListenerAfterConnection
();
}
private
static
void
HandleManageScriptInfo
(
JsonMsg
msg
)
private
static
void
HandleDataCollectionParameter
(
JsonMsg
msg
)
{
var
data
=
msg
.
GetValue
<
Dictionary
<
string
,
object
>>();
string
name
=
data
[
"logfileName"
].
ToString
();
bool
selectAll
=
Convert
.
ToBoolean
(
data
[
"autoselectAll"
]);
EventLogger
.
Instance
.
measurementName
=
name
;
EventLogger
.
Instance
.
autoSelectAllScripts
=
selectAll
;
}
private
static
void
HandleScriptInfoUpdate
(
JsonMsg
msg
)
{
var
data
=
msg
.
GetValue
<
Dictionary
<
string
,
object
>>();
...
...
@@ -119,9 +136,7 @@ namespace TeachR.WebCommunication
foreach
(
var
scriptInfo
in
EventLogger
.
Instance
.
scriptInfoList
)
{
if
(
scriptInfo
.
scriptAlias
==
scriptAlias
)
{
scriptInfo
.
SetLogValueByWebsite
(
logValue
);
}
}
}
...
...
@@ -129,7 +144,6 @@ namespace TeachR.WebCommunication
{
var
info
=
scriptInfo
.
GetScriptInfoAsJson
();
Send
(
"updateScriptInfoEntry"
,
info
);
Debug
.
Log
(
$"[DATA] update script Info entry:
{
info
}
"
);
}
/// <summary>
...
...
@@ -194,20 +208,10 @@ namespace TeachR.WebCommunication
{
Debug
.
Log
(
$"[DEBUG] received configuration parameters:
{
arg2
}
"
);
}
else
if
(
arg1
.
Equals
(
"dataCollectionParameters"
))
{
Debug
.
Log
(
$"[DATA] received data collection parameters:
{
arg2
}
"
);
//var parameters = JsonUtility.FromJson<DataCollectionParameters>(arg2);
//EventLogger.Instance.UpdateDataCollectionParameters(parameters);
}
else
if
(
arg1
.
Equals
(
"speechtoolParameters"
))
{
Debug
.
Log
(
$"[DEBUG] received speechtool parameters:
{
arg2
}
"
);
}
//else if (arg1.Equals("requestScriptInfoList"))
//{
// Debug.Log($"[DEBUG] received requestScriptInfoList : {arg2}");
//}
}
private
static
void
RunEventLoop
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment