Compare commits

...
5 changed files with 29 additions and 38 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG;ORACLE_DB</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;ORACLE_DB</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -17,7 +17,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG;ORACLE_DB</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
@@ -25,7 +25,7 @@
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;ORACLE_DB</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("3.1.1840.0")] [assembly: AssemblyVersion("3.1.1842.0")]
[assembly: AssemblyFileVersion("3.1.1840.0")] [assembly: AssemblyFileVersion("3.1.1842.0")]
@@ -87,6 +87,9 @@ namespace TBF.Rig.DataEntry.S620
static IList<Part> uniqueCodeParts; static IList<Part> uniqueCodeParts;
static IList<ICheckItem> palety; static IList<ICheckItem> palety;
int lastProducedPcsCount;
int lastAssignedSN;
static FormForMechanicalMetersWithTracing() static FormForMechanicalMetersWithTracing()
{ {
workflows = new List<Process>(); workflows = new List<Process>();
@@ -417,27 +420,29 @@ namespace TBF.Rig.DataEntry.S620
assignedSNs.Clear(); assignedSNs.Clear();
var order = ProcessData.OrderInfo; var order = ProcessData.OrderInfo;
var oraOrder = order as TBF.Rig.Output.DB.SensusOracle.OrderDetails;
/// ///
var oraOrder = order as TBF.Rig.Output.DB.SensusOracle.OrderDetails;
if (oraOrder != null && (ProcessData.OracleDB == null || !ProcessData.OracleDB.ReadOrderDetails(ref oraOrder))) if (oraOrder != null && (ProcessData.OracleDB == null || !ProcessData.OracleDB.ReadOrderDetails(ref oraOrder)))
{ {
return false; return false; /// Oracle order details could not be loaded
} }
lastProducedPcsCount = order.CurrentPcsCount;
lastAssignedSN = order.CurrentSN;
for (int i = 0; i < textBoxesCount; i++) for (int i = 0; i < textBoxesCount; i++)
{ {
bool passed = waterMeters[i].PassedFromTests(); bool passed = waterMeters[i].PassedFromTests();
if (passed && !string.IsNullOrEmpty(bodyNrBoxes[i].Text) && checkBoxes[i].Checked) if (passed && !string.IsNullOrEmpty(bodyNrBoxes[i].Text) && checkBoxes[i].Checked && lastProducedPcsCount < order.PiecesCount)
{ {
int currentSerialNr = (order.CurrentSN < order.SNFirst) int currentSerialNr = (lastAssignedSN < order.SNFirst)
? order.SNFirst ? order.SNFirst
: order.CurrentSN + 1; : lastAssignedSN + 1;
serialNrBoxes[i].Text = currentSerialNr.ToString(string.Format("D{0}", snDigits)); serialNrBoxes[i].Text = currentSerialNr.ToString(string.Format("D{0}", snDigits));
order.CurrentSN = currentSerialNr; lastAssignedSN = currentSerialNr;
order.CurrentPcsCount++; lastProducedPcsCount++;
} }
else else
{ {
@@ -789,7 +794,13 @@ namespace TBF.Rig.DataEntry.S620
} }
disabled[i] = !checkBoxes[i].Checked; disabled[i] = !checkBoxes[i].Checked;
} }
purchaseOrder = (preSelectedPurchaseOrder != null) ? preSelectedPurchaseOrder : orderCB.Text;
if (atTheEnd && ProcessData.OrderInfo != null)
{
ProcessData.OrderInfo.CurrentPcsCount = lastProducedPcsCount;
ProcessData.OrderInfo.CurrentSN = lastAssignedSN;
}
//SaveProductionTracingRecords(); /// TODO //SaveProductionTracingRecords(); /// TODO
@@ -1521,26 +1532,6 @@ namespace TBF.Rig.DataEntry.S620
} }
/// <summary>
/// Returns next free serial number within specified range or 0 if no appropriate s/n is available
/// </summary>
/// <returns>Serial number or 0</returns>
int GetNextSerialNr()
{
for (int sn = snRangeFirst; sn <= snRangeLast; sn++)
{
if (!foundSNs.Contains(sn) && !assignedSNs.Contains(sn))
{
/// A free serial number within specified range found
assignedSNs.Add(sn);
return sn;
}
}
return 0; /// No free serial number found
}
/// <summary> /// <summary>
/// Read released-active processes from the database. /// Read released-active processes from the database.
/// </summary> /// </summary>
+4 -4
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG;MANAGED;ORACLE_DB; TURA_IPERL</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -50,7 +50,7 @@
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;MANAGED;ORACLE_DB; TURA_IPERL</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@@ -60,7 +60,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG;MANAGED;ORACLE_DB; TURA_IPERL</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
@@ -70,7 +70,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath> <OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;MANAGED;ORACLE_DB; TURA_IPERL</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>