Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
550459285b | ||
|
|
498fc21412 | ||
|
|
3f07a506ad | ||
|
|
3a2290570d | ||
|
|
3b68e3f9fd | ||
|
|
3184b1da8e | ||
|
|
b70a10e697 | ||
|
|
203c2498ac | ||
|
|
2023ea5221 |
@@ -17,7 +17,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;LANG_PL</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -25,7 +25,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;LANG_PL</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -181,6 +181,18 @@ namespace Results.Entities
|
||||
return WaterMeters.Count - PassedMetersCount();
|
||||
}
|
||||
|
||||
|
||||
public virtual int PassedMetersCountE15()
|
||||
{
|
||||
int count = 0;
|
||||
foreach (var mtr in WaterMeters) if (mtr.PassedFromTestsE15()) count++;
|
||||
return count;
|
||||
}
|
||||
public virtual int FailedMetersCountE15()
|
||||
{
|
||||
return WaterMeters.Count - PassedMetersCountE15();
|
||||
}
|
||||
|
||||
public virtual long ErrorFlags()
|
||||
{
|
||||
long result = 0;
|
||||
|
||||
@@ -189,6 +189,12 @@ namespace Results.Entities
|
||||
{
|
||||
return ErrorFlagsFromTests() | ErrorFlags;
|
||||
}
|
||||
|
||||
public virtual long ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask errorFlagsQuestion)
|
||||
{
|
||||
long errorFlagsMask = (long)errorFlagsQuestion;
|
||||
return ErrorFlagsFromTests() & errorFlagsMask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert combined errorFlags of all tests to string
|
||||
@@ -270,6 +276,24 @@ namespace Results.Entities
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
||||
public virtual bool PassedFromTestsE15()
|
||||
{
|
||||
//TODO BUMI this will just let us is E15
|
||||
bool passed = (ErrorFlagsFromTestsAndWMByFlag(ErrorFlagMask.E15) == 0);
|
||||
|
||||
//TODO BUMI Check This may be not needed ?
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if (mtr.Evaluate() && (!mtr.TestDone))
|
||||
{
|
||||
passed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Three state test results and/or water meter result (Algeria PT25 requirement).
|
||||
|
||||
@@ -349,6 +349,8 @@ namespace Results
|
||||
Pulses_main, /// 295 Compound main meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
||||
Pulses_aux, /// 296 Compound aux meter pulses (recalculated so that the gated ref. pulses for this meter are equal to the total ref. pulses)
|
||||
|
||||
Failed_meters_countE15, /// 297
|
||||
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
+68
-1
@@ -224,15 +224,18 @@ namespace Results.Output
|
||||
/// Calculate Y-coordinate taking into account cell merging
|
||||
float mergedRowPos = rowPos[rowIx];
|
||||
mergedCellsCount = 1;
|
||||
List<string> texts = new List<string>();
|
||||
texts.Add(Cells[rowIx][colIx].Text);
|
||||
for (int rowIx2 = rowIx - 1; rowIx2 >= 0 && Cells[rowIx2][colIx].BottomMerge; rowIx2--)
|
||||
{
|
||||
mergedRowPos += rowPos[rowIx2];
|
||||
mergedCellsCount++;
|
||||
texts.Add(Cells[rowIx2][colIx].Text);
|
||||
}
|
||||
mergedRowPos /= mergedCellsCount;
|
||||
|
||||
/// Print the text at the calculated position
|
||||
Common.Printers.PrintersCommon.PrintAt(e, Cells[rowIx][colIx].Text,
|
||||
Common.Printers.PrintersCommon.PrintAt(e, mergedCellsCount == 1 ? Cells[rowIx][colIx].Text : GetMergedCellStringAsNegativeOrPositive(texts),
|
||||
Cells[rowIx][colIx].Font,
|
||||
left + mergedColPos,
|
||||
top + mergedRowPos,
|
||||
@@ -309,6 +312,70 @@ namespace Results.Output
|
||||
return table;
|
||||
}
|
||||
|
||||
public string GetMergedCellStringAsNegativeOrPositive(List<string> texts)
|
||||
{
|
||||
if (texts.Count < 1)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool firstIsHead = false;
|
||||
bool hasNegativeAll = true;
|
||||
bool hasPositiveAll = true;
|
||||
bool hasMixed = false;
|
||||
string lastRowText = null;
|
||||
|
||||
//check if is a header
|
||||
|
||||
foreach (string text in texts)
|
||||
{
|
||||
if (text != "-")
|
||||
{
|
||||
hasNegativeAll = false;
|
||||
}
|
||||
|
||||
if (text != "+")
|
||||
{
|
||||
hasPositiveAll = false;
|
||||
}
|
||||
|
||||
if (!hasMixed)
|
||||
{
|
||||
if (lastRowText == null)
|
||||
{
|
||||
lastRowText = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lastRowText != text)
|
||||
{
|
||||
hasMixed = true;
|
||||
}
|
||||
|
||||
lastRowText = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasMixed)
|
||||
{
|
||||
//merge as negative
|
||||
return "-";
|
||||
}
|
||||
else if (hasPositiveAll)
|
||||
{
|
||||
//merge as positive
|
||||
return "+";
|
||||
}
|
||||
else if (hasNegativeAll)
|
||||
{
|
||||
//merge as negative
|
||||
return "-";
|
||||
}
|
||||
|
||||
return texts[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a table where tests are in columns.
|
||||
/// Left column contains item (or row) captions.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;LANG_PL</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -29,7 +29,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;LANG_PL</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
|
||||
@@ -408,6 +408,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Lite_per_pulse_Read, "1 / PlsPerLtr_Read", Quantity.PulsePerLtr, ItemCategory.Other, (w,t,u,f,p) => FormatDbl(u, f, p, "V4", (w.WaterMeterData.PulsesPerLtr != 0) ? 1/w.WaterMeterData.PulsesPerLtr : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_meters_count, Strings.Passed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_count, Strings.Failed_meters_count, Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCount())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Failed_meters_countE15, Strings.Failed_meters_count + "E15", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.FailedMetersCountE15())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Passed_seals_count, "Seals count of passed meters", Quantity.Number, ItemCategory.Other, (w,t,u,f,p) => FormatInt(f, w.Batch.PassedMetersCount() * int.Parse(w.WaterMeterData.Text5))));
|
||||
|
||||
/// Extra water meter data
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.9.2142.21")]
|
||||
[assembly: AssemblyFileVersion("3.9.2142.21")]
|
||||
[assembly: AssemblyVersion("3.9.2143.1")]
|
||||
[assembly: AssemblyFileVersion("3.9.2143.1")]
|
||||
|
||||
@@ -29,12 +29,14 @@ namespace TBF.Rig.BuiltIn
|
||||
/// Relative time in [s] from the start of the operation
|
||||
int timeShift; /// Set in SetValvesOp(cb, bool open, OutputPath outPath, DateTimeBox timeStamp)
|
||||
|
||||
/// <summary>
|
||||
/// Processes coupled valves and creates switch points.
|
||||
/// </summary>
|
||||
/// <param name="valvesOpen">A list of opening master valves</param>
|
||||
/// <param name="valvesClose">A list of closing master valves</param>
|
||||
/// <returns></returns>
|
||||
int waitOnCBDelay = 2; // additional wait for the correct ControlBoard response in [s]
|
||||
|
||||
/// <summary>
|
||||
/// Processes coupled valves and creates switch points.
|
||||
/// </summary>
|
||||
/// <param name="valvesOpen">A list of opening master valves</param>
|
||||
/// <param name="valvesClose">A list of closing master valves</param>
|
||||
/// <returns></returns>
|
||||
IList<SwitchPoint> AddSwitchPoints(IList<SwitchPoint> swPoints, IList<IValve> valvesOpen, IList<IValve> valvesClose, int time)
|
||||
{
|
||||
int ix0 = swPoints.Count;
|
||||
@@ -277,7 +279,7 @@ namespace TBF.Rig.BuiltIn
|
||||
{
|
||||
if (nextIx >= switchPoints.Count)
|
||||
{
|
||||
return (StateMachine.Time >= swStartTime + maxDelayTime) ? Event.ValvesSet : Event.ValvesBusy;
|
||||
return (StateMachine.Time >= swStartTime + maxDelayTime + waitOnCBDelay) ? Event.ValvesSet : Event.ValvesBusy;
|
||||
}
|
||||
|
||||
if (StateMachine.Time >= swStartTime + switchPoints[nextIx].TimeSec)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.Rig
|
||||
public CfgChangeArgs(CfgChangeCmd command, Generic.IComponentCfg cfg)
|
||||
{
|
||||
Command = command;
|
||||
Cfg = cfg;
|
||||
Cfg = cfg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,10 +669,7 @@ namespace TBF.Rig.DataEntry.StandartCameraPurchaseOrder
|
||||
{
|
||||
foreach (PurchaseOrder pOrder in purchaseOrderListExample)
|
||||
{
|
||||
if (pOrder != null && !String.IsNullOrEmpty(pOrder.Name))
|
||||
{
|
||||
orderComboBox.Items.Add(pOrder.Name);
|
||||
}
|
||||
orderComboBox.Items.Add(pOrder.Name);
|
||||
}
|
||||
|
||||
LoadPurchaseBox("");
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Net;
|
||||
using Common;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.Rig.Network.Adapter
|
||||
@@ -37,7 +38,11 @@ namespace TBF.Rig.Network.Adapter
|
||||
AdapterInfo netadapter = AdapterInfo.GetNetAdapter(netadapterCfg.Description);
|
||||
ipAddress = netadapter.IPAddress;
|
||||
netMask = netadapter.NetMask;
|
||||
broadcastAddress = netadapter.GetBroadcastAddress();
|
||||
|
||||
if (this.Cfg.DebugLevel != DebugMode.Simulate)
|
||||
{
|
||||
broadcastAddress = netadapter.GetBroadcastAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user