Develop - GciBridge -> GCI -> PreadjustmentUI functions 5
This commit is contained in:
parent
d1b6247bb7
commit
a3bfc7a43e
@ -43,6 +43,7 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
//Preadjustment
|
||||
public PreAdjustmentSettingsContainer _settings = new PreAdjustmentSettingsContainer();
|
||||
public ProcessProgress _progressProcess = new ProcessProgress();
|
||||
public List<MeterStateControl> _meterControls = new List<MeterStateControl>();
|
||||
public List<MeterStateControl> _tempMeterControls = new List<MeterStateControl>();
|
||||
|
||||
@ -174,6 +175,16 @@ namespace GenesisCordonelInterface.API
|
||||
}
|
||||
}
|
||||
|
||||
private ZeroFlowGenesisMeter GetMeterThreadSafe2(int slot)
|
||||
{
|
||||
lock (_meterBatchLock)
|
||||
{
|
||||
return _meterBatch.ListOfMeters
|
||||
.OfType<ZeroFlowGenesisMeter>()
|
||||
.FirstOrDefault(m => m.Slot == slot);
|
||||
}
|
||||
}
|
||||
|
||||
private bool RemoveMeterThreadSafe(GenesisMeter meter)
|
||||
{
|
||||
if (meter == null)
|
||||
@ -653,7 +664,7 @@ namespace GenesisCordonelInterface.API
|
||||
{
|
||||
const string operation = nameof(CleanAllSlots);
|
||||
|
||||
try
|
||||
try
|
||||
{
|
||||
LogInfo(operation, "Start.");
|
||||
|
||||
@ -1524,16 +1535,69 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
// GCI to PreadjustmentUI - AUTOMATIC - STANDALONE - Laatzen GUI
|
||||
|
||||
#region ================================== PreAdjustmentUI INIT ==================================
|
||||
|
||||
/// <summary>
|
||||
/// Initializes PreAdjustment environment.
|
||||
/// </summary>
|
||||
public PreAdjustmentInitializationResult Preadjustment_Initialization(
|
||||
ProcessProgress pp,
|
||||
List<MeterStateControl> mc)
|
||||
{
|
||||
const string operation = nameof(Preadjustment_Initialization);
|
||||
|
||||
try
|
||||
{
|
||||
LogInfo(operation, "Start.");
|
||||
|
||||
_progressProcess = pp;
|
||||
_meterControls = mc;
|
||||
|
||||
var initializedSlots = _meterBatch.ListOfMeters
|
||||
.Select(m => m.Slot)
|
||||
.OrderBy(s => s)
|
||||
.ToList();
|
||||
|
||||
var result =
|
||||
new PreAdjustmentInitializationResult
|
||||
{
|
||||
Success = initializedSlots.Any(),
|
||||
Slots = string.Join(",", initializedSlots),
|
||||
ErrorMessage = initializedSlots.Any()
|
||||
? null
|
||||
: "No initialized meters found."
|
||||
};
|
||||
|
||||
LogInfo(operation, result.ToString());
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogError(operation, ex);
|
||||
|
||||
return new PreAdjustmentInitializationResult
|
||||
{
|
||||
Success = false,
|
||||
ErrorMessage = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================================== PreAdjustmentUI DETECT process ==================================
|
||||
|
||||
public Task<PreadjustmentDetectResult> PreAdjustment_DetectAsync(
|
||||
IEnumerable<PublicModels.MeterBatchDebugStatus> selectedSlots,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return Task.Run(() => Preadjustment_DetectCore(token), token);
|
||||
return Task.Run(() => Preadjustment_DetectCore(selectedSlots, token), token);
|
||||
}
|
||||
|
||||
private PreadjustmentDetectResult Preadjustment_DetectCore(
|
||||
CancellationToken token)
|
||||
IEnumerable<PublicModels.MeterBatchDebugStatus> selectedSlots,
|
||||
CancellationToken token)
|
||||
{
|
||||
const string operation = nameof(Preadjustment_DetectCore);
|
||||
|
||||
@ -1558,6 +1622,7 @@ namespace GenesisCordonelInterface.API
|
||||
thermoMeterBatch.RemoveAllMeters();
|
||||
|
||||
globalMeterBatch = _meterBatch;
|
||||
_meterControls = CreateMeterControls(selectedSlots);
|
||||
|
||||
if (!_settings.GetTempUseTempFlansh())
|
||||
_tempMeterControls.Clear();
|
||||
@ -1610,6 +1675,24 @@ namespace GenesisCordonelInterface.API
|
||||
}
|
||||
}
|
||||
|
||||
private List<MeterStateControl> CreateMeterControls(IEnumerable<PublicModels.MeterBatchDebugStatus> slots)
|
||||
{
|
||||
var controls =
|
||||
new List<MeterStateControl>();
|
||||
|
||||
foreach (var slot in slots)
|
||||
{
|
||||
var ctl = new MeterStateControl(slot.Slot);
|
||||
|
||||
ctl.SetChecked(true);
|
||||
ctl.IsEnabled = true;
|
||||
|
||||
controls.Add(ctl);
|
||||
}
|
||||
|
||||
return controls;
|
||||
}
|
||||
|
||||
private void CreateZeroFlowMeters(
|
||||
MeterBatch globalMeterBatch,
|
||||
MeterBatch thermoMeterBatch,
|
||||
@ -1629,7 +1712,7 @@ namespace GenesisCordonelInterface.API
|
||||
if (meterStateCtl.Slot == -1)
|
||||
continue;
|
||||
|
||||
ZeroFlowGenesisMeter currentMeter = new ZeroFlowGenesisMeter(meterStateCtl.Slot, 3, !(meterStateCtl is TempMeterStateControl));
|
||||
/*ZeroFlowGenesisMeter currentMeter = new ZeroFlowGenesisMeter(meterStateCtl.Slot, 3, !(meterStateCtl is TempMeterStateControl));
|
||||
|
||||
var convertedMeter = GetMeterThreadSafe(meterStateCtl.Slot);
|
||||
if (convertedMeter != null)
|
||||
@ -1660,7 +1743,9 @@ namespace GenesisCordonelInterface.API
|
||||
globalMeterBatch.AddMeter2(currentMeter);
|
||||
}
|
||||
|
||||
meterStateCtl.Meter = currentMeter;
|
||||
meterStateCtl.Meter = currentMeter;*/
|
||||
|
||||
meterStateCtl.Meter = GetMeterThreadSafe2(meterStateCtl.Slot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1726,11 +1811,10 @@ namespace GenesisCordonelInterface.API
|
||||
#region ================================== PreAdjustmentUI PREPARATION process ==================================
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_PreparationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetWorker(slot).RunAsync(
|
||||
() => PreAdjustment_Preparation(slot, pp),
|
||||
() => PreAdjustment_Preparation(slot),
|
||||
token);
|
||||
}
|
||||
|
||||
@ -1738,8 +1822,7 @@ namespace GenesisCordonelInterface.API
|
||||
/// Executes standalone preparation process.
|
||||
/// </summary>
|
||||
public PreAdjustmentProcessResult PreAdjustment_Preparation(
|
||||
int slot,
|
||||
ProcessProgress pp)
|
||||
int slot)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_Preparation);
|
||||
|
||||
@ -1750,11 +1833,10 @@ namespace GenesisCordonelInterface.API
|
||||
var meter = GetMeterThreadSafe(slot);
|
||||
EnsureConnected(meter);
|
||||
|
||||
BaseProcess process =
|
||||
CreatePreparationProcess(pp);
|
||||
BaseProcess process = CreatePreparationProcess(_progressProcess);
|
||||
|
||||
bool success =
|
||||
ExecuteProcess(process, pp);
|
||||
ExecuteProcess(process, _progressProcess);
|
||||
|
||||
var result =
|
||||
new PreAdjustmentProcessResult
|
||||
@ -1815,17 +1897,15 @@ namespace GenesisCordonelInterface.API
|
||||
#region ================================== PreAdjustmentUI AMPLITUDE TEST process ==================================
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_AmplitudeTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetWorker(slot).RunAsync(
|
||||
() => PreAdjustment_AmplitudeTest(slot, pp),
|
||||
() => PreAdjustment_AmplitudeTest(slot),
|
||||
token);
|
||||
}
|
||||
|
||||
public PreAdjustmentProcessResult PreAdjustment_AmplitudeTest(
|
||||
int slot,
|
||||
ProcessProgress pp)
|
||||
int slot)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_AmplitudeTest);
|
||||
|
||||
@ -1836,7 +1916,7 @@ namespace GenesisCordonelInterface.API
|
||||
var meter = GetMeterThreadSafe(slot);
|
||||
EnsureConnected(meter);
|
||||
|
||||
if (pp.Setting.TempOnly)
|
||||
if (_progressProcess.Setting.TempOnly)
|
||||
{
|
||||
return new PreAdjustmentProcessResult
|
||||
{
|
||||
@ -1846,9 +1926,9 @@ namespace GenesisCordonelInterface.API
|
||||
};
|
||||
}
|
||||
|
||||
BaseProcess process = CreateAmplitudeTestProcess(pp);
|
||||
BaseProcess process = CreateAmplitudeTestProcess(_progressProcess);
|
||||
|
||||
bool success = ExecuteProcess(process, pp);
|
||||
bool success = ExecuteProcess(process, _progressProcess);
|
||||
|
||||
LogInfo(operation, $"Finished. Slot={slot}, Success={success}");
|
||||
|
||||
@ -1905,20 +1985,17 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_TemperatureCalibrationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetWorker(slot).RunAsync(
|
||||
() => PreAdjustment_TemperatureCalibration(slot, pp),
|
||||
() => PreAdjustment_TemperatureCalibration(slot),
|
||||
token);
|
||||
}
|
||||
|
||||
public PreAdjustmentProcessResult PreAdjustment_TemperatureCalibration(
|
||||
int slot,
|
||||
ProcessProgress pp)
|
||||
int slot)
|
||||
{
|
||||
const string operation =
|
||||
nameof(PreAdjustment_TemperatureCalibration);
|
||||
const string operation = nameof(PreAdjustment_TemperatureCalibration);
|
||||
|
||||
try
|
||||
{
|
||||
@ -1929,11 +2006,9 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
EnsureConnected(meter);
|
||||
|
||||
BaseProcess process =
|
||||
CreateTemperatureCalibrationProcess(pp);
|
||||
BaseProcess process = CreateTemperatureCalibrationProcess(_progressProcess);
|
||||
|
||||
bool success =
|
||||
ExecuteProcess(process, pp);
|
||||
bool success = ExecuteProcess(process, _progressProcess);
|
||||
|
||||
var result =
|
||||
new PreAdjustmentProcessResult
|
||||
@ -1994,32 +2069,28 @@ namespace GenesisCordonelInterface.API
|
||||
#region ================================== PreAdjustmentUI OFFSET TEST process ==================================
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_OffsetTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
int slot,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetWorker(slot).RunAsync(
|
||||
() => PreAdjustment_OffsetTest(slot, pp),
|
||||
() => PreAdjustment_OffsetTest(slot),
|
||||
token);
|
||||
}
|
||||
|
||||
public PreAdjustmentProcessResult PreAdjustment_OffsetTest(
|
||||
int slot,
|
||||
ProcessProgress pp)
|
||||
int slot)
|
||||
{
|
||||
const string operation =
|
||||
nameof(PreAdjustment_OffsetTest);
|
||||
const string operation = nameof(PreAdjustment_OffsetTest);
|
||||
|
||||
try
|
||||
{
|
||||
LogInfo(operation, $"Start. Slot={slot}");
|
||||
|
||||
var meter =
|
||||
GetMeterThreadSafe(slot);
|
||||
var meter = GetMeterThreadSafe(slot);
|
||||
|
||||
EnsureConnected(meter);
|
||||
|
||||
if (pp.Setting.TempOnly)
|
||||
if (_progressProcess.Setting.TempOnly)
|
||||
{
|
||||
return new PreAdjustmentProcessResult
|
||||
{
|
||||
@ -2029,11 +2100,9 @@ namespace GenesisCordonelInterface.API
|
||||
};
|
||||
}
|
||||
|
||||
BaseProcess process =
|
||||
CreateOffsetTestProcess(pp);
|
||||
BaseProcess process = CreateOffsetTestProcess(_progressProcess);
|
||||
|
||||
bool success =
|
||||
ExecuteProcess(process, pp);
|
||||
bool success = ExecuteProcess(process, _progressProcess);
|
||||
|
||||
var result =
|
||||
new PreAdjustmentProcessResult
|
||||
@ -2095,20 +2164,17 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_CompletionAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return GetWorker(slot).RunAsync(
|
||||
() => PreAdjustment_Completion(slot, pp),
|
||||
() => PreAdjustment_Completion(slot),
|
||||
token);
|
||||
}
|
||||
|
||||
public PreAdjustmentProcessResult PreAdjustment_Completion(
|
||||
int slot,
|
||||
ProcessProgress pp)
|
||||
int slot)
|
||||
{
|
||||
const string operation =
|
||||
nameof(PreAdjustment_Completion);
|
||||
const string operation = nameof(PreAdjustment_Completion);
|
||||
|
||||
try
|
||||
{
|
||||
@ -2119,11 +2185,9 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
EnsureConnected(meter);
|
||||
|
||||
BaseProcess process =
|
||||
CreateCompletionProcess(pp);
|
||||
BaseProcess process = CreateCompletionProcess(_progressProcess);
|
||||
|
||||
bool success =
|
||||
ExecuteProcess(process, pp);
|
||||
bool success = ExecuteProcess(process, _progressProcess);
|
||||
|
||||
var result =
|
||||
new PreAdjustmentProcessResult
|
||||
|
||||
@ -585,50 +585,53 @@ namespace GenesisCordonelInterface.API
|
||||
// Laatzen Preadjustment processes
|
||||
|
||||
#region ================================== PreAdjustment ==================================
|
||||
public PreAdjustmentInitializationResult Preadjustment_Initialization(
|
||||
ProcessProgress pp,
|
||||
List<MeterStateControl> mc)
|
||||
{
|
||||
return _innerMeterAPI.Preadjustment_Initialization(pp, mc);
|
||||
}
|
||||
|
||||
public Task<PreadjustmentDetectResult> PreAdjustment_DetectAsync(
|
||||
IEnumerable<PublicModels.MeterBatchDebugStatus> selectedSlots,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_DetectAsync(token);
|
||||
return _innerMeterAPI.PreAdjustment_DetectAsync(selectedSlots, token);
|
||||
}
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_PreparationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_PreparationAsync(slot, pp, token);
|
||||
return _innerMeterAPI.PreAdjustment_PreparationAsync(slot, token);
|
||||
}
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_AmplitudeTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_AmplitudeTestAsync(slot, pp, token);
|
||||
return _innerMeterAPI.PreAdjustment_AmplitudeTestAsync(slot, token);
|
||||
}
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_TemperatureCalibrationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_TemperatureCalibrationAsync(slot, pp, token);
|
||||
return _innerMeterAPI.PreAdjustment_TemperatureCalibrationAsync(slot, token);
|
||||
}
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_OffsetTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_OffsetTestAsync(slot, pp, token);
|
||||
return _innerMeterAPI.PreAdjustment_OffsetTestAsync(slot, token);
|
||||
}
|
||||
|
||||
public Task<PreAdjustmentProcessResult> PreAdjustment_CompletionAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
return _innerMeterAPI.PreAdjustment_CompletionAsync(slot, pp, token);
|
||||
return _innerMeterAPI.PreAdjustment_CompletionAsync(slot, token);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -483,6 +483,22 @@ namespace GenesisCordonelInterface.API
|
||||
$"Error={ErrorMessage ?? "None"}";
|
||||
}
|
||||
}
|
||||
|
||||
public class PreAdjustmentInitializationResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string Slots { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return
|
||||
$"Success={Success}, " +
|
||||
$"Slots={Slots}, " +
|
||||
$"Error={ErrorMessage ?? "None"}";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ using GciType = GenesisCordonelInterface.API.InterfaceOutsideToGCI;
|
||||
using UdsReaderType = TBF.Rig.Input.DataStorage.UniDataStorageReader.Reader;
|
||||
using UDSRPublicModels = TBF.Rig.Input.DataStorage.UniDataStorageReader.Interfaces.PublicModels;
|
||||
using UdsWriterType = TBF.Rig.Output.DataStorage.UniDataStorageWriter.Writer;
|
||||
using GenesisCordonelInterface.Core.DataStorage.Config;
|
||||
using GenesisCordonelInterface.Core.DataStorage.Reading.Implementation.MeterLoginPasswords;
|
||||
|
||||
namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
@ -350,7 +348,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
timeoutMs: 30000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Updates an already initialized GCI slot.
|
||||
///
|
||||
@ -1234,7 +1232,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
/// <param name="pcbId">PCB ID used as query parameter.</param>
|
||||
/// <param name="token">Cancellation token.</param>
|
||||
/// <returns>Password lookup result.</returns>
|
||||
/*public async Task<UdsPasswordResult> GetPasswordAsync(
|
||||
public async Task<UdsPasswordResult> GetPasswordAsync(
|
||||
string pcbId,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
@ -1265,45 +1263,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
log.Error("GetPasswordAsync failed.", ex);
|
||||
|
||||
return new UdsPasswordResult
|
||||
{
|
||||
Success = false,
|
||||
PcbId = pcbId,
|
||||
Password = null,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
}*/
|
||||
|
||||
public async Task<UdsPasswordResult> GetPasswordAsync(
|
||||
string pcbId,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pcbId))
|
||||
throw new ArgumentException("PCB ID is empty.", nameof(pcbId));
|
||||
|
||||
try
|
||||
{
|
||||
GciConfig config = GciConfigLoader.LoadDefault();
|
||||
|
||||
var passwordReader = new MeterLoginPasswordReader(config.DataStorage.MeterLoginPasswords);
|
||||
|
||||
string password = await passwordReader.GetPasswordAsync(pcbId, token);
|
||||
|
||||
return new UdsPasswordResult
|
||||
{
|
||||
Success = !string.IsNullOrWhiteSpace(password),
|
||||
PcbId = pcbId,
|
||||
Password = password,
|
||||
Message = !string.IsNullOrWhiteSpace(password)
|
||||
? "Password found."
|
||||
: "Password was not found."
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("GetPasswordAsync failed.", ex);
|
||||
|
||||
return new UdsPasswordResult
|
||||
{
|
||||
Success = false,
|
||||
@ -1314,6 +1273,8 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reads password from UniDataStorageReader using PCB ID with retry support.
|
||||
///
|
||||
@ -1465,9 +1426,55 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
// Preadjustment API:
|
||||
|
||||
#region ================================== Preadjustment INIT bridge ==================================
|
||||
|
||||
public PreAdjustmentInitializationResult Preadjustment_Initialization(
|
||||
ProcessProgress pp, List<MeterStateControl> mc)
|
||||
{
|
||||
const string operation = nameof(Preadjustment_Initialization);
|
||||
|
||||
try
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start.",
|
||||
Name,
|
||||
operation);
|
||||
|
||||
PreAdjustmentInitializationResult result = gciExternalInterface.Preadjustment_Initialization(pp, mc);
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Finish. {2}",
|
||||
Name,
|
||||
operation,
|
||||
result);
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error(
|
||||
string.Format(
|
||||
"{0}: {1} failed.",
|
||||
Name,
|
||||
operation),
|
||||
ex);
|
||||
|
||||
return new PreAdjustmentInitializationResult
|
||||
{
|
||||
Success = false,
|
||||
ErrorMessage = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================================== Preadjustment DETECT bridge ==================================
|
||||
|
||||
public async Task<PreadjustmentDetectResult> PreAdjustment_DetectAsync(
|
||||
IEnumerable<GciPublicModels.MeterBatchDebugStatus> selectedSlots,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_DetectAsync);
|
||||
@ -1480,7 +1487,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
PreadjustmentDetectResult result =
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_DetectAsync(token)
|
||||
.PreAdjustment_DetectAsync(selectedSlots, token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
log.InfoFormat(
|
||||
@ -1507,12 +1514,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ================================== PreAdjustment PREPARATION bridge ==================================
|
||||
|
||||
public async Task<PreAdjustmentProcessResult> PreAdjustment_PreparationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_PreparationAsync);
|
||||
@ -1521,9 +1526,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (pp == null)
|
||||
throw new ArgumentNullException(nameof(pp));
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start. Slot={2}",
|
||||
Name,
|
||||
@ -1534,7 +1536,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_PreparationAsync(
|
||||
slot,
|
||||
pp,
|
||||
token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
@ -1564,12 +1565,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ================================== PreAdjustment AMPLITUDE TEST bridge ==================================
|
||||
|
||||
public async Task<PreAdjustmentProcessResult> PreAdjustment_AmplitudeTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_AmplitudeTestAsync);
|
||||
@ -1578,9 +1577,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (pp == null)
|
||||
throw new ArgumentNullException(nameof(pp));
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start. Slot={2}",
|
||||
Name,
|
||||
@ -1591,7 +1587,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_AmplitudeTestAsync(
|
||||
slot,
|
||||
pp,
|
||||
token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
@ -1625,7 +1620,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
public async Task<PreAdjustmentProcessResult> PreAdjustment_TemperatureCalibrationAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_TemperatureCalibrationAsync);
|
||||
@ -1634,9 +1628,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (pp == null)
|
||||
throw new ArgumentNullException(nameof(pp));
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start. Slot={2}",
|
||||
Name,
|
||||
@ -1647,7 +1638,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_TemperatureCalibrationAsync(
|
||||
slot,
|
||||
pp,
|
||||
token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
@ -1677,12 +1667,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ================================== PreAdjustment OFFSET TEST bridge ==================================
|
||||
|
||||
public async Task<PreAdjustmentProcessResult> PreAdjustment_OffsetTestAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_OffsetTestAsync);
|
||||
@ -1691,9 +1679,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (pp == null)
|
||||
throw new ArgumentNullException(nameof(pp));
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start. Slot={2}",
|
||||
Name,
|
||||
@ -1704,7 +1689,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_OffsetTestAsync(
|
||||
slot,
|
||||
pp,
|
||||
token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
@ -1734,12 +1718,10 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ================================== PreAdjustment COMPLETION bridge ==================================
|
||||
|
||||
public async Task<PreAdjustmentProcessResult> PreAdjustment_CompletionAsync(
|
||||
int slot,
|
||||
ProcessProgress pp,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
const string operation = nameof(PreAdjustment_CompletionAsync);
|
||||
@ -1748,9 +1730,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
{
|
||||
EnsureExternalInterface();
|
||||
|
||||
if (pp == null)
|
||||
throw new ArgumentNullException(nameof(pp));
|
||||
|
||||
log.InfoFormat(
|
||||
"{0}: {1} Start. Slot={2}",
|
||||
Name,
|
||||
@ -1761,7 +1740,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge
|
||||
await gciExternalInterface
|
||||
.PreAdjustment_CompletionAsync(
|
||||
slot,
|
||||
pp,
|
||||
token)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
|
||||
@ -24,6 +24,14 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.grpSlots = new System.Windows.Forms.GroupBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.preAdjustmentInitializationButton = new System.Windows.Forms.Button();
|
||||
this.completionActionButton = new System.Windows.Forms.Button();
|
||||
this.offsetTestActionButton = new System.Windows.Forms.Button();
|
||||
this.preparationActionButton = new System.Windows.Forms.Button();
|
||||
@ -32,19 +40,15 @@
|
||||
this.amplitudeTestActionButton = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.txtLog = new System.Windows.Forms.TextBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.cb_Metersize = new System.Windows.Forms.ComboBox();
|
||||
this.l_SettingsPreparationMetersize = new System.Windows.Forms.Label();
|
||||
this.grpSlots.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// grpSlots
|
||||
//
|
||||
this.grpSlots.Controls.Add(this.cb_Metersize);
|
||||
this.grpSlots.Controls.Add(this.l_SettingsPreparationMetersize);
|
||||
this.grpSlots.Controls.Add(this.label7);
|
||||
this.grpSlots.Controls.Add(this.label6);
|
||||
this.grpSlots.Controls.Add(this.label5);
|
||||
@ -52,7 +56,7 @@
|
||||
this.grpSlots.Controls.Add(this.label3);
|
||||
this.grpSlots.Controls.Add(this.label2);
|
||||
this.grpSlots.Controls.Add(this.label1);
|
||||
this.grpSlots.Controls.Add(this.button1);
|
||||
this.grpSlots.Controls.Add(this.preAdjustmentInitializationButton);
|
||||
this.grpSlots.Controls.Add(this.completionActionButton);
|
||||
this.grpSlots.Controls.Add(this.offsetTestActionButton);
|
||||
this.grpSlots.Controls.Add(this.preparationActionButton);
|
||||
@ -67,6 +71,85 @@
|
||||
this.grpSlots.Text = "Slots by selection in the table";
|
||||
this.grpSlots.Enter += new System.EventHandler(this.grpSlots_Enter);
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(144, 87);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(22, 13);
|
||||
this.label7.TabIndex = 115;
|
||||
this.label7.Text = "--->";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(14, 87);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(117, 13);
|
||||
this.label6.TabIndex = 114;
|
||||
this.label6.Text = "Preadjustment process:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(363, 257);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(22, 13);
|
||||
this.label5.TabIndex = 113;
|
||||
this.label5.Text = "--->";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(307, 223);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(22, 13);
|
||||
this.label4.TabIndex = 112;
|
||||
this.label4.Text = "--->";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(258, 189);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(22, 13);
|
||||
this.label3.TabIndex = 111;
|
||||
this.label3.Text = "--->";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(219, 155);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(22, 13);
|
||||
this.label2.TabIndex = 110;
|
||||
this.label2.Text = "--->";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(176, 121);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(22, 13);
|
||||
this.label1.TabIndex = 109;
|
||||
this.label1.Text = "--->";
|
||||
//
|
||||
// preAdjustmentInitializationButton
|
||||
//
|
||||
this.preAdjustmentInitializationButton.Location = new System.Drawing.Point(171, 28);
|
||||
this.preAdjustmentInitializationButton.Name = "preAdjustmentInitializationButton";
|
||||
this.preAdjustmentInitializationButton.Size = new System.Drawing.Size(150, 28);
|
||||
this.preAdjustmentInitializationButton.TabIndex = 108;
|
||||
this.preAdjustmentInitializationButton.Text = "Preadjustment init";
|
||||
this.preAdjustmentInitializationButton.Click += new System.EventHandler(this.preAdjustmentInitializationButton_Click);
|
||||
//
|
||||
// completionActionButton
|
||||
//
|
||||
this.completionActionButton.Location = new System.Drawing.Point(390, 249);
|
||||
@ -142,83 +225,23 @@
|
||||
this.txtLog.TabIndex = 5;
|
||||
this.txtLog.WordWrap = false;
|
||||
//
|
||||
// button1
|
||||
// cb_Metersize
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(17, 28);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(150, 28);
|
||||
this.button1.TabIndex = 108;
|
||||
this.button1.Text = "Preadjustment init";
|
||||
this.cb_Metersize.FormattingEnabled = true;
|
||||
this.cb_Metersize.Location = new System.Drawing.Point(74, 30);
|
||||
this.cb_Metersize.Name = "cb_Metersize";
|
||||
this.cb_Metersize.Size = new System.Drawing.Size(73, 21);
|
||||
this.cb_Metersize.TabIndex = 117;
|
||||
//
|
||||
// label1
|
||||
// l_SettingsPreparationMetersize
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(176, 121);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(22, 13);
|
||||
this.label1.TabIndex = 109;
|
||||
this.label1.Text = "--->";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(219, 155);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(22, 13);
|
||||
this.label2.TabIndex = 110;
|
||||
this.label2.Text = "--->";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(258, 189);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(22, 13);
|
||||
this.label3.TabIndex = 111;
|
||||
this.label3.Text = "--->";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(307, 223);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(22, 13);
|
||||
this.label4.TabIndex = 112;
|
||||
this.label4.Text = "--->";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(363, 257);
|
||||
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(22, 13);
|
||||
this.label5.TabIndex = 113;
|
||||
this.label5.Text = "--->";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(14, 87);
|
||||
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(117, 13);
|
||||
this.label6.TabIndex = 114;
|
||||
this.label6.Text = "Preadjustment process:";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(144, 87);
|
||||
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(22, 13);
|
||||
this.label7.TabIndex = 115;
|
||||
this.label7.Text = "--->";
|
||||
this.l_SettingsPreparationMetersize.AutoSize = true;
|
||||
this.l_SettingsPreparationMetersize.Location = new System.Drawing.Point(14, 36);
|
||||
this.l_SettingsPreparationMetersize.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.l_SettingsPreparationMetersize.Name = "l_SettingsPreparationMetersize";
|
||||
this.l_SettingsPreparationMetersize.Size = new System.Drawing.Size(55, 13);
|
||||
this.l_SettingsPreparationMetersize.TabIndex = 116;
|
||||
this.l_SettingsPreparationMetersize.Text = "Metersize:";
|
||||
//
|
||||
// PreadjustmentActionsView
|
||||
//
|
||||
@ -238,7 +261,7 @@
|
||||
private System.Windows.Forms.Button completionActionButton;
|
||||
private System.Windows.Forms.Button offsetTestActionButton;
|
||||
private System.Windows.Forms.Button amplitudeTestActionButton;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button preAdjustmentInitializationButton;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label3;
|
||||
@ -246,5 +269,7 @@
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.ComboBox cb_Metersize;
|
||||
private System.Windows.Forms.Label l_SettingsPreparationMetersize;
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Xylem.Common.Hardware.WaterMeter.WaterMeterCore;
|
||||
using Xylem.Common.Logic.ProductionOrderCore.OrderData;
|
||||
using Xylem.Common.Ui.CordonelPreadjustmentUi;
|
||||
using static GenesisCordonelInterface.API.PublicModels;
|
||||
using static Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.PreadjustmentMeter;
|
||||
@ -39,6 +40,18 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
InitializeComponent();
|
||||
|
||||
LoadRegisterComboBoxes();
|
||||
|
||||
cb_Metersize.Items.Clear();
|
||||
foreach (MeterSize size in (MeterSize[])Enum.GetValues(typeof(MeterSize)))
|
||||
{
|
||||
cb_Metersize.Items.Add(size);
|
||||
}
|
||||
var setM = MeterSize.DN50;
|
||||
if (_mainView._gciApi._innerMeterAPI._settings.MeterSize != null)
|
||||
{
|
||||
setM = _mainView._gciApi._innerMeterAPI._settings.MeterSize;
|
||||
}
|
||||
cb_Metersize.SelectedItem = setM;
|
||||
}
|
||||
|
||||
private void AddSlot()
|
||||
@ -159,6 +172,67 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
|
||||
}
|
||||
|
||||
private void preAdjustmentInitializationButton_Click(
|
||||
object sender,
|
||||
EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var selectedSlots = _mainView._batchPanel.GetSelectedGridData();
|
||||
|
||||
if (!selectedSlots.Any())
|
||||
{
|
||||
Log("Detect: no selected slots.");
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessProgress pp = CreatePreparationProgress();
|
||||
List<MeterStateControl> mc = CreateMeterControls(selectedSlots);
|
||||
|
||||
var result = _bridge.Preadjustment_Initialization(pp, mc);
|
||||
|
||||
if (!result.Success)
|
||||
{
|
||||
Log(result.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Log(
|
||||
$"Initialization successful. Slots: {result.Slots}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void detectActionButton_Click(
|
||||
object sender,
|
||||
EventArgs e)
|
||||
{
|
||||
ExecuteAsync(async token =>
|
||||
{
|
||||
var selectedSlots =
|
||||
_mainView._batchPanel.GetSelectedGridData();
|
||||
|
||||
if (!selectedSlots.Any())
|
||||
{
|
||||
Log("Detect: no selected slots.");
|
||||
return;
|
||||
}
|
||||
|
||||
PreadjustmentDetectResult result =
|
||||
await _bridge.PreAdjustment_DetectAsync(selectedSlots, token);
|
||||
|
||||
Log(
|
||||
result.Success
|
||||
? "Detect completed. " + result
|
||||
: "Detect failed. " + result);
|
||||
|
||||
RefreshGrid();
|
||||
});
|
||||
}
|
||||
|
||||
private void preparationActionButton_Click(
|
||||
object sender,
|
||||
EventArgs e)
|
||||
@ -224,52 +298,19 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
});
|
||||
}
|
||||
|
||||
private void detectActionButton_Click(
|
||||
object sender,
|
||||
EventArgs e)
|
||||
{
|
||||
ExecuteAsync(async token =>
|
||||
{
|
||||
var selectedSlots =
|
||||
_mainView._batchPanel.GetSelectedGridData();
|
||||
|
||||
if (!selectedSlots.Any())
|
||||
{
|
||||
Log("Detect: no selected slots.");
|
||||
return;
|
||||
}
|
||||
|
||||
_mainView._laatzenApi._settings =
|
||||
CreatePreAdjustmentSettings(selectedSlots);
|
||||
|
||||
_mainView._laatzenApi._meterControls =
|
||||
CreateMeterControls(selectedSlots);
|
||||
|
||||
PreadjustmentDetectResult result =
|
||||
await _bridge.PreAdjustment_DetectAsync(token);
|
||||
|
||||
Log(
|
||||
result.Success
|
||||
? "Detect completed. " + result
|
||||
: "Detect failed. " + result);
|
||||
|
||||
RefreshGrid();
|
||||
});
|
||||
}
|
||||
|
||||
private ProcessProgress CreatePreparationProgress()
|
||||
{
|
||||
return new ProcessProgress
|
||||
{
|
||||
Setting = new PreAdjustmentSettingsContainer
|
||||
{
|
||||
|
||||
|
||||
TempOnly = false,
|
||||
Culture =
|
||||
Thread.CurrentThread.CurrentCulture
|
||||
Culture = Thread.CurrentThread.CurrentCulture,
|
||||
MeterSize = (MeterSize)cb_Metersize.SelectedItem
|
||||
},
|
||||
|
||||
IsAutomaticMode = true
|
||||
IsAutomaticMode = false
|
||||
};
|
||||
}
|
||||
|
||||
@ -310,7 +351,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void writeRegisterButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -367,7 +408,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
}
|
||||
|
||||
private async Task ExecutePreadjustmentForSelectedSlotsAsync(
|
||||
Func<int, ProcessProgress, CancellationToken, Task<PreAdjustmentProcessResult>> action,
|
||||
Func<int, CancellationToken, Task<PreAdjustmentProcessResult>> action,
|
||||
string processName,
|
||||
CancellationToken token)
|
||||
{
|
||||
@ -388,7 +429,6 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge
|
||||
PreAdjustmentProcessResult result =
|
||||
await action(
|
||||
selectedSlot.Slot,
|
||||
pp,
|
||||
token);
|
||||
|
||||
Log(result.Success
|
||||
|
||||
Loading…
Reference in New Issue
Block a user