Skip to content

Commit a59f9b8

Browse files
authored
Merge pull request #51 from micbelgique/sprint5.5
#31 #40 et modifications sur les assets logitech
2 parents 70b42f4 + 317994c commit a59f9b8

File tree

77 files changed

+17025
-20917
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+17025
-20917
lines changed

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/AnimationScripts/SimuSandBoxAnimatorAnimator.cs

-59
This file was deleted.

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/AnimationScripts/SimuWorkAnimatorAnimator.cs src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/AnimationScripts/TalkingAnimator.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ namespace MeshApp.Animations
1111
using Microsoft.Mesh.CloudScripting.Declarations;
1212

1313
[UserCreatable(false)]
14-
public class SimuWorkAnimatorAnimator : AnimationNode
14+
public class TalkingAnimator : AnimationNode
1515
{
1616
private readonly float[] _baseLayerSpeeds = { 1F, };
1717

18-
protected SimuWorkAnimatorAnimator(in Guid ahandle, bool transfer)
18+
protected TalkingAnimator(in Guid ahandle, bool transfer)
1919
: base(ahandle, transfer)
2020
{ }
2121

2222
public enum BaseLayerState
2323
{
24-
ActiveSimuWork,
24+
Talking,
2525
}
2626

2727
[Replication(ReplicationKind.Full)]
@@ -46,14 +46,14 @@ internal long SystemTimeOfBaseLayerUpdated
4646
set => GetPropertyAccessor(nameof(SystemTimeOfBaseLayerUpdated)).SetValue(value);
4747
}
4848

49-
internal static SimuWorkAnimatorAnimator GetOrCreateInstance(in Guid cookie, bool transfer)
49+
internal static TalkingAnimator GetOrCreateInstance(in Guid cookie, bool transfer)
5050
{
5151
var result = GetOrCreateCloudObject(
5252
cookie,
5353
transfer,
54-
(handle, t) => new SimuWorkAnimatorAnimator(handle, transfer: t));
54+
(handle, t) => new TalkingAnimator(handle, transfer: t));
5555

56-
return result as SimuWorkAnimatorAnimator;
56+
return result as TalkingAnimator;
5757
}
5858
}
5959
}

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/App.cs

