Make empty Grid/Border clickable on WPF
If you set Background="Transparent"
for the grid/border it will resolve the issue.
References
https://www.noesisengine.com/forums/viewtopic.php?t=931
If you set Background="Transparent"
for the grid/border it will resolve the issue.
References
https://www.noesisengine.com/forums/viewtopic.php?t=931
<StackPanel FocusManager.FocusedElement="{Binding ElementName=Box}"> <TextBox Name="Box" /> </StackPanel>
References
https://stackoverflow.com/questions/1345391/set-focus-on-textbox-in-wpf
import cv2 image = cv2.imread("sample.jpg") color = int(image[300, 300]) # if image type is b g r, then b g r value will be displayed. # if image is gray then color intensity will be displayed. print color
output: [ 73 89 102]
Refernces
https://stackoverflow.com/questions/12187354/get-rgb-value-opencv-python
S7Client client = new S7Client(); int result = client.ConnectTo("192.168.0.3", 0, 2); if (result != 0) { Console.WriteLine(client.ErrorText(result)); } else { byte[] dbBuffer = new byte[12]; result = client.DBRead(1, 0, 12, dbBuffer); var var1 = S7.GetIntAt(dbBuffer, 0); var var2 = S7.GetRealAt(dbBuffer, 2); var var4 = S7.GetDWordAt(dbBuffer, 8); Console.WriteLine(var1); Console.WriteLine(var2); Console.WriteLine(var4); }
References
https://github.com/fbarresi/Sharp7/wiki
https://github.com/S7NetPlus/s7netplus/wiki
http://gmiru.com/article/s7comm/
https://wiki.wireshark.org/S7comm
https://plc4x.incubator.apache.org/protocols/s7/index.html
You should use Nettoplcsim in this way
References
https://www.mesta-automation.com/nettoplcsim-how-to-connect-step-7-plc-sim-to-scadas/
http://nettoplcsim.sourceforge.net/
https://sourceforge.net/p/nettoplcsim/discussion/912717/thread/777cf7c4/?limit=25
Creating Generic HostBuilder
Nuget :
PM> Install-Package Microsoft.Extensions.Hosting -Version 3.1.2
The HostBuilder class is available from the following namespace,
using Microsoft.Extensions.Hosting;
Initialize the Host
Within Constructor of App class(file: App.xaml.cs) please add below code to build Host,
host = new HostBuilder() .ConfigureServices((hostContext, services) => { }).Build();
DI Container
host = new HostBuilder() .ConfigureServices((hostContext, services) => { //Add business services as needed services.AddScoped<IEmployeeViewModel, EmployeeViewModel>(); //Lets Create single tone instance of Master windows services.AddSingleton<EmployeeWindow>(); }).Build();
Setting up OnStartup and OnExit Application events
private void OnStartup(object sender, StartupEventArgs e) { var mainWindow = host.Services.GetService<EmployeeWindow>(); mainWindow.Show(); }
protected override async void OnExit(ExitEventArgs e) { using (host) { await host.StopAsync(); } base.OnExit(e); }
App.XAML file used as below,
<Application x:Class="WPFDesktopApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="OnStartup"> <Application.Resources> </Application.Resources> </Application>
References
https://www.thecodebuzz.com/dependency-injection-wpf-generic-hostbuilder-net-core/
https://laurentkempe.com/2019/09/03/WPF-and-dotnet-Generic-Host-with-dotnet-Core-3-0/
apt-get install --only-upgrade <packagename>
References
https://askubuntu.com/questions/44122/how-to-upgrade-a-single-package-using-apt-get
SMBv1 (client and server)
Detect:
Get-WindowsOptionalFeature -Online -FeatureName smb1protocol
Disable:
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable:
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol