SignalR for VB6 and CS

This commit is contained in:
Stoyan Zlatev
2024-03-04 12:22:40 +01:00
parent 6d3b039175
commit 80e1e7e8de
22 changed files with 422 additions and 122 deletions
+86 -26
View File
@@ -1,39 +1,99 @@
namespace CommonConsole
{
using SignalR;
using OmniPlus;
using OmniPlus.Features;
using OmniPlus.Features.Enums;
using System;
public class Program
{
const string URL = "http://sla12iis01.emea.sensus.net/LaaProductionWeb";
// const string URL = "http://localhost:52822/LaaProductionWeb/";
public static void Main()
{
var client = new DataHub();
client.Connect(URL);
client.DataReceived += data =>
var connection = new OmniUniProConnection("COM9");
connection.StateChenged += Console.WriteLine;
connection.Open();
connection.FactorySeal(false);
connection.ViewBuildInformation();
connection.ViewFactoryCorrection();
var defaults = connection.ViewInputVolume();
connection.Set(new RegisterSettings
{
for (int i = 0; i < data.Count; i++)
{
var proeprty = data.GetProperty(i);
var value = data.GetString(proeprty);
Console.WriteLine($"{proeprty} = {value}");
}
IntPart = defaults.IntPart,
Fraction = defaults.Fraction,
Size = defaults.Size,
Range = defaults.Range,
VolumePerPulseUnit = 0,
MeterUnits = (byte)MessurementUnits.CubicMeters,
FlowUnits = (byte)MessurementUnits.CubicMeters,
FlowRate = (byte)TimeUnits.Hours,
FactoryCorrection = 0,
FieldCorrection = 0,
PulseWeight = 0,
PulseWidth = 7,
PulseUpdate = 0,
});
Console.WriteLine();
};
var counter = 0;
while (true)
{
var dictionary = new DataDictionary();
dictionary.AddInt(nameof(counter), counter++);
dictionary.AddString("message", Console.ReadLine());
client.Send(dictionary);
}
connection.Close();
}
}
}
}
//--- Connected: COM9, 2400, 8, None, One
//>>> 01
//<<< 01-39-34-37-30-35-36-38-36-00
//>>> 07
//<<< 01-00
//>>> 13
//<<< 01-30-30-30-30-30-31-30-31-00
//>>> FD-3D
//<<< 01-87-F2-BA-00
//>>> FD-64-00-F2-BA-BD-51-33-44-07-00
//<<< 01
//>>> FD-02
//<<< 01-00-00-E1-84-06-00
//>>> FD-25-00-00-E1-84-06-00-00-00-30-00-00-00-07
//<<< 01
//--- Connected: COM9, 2400, 8, None, One
//>>> 01
//<<< 01-39-34-37-30-35-36-38-33-00
//>>> 07
//<<< 01-00
//>>> 13
//<<< 01-30-30-30-30-30-33-37-38-00
//>>> FD-3D
//<<< 01-0D-24-B3-00
//>>> FD-64-00-24-B3-18-01-33-44-09-00
//<<< 02
//>>> 17
//<<< 01-38-31-36-32-33-33-35-30-30-39-32-31-00
//>>> FD-08
//<<< 01-00
//>>> FD-02
//<<< 01-00-00-E1-84-06-00
//>>> FD-25-00-00-E1-84-06-00-00-00-30-00-00-00-07
//<<< 01
//--- Disconnected: COM9, 2400, 8, None, One
//--- Connected: COM9, 2400, 8, None, One
//>>> 01
//<<< 01-39-34-37-30-35-36-38-32-00
//>>> 07
//<<< 01-00
//>>> 13
//<<< 01-30-30-30-30-30-30-39-39-00
//>>> FD-3D
//<<< 01-CA-12-B3-00
//>>> FD-64-00-12-B3-39-11-33-44-06-00
//<<< 01
//>>> 17
//<<< 01-38-31-36-32-33-33-35-31-35-32-34-37-00
//>>> FD-08
//<<< 01-31
//>>> FD-02
//<<< 01-00-00-E1-84-06-00
//>>> FD-25-00-00-E1-84-06-00-00-00-30-00-00-00-07
//<<< 01
//--- Disconnected: COM9, 2400, 8, None, One