+16-58
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
public class AppSettings
1616
{
17-
public BlobStorageSettings BlobStorage { get; set; }
17+
public Logitech Logitech { get; set; }
1818
}
19-
public class BlobStorageSettings
19+
20+
public class Logitech
2021
{
2122
public string BlobUrl { get; set; }
2223
}
@@ -50,7 +51,7 @@ public App(ICloudApplication app, ILogger<App> logger)
5051
//_qLearnings.Add(new QLearning(numStates, 8, 0.7, 0.7, 1, 0));
5152
}
5253
}
53-
private AppSettings? LoadSettings()
54+
private static AppSettings LoadSettings()
5455
{
5556
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
5657
if (File.Exists(filePath))
@@ -62,43 +63,21 @@ public App(ICloudApplication app, ILogger<App> logger)
6263
}
6364
catch (Exception ex)
6465
{
65-
_logger.LogError($"Error loading appsettings.json: {ex.Message}");
6666
return null;
6767
}
6868
}
6969
else
7070
{
71-
_logger.LogWarning("appsettings.json not found.");
7271
return null;
7372
}
7473
}
75-
76-
77-
74+
7875
public async Task StartAsync(CancellationToken token)
7976
{
80-
//Deep Eyes
81-
//var btnSphere = (TransformNode)_app.Scene.FindChildByPath("CubeOrSphere/ButtonSphere");
82-
//var sensorSphere = btnSphere.FindFirstChild<InteractableNode>();
83-
//var btnCube = (TransformNode)_app.Scene.FindChildByPath("CubeOrSphere/ButtonCube");
84-
//var sensorCube = btnCube.FindFirstChild<InteractableNode>();
85-
//sensorCube.Selected += async (sender, args) =>
86-
//{
87-
// await UploadImageToBlobStorage(1, _appSettings);
88-
// btnCube.IsActive = false;
89-
//};
90-
//sensorSphere.Selected += async (sender, args) =>
91-
//{
92-
// await UploadImageToBlobStorage(2, _appSettings);
93-
// btnSphere.IsActive = false;
94-
//};
95-
// Machine Learning
96-
97-
9877

9978
List<DescriptionLogitech> descriptions = new List<DescriptionLogitech>();
10079

101-
descriptions = await GetLogitechDescriptions(new Uri(_appSettings.BlobStorage.BlobUrl));
80+
descriptions = await GetLogitechDescriptions();
10281

10382
if (descriptions != null)
10483
{
@@ -108,11 +87,11 @@ public async Task StartAsync(CancellationToken token)
10887
var webCockpit = screenCockpit.FindFirstChild<WebSlateNode>();
10988

11089
var siteScheduler1 = (TransformNode)_app.Scene.FindChildByPath("Logitech/SiteSchedulerCockpit");
111-
var screenScheduler = (TransformNode)siteCockpit.FindChildByPath("WebSlate");
90+
var screenScheduler = (TransformNode)siteScheduler1.FindChildByPath("WebSlate");
11291
var webScheduler1 = screenScheduler.FindFirstChild<WebSlateNode>();
11392

11493
var siteScheduler2 = (TransformNode)_app.Scene.FindChildByPath("Logitech/SiteStudio");
115-
var screenScheduler2 = (TransformNode)siteCockpit.FindChildByPath("WebSlate");
94+
var screenScheduler2 = (TransformNode)siteScheduler2.FindChildByPath("WebSlate");
11695
var webScheduler2 = screenScheduler2.FindFirstChild<WebSlateNode>();
11796

11897

@@ -147,7 +126,6 @@ public async Task StartAsync(CancellationToken token)
147126
if (siteCockpit.IsActive)
148127
{
149128
siteCockpit.IsActive = false;
150-
Task.Delay(3000);
151129
webCockpit.Url = newUrl;
152130
siteCockpit.IsActive = true;
153131
}
@@ -165,7 +143,6 @@ public async Task StartAsync(CancellationToken token)
165143
if (siteCockpit.IsActive)
166144
{
167145
siteCockpit.IsActive = false;
168-
Task.Delay(3000);
169146
webCockpit.Url = newUrl;
170147
siteCockpit.IsActive = true;
171148
}
@@ -183,7 +160,6 @@ public async Task StartAsync(CancellationToken token)
183160
if (siteCockpit.IsActive)
184161
{
185162
siteCockpit.IsActive = false;
186-
Task.Delay(3000);
187163
webCockpit.Url = newUrl;
188164
siteCockpit.IsActive = true;
189165
}
@@ -201,7 +177,6 @@ public async Task StartAsync(CancellationToken token)
201177
if (siteCockpit.IsActive)
202178
{
203179
siteCockpit.IsActive = false;
204-
Task.Delay(3000);
205180
webCockpit.Url = newUrl;
206181
siteCockpit.IsActive = true;
207182
}
@@ -219,7 +194,6 @@ public async Task StartAsync(CancellationToken token)
219194
if (siteScheduler1.IsActive)
220195
{
221196
siteScheduler1.IsActive = false;
222-
Task.Delay(3000);
223197
webScheduler1.Url = newUrl;
224198
siteScheduler1.IsActive = true;
225199
}
@@ -237,7 +211,6 @@ public async Task StartAsync(CancellationToken token)
237211
if (siteScheduler1.IsActive)
238212
{
239213
siteScheduler1.IsActive = false;
240-
Task.Delay(3000);
241214
webScheduler1.Url = newUrl;
242215
siteScheduler1.IsActive = true;
243216
}
@@ -255,7 +228,6 @@ public async Task StartAsync(CancellationToken token)
255228
if (siteScheduler2.IsActive)
256229
{
257230
siteScheduler2.IsActive = false;
258-
Task.Delay(3000);
259231
webScheduler2.Url = newUrl;
260232
siteScheduler2.IsActive = true;
261233
}
@@ -272,6 +244,8 @@ public async Task StartAsync(CancellationToken token)
272244

273245
}
274246
}
247+
248+
275249
public async Task<string> GetImage(TransformNode node, string imageUrl)
276250
{
277251
using (HttpClient client = new HttpClient())
@@ -285,8 +259,13 @@ public async Task<string> GetImage(TransformNode node, string imageUrl)
285259
}
286260
}
287261

