MagFluxToolbox: - start of test implementation
This commit is contained in:
@@ -14,5 +14,5 @@ using System.Reflection;
|
|||||||
//[assembly: AssemblyVersion("1.2.*.0")]
|
//[assembly: AssemblyVersion("1.2.*.0")]
|
||||||
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("2.4.2.*")]
|
[assembly: AssemblyVersion("2.4.3.*")]
|
||||||
[assembly: AssemblyFileVersion("2.4.2.0")]
|
[assembly: AssemblyFileVersion("2.4.3.0")]
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\..\..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\..\..\..\packages\NLog.4.6.7\lib\net45\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -113,6 +116,10 @@
|
|||||||
<Project>{26afcf1e-1287-48b8-a506-32b1e8a0dd0e}</Project>
|
<Project>{26afcf1e-1287-48b8-a506-32b1e8a0dd0e}</Project>
|
||||||
<Name>WaterMeterRegisters</Name>
|
<Name>WaterMeterRegisters</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\DataPackages\DataPackages.csproj">
|
||||||
|
<Project>{BA17D20E-0CEB-4B27-9772-2392BD750ED5}</Project>
|
||||||
|
<Name>DataPackages</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\MagFluxConfig\MagFluxConfig.csproj">
|
<ProjectReference Include="..\MagFluxConfig\MagFluxConfig.csproj">
|
||||||
<Project>{70398b99-b134-4bbd-968b-7399b70c3ce2}</Project>
|
<Project>{70398b99-b134-4bbd-968b-7399b70c3ce2}</Project>
|
||||||
<Name>MagFluxConfig</Name>
|
<Name>MagFluxConfig</Name>
|
||||||
|
|||||||
@@ -2,13 +2,21 @@
|
|||||||
using NLog;
|
using NLog;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Xylem.Common.CommonCore.Consts;
|
using Xylem.Common.CommonCore.Consts;
|
||||||
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
|
using Xylem.Common.Hardware.Interfaces.Ports.PortCore;
|
||||||
|
using Xylem.Common.Hardware.Interfaces.Ports.PortCore.EventArguments;
|
||||||
using Xylem.Common.Hardware.Interfaces.Ports.SerialPorts;
|
using Xylem.Common.Hardware.Interfaces.Ports.SerialPorts;
|
||||||
|
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore;
|
||||||
|
using Xylem.Common.Hardware.Interfaces.Protocols.ProtocolCore.EventArguments;
|
||||||
using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol;
|
using Xylem.Common.Hardware.Interfaces.Protocols.TransmitProtocol;
|
||||||
using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol;
|
using Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.StreamingProtocol;
|
||||||
|
using Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.EventArguments;
|
||||||
|
using Xylem.Common.Hardware.WaterMeter.MagFlux.DataPackages.MeasurementRecords;
|
||||||
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig;
|
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig;
|
||||||
|
using Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxConfig.Const;
|
||||||
using Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol;
|
using Xylem.Common.Hardware.WaterMeter.MagFlux.Protocols.RequestProtocol;
|
||||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
|
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore.Consts;
|
||||||
@@ -72,6 +80,17 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
|
|
||||||
#region variables and properties
|
#region variables and properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of ongoing measurements, base- and calibration-measurements
|
||||||
|
/// </summary>
|
||||||
|
private List<IMeasurement> _listOfIMeasurement = new List<IMeasurement>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Quality watch mode can be used to decode intermediate records and check
|
||||||
|
/// for actual quality of the measurements.
|
||||||
|
/// </summary>
|
||||||
|
public Boolean QualityWatchMode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represent pcb serial number
|
/// Represent pcb serial number
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -134,10 +153,62 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// do not use it to set ProcessStatus
|
||||||
|
/// if you want to change ProcessStatus of this genesis use <see cref="ProcessStatus" />
|
||||||
|
/// <see cref="_myProcessStatus" /> is just store for some routines
|
||||||
|
/// </summary>
|
||||||
|
private ProcessState _myProcessStatus;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
/// if state is change
|
||||||
|
/// <see cref="OnProcessStatusChanged" />
|
||||||
|
/// will be invoked.
|
||||||
|
/// on some states other events will be invoke as well
|
||||||
public ProcessState ProcessStatus
|
public ProcessState ProcessStatus
|
||||||
{
|
{
|
||||||
get;
|
get
|
||||||
|
{
|
||||||
|
return _myProcessStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_myProcessStatus == value)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_myProcessStatus = value;
|
||||||
|
Invoker(OnProcessStatusChanged);
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case ProcessState.InitIsActive:
|
||||||
|
Invoker(OnInitCompleted);
|
||||||
|
break;
|
||||||
|
case ProcessState.MeasurementIsActive:
|
||||||
|
Invoker(OnMeasurementInitCompleted);
|
||||||
|
break;
|
||||||
|
case ProcessState.MeasurementIsDone:
|
||||||
|
Invoker(OnMeasurementCompleted);
|
||||||
|
break;
|
||||||
|
case ProcessState.CalibrationIsActive:
|
||||||
|
Invoker(OnCalibInitCompleted);
|
||||||
|
break;
|
||||||
|
case ProcessState.CalibrationIsDone:
|
||||||
|
Invoker(OnCalibCompleted);
|
||||||
|
break;
|
||||||
|
case ProcessState.QRefDone:
|
||||||
|
case ProcessState.WaitForQRef:
|
||||||
|
case ProcessState.WaitForCalibration:
|
||||||
|
case ProcessState.WaitForMeasurement:
|
||||||
|
case ProcessState.IsNotInit:
|
||||||
|
//no extra event needed
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new OverflowException("MagFlux measurement unknown process status");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -295,7 +366,7 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
/// If you have a password for highest access level you need, if you don't want to access the meter
|
/// If you have a password for highest access level you need, if you don't want to access the meter
|
||||||
/// (just read led record) than you can leave it nullS
|
/// (just read led record) than you can leave it nullS
|
||||||
/// </param>
|
/// </param>
|
||||||
public void SetupMagFluxMeter(Int32 slot, PortConfig? requestPort, PortConfig? streamingPort,
|
private void SetupMagFluxMeter(Int32 slot, PortConfig? requestPort, PortConfig? streamingPort,
|
||||||
Boolean ignoreCorruptedData = true, String password = "")
|
Boolean ignoreCorruptedData = true, String password = "")
|
||||||
{
|
{
|
||||||
Slot = slot;
|
Slot = slot;
|
||||||
@@ -304,12 +375,10 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
|
|
||||||
if (requestPort != null)
|
if (requestPort != null)
|
||||||
{
|
{
|
||||||
String requestIdent;
|
|
||||||
if (requestPort.Value.Type == "Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.UartSerialPort")
|
if (requestPort.Value.Type == "Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.UartSerialPort")
|
||||||
{
|
{
|
||||||
requestIdent = $"Slot:{Slot}, Port:{requestPort.Value.PortName}, Protocol:Request, Type:UART -";
|
var requestIdent = $"Slot:{Slot}, Port:{requestPort.Value.PortName}, Protocol:Request, Type:UART -";
|
||||||
|
|
||||||
//CRC calculation does include the CRC itself filled with 0x0000 in advance
|
|
||||||
RequestProtocol = new RequestProtocol(requestIdent);
|
RequestProtocol = new RequestProtocol(requestIdent);
|
||||||
TransmitProtocol = new UartTransmitProtocol(requestPort.Value.PortName);
|
TransmitProtocol = new UartTransmitProtocol(requestPort.Value.PortName);
|
||||||
RequestProtocol.SetTransmitProtocol(TransmitProtocol);
|
RequestProtocol.SetTransmitProtocol(TransmitProtocol);
|
||||||
@@ -335,86 +404,162 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region logging
|
|
||||||
private void SetLogger()
|
|
||||||
{
|
|
||||||
if (_logger != null)
|
|
||||||
{
|
|
||||||
LogManager.Flush();
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(CurrentActionText))
|
|
||||||
{
|
|
||||||
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}", $"", "Meter", "MeterBase", "MeterBase");
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var id = !string.IsNullOrEmpty(SerialNumber) ? $"SN{SerialNumber}" : $"PCB{PcbId}";
|
|
||||||
|
|
||||||
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}_{id}_{CurrentActionText}", $"Slot", "Meter", "MeterBase", "MeterBase");
|
|
||||||
if (StreamingPort != null && StreamingPort is LedSerialPort)
|
|
||||||
{
|
|
||||||
var streamingIdent = $"LedRawData_Slot_{Slot}_{id}_{CurrentActionText}";
|
|
||||||
|
|
||||||
((LedSerialPort)StreamingPort).Ident = streamingIdent;
|
|
||||||
((LedSerialPort)StreamingPort).RefreshLogger();
|
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(SerialNumber) && CurrentActionText.Contains("PG"))
|
|
||||||
{
|
|
||||||
|
|
||||||
var pathMain = NLogHelper.GetPath(_logger);
|
|
||||||
var pathRaw = NLogHelper.GetPath(((LedSerialPort)StreamingPort).GetRawLogger());
|
|
||||||
|
|
||||||
var basePath = Path.GetDirectoryName(pathMain);
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
var testRunString = CurrentActionText.Replace("PG", "");
|
|
||||||
var lastChat = pathMain.LastIndexOf('\\');
|
|
||||||
pathMain = pathMain.Substring(lastChat + 1);
|
|
||||||
pathRaw = Path.GetFileName(pathRaw);
|
|
||||||
|
|
||||||
var tmpUrl = $"http://10.49.40.25/MeterProcessState/api/TestBench/SetMeterLogPathInfo?SerialNumber={SerialNumber}&TestRunId={testRunString}&BasePath={basePath}&MainLogName={pathMain}&LEDName={pathRaw}";
|
|
||||||
_logger.Debug($"Request Url: { tmpUrl}");
|
|
||||||
//ToDO: Update to service URl
|
|
||||||
LocalWebRequest.GetRequest(tmpUrl);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Start Event listening, has to be called after <see cref="SetupMagFluxMeter" />
|
||||||
|
/// </summary>
|
||||||
public void ConnectMeter()
|
public void ConnectMeter()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
if (RequestPort != null && RequestPort.GetPortName() != BaseSerialPort.PortNotAssigned)
|
||||||
|
{
|
||||||
|
LinkPortToProtocol(RequestPort, RequestProtocol);
|
||||||
|
_logger.Trace($"Slot:{Slot} - RequestPort and RequestProtocol linked");
|
||||||
|
RequestProtocol.OnRecordIsDecoded += RequestProtocol_ApplyDecodedRecord;
|
||||||
|
}
|
||||||
|
if (StreamingPort != null && StreamingPort.GetPortName() != BaseSerialPort.PortNotAssigned)
|
||||||
|
{
|
||||||
|
LinkPortToProtocol(StreamingPort, StreamingProtocol);
|
||||||
|
_logger.Trace($"Slot:{Slot} - StreamingPort and StreamingProtocol linked");
|
||||||
|
StreamingProtocol.OnRecordIsDecoded += StreamingProtocol_ApplyDecodedRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.Debug($"Slot:{Slot} - Connected and communication started");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a port to working queue
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="port">On <see cref="IPort" /> should one once added in runtime</param>
|
||||||
|
/// <param name="protocol"></param>
|
||||||
|
public void LinkPortToProtocol(IPort port, IProtocol protocol)
|
||||||
|
{
|
||||||
|
//for streaming mode only
|
||||||
|
if (port == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
port.OnRawRecordReceived += delegate (Object o, BasePortDataEventArgs rawMsg)
|
||||||
|
{
|
||||||
|
protocol.FillDecodingBuffer(rawMsg);
|
||||||
|
};
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!port.IsOpen())
|
||||||
|
{
|
||||||
|
port.Open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new ApplicationException($"Cannot Open Comport. Check TaskManager for other Genesis relevant programs and close them. Also check if the comport is valid! { Environment.NewLine }{ ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
protocol.OnRecordReadyToSend += delegate (Object o, BasePortDataEventArgs dataToSend)
|
||||||
|
{
|
||||||
|
var data = (List<Byte>)dataToSend.GetData();
|
||||||
|
port.PortWrite(data.ToArray());
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Synchronization of the record for the streaming interface
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="markRecord"></param>
|
||||||
|
/// <exception cref="ApplicationException"></exception>
|
||||||
|
public void SyncStreamingBuffer(SyncMarkRecord markRecord)
|
||||||
|
{
|
||||||
|
if (StreamingPort == null)
|
||||||
|
{
|
||||||
|
throw new ApplicationException("Synchronization not possible due to undefined streaming port");
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamingPort.SynchronizeReceiveBuffer(markRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RequestProtocol_AuthorizationGrant(Object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
_logger.Debug($"Slot:{Slot} - Authorization succeeded");
|
||||||
|
|
||||||
|
}
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData = true)
|
public void SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData = true)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
SetupFromConfigFile(slot, ignoreCorruptedData, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Setup water meter from configuration file:
|
||||||
|
/// -slot,
|
||||||
|
/// -streaming protocol,
|
||||||
|
/// -streaming port
|
||||||
|
/// -request port
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="slot"></param>
|
||||||
|
/// <param name="ignoreCorruptedData"></param>
|
||||||
|
/// <param name="useRequest"></param>
|
||||||
|
/// <param name="useStreaming"></param>
|
||||||
|
/// <exception cref="ApplicationException"></exception>
|
||||||
|
public void SetupFromConfigFile(Int32 slot, Boolean ignoreCorruptedData, Boolean useRequest, Boolean useStreaming)
|
||||||
|
{
|
||||||
|
|
||||||
|
Slot = slot;
|
||||||
|
SetLogger();
|
||||||
|
|
||||||
|
|
||||||
|
var configFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(MagFlux), ProgramConfig.SerialConfigFileName);
|
||||||
|
|
||||||
|
if (!File.Exists(configFile))
|
||||||
|
{
|
||||||
|
configFile = Path.Combine(ProgramConfig.SerialConfigFileName);
|
||||||
|
if (!File.Exists(configFile))
|
||||||
|
{
|
||||||
|
throw new ApplicationException($"Configuration file {configFile} not found ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var tr = new StreamReader(configFile);
|
||||||
|
var slotConfigList = JsonConvert.DeserializeObject<SlotConfig[]>(tr.ReadToEnd());
|
||||||
|
|
||||||
|
var slotConfig = slotConfigList.FirstOrDefault(t => t.Slot == slot);
|
||||||
|
|
||||||
|
if (slotConfig == null)
|
||||||
|
{
|
||||||
|
throw new ApplicationException($"Slot:{slot} - File " +
|
||||||
|
$"{ProgramConfig.SerialConfigFileName} does not contain valid configuration");
|
||||||
|
}
|
||||||
|
_logger.Debug($"Slot:{slot} - Configuration loaded");
|
||||||
|
if (!useRequest)
|
||||||
|
{
|
||||||
|
SetupMagFluxMeter(slot, null, slotConfig.Streaming, ignoreCorruptedData);
|
||||||
|
}
|
||||||
|
else if (!useStreaming)
|
||||||
|
{
|
||||||
|
SetupMagFluxMeter(slot, slotConfig.Request, null, ignoreCorruptedData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetupMagFluxMeter(slot, slotConfig.Request, slotConfig.Streaming, ignoreCorruptedData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Boolean Logout()
|
public Boolean Logout()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Boolean Login()
|
public Boolean Login()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Boolean Login(String password, Boolean runImmediately = true, Boolean skipReadMeterFwAndAssignRegisters = false)
|
public Boolean Login(String password, Boolean runImmediately = true, Boolean skipReadMeterFwAndAssignRegisters = false)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -426,13 +571,35 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void StartMeasurement()
|
public void StartMeasurement()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
_listOfIMeasurement = new List<IMeasurement>
|
||||||
|
{
|
||||||
|
new BaseMeasurement(Slot, typeof(MagFluxRecord), IntermediateUpdateTimeS)
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var measurement in _listOfIMeasurement)
|
||||||
|
{
|
||||||
|
measurement.OnActionStateHasChanged += Measurement_ActionStateHasChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.Info($"Slot:{Slot} - Start measurement");
|
||||||
|
|
||||||
|
ProcessStatus = ProcessState.MeasurementIsActive;
|
||||||
|
_listOfIMeasurement.ForEach(m => m.MeasurementState = MeasurementStates.IsWaitingForStartData);
|
||||||
|
SyncStreamingBuffer(SyncMarkRecord.SyncStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void StopMeasurement()
|
public void StopMeasurement()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
_logger.Info($"Slot:{Slot} - Stop measurement");
|
||||||
|
ProcessStatus = ProcessState.MeasurementIsDone;
|
||||||
|
_listOfIMeasurement.ForEach(m => m.MeasurementState = MeasurementStates.IsWaitingForEndData);
|
||||||
|
SyncStreamingBuffer(SyncMarkRecord.SyncEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Measurement_ActionStateHasChanged(Object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SyncStreamingBuffer(SyncMarkRecord.DecodeIntermediate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -537,7 +704,186 @@ namespace Xylem.Common.Hardware.WaterMeter.MagFlux.MagFluxCore
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void DisposeMeter()
|
public void DisposeMeter()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddData(IMeasurementRecord newRecord)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (var measurement in _listOfIMeasurement)
|
||||||
|
{
|
||||||
|
if (measurement.GetType() != newRecord.GetType())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (measurement.GetChannel() == newRecord.GetChannel())
|
||||||
|
{
|
||||||
|
measurement.AddData(newRecord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// when every measurement has state IsRunning or every measurement has state IsCompleted, the streaming buffer set to skip decoding
|
||||||
|
if (_listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsRunning)
|
||||||
|
|| _listOfIMeasurement.All(m => m.MeasurementState == MeasurementStates.IsCompleted))
|
||||||
|
{
|
||||||
|
SyncStreamingBuffer(QualityWatchMode
|
||||||
|
? SyncMarkRecord.DecodeIntermediateQuality
|
||||||
|
: SyncMarkRecord.SkipDecoding);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
|
//public event EventHandler<StringEventArgs> HasInformationForCaller;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnCalibCompleted;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnErrorStatusChanged;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnProcessStatusChanged;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnCalibInitCompleted;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnInitCompleted;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnMeasurementInitCompleted;
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IMeter" />
|
||||||
|
public event EventHandler OnMeasurementCompleted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Response received after request for record
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<RequestResponseDataEventArgs> OnRequestRecordReceived;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// call this if session is expired and you need an re-authorization
|
||||||
|
/// </summary>
|
||||||
|
//public EventHandler<AuthorizationRequiredEventArgs> AuthorizationRequired;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A helper to invoke events only if someone is listening, otherwise nothing will happen
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="handler">Event handler to call</param>
|
||||||
|
/// <param name="sender">Sender (can be null)</param>
|
||||||
|
/// <param name="e">Event arguments (can be null)</param>
|
||||||
|
private void Invoker(EventHandler handler, Object sender = null, EventArgs e = null)
|
||||||
|
{
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
if (sender == null)
|
||||||
|
{
|
||||||
|
sender = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e == null)
|
||||||
|
{
|
||||||
|
e = new EventArgs();
|
||||||
|
}
|
||||||
|
|
||||||
|
handler.Invoke(sender, e);
|
||||||
|
}
|
||||||
|
// ReSharper disable once RedundantIfElseBlock
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//nobody is listening
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Track all incoming led record packages (Calibration and Flow)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e">
|
||||||
|
/// I should be <see cref="FlowTestRecord" /> or <see cref="CalibDataEventArgs" />
|
||||||
|
/// otherwise this method does nothing
|
||||||
|
/// </param>
|
||||||
|
private void StreamingProtocol_ApplyDecodedRecord(Object sender, BaseDataEventArgs e)
|
||||||
|
{
|
||||||
|
var result = e.GetEventData();
|
||||||
|
if (result is IMeasurementRecord)
|
||||||
|
{
|
||||||
|
if (result is MagFluxRecord)
|
||||||
|
{
|
||||||
|
if (!((MagFluxRecord)result).IsValid)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
AddData(((IMeasurementRecord)result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tracking request record processing
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void RequestProtocol_ApplyDecodedRecord(Object sender, BaseDataEventArgs e)
|
||||||
|
{
|
||||||
|
if (e is RequestResponseDataEventArgs)
|
||||||
|
{
|
||||||
|
OnRequestRecordReceived?.Invoke(sender, (RequestResponseDataEventArgs)e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region logging
|
||||||
|
private void SetLogger()
|
||||||
|
{
|
||||||
|
if (_logger != null)
|
||||||
|
{
|
||||||
|
LogManager.Flush();
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(CurrentActionText))
|
||||||
|
{
|
||||||
|
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}", $"", "Meter", "MeterBase", "MeterBase");
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var id = !string.IsNullOrEmpty(SerialNumber) ? $"SN{SerialNumber}" : $"PCB{PcbId}";
|
||||||
|
|
||||||
|
_logger = NLogHelper.CreateOrGetMultiLogger($"Slot:{Slot}_{id}_{CurrentActionText}", $"Slot", "Meter", "MeterBase", "MeterBase");
|
||||||
|
if (StreamingPort != null && StreamingPort is LedSerialPort)
|
||||||
|
{
|
||||||
|
var streamingIdent = $"LedRawData_Slot_{Slot}_{id}_{CurrentActionText}";
|
||||||
|
|
||||||
|
((LedSerialPort)StreamingPort).Ident = streamingIdent;
|
||||||
|
((LedSerialPort)StreamingPort).RefreshLogger();
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(SerialNumber) && CurrentActionText.Contains("PG"))
|
||||||
|
{
|
||||||
|
|
||||||
|
var pathMain = NLogHelper.GetPath(_logger);
|
||||||
|
var pathRaw = NLogHelper.GetPath(((LedSerialPort)StreamingPort).GetRawLogger());
|
||||||
|
|
||||||
|
var basePath = Path.GetDirectoryName(pathMain);
|
||||||
|
|
||||||
|
var testRunString = CurrentActionText.Replace("PG", "");
|
||||||
|
var lastChat = pathMain.LastIndexOf('\\');
|
||||||
|
pathMain = pathMain.Substring(lastChat + 1);
|
||||||
|
pathRaw = Path.GetFileName(pathRaw);
|
||||||
|
|
||||||
|
//var tmpUrl = $"http://10.49.40.25/MeterProcessState/api/TestBench/SetMeterLogPathInfo?SerialNumber={SerialNumber}&TestRunId={testRunString}&BasePath={basePath}&MainLogName={pathMain}&LEDName={pathRaw}";
|
||||||
|
//_logger.Debug($"Request Url: { tmpUrl}");
|
||||||
|
////ToDO: Update to service URl
|
||||||
|
//LocalWebRequest.GetRequest(tmpUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||||
<package id="NLog" version="4.6.7" targetFramework="net48" />
|
<package id="NLog" version="4.6.7" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -1,46 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<section name="Xylem.Common.Ui.GenesisToolBox.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Xylem.Common.Ui.GenesisToolBox.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
<Xylem.Common.Ui.GenesisToolBox.Properties.Settings>
|
<Xylem.Common.Ui.GenesisToolBox.Properties.Settings>
|
||||||
<setting name="InitialBinaryPath" serializeAs="String">
|
<setting name="InitialBinaryPath" serializeAs="String">
|
||||||
<value />
|
<value/>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="InitialPackageFile" serializeAs="String">
|
<setting name="InitialPackageFile" serializeAs="String">
|
||||||
<value />
|
<value/>
|
||||||
</setting>
|
</setting>
|
||||||
</Xylem.Common.Ui.GenesisToolBox.Properties.Settings>
|
</Xylem.Common.Ui.GenesisToolBox.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="AdminName" value="My Name" />
|
<add key="AdminName" value="My Name"/>
|
||||||
<add key="AdminEMail" value="MyEMailAddress" />
|
<add key="AdminEMail" value="MyEMailAddress"/>
|
||||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
<add key="ClientSettingsProvider.ServiceUri" value=""/>
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
|
||||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<system.web>
|
<system.web>
|
||||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||||
<providers>
|
<providers>
|
||||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
|
||||||
</providers>
|
</providers>
|
||||||
</membership>
|
</membership>
|
||||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||||
<providers>
|
<providers>
|
||||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
|
||||||
</providers>
|
</providers>
|
||||||
</roleManager>
|
</roleManager>
|
||||||
</system.web>
|
</system.web>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
<LangVersion>7.0</LangVersion>
|
<LangVersion>7.0</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ManifestCertificateThumbprint>14673934DFE995F28E9579F4A18DBDA05F7C1AFE</ManifestCertificateThumbprint>
|
<ManifestCertificateThumbprint>14673934DFE995F28E9579F4A18DBDA05F7C1AFE</ManifestCertificateThumbprint>
|
||||||
@@ -115,6 +116,7 @@
|
|||||||
<LangVersion>7.0</LangVersion>
|
<LangVersion>7.0</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
@@ -125,6 +127,7 @@
|
|||||||
<LangVersion>7.0</LangVersion>
|
<LangVersion>7.0</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'PerformTest|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -146,6 +149,7 @@
|
|||||||
<LangVersion>7.0</LangVersion>
|
<LangVersion>7.0</LangVersion>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ namespace Xylem.Common.Ui.GenesisToolBox.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ namespace Xylem.Common.Ui.GenesisToolBox.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
+159
-386
@@ -30,25 +30,12 @@
|
|||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
this.grpSetup = new System.Windows.Forms.GroupBox();
|
this.grpSetup = new System.Windows.Forms.GroupBox();
|
||||||
this.btnClearDisplay = new System.Windows.Forms.Button();
|
|
||||||
this.label10 = new System.Windows.Forms.Label();
|
|
||||||
this.tbxRadio = new System.Windows.Forms.TextBox();
|
|
||||||
this.tbxRegion = new System.Windows.Forms.TextBox();
|
|
||||||
this.label8 = new System.Windows.Forms.Label();
|
|
||||||
this.tbxPcbId = new System.Windows.Forms.TextBox();
|
this.tbxPcbId = new System.Windows.Forms.TextBox();
|
||||||
this.tbxMeterFw = new System.Windows.Forms.TextBox();
|
|
||||||
this.tbxMeterMeterSize = new System.Windows.Forms.TextBox();
|
|
||||||
this.tbxMeterLutCrc = new System.Windows.Forms.TextBox();
|
|
||||||
this.label5 = new System.Windows.Forms.Label();
|
|
||||||
this.label6 = new System.Windows.Forms.Label();
|
|
||||||
this.lblFwVersion = new System.Windows.Forms.Label();
|
|
||||||
this.btnConnect = new System.Windows.Forms.Button();
|
this.btnConnect = new System.Windows.Forms.Button();
|
||||||
this.lblConnectPcb = new System.Windows.Forms.Label();
|
this.lblConnectPcb = new System.Windows.Forms.Label();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.cbComSlot = new System.Windows.Forms.ComboBox();
|
this.cbComSlot = new System.Windows.Forms.ComboBox();
|
||||||
this.lblWaitingForMeterResponse = new System.Windows.Forms.Label();
|
this.lblWaitingForMeterResponse = new System.Windows.Forms.Label();
|
||||||
this.btnStopFwUpdate = new System.Windows.Forms.Button();
|
|
||||||
this.btnDownloadLutFile = new System.Windows.Forms.Button();
|
|
||||||
this.lblOverall = new System.Windows.Forms.Label();
|
this.lblOverall = new System.Windows.Forms.Label();
|
||||||
this.barSingleProgressUpdate = new System.Windows.Forms.ProgressBar();
|
this.barSingleProgressUpdate = new System.Windows.Forms.ProgressBar();
|
||||||
this.lblActualProcess = new System.Windows.Forms.Label();
|
this.lblActualProcess = new System.Windows.Forms.Label();
|
||||||
@@ -56,100 +43,41 @@
|
|||||||
this.tmrProgressUpdate = new System.Windows.Forms.Timer(this.components);
|
this.tmrProgressUpdate = new System.Windows.Forms.Timer(this.components);
|
||||||
this.dlgOpenLuFile = new System.Windows.Forms.OpenFileDialog();
|
this.dlgOpenLuFile = new System.Windows.Forms.OpenFileDialog();
|
||||||
this.lblFwUpdateInfo = new System.Windows.Forms.Label();
|
this.lblFwUpdateInfo = new System.Windows.Forms.Label();
|
||||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
|
||||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
|
||||||
this.btnLoadfromDb = new System.Windows.Forms.Button();
|
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
|
||||||
this.rbtProd = new System.Windows.Forms.RadioButton();
|
|
||||||
this.cbxDbLuts = new System.Windows.Forms.ComboBox();
|
|
||||||
this.rbtDb = new System.Windows.Forms.RadioButton();
|
|
||||||
this.rbtFile = new System.Windows.Forms.RadioButton();
|
|
||||||
this.lblSelectDb = new System.Windows.Forms.Label();
|
|
||||||
this.tbxFileMeterSize = new System.Windows.Forms.TextBox();
|
|
||||||
this.tbxFileCrc = new System.Windows.Forms.TextBox();
|
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
|
||||||
this.lblLutFileLoadedInfo = new System.Windows.Forms.Label();
|
|
||||||
this.tbxLutFilePathName = new System.Windows.Forms.TextBox();
|
|
||||||
this.lvlSelechtFile = new System.Windows.Forms.Label();
|
|
||||||
this.btnOpenLutFile = new System.Windows.Forms.Button();
|
|
||||||
this.label9 = new System.Windows.Forms.Label();
|
this.label9 = new System.Windows.Forms.Label();
|
||||||
this.lblUpdateTime = new System.Windows.Forms.Label();
|
this.lblUpdateTime = new System.Windows.Forms.Label();
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
this.picLogo = new System.Windows.Forms.PictureBox();
|
||||||
|
this.grpBoxInfo = new System.Windows.Forms.GroupBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||||
|
this.textBox5 = new System.Windows.Forms.TextBox();
|
||||||
|
this.textBox6 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.label7 = new System.Windows.Forms.Label();
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.label11 = new System.Windows.Forms.Label();
|
||||||
this.grpSetup.SuspendLayout();
|
this.grpSetup.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
this.groupBox1.SuspendLayout();
|
((System.ComponentModel.ISupportInitialize)(this.picLogo)).BeginInit();
|
||||||
|
this.grpBoxInfo.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// grpSetup
|
// grpSetup
|
||||||
//
|
//
|
||||||
this.grpSetup.Controls.Add(this.btnClearDisplay);
|
|
||||||
this.grpSetup.Controls.Add(this.label10);
|
|
||||||
this.grpSetup.Controls.Add(this.tbxRadio);
|
|
||||||
this.grpSetup.Controls.Add(this.tbxRegion);
|
|
||||||
this.grpSetup.Controls.Add(this.label8);
|
|
||||||
this.grpSetup.Controls.Add(this.tbxPcbId);
|
this.grpSetup.Controls.Add(this.tbxPcbId);
|
||||||
this.grpSetup.Controls.Add(this.tbxMeterFw);
|
|
||||||
this.grpSetup.Controls.Add(this.tbxMeterMeterSize);
|
|
||||||
this.grpSetup.Controls.Add(this.tbxMeterLutCrc);
|
|
||||||
this.grpSetup.Controls.Add(this.label5);
|
|
||||||
this.grpSetup.Controls.Add(this.label6);
|
|
||||||
this.grpSetup.Controls.Add(this.lblFwVersion);
|
|
||||||
this.grpSetup.Controls.Add(this.btnConnect);
|
this.grpSetup.Controls.Add(this.btnConnect);
|
||||||
this.grpSetup.Controls.Add(this.lblConnectPcb);
|
this.grpSetup.Controls.Add(this.lblConnectPcb);
|
||||||
this.grpSetup.Controls.Add(this.label2);
|
this.grpSetup.Controls.Add(this.label2);
|
||||||
this.grpSetup.Controls.Add(this.cbComSlot);
|
this.grpSetup.Controls.Add(this.cbComSlot);
|
||||||
this.grpSetup.Location = new System.Drawing.Point(12, 69);
|
this.grpSetup.Location = new System.Drawing.Point(100, 5);
|
||||||
this.grpSetup.Name = "grpSetup";
|
this.grpSetup.Name = "grpSetup";
|
||||||
this.grpSetup.Size = new System.Drawing.Size(257, 273);
|
this.grpSetup.Size = new System.Drawing.Size(257, 100);
|
||||||
this.grpSetup.TabIndex = 24;
|
this.grpSetup.TabIndex = 24;
|
||||||
this.grpSetup.TabStop = false;
|
this.grpSetup.TabStop = false;
|
||||||
this.grpSetup.Text = "Cordonel";
|
this.grpSetup.Text = "Setup";
|
||||||
//
|
|
||||||
// btnClearDisplay
|
|
||||||
//
|
|
||||||
this.btnClearDisplay.Location = new System.Drawing.Point(128, 239);
|
|
||||||
this.btnClearDisplay.Name = "btnClearDisplay";
|
|
||||||
this.btnClearDisplay.Size = new System.Drawing.Size(116, 25);
|
|
||||||
this.btnClearDisplay.TabIndex = 33;
|
|
||||||
this.btnClearDisplay.Text = "Release Display";
|
|
||||||
this.btnClearDisplay.UseVisualStyleBackColor = true;
|
|
||||||
this.btnClearDisplay.Click += new System.EventHandler(this.btnClearDisplay_Click);
|
|
||||||
//
|
|
||||||
// label10
|
|
||||||
//
|
|
||||||
this.label10.AutoSize = true;
|
|
||||||
this.label10.Location = new System.Drawing.Point(10, 212);
|
|
||||||
this.label10.Name = "label10";
|
|
||||||
this.label10.Size = new System.Drawing.Size(116, 13);
|
|
||||||
this.label10.TabIndex = 36;
|
|
||||||
this.label10.Text = "Radio frequency[MHz]:";
|
|
||||||
//
|
|
||||||
// tbxRadio
|
|
||||||
//
|
|
||||||
this.tbxRadio.Location = new System.Drawing.Point(128, 208);
|
|
||||||
this.tbxRadio.Name = "tbxRadio";
|
|
||||||
this.tbxRadio.ReadOnly = true;
|
|
||||||
this.tbxRadio.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxRadio.TabIndex = 35;
|
|
||||||
//
|
|
||||||
// tbxRegion
|
|
||||||
//
|
|
||||||
this.tbxRegion.Location = new System.Drawing.Point(128, 178);
|
|
||||||
this.tbxRegion.Name = "tbxRegion";
|
|
||||||
this.tbxRegion.ReadOnly = true;
|
|
||||||
this.tbxRegion.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxRegion.TabIndex = 34;
|
|
||||||
//
|
|
||||||
// label8
|
|
||||||
//
|
|
||||||
this.label8.AutoSize = true;
|
|
||||||
this.label8.Location = new System.Drawing.Point(10, 182);
|
|
||||||
this.label8.Name = "label8";
|
|
||||||
this.label8.Size = new System.Drawing.Size(44, 13);
|
|
||||||
this.label8.TabIndex = 33;
|
|
||||||
this.label8.Text = "Region:";
|
|
||||||
//
|
//
|
||||||
// tbxPcbId
|
// tbxPcbId
|
||||||
//
|
//
|
||||||
@@ -159,57 +87,6 @@
|
|||||||
this.tbxPcbId.Size = new System.Drawing.Size(68, 20);
|
this.tbxPcbId.Size = new System.Drawing.Size(68, 20);
|
||||||
this.tbxPcbId.TabIndex = 32;
|
this.tbxPcbId.TabIndex = 32;
|
||||||
//
|
//
|
||||||
// tbxMeterFw
|
|
||||||
//
|
|
||||||
this.tbxMeterFw.Location = new System.Drawing.Point(128, 88);
|
|
||||||
this.tbxMeterFw.Name = "tbxMeterFw";
|
|
||||||
this.tbxMeterFw.ReadOnly = true;
|
|
||||||
this.tbxMeterFw.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxMeterFw.TabIndex = 31;
|
|
||||||
//
|
|
||||||
// tbxMeterMeterSize
|
|
||||||
//
|
|
||||||
this.tbxMeterMeterSize.Location = new System.Drawing.Point(128, 148);
|
|
||||||
this.tbxMeterMeterSize.Name = "tbxMeterMeterSize";
|
|
||||||
this.tbxMeterMeterSize.ReadOnly = true;
|
|
||||||
this.tbxMeterMeterSize.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxMeterMeterSize.TabIndex = 30;
|
|
||||||
//
|
|
||||||
// tbxMeterLutCrc
|
|
||||||
//
|
|
||||||
this.tbxMeterLutCrc.Location = new System.Drawing.Point(128, 118);
|
|
||||||
this.tbxMeterLutCrc.Name = "tbxMeterLutCrc";
|
|
||||||
this.tbxMeterLutCrc.ReadOnly = true;
|
|
||||||
this.tbxMeterLutCrc.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxMeterLutCrc.TabIndex = 29;
|
|
||||||
//
|
|
||||||
// label5
|
|
||||||
//
|
|
||||||
this.label5.AutoSize = true;
|
|
||||||
this.label5.Location = new System.Drawing.Point(10, 152);
|
|
||||||
this.label5.Name = "label5";
|
|
||||||
this.label5.Size = new System.Drawing.Size(60, 13);
|
|
||||||
this.label5.TabIndex = 28;
|
|
||||||
this.label5.Text = "Meter Size:";
|
|
||||||
//
|
|
||||||
// label6
|
|
||||||
//
|
|
||||||
this.label6.AutoSize = true;
|
|
||||||
this.label6.Location = new System.Drawing.Point(10, 122);
|
|
||||||
this.label6.Name = "label6";
|
|
||||||
this.label6.Size = new System.Drawing.Size(86, 13);
|
|
||||||
this.label6.TabIndex = 27;
|
|
||||||
this.label6.Text = "Meter LUT CRC:";
|
|
||||||
//
|
|
||||||
// lblFwVersion
|
|
||||||
//
|
|
||||||
this.lblFwVersion.AutoSize = true;
|
|
||||||
this.lblFwVersion.Location = new System.Drawing.Point(10, 92);
|
|
||||||
this.lblFwVersion.Name = "lblFwVersion";
|
|
||||||
this.lblFwVersion.Size = new System.Drawing.Size(57, 13);
|
|
||||||
this.lblFwVersion.TabIndex = 25;
|
|
||||||
this.lblFwVersion.Text = "Meter FW:";
|
|
||||||
//
|
|
||||||
// btnConnect
|
// btnConnect
|
||||||
//
|
//
|
||||||
this.btnConnect.Location = new System.Drawing.Point(128, 24);
|
this.btnConnect.Location = new System.Drawing.Point(128, 24);
|
||||||
@@ -279,26 +156,6 @@
|
|||||||
this.lblWaitingForMeterResponse.TabIndex = 18;
|
this.lblWaitingForMeterResponse.TabIndex = 18;
|
||||||
this.lblWaitingForMeterResponse.Text = "WAITING FOR METER RESPONSE";
|
this.lblWaitingForMeterResponse.Text = "WAITING FOR METER RESPONSE";
|
||||||
//
|
//
|
||||||
// btnStopFwUpdate
|
|
||||||
//
|
|
||||||
this.btnStopFwUpdate.Location = new System.Drawing.Point(310, 216);
|
|
||||||
this.btnStopFwUpdate.Name = "btnStopFwUpdate";
|
|
||||||
this.btnStopFwUpdate.Size = new System.Drawing.Size(116, 25);
|
|
||||||
this.btnStopFwUpdate.TabIndex = 8;
|
|
||||||
this.btnStopFwUpdate.Text = "STOP";
|
|
||||||
this.btnStopFwUpdate.UseVisualStyleBackColor = true;
|
|
||||||
this.btnStopFwUpdate.Click += new System.EventHandler(this.btnStopFwUpdate_Click);
|
|
||||||
//
|
|
||||||
// btnDownloadLutFile
|
|
||||||
//
|
|
||||||
this.btnDownloadLutFile.Location = new System.Drawing.Point(310, 183);
|
|
||||||
this.btnDownloadLutFile.Name = "btnDownloadLutFile";
|
|
||||||
this.btnDownloadLutFile.Size = new System.Drawing.Size(116, 25);
|
|
||||||
this.btnDownloadLutFile.TabIndex = 0;
|
|
||||||
this.btnDownloadLutFile.Text = "Download";
|
|
||||||
this.btnDownloadLutFile.UseVisualStyleBackColor = true;
|
|
||||||
this.btnDownloadLutFile.Click += new System.EventHandler(this.btnDownloadLutFile_Click);
|
|
||||||
//
|
|
||||||
// lblOverall
|
// lblOverall
|
||||||
//
|
//
|
||||||
this.lblOverall.AutoSize = true;
|
this.lblOverall.AutoSize = true;
|
||||||
@@ -346,198 +203,16 @@
|
|||||||
//
|
//
|
||||||
this.lblFwUpdateInfo.AutoSize = true;
|
this.lblFwUpdateInfo.AutoSize = true;
|
||||||
this.lblFwUpdateInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.lblFwUpdateInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
this.lblFwUpdateInfo.Location = new System.Drawing.Point(18, 32);
|
this.lblFwUpdateInfo.Location = new System.Drawing.Point(623, 66);
|
||||||
this.lblFwUpdateInfo.Name = "lblFwUpdateInfo";
|
this.lblFwUpdateInfo.Name = "lblFwUpdateInfo";
|
||||||
this.lblFwUpdateInfo.Size = new System.Drawing.Size(72, 13);
|
this.lblFwUpdateInfo.Size = new System.Drawing.Size(72, 13);
|
||||||
this.lblFwUpdateInfo.TabIndex = 27;
|
this.lblFwUpdateInfo.TabIndex = 27;
|
||||||
this.lblFwUpdateInfo.Text = "Version: 0.0.0";
|
this.lblFwUpdateInfo.Text = "Version: 0.0.0";
|
||||||
//
|
//
|
||||||
// pictureBox1
|
|
||||||
//
|
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(609, 9);
|
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(102, 54);
|
|
||||||
this.pictureBox1.TabIndex = 29;
|
|
||||||
this.pictureBox1.TabStop = false;
|
|
||||||
//
|
|
||||||
// openFileDialog1
|
// openFileDialog1
|
||||||
//
|
//
|
||||||
this.openFileDialog1.FileName = "openFileDialog1";
|
this.openFileDialog1.FileName = "openFileDialog1";
|
||||||
//
|
//
|
||||||
// groupBox1
|
|
||||||
//
|
|
||||||
this.groupBox1.Controls.Add(this.btnLoadfromDb);
|
|
||||||
this.groupBox1.Controls.Add(this.label4);
|
|
||||||
this.groupBox1.Controls.Add(this.rbtProd);
|
|
||||||
this.groupBox1.Controls.Add(this.cbxDbLuts);
|
|
||||||
this.groupBox1.Controls.Add(this.rbtDb);
|
|
||||||
this.groupBox1.Controls.Add(this.rbtFile);
|
|
||||||
this.groupBox1.Controls.Add(this.lblSelectDb);
|
|
||||||
this.groupBox1.Controls.Add(this.tbxFileMeterSize);
|
|
||||||
this.groupBox1.Controls.Add(this.tbxFileCrc);
|
|
||||||
this.groupBox1.Controls.Add(this.label3);
|
|
||||||
this.groupBox1.Controls.Add(this.label1);
|
|
||||||
this.groupBox1.Controls.Add(this.lblLutFileLoadedInfo);
|
|
||||||
this.groupBox1.Controls.Add(this.btnDownloadLutFile);
|
|
||||||
this.groupBox1.Controls.Add(this.tbxLutFilePathName);
|
|
||||||
this.groupBox1.Controls.Add(this.lvlSelechtFile);
|
|
||||||
this.groupBox1.Controls.Add(this.btnStopFwUpdate);
|
|
||||||
this.groupBox1.Controls.Add(this.btnOpenLutFile);
|
|
||||||
this.groupBox1.Location = new System.Drawing.Point(275, 69);
|
|
||||||
this.groupBox1.Name = "groupBox1";
|
|
||||||
this.groupBox1.Size = new System.Drawing.Size(436, 273);
|
|
||||||
this.groupBox1.TabIndex = 28;
|
|
||||||
this.groupBox1.TabStop = false;
|
|
||||||
this.groupBox1.Text = "Lookup Table File";
|
|
||||||
//
|
|
||||||
// btnLoadfromDb
|
|
||||||
//
|
|
||||||
this.btnLoadfromDb.Location = new System.Drawing.Point(310, 118);
|
|
||||||
this.btnLoadfromDb.Name = "btnLoadfromDb";
|
|
||||||
this.btnLoadfromDb.Size = new System.Drawing.Size(116, 26);
|
|
||||||
this.btnLoadfromDb.TabIndex = 20;
|
|
||||||
this.btnLoadfromDb.Text = "Load from Db";
|
|
||||||
this.btnLoadfromDb.UseVisualStyleBackColor = true;
|
|
||||||
this.btnLoadfromDb.Click += new System.EventHandler(this.btnLoadfromDb_Click);
|
|
||||||
//
|
|
||||||
// label4
|
|
||||||
//
|
|
||||||
this.label4.AutoSize = true;
|
|
||||||
this.label4.Location = new System.Drawing.Point(12, 30);
|
|
||||||
this.label4.Name = "label4";
|
|
||||||
this.label4.Size = new System.Drawing.Size(68, 13);
|
|
||||||
this.label4.TabIndex = 19;
|
|
||||||
this.label4.Text = "LUT Source:";
|
|
||||||
//
|
|
||||||
// rbtProd
|
|
||||||
//
|
|
||||||
this.rbtProd.AutoSize = true;
|
|
||||||
this.rbtProd.Location = new System.Drawing.Point(270, 28);
|
|
||||||
this.rbtProd.Name = "rbtProd";
|
|
||||||
this.rbtProd.Size = new System.Drawing.Size(96, 17);
|
|
||||||
this.rbtProd.TabIndex = 18;
|
|
||||||
this.rbtProd.TabStop = true;
|
|
||||||
this.rbtProd.Text = "Prod Database";
|
|
||||||
this.rbtProd.UseVisualStyleBackColor = true;
|
|
||||||
this.rbtProd.CheckedChanged += new System.EventHandler(this.rbtProd_CheckedChanged);
|
|
||||||
this.rbtProd.Click += new System.EventHandler(this.SwitchView);
|
|
||||||
//
|
|
||||||
// cbxDbLuts
|
|
||||||
//
|
|
||||||
this.cbxDbLuts.FormattingEnabled = true;
|
|
||||||
this.cbxDbLuts.Location = new System.Drawing.Point(90, 58);
|
|
||||||
this.cbxDbLuts.Name = "cbxDbLuts";
|
|
||||||
this.cbxDbLuts.Size = new System.Drawing.Size(333, 21);
|
|
||||||
this.cbxDbLuts.TabIndex = 17;
|
|
||||||
this.cbxDbLuts.Visible = false;
|
|
||||||
this.cbxDbLuts.SelectedIndexChanged += new System.EventHandler(this.cbxDbLuts_SelectedIndexChanged);
|
|
||||||
//
|
|
||||||
// rbtDb
|
|
||||||
//
|
|
||||||
this.rbtDb.AutoSize = true;
|
|
||||||
this.rbtDb.Location = new System.Drawing.Point(144, 28);
|
|
||||||
this.rbtDb.Name = "rbtDb";
|
|
||||||
this.rbtDb.Size = new System.Drawing.Size(120, 17);
|
|
||||||
this.rbtDb.TabIndex = 16;
|
|
||||||
this.rbtDb.TabStop = true;
|
|
||||||
this.rbtDb.Text = "Research Database";
|
|
||||||
this.rbtDb.UseVisualStyleBackColor = true;
|
|
||||||
this.rbtDb.Click += new System.EventHandler(this.SwitchView);
|
|
||||||
//
|
|
||||||
// rbtFile
|
|
||||||
//
|
|
||||||
this.rbtFile.AutoSize = true;
|
|
||||||
this.rbtFile.Location = new System.Drawing.Point(87, 28);
|
|
||||||
this.rbtFile.Name = "rbtFile";
|
|
||||||
this.rbtFile.Size = new System.Drawing.Size(41, 17);
|
|
||||||
this.rbtFile.TabIndex = 15;
|
|
||||||
this.rbtFile.TabStop = true;
|
|
||||||
this.rbtFile.Text = "File";
|
|
||||||
this.rbtFile.UseVisualStyleBackColor = true;
|
|
||||||
this.rbtFile.Click += new System.EventHandler(this.SwitchView);
|
|
||||||
//
|
|
||||||
// lblSelectDb
|
|
||||||
//
|
|
||||||
this.lblSelectDb.AutoSize = true;
|
|
||||||
this.lblSelectDb.Location = new System.Drawing.Point(12, 62);
|
|
||||||
this.lblSelectDb.Name = "lblSelectDb";
|
|
||||||
this.lblSelectDb.Size = new System.Drawing.Size(64, 13);
|
|
||||||
this.lblSelectDb.TabIndex = 14;
|
|
||||||
this.lblSelectDb.Text = "Select LUT:";
|
|
||||||
this.lblSelectDb.Visible = false;
|
|
||||||
//
|
|
||||||
// tbxFileMeterSize
|
|
||||||
//
|
|
||||||
this.tbxFileMeterSize.Location = new System.Drawing.Point(91, 148);
|
|
||||||
this.tbxFileMeterSize.Name = "tbxFileMeterSize";
|
|
||||||
this.tbxFileMeterSize.ReadOnly = true;
|
|
||||||
this.tbxFileMeterSize.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxFileMeterSize.TabIndex = 13;
|
|
||||||
//
|
|
||||||
// tbxFileCrc
|
|
||||||
//
|
|
||||||
this.tbxFileCrc.Location = new System.Drawing.Point(91, 118);
|
|
||||||
this.tbxFileCrc.Name = "tbxFileCrc";
|
|
||||||
this.tbxFileCrc.ReadOnly = true;
|
|
||||||
this.tbxFileCrc.Size = new System.Drawing.Size(68, 20);
|
|
||||||
this.tbxFileCrc.TabIndex = 12;
|
|
||||||
//
|
|
||||||
// label3
|
|
||||||
//
|
|
||||||
this.label3.AutoSize = true;
|
|
||||||
this.label3.Location = new System.Drawing.Point(12, 152);
|
|
||||||
this.label3.Name = "label3";
|
|
||||||
this.label3.Size = new System.Drawing.Size(79, 13);
|
|
||||||
this.label3.TabIndex = 11;
|
|
||||||
this.label3.Text = "File Meter Size:";
|
|
||||||
//
|
|
||||||
// label1
|
|
||||||
//
|
|
||||||
this.label1.AutoSize = true;
|
|
||||||
this.label1.Location = new System.Drawing.Point(12, 121);
|
|
||||||
this.label1.Name = "label1";
|
|
||||||
this.label1.Size = new System.Drawing.Size(75, 13);
|
|
||||||
this.label1.TabIndex = 10;
|
|
||||||
this.label1.Text = "File LUT CRC:";
|
|
||||||
//
|
|
||||||
// lblLutFileLoadedInfo
|
|
||||||
//
|
|
||||||
this.lblLutFileLoadedInfo.AutoSize = true;
|
|
||||||
this.lblLutFileLoadedInfo.Location = new System.Drawing.Point(190, 121);
|
|
||||||
this.lblLutFileLoadedInfo.Name = "lblLutFileLoadedInfo";
|
|
||||||
this.lblLutFileLoadedInfo.Size = new System.Drawing.Size(97, 13);
|
|
||||||
this.lblLutFileLoadedInfo.TabIndex = 9;
|
|
||||||
this.lblLutFileLoadedInfo.Text = "LUT file not loaded";
|
|
||||||
//
|
|
||||||
// tbxLutFilePathName
|
|
||||||
//
|
|
||||||
this.tbxLutFilePathName.Location = new System.Drawing.Point(90, 85);
|
|
||||||
this.tbxLutFilePathName.Name = "tbxLutFilePathName";
|
|
||||||
this.tbxLutFilePathName.ReadOnly = true;
|
|
||||||
this.tbxLutFilePathName.Size = new System.Drawing.Size(333, 20);
|
|
||||||
this.tbxLutFilePathName.TabIndex = 2;
|
|
||||||
this.tbxLutFilePathName.Visible = false;
|
|
||||||
//
|
|
||||||
// lvlSelechtFile
|
|
||||||
//
|
|
||||||
this.lvlSelechtFile.AutoSize = true;
|
|
||||||
this.lvlSelechtFile.Location = new System.Drawing.Point(12, 88);
|
|
||||||
this.lvlSelechtFile.Name = "lvlSelechtFile";
|
|
||||||
this.lvlSelechtFile.Size = new System.Drawing.Size(63, 13);
|
|
||||||
this.lvlSelechtFile.TabIndex = 1;
|
|
||||||
this.lvlSelechtFile.Text = "Path Name:";
|
|
||||||
this.lvlSelechtFile.Visible = false;
|
|
||||||
//
|
|
||||||
// btnOpenLutFile
|
|
||||||
//
|
|
||||||
this.btnOpenLutFile.Location = new System.Drawing.Point(310, 150);
|
|
||||||
this.btnOpenLutFile.Name = "btnOpenLutFile";
|
|
||||||
this.btnOpenLutFile.Size = new System.Drawing.Size(116, 26);
|
|
||||||
this.btnOpenLutFile.TabIndex = 0;
|
|
||||||
this.btnOpenLutFile.Text = "Open";
|
|
||||||
this.btnOpenLutFile.UseVisualStyleBackColor = true;
|
|
||||||
this.btnOpenLutFile.Click += new System.EventHandler(this.btnOpenLutFile_Click);
|
|
||||||
//
|
|
||||||
// label9
|
// label9
|
||||||
//
|
//
|
||||||
this.label9.AutoSize = true;
|
this.label9.AutoSize = true;
|
||||||
@@ -556,28 +231,143 @@
|
|||||||
this.lblUpdateTime.TabIndex = 31;
|
this.lblUpdateTime.TabIndex = 31;
|
||||||
this.lblUpdateTime.Text = "0:00";
|
this.lblUpdateTime.Text = "0:00";
|
||||||
//
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||||
|
this.pictureBox1.Image = global::Xylem.Common.Ui.MagFluxToolBox.Properties.Resources.MagFluxVerySmall;
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(9, 9);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(85, 96);
|
||||||
|
this.pictureBox1.TabIndex = 33;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// picLogo
|
||||||
|
//
|
||||||
|
this.picLogo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.picLogo.Image = global::Xylem.Common.Ui.MagFluxToolBox.Properties.Resources.MjK_LogoSmall;
|
||||||
|
this.picLogo.InitialImage = null;
|
||||||
|
this.picLogo.Location = new System.Drawing.Point(620, 5);
|
||||||
|
this.picLogo.Name = "picLogo";
|
||||||
|
this.picLogo.Size = new System.Drawing.Size(91, 58);
|
||||||
|
this.picLogo.TabIndex = 34;
|
||||||
|
this.picLogo.TabStop = false;
|
||||||
|
//
|
||||||
|
// grpBoxInfo
|
||||||
|
//
|
||||||
|
this.grpBoxInfo.Controls.Add(this.label1);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.textBox1);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.textBox2);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.label3);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.textBox4);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.textBox5);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.textBox6);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.label4);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.label7);
|
||||||
|
this.grpBoxInfo.Controls.Add(this.label11);
|
||||||
|
this.grpBoxInfo.Location = new System.Drawing.Point(9, 109);
|
||||||
|
this.grpBoxInfo.Name = "grpBoxInfo";
|
||||||
|
this.grpBoxInfo.Size = new System.Drawing.Size(348, 228);
|
||||||
|
this.grpBoxInfo.TabIndex = 37;
|
||||||
|
this.grpBoxInfo.TabStop = false;
|
||||||
|
this.grpBoxInfo.Text = "Info";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(6, 146);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(116, 13);
|
||||||
|
this.label1.TabIndex = 36;
|
||||||
|
this.label1.Text = "Radio frequency[MHz]:";
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(124, 142);
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.ReadOnly = true;
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(68, 20);
|
||||||
|
this.textBox1.TabIndex = 35;
|
||||||
|
//
|
||||||
|
// textBox2
|
||||||
|
//
|
||||||
|
this.textBox2.Location = new System.Drawing.Point(124, 112);
|
||||||
|
this.textBox2.Name = "textBox2";
|
||||||
|
this.textBox2.ReadOnly = true;
|
||||||
|
this.textBox2.Size = new System.Drawing.Size(68, 20);
|
||||||
|
this.textBox2.TabIndex = 34;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(6, 116);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(44, 13);
|
||||||
|
this.label3.TabIndex = 33;
|
||||||
|
this.label3.Text = "Region:";
|
||||||
|
//
|
||||||
|
// textBox4
|
||||||
|
//
|
||||||
|
this.textBox4.Location = new System.Drawing.Point(124, 22);
|
||||||
|
this.textBox4.Name = "textBox4";
|
||||||
|
this.textBox4.ReadOnly = true;
|
||||||
|
this.textBox4.Size = new System.Drawing.Size(68, 20);
|
||||||
|
this.textBox4.TabIndex = 31;
|
||||||
|
//
|
||||||
|
// textBox5
|
||||||
|
//
|
||||||
|
this.textBox5.Location = new System.Drawing.Point(124, 82);
|
||||||
|
this.textBox5.Name = "textBox5";
|
||||||
|
this.textBox5.ReadOnly = true;
|
||||||
|
this.textBox5.Size = new System.Drawing.Size(68, 20);
|
||||||
|
this.textBox5.TabIndex = 30;
|
||||||
|
//
|
||||||
|
// textBox6
|
||||||
|
//
|
||||||
|
this.textBox6.Location = new System.Drawing.Point(124, 52);
|
||||||
|
this.textBox6.Name = "textBox6";
|
||||||
|
this.textBox6.ReadOnly = true;
|
||||||
|
this.textBox6.Size = new System.Drawing.Size(68, 20);
|
||||||
|
this.textBox6.TabIndex = 29;
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(6, 86);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(60, 13);
|
||||||
|
this.label4.TabIndex = 28;
|
||||||
|
this.label4.Text = "Meter Size:";
|
||||||
|
//
|
||||||
// label7
|
// label7
|
||||||
//
|
//
|
||||||
this.label7.AutoSize = true;
|
this.label7.AutoSize = true;
|
||||||
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
this.label7.Location = new System.Drawing.Point(6, 56);
|
||||||
this.label7.Location = new System.Drawing.Point(16, 9);
|
|
||||||
this.label7.Name = "label7";
|
this.label7.Name = "label7";
|
||||||
this.label7.Size = new System.Drawing.Size(159, 16);
|
this.label7.Size = new System.Drawing.Size(86, 13);
|
||||||
this.label7.TabIndex = 32;
|
this.label7.TabIndex = 27;
|
||||||
this.label7.Text = "Cordonel LUT Update";
|
this.label7.Text = "Meter LUT CRC:";
|
||||||
//
|
//
|
||||||
// FrmLutUpdate
|
// label11
|
||||||
|
//
|
||||||
|
this.label11.AutoSize = true;
|
||||||
|
this.label11.Location = new System.Drawing.Point(6, 26);
|
||||||
|
this.label11.Name = "label11";
|
||||||
|
this.label11.Size = new System.Drawing.Size(57, 13);
|
||||||
|
this.label11.TabIndex = 25;
|
||||||
|
this.label11.Text = "Meter FW:";
|
||||||
|
//
|
||||||
|
// FrmTest
|
||||||
//
|
//
|
||||||
this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound;
|
this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(723, 432);
|
this.ClientSize = new System.Drawing.Size(723, 432);
|
||||||
this.Controls.Add(this.label7);
|
this.Controls.Add(this.grpBoxInfo);
|
||||||
|
this.Controls.Add(this.picLogo);
|
||||||
|
this.Controls.Add(this.pictureBox1);
|
||||||
this.Controls.Add(this.lblUpdateTime);
|
this.Controls.Add(this.lblUpdateTime);
|
||||||
this.Controls.Add(this.label9);
|
this.Controls.Add(this.label9);
|
||||||
this.Controls.Add(this.groupBox1);
|
|
||||||
this.Controls.Add(this.lblWaitingForMeterResponse);
|
this.Controls.Add(this.lblWaitingForMeterResponse);
|
||||||
this.Controls.Add(this.pictureBox1);
|
|
||||||
this.Controls.Add(this.lblOverall);
|
this.Controls.Add(this.lblOverall);
|
||||||
this.Controls.Add(this.lblFwUpdateInfo);
|
this.Controls.Add(this.lblFwUpdateInfo);
|
||||||
this.Controls.Add(this.barSingleProgressUpdate);
|
this.Controls.Add(this.barSingleProgressUpdate);
|
||||||
@@ -588,15 +378,16 @@
|
|||||||
this.MaximumSize = new System.Drawing.Size(739, 500);
|
this.MaximumSize = new System.Drawing.Size(739, 500);
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
this.MinimumSize = new System.Drawing.Size(739, 405);
|
this.MinimumSize = new System.Drawing.Size(739, 405);
|
||||||
this.Name = "FrmLutUpdate";
|
this.Name = "FrmTest";
|
||||||
this.Text = "Metrology Lookup Table Update";
|
this.Text = "MagFlux Test";
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTest_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTest_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.FrmTest_Load);
|
this.Load += new System.EventHandler(this.FrmTest_Load);
|
||||||
this.grpSetup.ResumeLayout(false);
|
this.grpSetup.ResumeLayout(false);
|
||||||
this.grpSetup.PerformLayout();
|
this.grpSetup.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
this.groupBox1.ResumeLayout(false);
|
((System.ComponentModel.ISupportInitialize)(this.picLogo)).EndInit();
|
||||||
this.groupBox1.PerformLayout();
|
this.grpBoxInfo.ResumeLayout(false);
|
||||||
|
this.grpBoxInfo.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
@@ -609,7 +400,6 @@
|
|||||||
private System.Windows.Forms.Label lblConnectPcb;
|
private System.Windows.Forms.Label lblConnectPcb;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Label label2;
|
||||||
private System.Windows.Forms.ComboBox cbComSlot;
|
private System.Windows.Forms.ComboBox cbComSlot;
|
||||||
private System.Windows.Forms.Button btnDownloadLutFile;
|
|
||||||
private System.Windows.Forms.ProgressBar barOverallProgressUpdate;
|
private System.Windows.Forms.ProgressBar barOverallProgressUpdate;
|
||||||
private System.Windows.Forms.Timer tmrProgressUpdate;
|
private System.Windows.Forms.Timer tmrProgressUpdate;
|
||||||
private System.Windows.Forms.Label lblActualProcess;
|
private System.Windows.Forms.Label lblActualProcess;
|
||||||
@@ -617,40 +407,23 @@
|
|||||||
private System.Windows.Forms.ProgressBar barSingleProgressUpdate;
|
private System.Windows.Forms.ProgressBar barSingleProgressUpdate;
|
||||||
private System.Windows.Forms.OpenFileDialog dlgOpenLuFile;
|
private System.Windows.Forms.OpenFileDialog dlgOpenLuFile;
|
||||||
private System.Windows.Forms.Label lblFwUpdateInfo;
|
private System.Windows.Forms.Label lblFwUpdateInfo;
|
||||||
private System.Windows.Forms.Button btnStopFwUpdate;
|
|
||||||
private System.Windows.Forms.PictureBox pictureBox1;
|
|
||||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||||
private System.Windows.Forms.Label lblWaitingForMeterResponse;
|
private System.Windows.Forms.Label lblWaitingForMeterResponse;
|
||||||
private System.Windows.Forms.Label lblFwVersion;
|
|
||||||
private System.Windows.Forms.GroupBox groupBox1;
|
|
||||||
private System.Windows.Forms.TextBox tbxLutFilePathName;
|
|
||||||
private System.Windows.Forms.Label lvlSelechtFile;
|
|
||||||
private System.Windows.Forms.Button btnOpenLutFile;
|
|
||||||
private System.Windows.Forms.Label label9;
|
private System.Windows.Forms.Label label9;
|
||||||
private System.Windows.Forms.Label lblUpdateTime;
|
private System.Windows.Forms.Label lblUpdateTime;
|
||||||
private System.Windows.Forms.Label lblLutFileLoadedInfo;
|
|
||||||
private System.Windows.Forms.TextBox tbxFileMeterSize;
|
|
||||||
private System.Windows.Forms.TextBox tbxFileCrc;
|
|
||||||
private System.Windows.Forms.Label label3;
|
|
||||||
private System.Windows.Forms.Label label1;
|
|
||||||
private System.Windows.Forms.TextBox tbxMeterMeterSize;
|
|
||||||
private System.Windows.Forms.TextBox tbxMeterLutCrc;
|
|
||||||
private System.Windows.Forms.Label label5;
|
|
||||||
private System.Windows.Forms.Label label6;
|
|
||||||
private System.Windows.Forms.TextBox tbxMeterFw;
|
|
||||||
private System.Windows.Forms.TextBox tbxPcbId;
|
private System.Windows.Forms.TextBox tbxPcbId;
|
||||||
private System.Windows.Forms.Label label7;
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
private System.Windows.Forms.TextBox tbxRegion;
|
private System.Windows.Forms.PictureBox picLogo;
|
||||||
private System.Windows.Forms.Label label8;
|
private System.Windows.Forms.GroupBox grpBoxInfo;
|
||||||
private System.Windows.Forms.Label lblSelectDb;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.RadioButton rbtDb;
|
private System.Windows.Forms.TextBox textBox1;
|
||||||
private System.Windows.Forms.RadioButton rbtFile;
|
private System.Windows.Forms.TextBox textBox2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.TextBox textBox4;
|
||||||
|
private System.Windows.Forms.TextBox textBox5;
|
||||||
|
private System.Windows.Forms.TextBox textBox6;
|
||||||
private System.Windows.Forms.Label label4;
|
private System.Windows.Forms.Label label4;
|
||||||
private System.Windows.Forms.RadioButton rbtProd;
|
private System.Windows.Forms.Label label7;
|
||||||
private System.Windows.Forms.ComboBox cbxDbLuts;
|
private System.Windows.Forms.Label label11;
|
||||||
private System.Windows.Forms.Button btnLoadfromDb;
|
|
||||||
private System.Windows.Forms.Label label10;
|
|
||||||
private System.Windows.Forms.TextBox tbxRadio;
|
|
||||||
private System.Windows.Forms.Button btnClearDisplay;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,11 +32,6 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
private readonly Boolean _updateGui = true;
|
private readonly Boolean _updateGui = true;
|
||||||
|
|
||||||
private Boolean _tryConnectPcb;
|
private Boolean _tryConnectPcb;
|
||||||
private Boolean _lutFileSuccessfulWritten;
|
|
||||||
private const String StrUpdateErrorMessage = "METROLOGY LOOKUP TABLE UPDATE FAILED!";
|
|
||||||
private const String StrUpdateSuccessMessage = "Metrology lookup table successfulley written!";
|
|
||||||
private const String StrLutFileInvalid = "LUT FILE INVALID";
|
|
||||||
private const String StrLutFileValid = "LUT file loaded";
|
|
||||||
|
|
||||||
// external update remarks form
|
// external update remarks form
|
||||||
// private readonly FrmHistory _frmHistory = new FrmHistory();
|
// private readonly FrmHistory _frmHistory = new FrmHistory();
|
||||||
@@ -79,12 +74,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
lblConnectPcb.ForeColor = Color.Red;
|
lblConnectPcb.ForeColor = Color.Red;
|
||||||
lblWaitingForMeterResponse.Visible = false;
|
lblWaitingForMeterResponse.Visible = false;
|
||||||
btnConnect.Enabled = true;
|
btnConnect.Enabled = true;
|
||||||
btnDownloadLutFile.ForeColor = Color.DarkGreen;
|
|
||||||
btnStopFwUpdate.ForeColor = Color.Red;
|
|
||||||
SetControlDownloadsLocked();
|
SetControlDownloadsLocked();
|
||||||
btnStopFwUpdate.Enabled = false;
|
|
||||||
btnOpenLutFile.Enabled = true;
|
|
||||||
btnClearDisplay.Enabled = false;
|
|
||||||
tbxPcbId.Visible = false;
|
tbxPcbId.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,38 +108,21 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
|
|
||||||
private void SetControlDownloadsLocked()
|
private void SetControlDownloadsLocked()
|
||||||
{
|
{
|
||||||
btnDownloadLutFile.Enabled = false;
|
|
||||||
btnStopFwUpdate.Enabled = false;
|
|
||||||
btnConnect.Enabled = true;
|
btnConnect.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetControlsDownloadIsOngoing()
|
private void SetControlsDownloadIsOngoing()
|
||||||
{
|
{
|
||||||
btnConnect.Enabled = false;
|
btnConnect.Enabled = false;
|
||||||
btnOpenLutFile.Enabled = false;
|
|
||||||
|
|
||||||
btnDownloadLutFile.Enabled = false;
|
|
||||||
btnClearDisplay.Enabled = false;
|
|
||||||
btnStopFwUpdate.Enabled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetControlsDownloadIsFinished()
|
private void SetControlsDownloadIsFinished()
|
||||||
{
|
{
|
||||||
btnConnect.Enabled = true;
|
btnConnect.Enabled = true;
|
||||||
btnOpenLutFile.Enabled = true;
|
|
||||||
|
|
||||||
btnDownloadLutFile.Enabled = true;
|
|
||||||
btnStopFwUpdate.Enabled = false;
|
|
||||||
btnClearDisplay.Enabled = true;
|
|
||||||
}
|
}
|
||||||
private void SetControlsDownloadEnabled()
|
private void SetControlsDownloadEnabled()
|
||||||
{
|
{
|
||||||
btnConnect.Enabled = true;
|
btnConnect.Enabled = true;
|
||||||
btnOpenLutFile.Enabled = true;
|
|
||||||
|
|
||||||
btnDownloadLutFile.Enabled = true;
|
|
||||||
btnStopFwUpdate.Enabled = false;
|
|
||||||
btnClearDisplay.Enabled = true;
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -166,7 +139,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lblOverall.Text = @"Establish data base connection..";
|
//lblOverall.Text = @"Establish data base connection..";
|
||||||
|
|
||||||
Task.Factory.StartNew(() =>
|
Task.Factory.StartNew(() =>
|
||||||
{
|
{
|
||||||
@@ -258,8 +231,6 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
{
|
{
|
||||||
_tryConnectPcb = false;
|
_tryConnectPcb = false;
|
||||||
ProcessViewControl(false);
|
ProcessViewControl(false);
|
||||||
btnClearDisplay.Enabled = true;
|
|
||||||
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -525,69 +496,8 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
_resetTimeMeasurement = false;
|
_resetTimeMeasurement = false;
|
||||||
}
|
}
|
||||||
Connect();
|
Connect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnOpenLutFile_Click(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//if (dlgOpenLuFile.ShowDialog() != DialogResult.OK)
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//var lutFilePathName = dlgOpenLuFile.FileName;
|
|
||||||
|
|
||||||
//lblLutFileLoadedInfo.Text = "";
|
|
||||||
//tbxLutFilePathName.Text = lutFilePathName;
|
|
||||||
//if (_meterLutUpdate == null)
|
|
||||||
//{
|
|
||||||
// _meterLutUpdate = new MeterLutUpdate(_magFluxMeter);
|
|
||||||
// _meterLutUpdate.OnProcessUpdate += ProcessUpdate_Event;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (_meterLutUpdate == null)
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (_meterLutUpdate.LoadLutFile(lutFilePathName))
|
|
||||||
//{
|
|
||||||
// lblLutFileLoadedInfo.ForeColor = Color.Green;
|
|
||||||
// lblLutFileLoadedInfo.Text = StrLutFileValid;
|
|
||||||
// tbxFileCrc.Text = $@"0x{_meterLutUpdate.LutFile.FileCrc:X4}";
|
|
||||||
// tbxFileMeterSize.Text = MeterSizeConverter.ConvertMeterSizeEnumToSizeName(_meterLutUpdate.LutFile.MeterSize);
|
|
||||||
// _lutFileValid = true;
|
|
||||||
|
|
||||||
// LogText("File Meter Size: " + tbxFileMeterSize.Text);
|
|
||||||
// LogText("File LUT CRC: " + tbxFileCrc.Text);
|
|
||||||
// LogText(StrSeparator);
|
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// var txt = "";
|
|
||||||
// if (!string.IsNullOrEmpty(_meterLutUpdate?.ErrorMessage))
|
|
||||||
// {
|
|
||||||
// txt += _meterLutUpdate?.ErrorMessage;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// txt = StrLutFileInvalid;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// LogErrorText(txt);
|
|
||||||
// lblLutFileLoadedInfo.ForeColor = Color.Red;
|
|
||||||
// lblLutFileLoadedInfo.Text = txt;
|
|
||||||
// tbxFileCrc.Text = @" --- ";
|
|
||||||
// tbxFileMeterSize.Text = @" --- ";
|
|
||||||
// _lutFileValid = false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//CheckUpdateEnabled();
|
|
||||||
//_resetTimeMeasurement = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Download LUT file
|
/// Download LUT file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -600,22 +510,11 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lblLutFileLoadedInfo.Text = "";
|
|
||||||
SetControlsDownloadIsOngoing();
|
SetControlsDownloadIsOngoing();
|
||||||
StartStopDownload(true);
|
StartStopDownload(true);
|
||||||
|
|
||||||
_startTime = DateTimeOffset.UtcNow;
|
_startTime = DateTimeOffset.UtcNow;
|
||||||
_resetTimeMeasurement = false;
|
_resetTimeMeasurement = false;
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnStopFwUpdate_Click(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// if (_meterLutUpdate != null)
|
|
||||||
// {
|
|
||||||
// _meterLutUpdate.StopUpdateProcess = true;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -646,6 +545,7 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MessageBoxIcon Icon;
|
public MessageBoxIcon Icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Message pop up event handler
|
/// Message pop up event handler
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -667,152 +567,6 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
private void SwitchView(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
btnLoadfromDb.Enabled = false;
|
|
||||||
var file = rbtFile.Checked;
|
|
||||||
cbxDbLuts.Visible = !file;
|
|
||||||
lblSelectDb.Visible = !file;
|
|
||||||
btnLoadfromDb.Visible = !file;
|
|
||||||
|
|
||||||
lvlSelechtFile.Visible = file;
|
|
||||||
tbxLutFilePathName.Visible = file;
|
|
||||||
btnOpenLutFile.Visible = file;
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
LoadDbLuts(rbtProd.Checked);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadDbLuts(Boolean prod)
|
|
||||||
{
|
|
||||||
|
|
||||||
//var sbUrl = new StringBuilder();
|
|
||||||
//sbUrl.Append("http://10.49.40.25/MeterProcessState/api/FileUpToDate/GetLutFiles");
|
|
||||||
////sbUrl.Append("http://localhost:56011/api/FileUpToDate/GetLutFiles");
|
|
||||||
////sbUrl.Append($"?DataLength={_DataLength}");
|
|
||||||
////sbUrl.Append($"&version={_Version}");
|
|
||||||
////sbUrl.Append($"&crc={_FileCrc}");
|
|
||||||
////sbUrl.Append($"&Metersize={_MeterSize.GetHashCode()}");
|
|
||||||
////sbUrl.Append($"&Region={_StrLutRegion}");
|
|
||||||
//try
|
|
||||||
//{
|
|
||||||
|
|
||||||
// var ret = LocalWebRequest.GetRequest(sbUrl.ToString(), 80000);
|
|
||||||
|
|
||||||
|
|
||||||
// var a = JsonConvert.DeserializeObject<List<CordonelMetrologyLut>>(ret);
|
|
||||||
// cbxDbLuts.SelectedIndex = -1;
|
|
||||||
// cbxDbLuts.Items.Clear();
|
|
||||||
|
|
||||||
// foreach (var item in a)
|
|
||||||
// {
|
|
||||||
// if (!prod || item.CurrentVersionForProd)
|
|
||||||
// {
|
|
||||||
// cbxDbLuts.Items.Add(item);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//catch (Exception ex)
|
|
||||||
//{
|
|
||||||
// MessageBox.Show(ex.Message);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cbxDbLuts_SelectedIndexChanged(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//if (cbxDbLuts.SelectedItem is CordonelMetrologyLut)
|
|
||||||
//{
|
|
||||||
// btnLoadfromDb.Enabled = true;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// btnLoadfromDb.Enabled = false;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnLoadfromDb_Click(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//if (cbxDbLuts.SelectedItem is CordonelMetrologyLut lut)
|
|
||||||
//{
|
|
||||||
// lblLutFileLoadedInfo.Text = "";
|
|
||||||
// tbxLutFilePathName.Text = $"fromDB{lut.FileName}";
|
|
||||||
// if (_meterLutUpdate == null)
|
|
||||||
// {
|
|
||||||
// _meterLutUpdate = new MeterLutUpdate(_magFluxMeter);
|
|
||||||
// _meterLutUpdate.OnProcessUpdate += ProcessUpdate_Event;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (_meterLutUpdate == null)
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (_meterLutUpdate.LoadLutFromStream(lut.FileName, lut.FileContent.ToList()))
|
|
||||||
// {
|
|
||||||
// lblLutFileLoadedInfo.ForeColor = Color.Green;
|
|
||||||
// lblLutFileLoadedInfo.Text = StrLutFileValid;
|
|
||||||
// tbxFileCrc.Text = $@"0x{_meterLutUpdate.LutFile.FileCrc:X4}";
|
|
||||||
// tbxFileMeterSize.Text = MeterSizeConverter.ConvertMeterSizeEnumToSizeName(_meterLutUpdate.LutFile.MeterSize);
|
|
||||||
// _lutFileValid = true;
|
|
||||||
|
|
||||||
// LogText("File Meter Size: " + tbxFileMeterSize.Text);
|
|
||||||
// LogText("File LUT CRC: " + tbxFileCrc.Text);
|
|
||||||
// LogText(StrSeparator);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// var txt = "";
|
|
||||||
// if (!string.IsNullOrEmpty(_meterLutUpdate?.ErrorMessage))
|
|
||||||
// {
|
|
||||||
// txt += _meterLutUpdate?.ErrorMessage;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// txt = StrLutFileInvalid;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// LogErrorText(txt);
|
|
||||||
// lblLutFileLoadedInfo.ForeColor = Color.Red;
|
|
||||||
// lblLutFileLoadedInfo.Text = txt;
|
|
||||||
// tbxFileCrc.Text = @" --- ";
|
|
||||||
// tbxFileMeterSize.Text = @" --- ";
|
|
||||||
// _lutFileValid = false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// CheckUpdateEnabled();
|
|
||||||
// _resetTimeMeasurement = true;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rbtProd_CheckedChanged(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnClearDisplay_Click(Object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// if (_magFluxMeter == null)
|
|
||||||
// return;
|
|
||||||
|
|
||||||
// lblOverall.Text = @"Set display to normal operation";
|
|
||||||
// lblOverall.Visible = true;
|
|
||||||
// Update();
|
|
||||||
|
|
||||||
// if (!_magFluxMeter.IsLoggedOn)
|
|
||||||
// {
|
|
||||||
// _magFluxMeter.ReLogin();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _magFluxMeter.SetLcdText(true, new Byte[] { 0x00, 0x00, 0x00, 0x00 });
|
|
||||||
// _magFluxMeter.Logout();
|
|
||||||
// lblOverall.Visible = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -31,6 +33,7 @@
|
|||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
|||||||
@@ -118,10 +118,10 @@ namespace Xylem.Common.Ui.MagFluxToolBox
|
|||||||
|
|
||||||
private void btnTest_Click(Object sender, EventArgs e)
|
private void btnTest_Click(Object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//var form = new FrmTest();
|
var form = new FrmTest();
|
||||||
//form.Show();
|
form.Show();
|
||||||
//form.Closed += Form_Closed;
|
form.Closed += Form_Closed;
|
||||||
//Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user