This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
450 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
Copyright (c) 2018-2023 Festo SE & Co. KG <https://www.festo.com/net/de_de/Forms/web/contact_international> | ||
Author: Michael Hoffmeister | ||
This source code is licensed under the Apache License 2.0 (see LICENSE.txt). | ||
This source code may use other Open Source software components (see LICENSE.txt). | ||
*/ | ||
|
||
using AasxIntegrationBase; | ||
using AasxIntegrationBaseGdi; | ||
using AdminShellNS; | ||
using AnyUi; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace AasxPluginAssetInterfaceDescription | ||
{ | ||
/// <summary> | ||
/// This is thought as ONE service per ONE instance of AASX PE / BlazorExplorer | ||
/// to care for all (continous) interfacing. | ||
/// </summary> | ||
public class AidInterfaceService | ||
{ | ||
// | ||
// Start of service | ||
// | ||
|
||
private LogInstance _log = new LogInstance(); | ||
|
||
private const int _timerTickMs = 200; | ||
private System.Timers.Timer _dispatcherTimer = null; | ||
|
||
private AidAllInterfaceStatus _allInterfaceStatus = null; | ||
|
||
public void StartOperation(LogInstance log, AidAllInterfaceStatus allInterfaceStatus) | ||
{ | ||
_log = log; | ||
_allInterfaceStatus = allInterfaceStatus; | ||
|
||
_dispatcherTimer = new System.Timers.Timer(_timerTickMs); | ||
_dispatcherTimer.Elapsed += DispatcherTimer_Tick; | ||
_dispatcherTimer.Enabled = true; | ||
_dispatcherTimer.Start(); | ||
} | ||
|
||
// | ||
// Service | ||
// | ||
|
||
private bool _inDispatcherTimer = false; | ||
|
||
private void DispatcherTimer_Tick(object sender, EventArgs e) | ||
{ | ||
// access | ||
if (_allInterfaceStatus == null || _inDispatcherTimer) | ||
return; | ||
|
||
// block | ||
_inDispatcherTimer = true; | ||
|
||
// .. | ||
|
||
// release mutex | ||
_inDispatcherTimer = false; | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.