288-
static async Task<List<DescriptionLogitech>> GetLogitechDescriptions(Uri blobUrl)
262+
static async Task<List<DescriptionLogitech>> GetLogitechDescriptions()
289263
{
264+
AppSettings appSettings = LoadSettings();
265+
266+
string blobUrl = appSettings.Logitech.BlobUrl;
267+
268+
290269
using (HttpClient client = new HttpClient())
291270
{
292271
try
@@ -310,27 +289,6 @@ static async Task<List<DescriptionLogitech>> GetLogitechDescriptions(Uri blobUrl
310289
}
311290
}
312291

313-
//static async Task UploadImageToBlobStorage(int choice, AppSettings appSettings)
314-
//{
315-
// string blobName = choice == 1 ? "cube.jpg" : "sphere.jpg";
316-
// string imageUrl = choice == 1 ? "https://images.pexels.com/photos/1340185/pexels-photo-1340185.jpeg?cs=srgb&dl=pexels-magda-ehlers-1340185.jpg&fm=jpg" : "https://images.unsplash.com/photo-1617358142775-4be217d9cc19?q=80&w=1000&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8c3BoZXJlfGVufDB8fDB8fHww";
317-
// HttpClient httpClient = new HttpClient();
318-
// var imageData = await httpClient.GetByteArrayAsync(imageUrl);
319-
// string blobUrl = $"{appSettings.DeepEyes.Url}{blobName}{appSettings.DeepEyes.Token}";
320-
// using (MemoryStream memoryStream = new MemoryStream(imageData))
321-
// {
322-
// using (HttpClient client = new HttpClient())
323-
// {
324-
// ByteArrayContent content = new ByteArrayContent(memoryStream.ToArray());
325-
// content.Headers.ContentType = new MediaTypeHeaderValue("image/jpg");
326-
// content.Headers.Add("x-ms-blob-type", "BlockBlob");
327-
// HttpResponseMessage response = await client.PutAsync(blobUrl, content);
328-
// Console.WriteLine(response.StatusCode);
329-
// }
330-
// }
331-
//}
332-
333-
334292
/// <inheritdoc/>
335293
public Task StopAsync(CancellationToken token)
336294
{

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/appsettings.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"LogLevel": {
1414
"Default": "Information"
1515
}
16-
},
17-
"Logitech": {
18-
"Blob": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-25T09:25:14Z&se=2024-04-25T17:25:14Z&spr=https&sv=2022-11-02&sr=c&sig=96ga08wNqRfdZaDl4p0HZmn8dFRbiLHdx6TSg2xz4J4%3D"
1916
}
17+
},
18+
"Logitech": {
19+
"BlobUrl": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-30T08:14:22Z&se=2025-02-26T17:14:22Z&spr=https&sv=2022-11-02&sr=c&sig=QS7b551x72JjiLgJE2E7OQIABzf7H9kBwkHjp6xJ3HM%3D"
2020
}
21-
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:2274ad01015ed571983f80a67a86e256cacf3f08ece1e9fc8147d05cfa63a93e
3-
size 340992
2+
oid sha256:7a1593c57d716d894b3db77c48987a0b17ee075fb990092ab5751291d43a670b
3+
size 338432
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:4794bf4b253d2c284f3b804f09bb227ea7d87ba9cdfe49f2b16480bf9598a840
2+
oid sha256:da972b62e93197be147a7b5edcb7c31823d764741bd039e536fe994c55522c18
33
size 149504

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/bin/Debug/net6.0/appsettings.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"LogLevel": {
1414
"Default": "Information"
1515
}
16-
},
17-
"Logitech": {
18-
"Blob": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-25T09:25:14Z&se=2024-04-25T17:25:14Z&spr=https&sv=2022-11-02&sr=c&sig=96ga08wNqRfdZaDl4p0HZmn8dFRbiLHdx6TSg2xz4J4%3D"
1916
}
17+
},
18+
"Logitech": {
19+
"BlobUrl": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-30T08:14:22Z&se=2025-02-26T17:14:22Z&spr=https&sv=2022-11-02&sr=c&sig=QS7b551x72JjiLgJE2E7OQIABzf7H9kBwkHjp6xJ3HM%3D"
2020
}
21-
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"updatedDate": "2024-03-28T10:18:32.1597991+01:00",
3-
"appEndpoint": "https://app-ma-87fdfae99f524379-we-svc.azurewebsites.net/channel",
4-
"appEndpointStaging": "https://app-ma-87fdfae99f524379-we-svc-staging.azurewebsites.net/channel",
5-
"appId": "18b91a63-5b12-453a-8ea7-92cd7e07dfe8",
3+
"appEndpoint": "https://app-ma-2f818376bb244009-we-svc.azurewebsites.net/channel",
4+
"appEndpointStaging": "https://app-ma-2f818376bb244009-we-svc-staging.azurewebsites.net/channel",
5+
"appId": "e6e370a1-289a-4484-b7bf-4f6241b35991",
66
"cloudhostVersion": "ms.mrservices.meshapps:cloudhost_main_2311.2203_2.0.105",
7-
"InfraCreatedDate": "2024-04-29T10:46:57.148294+02:00",
7+
"InfraCreatedDate": "2024-04-30T11:33:13.8752984+02:00",
88
"deactivateAppInstanceWhenVacant": "False",
99
"enableAppMonitoring": "True",
1010
"entryPoint": "MIC-Maquette.dll",
1111
"instanceIdleTimeout": "30",
1212
"instanceResponseTimeout": "30",
1313
"language": "C#",
14-
"latestAppId": "87fdfae9-9f52-4379-8874-5e4464d129a5",
14+
"latestAppId": "2f818376-bb24-4009-bef9-715de10aee41",
1515
"location": "westeurope",
16-
"mode": "prod",
16+
"mode": "dev",
1717
"name": "MIC-Maquette",
1818
"resourceGroup": "rg-meshInnovateCreate-westeurope-dev-001",
1919
"subscriptionId": "1310286d-4161-404b-b6eb-6a936fac3555",
2020
"wasLastProvisionAppSuccessful": "True",
2121
"wasLastDeployAppSuccessful": null,
2222
"wasLastUploadBlobSuccessful": "True",
23-
"meshAppBuildId": "2ccc1841-96e8-4164-8f8d-cf9ddcb44a7b",
23+
"meshAppBuildId": "01329c52-3855-48f4-afbd-10c2e0a758ac",
2424
"debugTimeoutSecs": 120,
2525
"provisionState": "Inactive"
2626
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:fad1143b5d11925463d819af554c98a23b0f1aef10823931b4f5f3212be827d3
3-
size 335360
2+
oid sha256:96aae51ce62a03d9c56b92685ca41d7be585e4892ad01cd29033f849731cfc05
3+
size 333312
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:4794bf4b253d2c284f3b804f09bb227ea7d87ba9cdfe49f2b16480bf9598a840
2+
oid sha256:da972b62e93197be147a7b5edcb7c31823d764741bd039e536fe994c55522c18
33
size 149504

src/MIC/Assets/.MeshCloudScripting/MIC-Maquette/bin/Release/net6.0/appsettings.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{
23
"Logging": {
34
"LogLevel": {
@@ -15,7 +16,7 @@
1516
}
1617
},
1718
"Logitech": {
18-
"Blob": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-25T09:25:14Z&se=2024-04-25T17:25:14Z&spr=https&sv=2022-11-02&sr=c&sig=96ga08wNqRfdZaDl4p0HZmn8dFRbiLHdx6TSg2xz4J4%3D"
19+
"BlobUrl": "https://stma86a4449dc84f4d2bwe.blob.core.windows.net/logitech-descriptions/logitechDescriptions.json?sp=r&st=2024-04-25T09:25:14Z&se=2024-04-25T17:25:14Z&spr=https&sv=2022-11-02&sr=c&sig=96ga08wNqRfdZaDl4p0HZmn8dFRbiLHdx6TSg2xz4J4%3D"
1920
}
2021
}
21-
}
22+
}

0 commit comments

Comments
 (0)