Add Genesis COM port configuration and update Genesis meter setup logic
- Introduce `OptoComPortNr` and `HeadComPortNr` properties in `GenesisHead`. - Update `SetupGenesisMeter` to use new COM port configurations. - Add reference to `Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig`.
This commit is contained in:
parent
6b18a750db
commit
9bfc773240
@ -71,6 +71,8 @@ namespace TBF.Rig.TestMethods.GenesisCommunication.GenesisHead
|
||||
|
||||
private readonly GenesisHeadCfg genesisHeadCfg;
|
||||
public int SlotNr { get { return genesisHeadCfg.SlotNr; } }
|
||||
public int OptoComPortNr { get { return genesisHeadCfg.OptoComPortNr; } }
|
||||
public int HeadComPortNr { get { return genesisHeadCfg.HeadComPortNr; } }
|
||||
public double PulsesPerLtr { get { return 1000.0; } }
|
||||
public double LtrsPerPulse { get { return 1 / PulsesPerLtr; } }
|
||||
public string QuantityUnits { get; set; }
|
||||
@ -254,7 +256,22 @@ namespace TBF.Rig.TestMethods.GenesisCommunication.GenesisHead
|
||||
//add for gen
|
||||
|
||||
myGenesis = new GenesisMeter();
|
||||
myGenesis.SetupFromConfigFile(SlotNr);
|
||||
//myGenesis.SetupFromConfigFile(SlotNr);
|
||||
//myGenesis.SetLogger(); - private, but called into basic constructor!
|
||||
myGenesis.SetupGenesisMeter(
|
||||
SlotNr,
|
||||
new Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.PortConfig()
|
||||
{
|
||||
Type = "Xylem.Common.Hardware.Interfaces.Ports.SerialPorts.IrdaSerialPort",
|
||||
PortName =$"COM{HeadComPortNr}"
|
||||
},
|
||||
new Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.PortConfig()
|
||||
{
|
||||
Type = "",
|
||||
PortName = $"COM{OptoComPortNr}"
|
||||
}
|
||||
);
|
||||
|
||||
Log("Add Meter to batch");
|
||||
GenesisHeadBatch.BatchHolder.Value.AddMeter(myGenesis);
|
||||
Log("Log Raw Data");
|
||||
|
||||
@ -173,6 +173,9 @@
|
||||
<Reference Include="Xylem.Common.CommonCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.CommonCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisConfig.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore">
|
||||
<HintPath>..\packages\Common\Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user