Merge branch 'develop/SLM-PT50_genesisDirectDecode' into develop/SLM-PT50_genesisDirectDecode_special
# Conflicts: # TBF/Rig/RegisterReaders/GenesisRegReader/communication/RadioService.cs
This commit is contained in:
commit
f4b8e42f59
@ -79,6 +79,7 @@ namespace GenesisCordonelInterface.API
|
||||
Slot = m.Slot,
|
||||
Selected = IsSlotSelected(m.Slot),
|
||||
PcbId = m.PcbId,
|
||||
IsConnected = m.IsConnected,
|
||||
IsLoggedOn = m.IsLoggedOn,
|
||||
RequestPort = m.RequestPort?.GetPortName(),
|
||||
StreamingPort = m.StreamingPort?.GetPortName(),
|
||||
@ -468,6 +469,8 @@ namespace GenesisCordonelInterface.API
|
||||
SlotId = slot,
|
||||
Success = true,
|
||||
Exists = false,
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
Message = "Slot is empty."
|
||||
};
|
||||
}
|
||||
@ -477,6 +480,8 @@ namespace GenesisCordonelInterface.API
|
||||
SlotId = slot,
|
||||
Success = true,
|
||||
Exists = true,
|
||||
IsConnected = meter.IsConnected,
|
||||
IsLoggedOn = meter.IsLoggedOn,
|
||||
Message = "Slot found.",
|
||||
|
||||
PcbId = meter.PcbId,
|
||||
@ -498,6 +503,8 @@ namespace GenesisCordonelInterface.API
|
||||
SlotId = slot,
|
||||
Success = false,
|
||||
Exists = false,
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
@ -567,6 +574,11 @@ namespace GenesisCordonelInterface.API
|
||||
{
|
||||
LogInfo(operation, "Start.");
|
||||
|
||||
foreach (var meter in _meterBatch.ListOfMeters)
|
||||
{
|
||||
meter.DisposeMeter();
|
||||
}
|
||||
|
||||
_meterBatch.ListOfMeters.Clear();
|
||||
|
||||
foreach (var pair in _workers.ToList())
|
||||
@ -723,31 +735,43 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
var meter = GetMeter(slot);
|
||||
|
||||
meter.Login();
|
||||
|
||||
if (!meter.IsLoggedOn)
|
||||
{
|
||||
var failedResult = new PublicModels.GciLoginResult
|
||||
meter.Login();
|
||||
|
||||
if (meter.IsLoggedOn)
|
||||
{
|
||||
LogInfo(operation, $"New Slot {slot} login success.");
|
||||
|
||||
return new PublicModels.GciLoginResult
|
||||
{
|
||||
Success = true,
|
||||
SlotId = slot,
|
||||
IsLoggedOn = true,
|
||||
Message = "Logged on now"
|
||||
};
|
||||
}
|
||||
|
||||
LogInfo(operation, $"Failed Slot {slot} login.");
|
||||
|
||||
return new PublicModels.GciLoginResult
|
||||
{
|
||||
Success = false,
|
||||
SlotId = slot,
|
||||
IsLoggedOn = false,
|
||||
Message = "Login failed."
|
||||
Message = "Login failed"
|
||||
};
|
||||
|
||||
LogInfo(operation, $"Failed. {failedResult}");
|
||||
|
||||
return failedResult;
|
||||
}
|
||||
|
||||
var result = new PublicModels.GciLoginResult
|
||||
{
|
||||
Success = true,
|
||||
SlotId = slot,
|
||||
IsLoggedOn = true
|
||||
IsLoggedOn = true,
|
||||
Message = "Already logged on"
|
||||
};
|
||||
|
||||
LogInfo(operation, $"Success. {result}");
|
||||
LogInfo(operation, $"Slot={slot} already logged on.");
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -783,21 +807,31 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
var meter = GetMeter(slot);
|
||||
|
||||
//meter.SoftDispose();
|
||||
//meter.Dispose();
|
||||
|
||||
if(!meter.IsLoggedOn)
|
||||
if (!meter.IsConnected)
|
||||
{
|
||||
meter.ConnectMeter();
|
||||
|
||||
if (!meter.IsLoggedOn)
|
||||
LogInfo(operation, $"New Slot {slot} connection success.");
|
||||
|
||||
return new PublicModels.GciConnectResult
|
||||
{
|
||||
Success = true,
|
||||
SlotId = slot,
|
||||
IsConnected = true,
|
||||
Message = "Connected now"
|
||||
};
|
||||
}
|
||||
|
||||
if (!meter.IsConnected)
|
||||
{
|
||||
LogInfo(operation, $"Failed. Slot={slot}, Reason=Login failed.");
|
||||
LogInfo(operation, $"Failed Slot {slot} connection.");
|
||||
|
||||
return new PublicModels.GciConnectResult
|
||||
{
|
||||
Success = false,
|
||||
SlotId = slot,
|
||||
Message = "Login failed."
|
||||
IsConnected = false,
|
||||
Message = "Connect failed"
|
||||
};
|
||||
}
|
||||
|
||||
@ -805,18 +839,11 @@ namespace GenesisCordonelInterface.API
|
||||
{
|
||||
Success = true,
|
||||
SlotId = slot,
|
||||
PcbId = meter.PcbId,
|
||||
IsLoggedOn = true,
|
||||
FwVersion = meter.FwVersion,
|
||||
InterfaceVersion = meter.InterfaceInfo?.InterfaceVersion,
|
||||
InterfaceSupportsFwVersion = meter.InterfaceSupportsFwVersion,
|
||||
Registers = null//BuildRegisters(meter)
|
||||
IsConnected = true,
|
||||
Message = "Already connected"
|
||||
};
|
||||
|
||||
LogInfo(operation,
|
||||
$"Success. Slot={slot}, PcbId={result.PcbId ?? "<empty>"}, " +
|
||||
$"FwVersion={result.FwVersion ?? "<empty>"}, InterfaceVersion={result.InterfaceVersion ?? "<empty>"}, " +
|
||||
$"Registers={result.Registers?.Count}");
|
||||
LogInfo(operation, $"Slot={slot} already connected.");
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -828,6 +855,7 @@ namespace GenesisCordonelInterface.API
|
||||
{
|
||||
Success = false,
|
||||
SlotId = slot,
|
||||
IsConnected = false,
|
||||
Message = ex.Message
|
||||
};
|
||||
}
|
||||
@ -933,69 +961,6 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
try
|
||||
{
|
||||
/*const String checkMark = "\u2714";
|
||||
using (var mb = new MeterBatch())
|
||||
{
|
||||
using (var meter = new GenesisMeter())
|
||||
{
|
||||
meter.SetupFromConfigFile(slot, false);
|
||||
mb.AddMeter(meter);
|
||||
|
||||
meter.Logout();
|
||||
|
||||
var pcbId = meter.GetPcbId();
|
||||
|
||||
if (string.IsNullOrEmpty(pcbId))
|
||||
{
|
||||
var text = $"FAILED\nSlot: {slot}\nRequest port: {meter.RequestPort.GetPortName()}";
|
||||
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
|
||||
Logger.Info("COM: Streaming detection SUCCESS for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
var text = $"SUCCESS\nSlot: {slot}\nRequest port: {meter.RequestPort.GetPortName()}\n\n{checkMark}";
|
||||
MessageBox.Show(text, @"SUCCESS", MessageBoxButtons.OK);
|
||||
|
||||
Logger.Error("COM: Streaming detection FAILED for slot " + slot + ", port " + meter.StreamingPort.GetPortName() + ".");
|
||||
}
|
||||
|
||||
return new PublicModels.GciGetPcbIdResult
|
||||
{
|
||||
SlotId = slot,
|
||||
Success = !string.IsNullOrWhiteSpace(pcbId),
|
||||
PcbId = pcbId,
|
||||
Message = !string.IsNullOrWhiteSpace(pcbId)
|
||||
? "PCB ID read successfully."
|
||||
: "PCB ID is empty."
|
||||
};
|
||||
}
|
||||
}*/
|
||||
//toto ide!!!
|
||||
/*LogInfo(operation, $"Start. Slot={slot}");
|
||||
|
||||
using (var mb = new MeterBatch())
|
||||
using (var meter = new GenesisMeter())
|
||||
{
|
||||
meter.SetupFromConfigFile(slot, false);
|
||||
mb.AddMeter(meter);
|
||||
meter.Logout();
|
||||
|
||||
string pcbId = meter.GetPcbId();
|
||||
|
||||
LogInfo(operation, $"Finish. Slot={slot}, PcbId={pcbId ?? "<empty>"}");
|
||||
|
||||
return new PublicModels.GciGetPcbIdResult
|
||||
{
|
||||
SlotId = slot,
|
||||
Success = !string.IsNullOrWhiteSpace(pcbId),
|
||||
PcbId = pcbId,
|
||||
Message = !string.IsNullOrWhiteSpace(pcbId)
|
||||
? "PCB ID read successfully."
|
||||
: "PCB ID is empty."
|
||||
};
|
||||
}
|
||||
*/
|
||||
LogInfo(operation, $"Start. Slot={slot}");
|
||||
|
||||
var meter = GetMeter(slot);
|
||||
@ -1004,34 +969,21 @@ namespace GenesisCordonelInterface.API
|
||||
|
||||
string pcbId = meter.GetPcbId();
|
||||
|
||||
bool isValid =
|
||||
!string.IsNullOrWhiteSpace(pcbId) &&
|
||||
pcbId.Length == 9;
|
||||
|
||||
LogInfo(operation, $"Finish. Slot={slot}, PcbId={pcbId ?? "<empty>"}");
|
||||
|
||||
return new PublicModels.GciGetPcbIdResult
|
||||
{
|
||||
SlotId = slot,
|
||||
Success = !string.IsNullOrWhiteSpace(pcbId),
|
||||
Success = isValid,
|
||||
PcbId = pcbId,
|
||||
Message = !string.IsNullOrWhiteSpace(pcbId)
|
||||
Message = isValid
|
||||
? "PCB ID read successfully."
|
||||
: "PCB ID is empty."
|
||||
: "Invalid length"
|
||||
};
|
||||
/*var meter = new GenesisMeter();// GetMeter(slot);
|
||||
meter.SetupFromConfigFile(slot, true);
|
||||
meter.Logout();
|
||||
|
||||
string pcbId = meter.GetPcbId();
|
||||
|
||||
LogInfo(operation, $"Finish. Slot={slot}, PcbId={pcbId ?? "<empty>"}");
|
||||
|
||||
return new PublicModels.GciGetPcbIdResult
|
||||
{
|
||||
SlotId = slot,
|
||||
Success = !string.IsNullOrWhiteSpace(pcbId),
|
||||
PcbId = pcbId,
|
||||
Message = !string.IsNullOrWhiteSpace(pcbId)
|
||||
? "PCB ID read successfully."
|
||||
: "PCB ID is empty."
|
||||
};*/
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -1269,7 +1221,6 @@ namespace GenesisCordonelInterface.API
|
||||
#endregion
|
||||
|
||||
#region ================================== METER BATCH SETUP ==================================
|
||||
// ----------------------------------------------------
|
||||
|
||||
public void ReloadSlotSetup()
|
||||
{
|
||||
@ -1363,7 +1314,6 @@ namespace GenesisCordonelInterface.API
|
||||
return _cachedRegisters;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -136,6 +136,7 @@ namespace GenesisCordonelInterface.API
|
||||
Slot = slot.SlotId,
|
||||
Selected = true,
|
||||
PcbId = slot.PcbId,
|
||||
IsConnected = false,
|
||||
IsLoggedOn = false,
|
||||
RequestPort = slot.RequestPort == null ? "" : slot.RequestPort.PortName,
|
||||
StreamingPort = slot.StreamingPort == null ? "" : slot.StreamingPort.PortName,
|
||||
|
||||
@ -90,6 +90,7 @@ namespace GenesisCordonelInterface.API
|
||||
public int Slot { get; set; }
|
||||
public bool Selected { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public bool IsConnected { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string RequestPort { get; set; }
|
||||
public string StreamingPort { get; set; }
|
||||
@ -97,6 +98,7 @@ namespace GenesisCordonelInterface.API
|
||||
public string FwVersion { get; set; }
|
||||
public string InterfaceVersion { get; set; }
|
||||
}
|
||||
|
||||
public class RegisterWriteResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
@ -140,26 +142,27 @@ namespace GenesisCordonelInterface.API
|
||||
public class GciSlotInfo
|
||||
{
|
||||
public int SlotId { get; set; }
|
||||
|
||||
public bool Exists { get; set; }
|
||||
public bool Success { get; set; }
|
||||
public bool IsConnected { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string Message { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public GciConfigSource ConfigSource { get; set; }
|
||||
public GciPasswordSource PasswordSource { get; set; }
|
||||
|
||||
public GciPortConfig RequestPort { get; set; }
|
||||
public GciPortConfig StreamingPort { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(
|
||||
"SlotId={0}, Exists={1}, Success={2}, Message={3}, PcbId={4}, Password={5}, ConfigSource={6}, PasswordSource={7}, RequestPort={8}, StreamingPort={9}",
|
||||
"SlotId={0}, Exists={1}, Success={2}, IsConnected={3}, IsLoggedOn={4}, Message={5}, PcbId={6}, Password={7}, ConfigSource={8}, PasswordSource={9}, RequestPort={10}, StreamingPort={11}",
|
||||
SlotId,
|
||||
Exists,
|
||||
Success,
|
||||
IsConnected,
|
||||
IsLoggedOn,
|
||||
Message,
|
||||
PcbId,
|
||||
Password,
|
||||
@ -341,39 +344,31 @@ namespace GenesisCordonelInterface.API
|
||||
public int SlotId { get; set; }
|
||||
public bool Success { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string FwVersion { get; set; }
|
||||
public string InterfaceVersion { get; set; }
|
||||
public bool InterfaceSupportsFwVersion { get; set; }
|
||||
public List<GciRegisterSnapshot> Registers { get; set; } = new List<GciRegisterSnapshot>();
|
||||
public bool IsConnected { get; set; }
|
||||
public string Message { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(
|
||||
"SlotId={0}, Success={1}, IsLoggedOn={2}, PcbId={3}, FwVersion={4}, InterfaceVersion={5}, InterfaceSupportsFwVersion={6}, Registers={7}, Message={8}",
|
||||
"SlotId={0}, Success={1}, PcbId={2}, IsConnected={3}, Message={4}",
|
||||
SlotId,
|
||||
Success,
|
||||
IsLoggedOn,
|
||||
PcbId,
|
||||
FwVersion,
|
||||
InterfaceVersion,
|
||||
InterfaceSupportsFwVersion,
|
||||
Registers == null ? 0 : Registers.Count,
|
||||
IsConnected,
|
||||
Message);
|
||||
}
|
||||
}
|
||||
|
||||
public class GciLoginResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public int SlotId { get; set; }
|
||||
public bool Success { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string Message { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Slot={SlotId}, Success={Success}, IsLoggedOn={IsLoggedOn}, Message={Message ?? "<none>"}";
|
||||
return $"Slot={SlotId}, Success={Success}, PcbId={PcbId}, IsLoggedOn={IsLoggedOn}, Message={Message ?? "<none>"}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,9 +9,10 @@ namespace GenesisCordonelInterface.UI.Grid
|
||||
return new List<MeterGridColumnConfig>
|
||||
{
|
||||
new MeterGridColumnConfig { Name = "Slot", HeaderText = "Slot", DisplayIndex = 0, Width = 50, ReadOnly = true },
|
||||
new MeterGridColumnConfig { Name = "Selected", HeaderText = "Selected", DisplayIndex = 1, Width = 60 },
|
||||
new MeterGridColumnConfig { Name = "Selected", HeaderText = "Selected", DisplayIndex = 1, Width = 40 },
|
||||
new MeterGridColumnConfig { Name = "PcbId", HeaderText = "PcbId", DisplayIndex = 2, Width = 80 },
|
||||
new MeterGridColumnConfig { Name = "IsLoggedOn", HeaderText = "IsLoggedOn", DisplayIndex = 3, Width = 80 },
|
||||
new MeterGridColumnConfig { Name = "IsConnected", HeaderText = "IsConnected", DisplayIndex = 3, Width = 40 },
|
||||
new MeterGridColumnConfig { Name = "IsLoggedOn", HeaderText = "IsLoggedOn", DisplayIndex = 3, Width = 40 },
|
||||
new MeterGridColumnConfig { Name = "RequestPort", HeaderText = "RequestPort", DisplayIndex = 4, Width = 90 },
|
||||
new MeterGridColumnConfig { Name = "StreamingPort", HeaderText = "StreamingPort", DisplayIndex = 5, Width = 100 },
|
||||
new MeterGridColumnConfig { Name = "FwVersion", HeaderText = "FwVersion", DisplayIndex = 6, Width = 80 },
|
||||
|
||||
@ -59,6 +59,7 @@ namespace GenesisCordonelInterface.UI.Grid
|
||||
SetCell(row, "Slot", meter.Slot);
|
||||
SetCell(row, "Selected", meter.Selected);
|
||||
SetCell(row, "PcbId", meter.PcbId);
|
||||
SetCell(row, "IsConnected", meter.IsConnected);
|
||||
SetCell(row, "IsLoggedOn", meter.IsLoggedOn);
|
||||
SetCell(row, "RequestPort", meter.RequestPort);
|
||||
SetCell(row, "StreamingPort", meter.StreamingPort);
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
public int Slot { get; set; }
|
||||
public bool Selected { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public bool IsConnected { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string RequestPort { get; set; }
|
||||
public string StreamingPort { get; set; }
|
||||
|
||||
@ -477,115 +477,6 @@ namespace GenesisCordonelInterface.UI.LaatzenAPI_GenesisToolBox
|
||||
}
|
||||
}
|
||||
|
||||
private async void __Connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cbComSlot.SelectedItem == null ||
|
||||
string.IsNullOrEmpty(cbComSlot.SelectedItem.ToString()) ||
|
||||
!int.TryParse(cbComSlot.SelectedItem.ToString(), out var slotNo))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetBusy(true, "Connect");
|
||||
DisableAllButtons();
|
||||
_dataTable.Rows.Clear();
|
||||
|
||||
var result = await interfaceToLaatzen.ConnectOneSlotAsync(slotNo);
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
lblState.ForeColor = Color.Green;
|
||||
lblState.Text = $@"Connected to PCB {result.PcbId}";
|
||||
lblConfigVersion.Text = @"Configuration Version: " + result.InterfaceVersion;
|
||||
lblConfigVersion.ForeColor = result.InterfaceSupportsFwVersion ? Color.Green : Color.Red;
|
||||
|
||||
if (!result.InterfaceSupportsFwVersion)
|
||||
{
|
||||
var text = "CONFIGURATION OUTDATED!\n\n" +
|
||||
"The loaded \"configuration.json\" " +
|
||||
$"version: {result.InterfaceVersion}\n" +
|
||||
$"does NOT support the Cordonel FW version: {result.FwVersion}!";
|
||||
|
||||
MessageBox.Show(text, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
foreach (var item in result.Registers)
|
||||
{
|
||||
var row = _dataTable.NewRow();
|
||||
row["Name"] = item.Name;
|
||||
row["Type"] = item.Type;
|
||||
row["isChecked"] = false;
|
||||
row["Value"] = "";
|
||||
row["RawValue"] = item.RawValue;
|
||||
row["RawValueFile"] = item.RawValue;
|
||||
row["Min"] = item.Min;
|
||||
row["Max"] = item.Max;
|
||||
row["Description"] = item.Description;
|
||||
row["Version"] = item.Version;
|
||||
row["IsAvailable"] = item.IsAvailable;
|
||||
row["Privilege"] = item.Privilege;
|
||||
row["btnHistoryText"] = "View History";
|
||||
|
||||
_dataTable.Rows.Add(row);
|
||||
}
|
||||
|
||||
registerGridView.DataSource = _dataTable.DefaultView;
|
||||
|
||||
var column = registerGridView?.Columns["isChecked"];
|
||||
if (column != null)
|
||||
{
|
||||
column.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
registerGridView.Sort(column, ListSortDirection.Descending);
|
||||
|
||||
var viewColumn = registerGridView.Columns["RawValueFile"];
|
||||
if (viewColumn != null)
|
||||
viewColumn.Visible = false;
|
||||
}
|
||||
|
||||
column = registerGridView?.Columns["Name"];
|
||||
if (column != null)
|
||||
{
|
||||
registerGridView.Sort(column, ListSortDirection.Ascending);
|
||||
}
|
||||
|
||||
if (registerGridView.Columns["btnHistory"] == null)
|
||||
{
|
||||
var btnHistory = new DataGridViewButtonColumn
|
||||
{
|
||||
Name = "btnHistory",
|
||||
DataPropertyName = "btnHistoryText"
|
||||
};
|
||||
|
||||
registerGridView.Columns.Add(btnHistory);
|
||||
}
|
||||
|
||||
registerGridView.Visible = true;
|
||||
btnConnect.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnConnect.Enabled = false;
|
||||
lblState.ForeColor = Color.Red;
|
||||
lblState.Text = $@"Not Connected to PcbId:{result.PcbId}";
|
||||
registerGridView.Visible = false;
|
||||
|
||||
MessageBox.Show(result.Message ?? "Connect failed.", @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, @"FAILED", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
btnConnect.Enabled = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
SetBusy(false);
|
||||
EnableAllButtons();
|
||||
}
|
||||
}
|
||||
|
||||
private void GetPcbId(Int32 slotNR)
|
||||
{
|
||||
try
|
||||
|
||||
@ -268,7 +268,7 @@ namespace GenesisCordonelInterface.UI.StaraTuraAPI_GenesisCordonelInterface
|
||||
if (!result.Success)
|
||||
throw new Exception(result.Message);
|
||||
|
||||
MessageBox.Show($"Connected.\r\nPCB ID: {result.PcbId}");
|
||||
MessageBox.Show($"Connected.\r\n");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -8,10 +8,11 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
{
|
||||
return new List<MeterGridColumnConfig>
|
||||
{
|
||||
new MeterGridColumnConfig { Name = "Slot", HeaderText = "Slot", DisplayIndex = 0, Width = 50, ReadOnly = true },
|
||||
new MeterGridColumnConfig { Name = "Selected", HeaderText = "Selected", DisplayIndex = 1, Width = 60 },
|
||||
new MeterGridColumnConfig { Name = "Slot", HeaderText = "Slot", DisplayIndex = 0, Width = 30, ReadOnly = true },
|
||||
new MeterGridColumnConfig { Name = "Selected", HeaderText = "Selected", DisplayIndex = 1, Width = 30 },
|
||||
new MeterGridColumnConfig { Name = "PcbId", HeaderText = "PcbId", DisplayIndex = 2, Width = 80 },
|
||||
new MeterGridColumnConfig { Name = "IsLoggedOn", HeaderText = "IsLoggedOn", DisplayIndex = 3, Width = 80 },
|
||||
new MeterGridColumnConfig { Name = "IsLoggedOn", HeaderText = "IsLoggedOn", DisplayIndex = 3, Width = 30 },
|
||||
new MeterGridColumnConfig { Name = "IsLoggedOn", HeaderText = "IsLoggedOn", DisplayIndex = 3, Width = 30 },
|
||||
new MeterGridColumnConfig { Name = "RequestPort", HeaderText = "RequestPort", DisplayIndex = 4, Width = 90 },
|
||||
new MeterGridColumnConfig { Name = "StreamingPort", HeaderText = "StreamingPort", DisplayIndex = 5, Width = 100 },
|
||||
new MeterGridColumnConfig { Name = "FwVersion", HeaderText = "FwVersion", DisplayIndex = 6, Width = 80 },
|
||||
|
||||
@ -33,6 +33,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
grid.Columns.Add("Slot", "Slot");
|
||||
grid.Columns.Add(new DataGridViewCheckBoxColumn { Name = "Selected", HeaderText = "Selected" });
|
||||
grid.Columns.Add("PcbId", "PcbId");
|
||||
grid.Columns.Add(new DataGridViewCheckBoxColumn { Name = "IsConnected", HeaderText = "IsConnected" });
|
||||
grid.Columns.Add(new DataGridViewCheckBoxColumn { Name = "IsLoggedOn", HeaderText = "IsLoggedOn" });
|
||||
|
||||
grid.Columns.Add(CreateComPortColumn("RequestPort", "RequestPort", comPorts));
|
||||
@ -84,6 +85,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
SetCell(row, "Slot", meter.Slot);
|
||||
SetCell(row, "Selected", meter.Selected);
|
||||
SetCell(row, "PcbId", meter.PcbId);
|
||||
SetCell(row, "IsConnected", meter.IsConnected);
|
||||
SetCell(row, "IsLoggedOn", meter.IsLoggedOn);
|
||||
SetCell(row, "RequestPort", meter.RequestPort);
|
||||
SetCell(row, "RequestPortType", NormalizeRequestPortType(meter.RequestPortType));
|
||||
@ -113,6 +115,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
SetCell(row, "RequestPort", slot.RequestPort == null ? "" : slot.RequestPort.PortName);
|
||||
SetCell(row, "RequestPortType", MapRequestPortTypeBack(slot.RequestPort == null ? null : slot.RequestPort.Type));
|
||||
SetCell(row, "StreamingPort", slot.StreamingPort == null ? "" : slot.StreamingPort.PortName);
|
||||
SetCell(row, "IsConnected", false);
|
||||
SetCell(row, "IsLoggedOn", false);
|
||||
SetCell(row, "FwVersion", "");
|
||||
SetCell(row, "InterfaceVersion", "");
|
||||
@ -148,6 +151,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
SetCell(row, "RequestPortType", "IRDA");
|
||||
SetCell(row, "StreamingPort", "");
|
||||
SetCell(row, "PcbId", "");
|
||||
SetCell(row, "IsConnected", false);
|
||||
SetCell(row, "IsLoggedOn", false);
|
||||
SetCell(row, "FwVersion", "");
|
||||
SetCell(row, "InterfaceVersion", "");
|
||||
@ -170,6 +174,7 @@ namespace TBF.Rig.BridgeComponents.GciBridge.UI.Grid
|
||||
Slot = Convert.ToInt32(row.Cells["Slot"].Value),
|
||||
Selected = GetBool(row, "Selected"),
|
||||
PcbId = GetString(row, "PcbId"),
|
||||
IsConnected = GetBool(row, "IsConnected"),
|
||||
IsLoggedOn = GetBool(row, "IsLoggedOn"),
|
||||
RequestPort = GetString(row, "RequestPort"),
|
||||
RequestPortType = NormalizeRequestPortType(GetString(row, "RequestPortType")),
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
public int Slot { get; set; }
|
||||
public bool Selected { get; set; }
|
||||
public string PcbId { get; set; }
|
||||
public bool IsConnected { get; set; }
|
||||
public bool IsLoggedOn { get; set; }
|
||||
public string RequestPort { get; set; }
|
||||
public string StreamingPort { get; set; }
|
||||
|
||||
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Xylem.Common.Utils.Logging;
|
||||
using TBF.Rig.BridgeComponents.GciBridge.UI.StaraTuraAPI_GciBridge;
|
||||
|
||||
namespace TBF.Rig.BridgeComponents.GciBridge.UI
|
||||
|
||||
Loading…
Reference in New Issue
Block a user