Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc7aec8494 |
@@ -26,8 +26,6 @@ GenericTest/bin/
|
||||
GenericTest/obj/
|
||||
GraphLib/bin/
|
||||
GraphLib/obj/
|
||||
LabelPrinting/bin/
|
||||
LabelPrinting/obj/
|
||||
MergeResultsDBs/bin/
|
||||
MergeResultsDBs/obj/
|
||||
OrderManagement/bin/
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace Common.Forms
|
||||
{
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -56,20 +53,20 @@ namespace Common.Forms
|
||||
public event EventHandler<MessageEventArgs> UpdateMessageHandler;
|
||||
void OnUpdateMessage(object sender, MessageEventArgs args)
|
||||
{
|
||||
if (args != null && args.Message != null) label1.Text = args.Message;
|
||||
if (args.Message != null) label1.Text = args.Message;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called from the state machine when an operation forces a modeless dialog close.
|
||||
/// </summary>
|
||||
public void CloseForm()
|
||||
public static void CloseForm()
|
||||
{
|
||||
if (CloseFormHandler == null) return;
|
||||
try { CloseFormHandler(null, null); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
public event EventHandler<EventArgs> CloseFormHandler;
|
||||
static public event EventHandler<EventArgs> CloseFormHandler;
|
||||
void OnCloseForm(object sender, EventArgs args)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
|
||||
+1
-43
@@ -105,14 +105,6 @@ namespace Common
|
||||
///
|
||||
[Description("pulse/kWh")] ppkWh, /// * 1 pulse/kWh
|
||||
[Description("kWh/pulse")] kWhpp, /// 1 kWh/pulse
|
||||
|
||||
///
|
||||
[Description("A")] A, /// *1 A
|
||||
[Description("mA")] mA, /// 1 mA = 0.001 A
|
||||
///
|
||||
[Description("V")] V, /// *1 V
|
||||
[Description("mV")] mV, /// 1 mV = 0.001 V
|
||||
|
||||
|
||||
Count
|
||||
}
|
||||
@@ -143,8 +135,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum und Uhrzeit")] DateTime,
|
||||
[Description("Aufgezählt")] Enumerated,
|
||||
[Description("Strom")] Current,
|
||||
[Description("Spannung")] Voltage,
|
||||
#elif LANG_PL
|
||||
[Description("Objętość")] Volume,
|
||||
[Description("Przepływ")] Flow,
|
||||
@@ -168,8 +158,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data i czas")] DateTime,
|
||||
[Description("Wyliczone")] Enumerated,
|
||||
[Description("Prąd")] Current,
|
||||
[Description("Napięcie")] Voltage,
|
||||
#elif LANG_CS
|
||||
[Description("Objem")] Volume,
|
||||
[Description("Průtok")] Flow,
|
||||
@@ -193,8 +181,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Datum a čas")] DateTime,
|
||||
[Description("Vyjmenované")] Enumerated,
|
||||
[Description("Proud")] Current,
|
||||
[Description("Napětí")] Voltage,
|
||||
#elif LANG_IT
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flusso")] Flow,
|
||||
@@ -218,8 +204,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Data e ora")] DateTime,
|
||||
[Description("Enumerato")] Enumerated,
|
||||
[Description("Corrente")] Current,
|
||||
[Description("Voltaggio")] Voltage,
|
||||
#else
|
||||
[Description("Volume")] Volume,
|
||||
[Description("Flow")] Flow,
|
||||
@@ -243,8 +227,6 @@ namespace Common
|
||||
[Description("Boolean")] Boolean,
|
||||
[Description("Date and time")] DateTime,
|
||||
[Description("Enumerated")] Enumerated,
|
||||
[Description("Current")] Current,
|
||||
[Description("Voltage")] Voltage,
|
||||
#endif
|
||||
Count,
|
||||
}
|
||||
@@ -260,8 +242,7 @@ namespace Common
|
||||
{
|
||||
return unit == Unit.l || unit == Unit.m3ph || unit == Unit.kg || unit == Unit.s || unit == Unit.C ||
|
||||
unit == Unit.bar || unit == Unit.RPct || unit == Unit.Pct || unit == Unit.mm || unit == Unit.kgpm3 ||
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh || unit == Unit.A ||
|
||||
unit == Unit.V;
|
||||
unit == Unit.J || unit == Unit.uSpcm || unit == Unit.ppl || unit == Unit.ppkWh;
|
||||
}
|
||||
|
||||
public static bool IsQuantity(Unit unit, Quantity quantity)
|
||||
@@ -370,14 +351,6 @@ namespace Common
|
||||
case Unit.ppkWh:
|
||||
case Unit.kWhpp:
|
||||
return Quantity.PulsePerKWh;
|
||||
|
||||
case Unit.A:
|
||||
case Unit.mA:
|
||||
return Quantity.Current;
|
||||
|
||||
case Unit.V:
|
||||
case Unit.mV:
|
||||
return Quantity.Voltage;
|
||||
|
||||
default:
|
||||
return Quantity.Number;
|
||||
@@ -399,8 +372,6 @@ namespace Common
|
||||
public static bool IsPulsePerLtr(Unit unit) { return IsQuantity(unit, Quantity.PulsePerLtr); }
|
||||
public static bool IsPulsePerKWh(Unit unit) { return IsQuantity(unit, Quantity.PulsePerKWh); }
|
||||
public static bool IsConductivity(Unit unit) { return IsQuantity(unit, Quantity.Conductivity); }
|
||||
public static bool IsCurrent(Unit unit) { return IsQuantity(unit, Quantity.Current); }
|
||||
public static bool IsVoltage(Unit unit) { return IsQuantity(unit, Quantity.Voltage); }
|
||||
|
||||
|
||||
|
||||
@@ -484,13 +455,6 @@ namespace Common
|
||||
case Unit.dm3pp:
|
||||
case Unit.lpdeg:
|
||||
case Unit.dm3pdeg: return (v <= float.Epsilon) ? 0 : 1/v;
|
||||
|
||||
/// Current: internal representation in A
|
||||
case Unit.mA: return 1000 * v; /// 1000 mA = 1 A
|
||||
|
||||
/// Voltage: internal representation in V
|
||||
case Unit.mV: return 1000 * v; /// 1000 mV = 1 V
|
||||
|
||||
|
||||
default: return v; /// Do not convert
|
||||
}
|
||||
@@ -570,12 +534,6 @@ namespace Common
|
||||
|
||||
/// Electrical conductivity
|
||||
case Unit.mSpm: return 10 * v;
|
||||
|
||||
/// Current: internal representation in A
|
||||
case Unit.mA: return 0.001 * v; /// 1 mA = 0.001 A
|
||||
|
||||
/// Voltage: internal representation in V
|
||||
case Unit.mV: return 0.001 * v; /// 1 mV = 0.001 V
|
||||
|
||||
/// Invert
|
||||
case Unit.kWhpp:
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -43,7 +43,7 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -22,9 +22,6 @@ namespace Config.Entities
|
||||
public virtual string PressMtrUp { get; set; }
|
||||
public virtual string PressMtrDown { get; set; }
|
||||
public virtual string PressMtrDelta { get; set; }
|
||||
public virtual string ElectricMtrUp { get; set; }
|
||||
public virtual string ElectricMtrDown { get; set; }
|
||||
public virtual string ElectricMtrDelta { get; set; }
|
||||
public virtual string StopBFValve { get; set; }
|
||||
|
||||
/// Valves
|
||||
@@ -62,9 +59,6 @@ namespace Config.Entities
|
||||
result.PressMtrUp = PressMtrUp;
|
||||
result.PressMtrDown = PressMtrDown;
|
||||
result.PressMtrDelta = PressMtrDelta;
|
||||
result.ElectricMtrUp = ElectricMtrUp;
|
||||
result.ElectricMtrDown = ElectricMtrDown;
|
||||
result.ElectricMtrDelta = ElectricMtrDelta;
|
||||
result.StopBFValve = StopBFValve;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace Config.Entities
|
||||
public virtual Unit TempUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit PressUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit LengthUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
public virtual Unit ElectricUnit { get; set; } /// Not mapped to database, used in ProcedureDlg / Metrology1Tab
|
||||
|
||||
/// Wrappers
|
||||
public virtual double QfromM3ph()
|
||||
@@ -210,7 +209,6 @@ namespace Config.Entities
|
||||
result.TempUnit = TempUnit;
|
||||
result.PressUnit = PressUnit;
|
||||
result.LengthUnit = LengthUnit;
|
||||
result.ElectricUnit = ElectricUnit;
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
|
||||
return result;
|
||||
|
||||
@@ -40,8 +40,9 @@
|
||||
<StartupObject>DeviceTest.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -49,7 +49,7 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -65,8 +65,7 @@ namespace GenericTest
|
||||
const int ActivityMsgsCount = 7;
|
||||
ActivityEventArgs[] activityEvents; /// Activity messages displayed in the main window
|
||||
|
||||
Common.Forms.ModelessForm modelessForm;
|
||||
|
||||
|
||||
NHibernate.ISession dbSession; /// MySQL database session
|
||||
static OracleConnection oracleConn; /// Oracle database connection (server is in Stara Tura)
|
||||
#if RF_TEST_400_900
|
||||
@@ -116,8 +115,7 @@ namespace GenericTest
|
||||
UpdateTitle();
|
||||
|
||||
/// Open a modeless form that is closed after initialization and loading the main window
|
||||
modelessForm = new Common.Forms.ModelessForm("Loading workflows from a database");
|
||||
new Thread(() => Application.Run(modelessForm)).Start();
|
||||
new Thread(() => Application.Run(new Common.Forms.ModelessForm("Loading workflows from a database"))).Start();
|
||||
|
||||
|
||||
activityEvents = new ActivityEventArgs[ActivityMsgsCount];
|
||||
@@ -161,7 +159,7 @@ namespace GenericTest
|
||||
StarSensorReading();
|
||||
}
|
||||
|
||||
if (modelessForm != null) modelessForm.CloseForm(); /// Close the modeless information form
|
||||
Common.Forms.ModelessForm.CloseForm(); /// Close the modeless information form
|
||||
}
|
||||
|
||||
private void startButton_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace GenericTest
|
||||
{
|
||||
if (exc is QuitAppException)
|
||||
{
|
||||
//Common.Forms.ModelessForm.CloseForm();
|
||||
Common.Forms.ModelessForm.CloseForm();
|
||||
log.FatalFormat(Strings.Program_was_not_started_0, exc.Message);
|
||||
MessageBox.Show(exc.Message,
|
||||
Strings.Warning,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace LabelPrinting
|
||||
{
|
||||
public class Cnst
|
||||
{
|
||||
public const int ExtraPieces = 10;
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E4531D13-317C-4D9F-809F-5533B5C3C8BF}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LabelPrinting</RootNamespace>
|
||||
<AssemblyName>LabelPrinting</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>LabelPrinting.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Gma.QrCodeNet.Encoding">
|
||||
<HintPath>..\packages\QrCode.Net.0.4.0.0\net40\Gma.QrCodeNet.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Cnst.cs" />
|
||||
<Compile Include="LocalSettings.cs" />
|
||||
<Compile Include="MainWnd.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWnd.Designer.cs">
|
||||
<DependentUpon>MainWnd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Printers\DataMatrixAndTextPrintDoc.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Resources\Strings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Strings.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SettingsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SettingsDlg.Designer.cs">
|
||||
<DependentUpon>SettingsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="MainWnd.resx">
|
||||
<DependentUpon>MainWnd.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Resources\Strings.cs.resx" />
|
||||
<EmbeddedResource Include="Resources\Strings.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\Strings.sk.resx" />
|
||||
<EmbeddedResource Include="SettingsDlg.resx">
|
||||
<DependentUpon>SettingsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.csproj">
|
||||
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
|
||||
<Name>Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
<Project>{743df7db-c7b6-42eb-986d-0f485e5588e4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DataMatrix4Net\DataMatrix4Net.csproj">
|
||||
<Project>{7cd2b5b4-3304-4151-b8b4-76a8b8af9b06}</Project>
|
||||
<Name>DataMatrix4Net</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GenCode128\GenCode128.csproj">
|
||||
<Project>{32817bf9-e380-4467-9c7f-936f4b122bc7}</Project>
|
||||
<Name>GenCode128</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Results\Results.csproj">
|
||||
<Project>{9d0dcc88-dc81-47eb-9fdd-4c3907871bfb}</Project>
|
||||
<Name>Results</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SharedDatabase\SharedDatabase.csproj">
|
||||
<Project>{211b5e3f-9996-48a7-abde-c878dd2d71c2}</Project>
|
||||
<Name>SharedDatabase</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TBF\TBF.csproj">
|
||||
<Project>{8648fd92-cda1-4c3a-b5f9-fe547ce1fa48}</Project>
|
||||
<Name>TBF</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Users\Users.csproj">
|
||||
<Project>{6e5cb0e9-e1b6-4e5d-ac6e-b1049e180f2b}</Project>
|
||||
<Name>Users</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="SampleConfig\log4netConfig.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,245 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace LabelPrinting
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to be serialized to an XML file...
|
||||
/// </summary>
|
||||
[XmlRootAttribute("SNPrinting")]
|
||||
public class LocalSettings
|
||||
{
|
||||
static XmlSerializer serializer = XmlSerializer.FromTypes(new[] { typeof(LocalSettings) })[0];
|
||||
|
||||
/// Configuration file ecryption/decryption key and initialization vector
|
||||
static byte[] key = new byte[] { 83, 254, 105, 64, 184, 201, 195, 127, 52, 99, 77, 45, 252, 132, 163, 156 };
|
||||
static byte[] IV = new byte[] { 189, 23, 137, 56, 204, 241, 242, 118, 28, 89, 9, 198, 224, 111, 186, 125 };
|
||||
|
||||
public Mode Mode;
|
||||
public string Language; /// User interface language used as CultureInfo(..) constructor argument
|
||||
public int DelayBetweenLabels; /// Delay between printing two consecutive labels in ms
|
||||
public bool IsUserLoginRequired; /// true = require user login on program start-up
|
||||
public string LabelPrinterCfg;
|
||||
public string TracingDBConnString; /// Connection string to MySQL database with production tracing records
|
||||
public string UsersDBConnString; /// Connection string to MySQL database with authorized users
|
||||
public string[] SapNumberHistory; /// SAP number history
|
||||
public string[] SeparatorHistory; /// Separator history
|
||||
public int CurrentSNTrail; /// Serial number trail to be printed now
|
||||
public int RemainingSNsCount; /// Remaining count of serial numbers to be printed in this session
|
||||
|
||||
|
||||
/// Parameterless constructor required by serialization
|
||||
public LocalSettings() { }
|
||||
|
||||
public LocalSettings(bool createNew)
|
||||
{
|
||||
if (createNew)
|
||||
{
|
||||
Mode = Mode.TbfLabelPrinter;
|
||||
Language = "EN";
|
||||
DelayBetweenLabels = 1000;
|
||||
IsUserLoginRequired = false;
|
||||
LabelPrinterCfg = new TBF.Rig.Output.Printers.Label.Factory().DefaultConfig().CreateDbEntity().Parameters;
|
||||
TracingDBConnString = string.Empty;
|
||||
UsersDBConnString = string.Empty;
|
||||
SapNumberHistory = new string[] { };
|
||||
SeparatorHistory = new string[] { "4VQ" };
|
||||
CurrentSNTrail = 1;
|
||||
RemainingSNsCount = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load public fields of this class from the XML file.
|
||||
/// </summary>
|
||||
/// <returns>LocalSettings object or null when Load() fails</returns>
|
||||
public static LocalSettings Load(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool isEncrypted = true;
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
isEncrypted = !reader.ReadLine().StartsWith("<?xml version=");
|
||||
reader.Close();
|
||||
}
|
||||
|
||||
if (isEncrypted)
|
||||
{
|
||||
/// Write settings to a string
|
||||
StringBuilder plain = new StringBuilder();
|
||||
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
using (ICryptoTransform decryptor = aes.CreateDecryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, decryptor, CryptoStreamMode.Read))
|
||||
{
|
||||
using (MemoryStream mStream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new BinaryWriter(mStream))
|
||||
{
|
||||
int data;
|
||||
while ((data = cs.ReadByte()) != -1)
|
||||
{
|
||||
if (data != 0) writer.Write((byte)data);
|
||||
}
|
||||
writer.Flush();
|
||||
mStream.Position = 0;
|
||||
|
||||
using (var reader = new StreamReader(mStream))
|
||||
{
|
||||
return serializer.Deserialize(reader) as LocalSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(fileName))
|
||||
{
|
||||
return serializer.Deserialize(reader) as LocalSettings;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string msg = e.Message;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save public fields of this class to the XML file.
|
||||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
/// Encrypt and write to file 'Program.LocalSettingsFileName'
|
||||
using (RijndaelManaged aes = new RijndaelManaged { Padding = PaddingMode.Zeros })
|
||||
{
|
||||
using (FileStream fsCrypt = new FileStream(Program.LocalSettingsFileName, FileMode.Create))
|
||||
{
|
||||
using (ICryptoTransform encryptor = aes.CreateEncryptor(key, IV))
|
||||
{
|
||||
using (CryptoStream cs = new CryptoStream(fsCrypt, encryptor, CryptoStreamMode.Write))
|
||||
{
|
||||
using (MemoryStream mStream = new MemoryStream())
|
||||
{
|
||||
using (var writer = new StreamWriter(mStream))
|
||||
{
|
||||
/// Serialize and write settings to a memory stream
|
||||
serializer.Serialize(writer, this);
|
||||
writer.Flush();
|
||||
mStream.Position = 0;
|
||||
|
||||
using (var reader = new StreamReader(mStream))
|
||||
{
|
||||
/// Encrypt and write to file 'Program.LocalSettingsFileName'
|
||||
int data;
|
||||
while ((data = mStream.ReadByte()) != -1) cs.WriteByte((byte)data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string msg = e.Message;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates history stored in a string array by a new latest string.
|
||||
/// </summary>
|
||||
/// <param name="lastStrValue">Last entered string</param>
|
||||
/// <returns>true = history updated</returns>
|
||||
public static bool UpdateHistory(string lastStrValue, ref string[] history)
|
||||
{
|
||||
const int MaxHistoryLen = 10;
|
||||
|
||||
if (string.IsNullOrEmpty(lastStrValue)) return false;
|
||||
|
||||
int currentHistoryLength = (history != null) ? history.Length : 0;
|
||||
|
||||
int match = -1;
|
||||
for (int i = 0; i < currentHistoryLength; i++)
|
||||
{
|
||||
if (history[i] == lastStrValue)
|
||||
{
|
||||
match = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (match >= 0 || currentHistoryLength >= MaxHistoryLen)
|
||||
{
|
||||
/// History does not have to be extended (because of a match) or should not be extended (because of the lenght)
|
||||
if (match < 0) match = currentHistoryLength - 1;
|
||||
|
||||
for (int j = match; j > 0; j--)
|
||||
{
|
||||
history[j] = history[j - 1];
|
||||
}
|
||||
history[0] = lastStrValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// History wiil be extended, new item inserted at the beginning
|
||||
string[] newHistory = new string[currentHistoryLength + 1];
|
||||
newHistory[0] = lastStrValue;
|
||||
for (int j = 1; j <= currentHistoryLength; j++)
|
||||
{
|
||||
newHistory[j] = history[j - 1];
|
||||
}
|
||||
history = newHistory;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="comboBox">Puchase order ComboBox</param>
|
||||
public static void PrepareCombo(string[] history, System.Windows.Forms.ComboBox comboBox)
|
||||
{
|
||||
if (history != null)
|
||||
{
|
||||
for (int i = 0; i < history.Length; i++)
|
||||
{
|
||||
comboBox.Items.Add(history[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (comboBox.Items.Count > 0)
|
||||
{
|
||||
comboBox.Text = comboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum Mode
|
||||
{
|
||||
TbfLabelPrinter,
|
||||
Standalone,
|
||||
WithDatabase,
|
||||
}
|
||||
}
|
||||
Generated
-197
@@ -1,197 +0,0 @@
|
||||
namespace LabelPrinting
|
||||
{
|
||||
partial class MainWnd
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.snTrailTextBox = new System.Windows.Forms.TextBox();
|
||||
this.countTextBox = new System.Windows.Forms.TextBox();
|
||||
this.snTrailLabel = new System.Windows.Forms.Label();
|
||||
this.countLabel = new System.Windows.Forms.Label();
|
||||
this.sapNumberLabel = new System.Windows.Forms.Label();
|
||||
this.separatorLabel = new System.Windows.Forms.Label();
|
||||
this.startButton = new System.Windows.Forms.Button();
|
||||
this.sapNumberComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.separatorComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.interruptButton = new System.Windows.Forms.Button();
|
||||
this.mainMenuStrip = new System.Windows.Forms.MenuStrip();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// snTrailTextBox
|
||||
//
|
||||
this.snTrailTextBox.Location = new System.Drawing.Point(230, 97);
|
||||
this.snTrailTextBox.Name = "snTrailTextBox";
|
||||
this.snTrailTextBox.Size = new System.Drawing.Size(121, 20);
|
||||
this.snTrailTextBox.TabIndex = 8;
|
||||
//
|
||||
// countTextBox
|
||||
//
|
||||
this.countTextBox.Location = new System.Drawing.Point(230, 123);
|
||||
this.countTextBox.Name = "countTextBox";
|
||||
this.countTextBox.Size = new System.Drawing.Size(72, 20);
|
||||
this.countTextBox.TabIndex = 1;
|
||||
//
|
||||
// snTrailLabel
|
||||
//
|
||||
this.snTrailLabel.AutoSize = true;
|
||||
this.snTrailLabel.Location = new System.Drawing.Point(35, 100);
|
||||
this.snTrailLabel.Name = "snTrailLabel";
|
||||
this.snTrailLabel.Size = new System.Drawing.Size(110, 13);
|
||||
this.snTrailLabel.TabIndex = 7;
|
||||
this.snTrailLabel.Text = "First S/N trail (9 digits)";
|
||||
//
|
||||
// countLabel
|
||||
//
|
||||
this.countLabel.AutoSize = true;
|
||||
this.countLabel.Location = new System.Drawing.Point(35, 126);
|
||||
this.countLabel.Name = "countLabel";
|
||||
this.countLabel.Size = new System.Drawing.Size(65, 13);
|
||||
this.countLabel.TabIndex = 0;
|
||||
this.countLabel.Text = "S/N-s count";
|
||||
//
|
||||
// sapNumberLabel
|
||||
//
|
||||
this.sapNumberLabel.AutoSize = true;
|
||||
this.sapNumberLabel.Location = new System.Drawing.Point(35, 48);
|
||||
this.sapNumberLabel.Name = "sapNumberLabel";
|
||||
this.sapNumberLabel.Size = new System.Drawing.Size(111, 13);
|
||||
this.sapNumberLabel.TabIndex = 3;
|
||||
this.sapNumberLabel.Text = "SAP number ( 8 digits)";
|
||||
//
|
||||
// separatorLabel
|
||||
//
|
||||
this.separatorLabel.AutoSize = true;
|
||||
this.separatorLabel.Location = new System.Drawing.Point(35, 74);
|
||||
this.separatorLabel.Name = "separatorLabel";
|
||||
this.separatorLabel.Size = new System.Drawing.Size(124, 13);
|
||||
this.separatorLabel.TabIndex = 5;
|
||||
this.separatorLabel.Text = "Separator ( 3 characters)";
|
||||
//
|
||||
// startButton
|
||||
//
|
||||
this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.startButton.Location = new System.Drawing.Point(439, 63);
|
||||
this.startButton.Name = "startButton";
|
||||
this.startButton.Size = new System.Drawing.Size(117, 54);
|
||||
this.startButton.TabIndex = 2;
|
||||
this.startButton.Text = "Start printing";
|
||||
this.startButton.UseVisualStyleBackColor = true;
|
||||
this.startButton.Click += new System.EventHandler(this.startButton_Click);
|
||||
//
|
||||
// sapNumberComboBox
|
||||
//
|
||||
this.sapNumberComboBox.FormattingEnabled = true;
|
||||
this.sapNumberComboBox.Location = new System.Drawing.Point(230, 45);
|
||||
this.sapNumberComboBox.Name = "sapNumberComboBox";
|
||||
this.sapNumberComboBox.Size = new System.Drawing.Size(121, 21);
|
||||
this.sapNumberComboBox.TabIndex = 9;
|
||||
//
|
||||
// separatorComboBox
|
||||
//
|
||||
this.separatorComboBox.FormattingEnabled = true;
|
||||
this.separatorComboBox.Location = new System.Drawing.Point(230, 71);
|
||||
this.separatorComboBox.Name = "separatorComboBox";
|
||||
this.separatorComboBox.Size = new System.Drawing.Size(72, 21);
|
||||
this.separatorComboBox.TabIndex = 10;
|
||||
//
|
||||
// interruptButton
|
||||
//
|
||||
this.interruptButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.interruptButton.Enabled = false;
|
||||
this.interruptButton.Location = new System.Drawing.Point(590, 63);
|
||||
this.interruptButton.Name = "interruptButton";
|
||||
this.interruptButton.Size = new System.Drawing.Size(117, 54);
|
||||
this.interruptButton.TabIndex = 11;
|
||||
this.interruptButton.Text = "Interrupt";
|
||||
this.interruptButton.UseVisualStyleBackColor = true;
|
||||
this.interruptButton.Click += new System.EventHandler(this.interruptButton_Click);
|
||||
//
|
||||
// mainMenuStrip
|
||||
//
|
||||
this.mainMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.settingsToolStripMenuItem});
|
||||
this.mainMenuStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.mainMenuStrip.Name = "mainMenuStrip";
|
||||
this.mainMenuStrip.Size = new System.Drawing.Size(742, 24);
|
||||
this.mainMenuStrip.TabIndex = 12;
|
||||
this.mainMenuStrip.Text = "mainMenuStrip";
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.settingsToolStripMenuItem.Text = "Settings";
|
||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||
//
|
||||
// MainWnd
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(742, 168);
|
||||
this.Controls.Add(this.interruptButton);
|
||||
this.Controls.Add(this.separatorComboBox);
|
||||
this.Controls.Add(this.sapNumberComboBox);
|
||||
this.Controls.Add(this.startButton);
|
||||
this.Controls.Add(this.separatorLabel);
|
||||
this.Controls.Add(this.sapNumberLabel);
|
||||
this.Controls.Add(this.countLabel);
|
||||
this.Controls.Add(this.snTrailLabel);
|
||||
this.Controls.Add(this.countTextBox);
|
||||
this.Controls.Add(this.snTrailTextBox);
|
||||
this.Controls.Add(this.mainMenuStrip);
|
||||
this.MainMenuStrip = this.mainMenuStrip;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MainWnd";
|
||||
this.Text = "S/N Printing";
|
||||
this.Load += new System.EventHandler(this.MainWnd_Load);
|
||||
this.mainMenuStrip.ResumeLayout(false);
|
||||
this.mainMenuStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox snTrailTextBox;
|
||||
private System.Windows.Forms.TextBox countTextBox;
|
||||
private System.Windows.Forms.Label snTrailLabel;
|
||||
private System.Windows.Forms.Label countLabel;
|
||||
private System.Windows.Forms.Label sapNumberLabel;
|
||||
private System.Windows.Forms.Label separatorLabel;
|
||||
private System.Windows.Forms.Button startButton;
|
||||
private System.Windows.Forms.ComboBox sapNumberComboBox;
|
||||
private System.Windows.Forms.ComboBox separatorComboBox;
|
||||
private System.Windows.Forms.Button interruptButton;
|
||||
private System.Windows.Forms.MenuStrip mainMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,480 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using DataMatrix4Net;
|
||||
using SharedDatabase.Entities;
|
||||
using LabelPrinting.Resources;
|
||||
using TBF.Rig.Output.Printers.Label;
|
||||
using NHibernate;
|
||||
using Common;
|
||||
using Results.Entities;
|
||||
|
||||
namespace LabelPrinting
|
||||
{
|
||||
public partial class MainWnd : Form
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(MainWnd));
|
||||
|
||||
private readonly Factory factory;
|
||||
private readonly Printer printer;
|
||||
|
||||
string programNameAndVer;
|
||||
string prefix; /// S/N prefix after parsing/verification by the UI
|
||||
string separator; /// Separator after parsing/verification by the UI
|
||||
int currentSNTrail; /// Current S/N trai (1st S/N trail after parsing/verification by the UI)
|
||||
int totalCount; /// Total S/N count after parsing/verification by the UI
|
||||
int remainingCount; /// Remaining S/N-s count
|
||||
IList<OrderInfo> orderInfos; /// null in Standalone mode
|
||||
Timer timer;
|
||||
bool interrupt;
|
||||
|
||||
public MainWnd()
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = programNameAndVer = string.Format("{0} v.{1}", Program.ProgramName, Program.Version); ;
|
||||
factory = new Factory();
|
||||
}
|
||||
|
||||
public MainWnd(IList<OrderInfo> orderInfos)
|
||||
: this()
|
||||
{
|
||||
this.orderInfos = orderInfos;
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.TbfLabelPrinter)
|
||||
{
|
||||
try
|
||||
{
|
||||
var cmpntEntity = Config.Entities.Component.CreateFromCfg("Printer", factory.ClassName, string.Empty, 1,
|
||||
DebugMode.Normal, LogLevel.Off,
|
||||
Program.LocalSettings.LabelPrinterCfg);
|
||||
printer = factory.GetComponent(factory.CmpntCfgFromCmpntEntity(cmpntEntity), null) as Printer;
|
||||
printer.Initialize();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Cannot create or initialize a printer",
|
||||
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string culture = Program.LocalSettings.Language.Replace('_', '-');
|
||||
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Selected language is not supported.\nUsing English.",
|
||||
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
System.Threading.Thread.CurrentThread.CurrentUICulture =
|
||||
new System.Globalization.CultureInfo("en");
|
||||
}
|
||||
|
||||
timer = new Timer();
|
||||
timer.Interval = Program.LocalSettings.DelayBetweenLabels; /// [ms] default = 1000
|
||||
timer.Tick += new EventHandler(timer_Tick);
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
startButton.Text = Strings.Start_printing;
|
||||
interruptButton.Text = Strings.Interrupt;
|
||||
settingsToolStripMenuItem.Text = Strings.Settings;
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.TbfLabelPrinter)
|
||||
{
|
||||
sapNumberLabel.Text = Strings.Order;
|
||||
separatorLabel.Text = string.Empty;
|
||||
separatorComboBox.Visible = false;
|
||||
snTrailLabel.Text = Strings.Serial_number;
|
||||
}
|
||||
else
|
||||
{
|
||||
sapNumberLabel.Text = Strings.SAP_number_8_digits;
|
||||
separatorLabel.Text = Strings.Separator_3_characters;
|
||||
snTrailLabel.Text = Strings.First_SN_trail_9_digits;
|
||||
}
|
||||
|
||||
countLabel.Text = Strings.Labels_count;
|
||||
}
|
||||
|
||||
private void MainWnd_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
LocalSettings.PrepareCombo(Program.LocalSettings.SapNumberHistory, sapNumberComboBox);
|
||||
LocalSettings.PrepareCombo(Program.LocalSettings.SeparatorHistory, separatorComboBox);
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.TbfLabelPrinter)
|
||||
{
|
||||
snTrailTextBox.Text = string.Empty;
|
||||
countTextBox.Text = Math.Max(Program.LocalSettings.RemainingSNsCount, 1).ToString();
|
||||
|
||||
snTrailLabel.Top -= 26;
|
||||
snTrailTextBox.Top -= 26;
|
||||
countLabel.Top -= 26;
|
||||
countTextBox.Top -= 26;
|
||||
|
||||
this.ActiveControl = snTrailTextBox;
|
||||
}
|
||||
else if (Program.LocalSettings.Mode == Mode.Standalone)
|
||||
{
|
||||
snTrailTextBox.Text = Program.LocalSettings.CurrentSNTrail.ToString("D9");
|
||||
countTextBox.Text = Math.Max(Program.LocalSettings.RemainingSNsCount, 1).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (orderInfos == null) throw new Exception("Missing OrderInfo-s from production tracing database");
|
||||
|
||||
currentSNTrail = 0;
|
||||
foreach (var oi in orderInfos)
|
||||
{
|
||||
if (oi.BaseNr1 + oi.PiecesCount + Cnst.ExtraPieces > currentSNTrail)
|
||||
{
|
||||
currentSNTrail = oi.BaseNr1 + oi.PiecesCount + Cnst.ExtraPieces;
|
||||
}
|
||||
}
|
||||
|
||||
snTrailTextBox.Text = currentSNTrail.ToString("D9");
|
||||
snTrailTextBox.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start printing labels
|
||||
/// </summary>
|
||||
private void startButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!int.TryParse(countTextBox.Text, out totalCount) || totalCount <= 0)
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_SNs_count);
|
||||
return;
|
||||
}
|
||||
remainingCount = totalCount;
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.TbfLabelPrinter)
|
||||
{
|
||||
var wm = new Results.Entities.WaterMeter();
|
||||
wm.PurchaseOrder = string.IsNullOrEmpty(sapNumberComboBox.Text) ? string.Empty : sapNumberComboBox.Text;
|
||||
wm.SerialNr = string.IsNullOrEmpty(snTrailTextBox.Text) ? string.Empty : snTrailTextBox.Text;
|
||||
|
||||
LocalSettings.UpdateHistory(sapNumberComboBox.Text, ref Program.LocalSettings.SapNumberHistory);
|
||||
//Program.LocalSettings.CurrentSNTrail = snTrailTextBox.Text;
|
||||
Program.LocalSettings.RemainingSNsCount = remainingCount;
|
||||
Program.LocalSettings.Save();
|
||||
|
||||
startButton.Enabled = false;
|
||||
interruptButton.Enabled = true;
|
||||
interrupt = false;
|
||||
|
||||
printer.PrintResults(wm, "document name");
|
||||
|
||||
remainingCount--;
|
||||
IncrementSN(snTrailTextBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Program.LocalSettings.Mode == Mode.Standalone || Program.LocalSettings.Mode == Mode.WithDatabase
|
||||
|
||||
int sapNumber;
|
||||
if (sapNumberComboBox.Text.Length != 8 || !int.TryParse(sapNumberComboBox.Text, out sapNumber) || sapNumber <= 0 || sapNumber > 99999999)
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_SAP_number);
|
||||
return;
|
||||
}
|
||||
|
||||
if (separatorComboBox.Text.Length != 3)
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_separator);
|
||||
return;
|
||||
}
|
||||
|
||||
if (snTrailTextBox.Text.Length != 9 || !int.TryParse(snTrailTextBox.Text, out currentSNTrail))
|
||||
{
|
||||
MessageBox.Show(Strings.Invalid_first_SN_trail);
|
||||
return;
|
||||
}
|
||||
else if (Program.LocalSettings.Mode == Mode.Standalone && currentSNTrail < Program.LocalSettings.CurrentSNTrail)
|
||||
{
|
||||
MessageBox.Show(string.Format("{0}, {1} {2:D9}", Strings.Invalid_first_SN_trail, Strings.min, Program.LocalSettings.CurrentSNTrail));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.Standalone && currentSNTrail > Program.LocalSettings.CurrentSNTrail)
|
||||
{
|
||||
if (MessageBox.Show(string.Format("{0} {1:D9}{2}{3}{4}",
|
||||
Strings.You_are_skipping,
|
||||
Program.LocalSettings.CurrentSNTrail,
|
||||
(currentSNTrail == Program.LocalSettings.CurrentSNTrail + 1) ? "" : string.Format(" ... {0:D9}", currentSNTrail - 1),
|
||||
Environment.NewLine,
|
||||
Strings.Are_you_sure),
|
||||
string.Empty,
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Program.LocalSettings.Mode == Mode.WithDatabase)
|
||||
{
|
||||
SaveNewOrderInfo(ref currentSNTrail, totalCount);
|
||||
}
|
||||
|
||||
prefix = sapNumberComboBox.Text;
|
||||
separator = separatorComboBox.Text;
|
||||
|
||||
sapNumberComboBox.Enabled = false;
|
||||
separatorComboBox.Enabled = false;
|
||||
snTrailTextBox.Enabled = false;
|
||||
countTextBox.Enabled = false;
|
||||
|
||||
LocalSettings.UpdateHistory(sapNumberComboBox.Text, ref Program.LocalSettings.SapNumberHistory);
|
||||
LocalSettings.UpdateHistory(separatorComboBox.Text, ref Program.LocalSettings.SeparatorHistory);
|
||||
|
||||
Program.LocalSettings.CurrentSNTrail = currentSNTrail;
|
||||
Program.LocalSettings.RemainingSNsCount = remainingCount;
|
||||
Program.LocalSettings.Save();
|
||||
|
||||
startButton.Enabled = false;
|
||||
interruptButton.Enabled = true;
|
||||
interrupt = false;
|
||||
|
||||
PrintOneLabel();
|
||||
}
|
||||
|
||||
if (remainingCount > 0)
|
||||
{
|
||||
timer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
Text = string.Format("{0} ... {1}", programNameAndVer, Strings.completed);
|
||||
MessageBox.Show(string.Format(Strings.x_labels_printed, totalCount));
|
||||
SaveSettingsUpdateAndEnableUI();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save a record tp OrderInfo table that coresponds to printed labels
|
||||
/// </summary>
|
||||
/// <param name="currentSNTrail">Start S/N trail number</param>
|
||||
/// <param name="totalCount">Printed labels count</param>
|
||||
/// <returns>true when successful</returns>
|
||||
bool SaveNewOrderInfo(ref int currentSNTrail, int totalCount)
|
||||
{
|
||||
ISession session = SharedDatabase.TracingDB.CreateSession(Program.LocalSettings.TracingDBConnString);
|
||||
ITransaction transaction = session.BeginTransaction();
|
||||
OrderInfo oi = new OrderInfo();
|
||||
bool successfullySaved = false;
|
||||
try
|
||||
{
|
||||
var orders = session.QueryOver<OrderInfo>().List();
|
||||
|
||||
/// Determine current S/N trail once again
|
||||
int snTrail = 0;
|
||||
foreach (var o in orders)
|
||||
{
|
||||
if (o.BaseNr1 + o.PiecesCount + Cnst.ExtraPieces > snTrail)
|
||||
{
|
||||
snTrail = o.BaseNr1 + o.PiecesCount + Cnst.ExtraPieces;
|
||||
}
|
||||
}
|
||||
|
||||
/// Compare current S/N trail with the newly obtained one, update if necessary
|
||||
if (snTrail > currentSNTrail) currentSNTrail = snTrail;
|
||||
|
||||
oi.POName = "0000000";
|
||||
oi.PiecesCount = totalCount;
|
||||
oi.TestProcedure = string.Empty;
|
||||
oi.BaseNr1 = currentSNTrail;
|
||||
oi.BaseNr2 = 0;
|
||||
oi.BaseNr3 = 0;
|
||||
oi.BaseNr4 = 0;
|
||||
oi.BaseNr5 = 0;
|
||||
oi.Remark = "Manual S/N printing";
|
||||
oi.Workflow = null;
|
||||
orders.Add(oi);
|
||||
session.SaveOrUpdate(oi);
|
||||
transaction.Commit();
|
||||
successfullySaved = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("MySQL database transaction rolled back, data not comitted: {0}", exc.Message);
|
||||
transaction.Rollback();
|
||||
}
|
||||
|
||||
return successfullySaved;
|
||||
}
|
||||
|
||||
|
||||
void timer_Tick(object sender, EventArgs args)
|
||||
{
|
||||
timer.Stop();
|
||||
|
||||
if (interrupt)
|
||||
{
|
||||
Text = string.Format("{0} ... {1}", programNameAndVer, Strings.interrupted);
|
||||
MessageBox.Show(string.Format(Strings.x_labels_printed, totalCount - remainingCount));
|
||||
SaveSettingsUpdateAndEnableUI();
|
||||
}
|
||||
else if (Program.LocalSettings.Mode == Mode.TbfLabelPrinter)
|
||||
{
|
||||
var wm = new Results.Entities.WaterMeter();
|
||||
wm.PurchaseOrder = string.IsNullOrEmpty(sapNumberComboBox.Text) ? string.Empty : sapNumberComboBox.Text;
|
||||
wm.SerialNr = string.IsNullOrEmpty(snTrailTextBox.Text) ? string.Empty : snTrailTextBox.Text;
|
||||
|
||||
printer.PrintResults(wm, "document name");
|
||||
|
||||
remainingCount--;
|
||||
IncrementSN(snTrailTextBox);
|
||||
|
||||
if (remainingCount > 0)
|
||||
{
|
||||
timer.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Text = string.Format("{0} ... {1}", programNameAndVer, Strings.completed);
|
||||
MessageBox.Show(string.Format(Strings.x_labels_printed, totalCount));
|
||||
SaveSettingsUpdateAndEnableUI();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Program.LocalSettings.Mode == Mode.Standalone || Program.LocalSettings.Mode == Mode.WithDatabase
|
||||
|
||||
PrintOneLabel();
|
||||
|
||||
if (remainingCount > 0)
|
||||
{
|
||||
timer.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Text = string.Format("{0} ... {1}", programNameAndVer, Strings.completed);
|
||||
MessageBox.Show(string.Format(Strings.x_labels_printed, totalCount));
|
||||
SaveSettingsUpdateAndEnableUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char[] digits = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
||||
///
|
||||
void IncrementSN(TextBox tb)
|
||||
{
|
||||
if (tb != null)
|
||||
{
|
||||
string currentSN = tb.Text;
|
||||
|
||||
int currentSnNr;
|
||||
int startIx = currentSN.IndexOfAny(digits);
|
||||
if (startIx >= 0)
|
||||
{
|
||||
int lastDigitPosPlus1 = startIx + 1;
|
||||
var listOfDigits = new List<char>(digits);
|
||||
while (lastDigitPosPlus1 < currentSN.Length && listOfDigits.Contains(currentSN[lastDigitPosPlus1]))
|
||||
{
|
||||
lastDigitPosPlus1++;
|
||||
}
|
||||
int digitsCount = lastDigitPosPlus1 - startIx;
|
||||
|
||||
if (int.TryParse(currentSN.Substring(startIx, digitsCount), out currentSnNr) && currentSnNr >= 0)
|
||||
{
|
||||
currentSnNr++;
|
||||
string newSN = currentSnNr.ToString();
|
||||
int len = newSN.Length;
|
||||
if (len <= digitsCount)
|
||||
{
|
||||
tb.Text = currentSN.Substring(0, startIx + digitsCount - len) + newSN + currentSN.Substring(startIx + digitsCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
tb.Text = currentSN.Substring(0, startIx) + newSN + currentSN.Substring(startIx + digitsCount); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void PrintOneLabel()
|
||||
{
|
||||
if (remainingCount > 0)
|
||||
{
|
||||
string code = string.Format("{0}{1}{2:D9}", prefix, separator, currentSNTrail);
|
||||
Text = string.Format("{0} ... {1} ... {2} / {3}", programNameAndVer, code, totalCount - remainingCount + 1, totalCount);
|
||||
DataMatrix matrix = new DataMatrix(code, SymbolSize.SquareAuto);
|
||||
new Printers.DataMatrixAndTextPrintDoc(matrix.Matrix, code.Replace(separator.Substring(0, 2), "\n")).Print();
|
||||
currentSNTrail++;
|
||||
remainingCount--;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveSettingsUpdateAndEnableUI()
|
||||
{
|
||||
if (Program.LocalSettings.Mode != Mode.TbfLabelPrinter) snTrailTextBox.Text = currentSNTrail.ToString("D9");
|
||||
countTextBox.Text = remainingCount.ToString();
|
||||
|
||||
Program.LocalSettings.CurrentSNTrail = currentSNTrail;
|
||||
Program.LocalSettings.RemainingSNsCount = remainingCount;
|
||||
Program.LocalSettings.Save();
|
||||
|
||||
sapNumberComboBox.Enabled = true;
|
||||
separatorComboBox.Enabled = true;
|
||||
snTrailTextBox.Enabled = (Program.LocalSettings.Mode == Mode.TbfLabelPrinter || Program.LocalSettings.Mode == Mode.Standalone);
|
||||
countTextBox.Enabled = true;
|
||||
|
||||
startButton.Enabled = true;
|
||||
interruptButton.Enabled = false;
|
||||
}
|
||||
|
||||
private void interruptButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
interrupt = true;
|
||||
}
|
||||
|
||||
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
/// Connect to the database of users and log in a user
|
||||
try
|
||||
{
|
||||
SharedDatabase.UsersDB.ConnectionString = Program.LocalSettings.UsersDBConnString;
|
||||
SharedDatabase.UsersDB.DbType = Common.DBType.MySql;
|
||||
|
||||
DialogResult dr = new SharedDatabase.Forms.LoginDlg().ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string msg = string.Format("Failed to connect to the database of users:{0}{1}", Environment.NewLine, exc.Message);
|
||||
log.Error(msg);
|
||||
MessageBox.Show(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
/// Modify program settings
|
||||
try
|
||||
{
|
||||
DialogResult dr = new SettingsDlg(Program.LocalSettings).ShowDialog();
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
Program.LocalSettings.Save();
|
||||
MessageBox.Show(Strings.Program_restart_is_required);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string msg = string.Format("Error occurred, settings were not modified:{0}{1}", Environment.NewLine, exc.Message);
|
||||
log.Error(msg);
|
||||
MessageBox.Show(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="mainMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -1,120 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Printing;
|
||||
using Gma.QrCodeNet.Encoding;
|
||||
using DataMatrix4Net;
|
||||
|
||||
namespace LabelPrinting.Printers
|
||||
{
|
||||
public class DataMatrixAndTextPrintDoc : PrintDocument
|
||||
{
|
||||
const float mm = 1 / 0.254F; /// 1 mm expressed in 1/100 inch
|
||||
|
||||
int printWidth;
|
||||
int printHeight;
|
||||
int leftMargin;
|
||||
int topMargin;
|
||||
|
||||
|
||||
BitMatrix bitMatrix;
|
||||
string text;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="bitmap">Bitmap to be printed</param>
|
||||
/// <param name="paperWidth">Label width</param>
|
||||
/// <param name="paperHeight">Label height</param>
|
||||
/// <param name="landscape">true = landscape</param>
|
||||
public DataMatrixAndTextPrintDoc(BitMatrix bitMatrix, string text, bool landscape = false)
|
||||
{
|
||||
this.bitMatrix = bitMatrix;
|
||||
this.text = text;
|
||||
|
||||
DefaultPageSettings.Landscape = landscape;
|
||||
|
||||
/// Set print area size and margins (in dots using 80 dpi)
|
||||
if (landscape)
|
||||
{
|
||||
printWidth = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
||||
printHeight = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
|
||||
leftMargin = base.DefaultPageSettings.Margins.Top; /// X
|
||||
topMargin = base.DefaultPageSettings.Margins.Left; /// Y
|
||||
}
|
||||
else
|
||||
{
|
||||
printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
||||
printWidth = base.DefaultPageSettings.PaperSize.Width - base.DefaultPageSettings.Margins.Left - base.DefaultPageSettings.Margins.Right;
|
||||
leftMargin = base.DefaultPageSettings.Margins.Left; /// X
|
||||
topMargin = base.DefaultPageSettings.Margins.Top; /// Y
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBeginPrint(System.Drawing.Printing.PrintEventArgs e)
|
||||
{
|
||||
base.OnBeginPrint(e); /// Run base code
|
||||
}
|
||||
|
||||
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
|
||||
{
|
||||
base.OnPrintPage(e); /// Run base code
|
||||
DrawLabel(e.Graphics, bitMatrix, text);
|
||||
e.HasMorePages = false;
|
||||
}
|
||||
|
||||
public static void DrawLabel(Graphics g, BitMatrix bitMatrix, string text)
|
||||
{
|
||||
string[] lines = text.Split(new char[] { '\n' });
|
||||
|
||||
/// Assuming 100 dpi (printer), drawing size: 2 inch (width) x 1 inch (height)
|
||||
const float W = 18 * mm;
|
||||
const float H = 10 * mm;
|
||||
|
||||
const float L1 = 7.0f * mm;
|
||||
const float L2 = 7.0f * mm;
|
||||
const float T1 = 3.5f * mm;
|
||||
const float T2 = 5.5f * mm;
|
||||
|
||||
const float QRL = 1.0f * mm;
|
||||
const float QRT = 2.5f * mm;
|
||||
const float QrSize = 5.5f * mm;
|
||||
|
||||
string fontFamily = "Arial";
|
||||
Font font = new Font(fontFamily, 4.5f, FontStyle.Bold);
|
||||
|
||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
g.Clear(Color.White);
|
||||
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
g.DrawString(lines[0], font, Brushes.Black, new RectangleF(L1, T1, W - L1, H - T1));
|
||||
}
|
||||
|
||||
if (lines.Length > 1)
|
||||
{
|
||||
g.DrawString(lines[1], font, Brushes.Black, new RectangleF(L2, T2, W - L2, H - T2));
|
||||
}
|
||||
|
||||
g.Flush();
|
||||
|
||||
float QrPixSize = QrSize / bitMatrix.Width;
|
||||
for (int i = 0; i < bitMatrix.Height; i++)
|
||||
{
|
||||
for (int j = 0; j < bitMatrix.Width; j++)
|
||||
{
|
||||
if (bitMatrix[j, i])
|
||||
{
|
||||
g.FillRectangle(Brushes.Black, new RectangleF(QRL + QrPixSize * j, QRT + QrPixSize * i, QrPixSize, QrPixSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using Common;
|
||||
using SharedDatabase;
|
||||
using SharedDatabase.Entities;
|
||||
using LabelPrinting.Resources;
|
||||
|
||||
namespace LabelPrinting
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// Constants
|
||||
public static GID[] SettingsAccessLevel = new GID[] { GID.TraceabilityManagement }; /// Group membership to access settings
|
||||
public const string ProgramName = "LabelPrinting";
|
||||
public const string ConfigFName = "config.xml";
|
||||
public const string BackupConfigFName = "config.backup.xml";
|
||||
public const string Log4NetConfigFName = "log4netConfig.xml";
|
||||
|
||||
/// Program information
|
||||
public static readonly string Version; /// version string
|
||||
public static readonly DateTime BuildDateTime; /// date and time of program build
|
||||
public static readonly string ExeDirectory;
|
||||
public static readonly string ConfigDirectory;
|
||||
public static readonly string LogDirectory;
|
||||
public static readonly string LocalSettingsFileName;
|
||||
public static readonly string LocalSettingsBackupName;
|
||||
|
||||
/// Local settings
|
||||
public static LocalSettings LocalSettings;
|
||||
|
||||
/// log4net
|
||||
static ILog log;
|
||||
|
||||
|
||||
static Program()
|
||||
{
|
||||
/// Program version string
|
||||
Assembly thisAssembly = Assembly.GetExecutingAssembly();
|
||||
Version ver = thisAssembly.GetName().Version;
|
||||
Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
|
||||
BuildDateTime = new FileInfo(thisAssembly.Location).LastWriteTime;
|
||||
|
||||
/// Local program configuration directory including the trailing backslash
|
||||
ExeDirectory = Path.GetDirectoryName(thisAssembly.Location);
|
||||
ConfigDirectory = Path.Combine(ExeDirectory, "..\\Cfg");
|
||||
LogDirectory = Path.Combine(ExeDirectory, "..", "Logs");
|
||||
LocalSettingsFileName = Path.Combine(ConfigDirectory, ConfigFName);
|
||||
LocalSettingsBackupName = Path.Combine(ConfigDirectory, BackupConfigFName);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
///
|
||||
/// Check if another instance is running
|
||||
///
|
||||
Assembly thisAssembly = Assembly.GetExecutingAssembly();
|
||||
string processName = Path.GetFileNameWithoutExtension(thisAssembly.Location);
|
||||
if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
|
||||
{
|
||||
MessageBox.Show(string.Format("{0}{1}{2}", string.Format(Strings.Program_0_is_running_already, ProgramName),
|
||||
Environment.NewLine,
|
||||
Strings.Close_it_please),
|
||||
Strings.Error,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Asterisk);
|
||||
return;
|
||||
}
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
|
||||
|
||||
bool configDirectoryCreated = false;
|
||||
if (!Directory.Exists(ConfigDirectory) || new DirectoryInfo(ConfigDirectory).GetFileSystemInfos().Length == 0)
|
||||
{
|
||||
MessageBox.Show(string.Format("{0}{1}{2}", Strings.Program_is_running_for_the_1st_time_on_this_PC,
|
||||
Environment.NewLine,
|
||||
Strings.Default_settings_are_used),
|
||||
Strings.Warning,
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
///
|
||||
/// Create a new config subdirectory
|
||||
///
|
||||
Directory.CreateDirectory(ConfigDirectory);
|
||||
configDirectoryCreated = true;
|
||||
|
||||
LocalSettings = new LocalSettings(true);
|
||||
LocalSettings.Save();
|
||||
|
||||
if (File.Exists(Path.Combine(ExeDirectory, "SampleConfig", Log4NetConfigFName)))
|
||||
{
|
||||
File.Copy(Path.Combine(ExeDirectory, "SampleConfig", Log4NetConfigFName),
|
||||
Path.Combine(ConfigDirectory, Log4NetConfigFName));
|
||||
}
|
||||
|
||||
File.SetAttributes(Path.Combine(ConfigDirectory, Log4NetConfigFName), FileAttributes.Normal);
|
||||
}
|
||||
|
||||
///
|
||||
/// Configue and start logging
|
||||
///
|
||||
log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.Combine(ConfigDirectory, Log4NetConfigFName)));
|
||||
log = LogManager.GetLogger(typeof(Program));
|
||||
log.Fatal("--------------------------------------------------------------------------------");
|
||||
log.FatalFormat("{0} ver.{1}", ProgramName, Version);
|
||||
log.FatalFormat("Executable directory is {0}", ExeDirectory);
|
||||
if (configDirectoryCreated)
|
||||
{
|
||||
log.Fatal("A new config directory and configuration files created !");
|
||||
}
|
||||
|
||||
///
|
||||
/// Load the local settings
|
||||
///
|
||||
LocalSettings = LocalSettings.Load(LocalSettingsFileName);
|
||||
if (LocalSettings == null)
|
||||
{
|
||||
/// Loading local seetings from regular config file failed. Use the backup
|
||||
LocalSettings = LocalSettings.Load(LocalSettingsBackupName);
|
||||
if (LocalSettings == null)
|
||||
{
|
||||
log.FatalFormat("Local settings: Could not load file {0}, nor {1}.", ConfigFName, BackupConfigFName);
|
||||
log.Fatal("Application terminated.");
|
||||
MessageBox.Show(string.Format("Could not load file {0}, nor {1}.", ConfigFName, BackupConfigFName), "Fatal error");
|
||||
return; /// Fatal error
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalSettings.Save(); /// Save the settings to overwrite the wrong file
|
||||
log.FatalFormat("Local settings: Could not load file {0}, successfully loaded {1}", ConfigFName, BackupConfigFName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Loading local seetings from the regular config file was successful. Update the backup
|
||||
File.Copy(LocalSettingsFileName, LocalSettingsBackupName, true);
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
///
|
||||
/// User login
|
||||
///
|
||||
if (LocalSettings.IsUserLoginRequired && !string.IsNullOrEmpty(LocalSettings.UsersDBConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
UsersDB.ConnectionString = LocalSettings.UsersDBConnString;
|
||||
UsersDB.DbType = DBType.MySql;
|
||||
|
||||
DialogResult dr = new SharedDatabase.Forms.LoginDlg().ShowDialog();
|
||||
if (dr != DialogResult.OK) return;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.ErrorFormat("Failed to connect to database of users: {0}", exc.Message);
|
||||
}
|
||||
}
|
||||
|
||||
IList<OrderInfo> orderInfos = null;
|
||||
while (LocalSettings.Mode == Mode.WithDatabase)
|
||||
{
|
||||
try
|
||||
{
|
||||
ISession session = TracingDB.CreateSession(LocalSettings.TracingDBConnString);
|
||||
orderInfos = session.QueryOver<OrderInfo>().List();
|
||||
break;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
log.FatalFormat("Failed to connect to production tracing database: {0}", exc.Message);
|
||||
if (exc.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerException: {0}", exc.InnerException.Message);
|
||||
}
|
||||
|
||||
MessageBox.Show(string.Format("Failed to connect to production tracing database:{0}{1}", Environment.NewLine, exc.Message));
|
||||
|
||||
if (new SettingsDlg(LocalSettings).ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
LocalSettings.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
MainWnd dlg = new MainWnd(orderInfos);
|
||||
Application.Run(dlg);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogException(log, "Exception in Application.Run(MainWnd)", e);
|
||||
|
||||
MessageBox.Show("Program crashed:" +
|
||||
Environment.NewLine + Environment.NewLine + e.Message +
|
||||
((e.InnerException == null) ? string.Empty : (Environment.NewLine + e.InnerException.Message)) +
|
||||
Environment.NewLine + e.StackTrace,
|
||||
"Fatal error",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MyHandler(object sender, UnhandledExceptionEventArgs args)
|
||||
{
|
||||
Exception e = args.ExceptionObject as Exception;
|
||||
if (e == null) return;
|
||||
|
||||
LogException(log, "Unhandled exception", e);
|
||||
|
||||
MessageBox.Show("Program crashed:" +
|
||||
Environment.NewLine + Environment.NewLine + e.Message +
|
||||
((e.InnerException == null) ? string.Empty : (Environment.NewLine + e.InnerException.Message)) +
|
||||
Environment.NewLine + e.StackTrace,
|
||||
"Fatal error",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Exclamation);
|
||||
}
|
||||
|
||||
static void LogException(ILog log, string description, Exception e)
|
||||
{
|
||||
log.FatalFormat("---------------( {0} )---------------", description);
|
||||
log.FatalFormat("Message : {0}", e.Message);
|
||||
if (e.InnerException != null)
|
||||
{
|
||||
log.FatalFormat("InnerMessage : {0}", e.InnerException.Message);
|
||||
}
|
||||
log.FatalFormat("StackTrace : {0}{1}", Environment.NewLine, e.StackTrace);
|
||||
log.Fatal("--------------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("LabelPrinting")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LabelPrinting")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("270db60d-5938-40be-b15c-e2bc3c7ddb86")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.6.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.6.0")]
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace LabelPrinting.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SNPrinting.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace LabelPrinting.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
-414
@@ -1,414 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace LabelPrinting.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Strings {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Strings() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LabelPrinting.Resources.Strings", typeof(Strings).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Are you sure?.
|
||||
/// </summary>
|
||||
internal static string Are_you_sure {
|
||||
get {
|
||||
return ResourceManager.GetString("Are_you_sure", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
internal static string Cancel {
|
||||
get {
|
||||
return ResourceManager.GetString("Cancel", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Close it please using 'Task manager'..
|
||||
/// </summary>
|
||||
internal static string Close_it_please {
|
||||
get {
|
||||
return ResourceManager.GetString("Close_it_please", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to completed.
|
||||
/// </summary>
|
||||
internal static string completed {
|
||||
get {
|
||||
return ResourceManager.GetString("completed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connection string for production tracing database.
|
||||
/// </summary>
|
||||
internal static string Connection_string_tracing_DB {
|
||||
get {
|
||||
return ResourceManager.GetString("Connection_string_tracing_DB", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connection string for database of users.
|
||||
/// </summary>
|
||||
internal static string Connection_string_users_DB {
|
||||
get {
|
||||
return ResourceManager.GetString("Connection_string_users_DB", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Database.
|
||||
/// </summary>
|
||||
internal static string Database {
|
||||
get {
|
||||
return ResourceManager.GetString("Database", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Default settings are used..
|
||||
/// </summary>
|
||||
internal static string Default_settings_are_used {
|
||||
get {
|
||||
return ResourceManager.GetString("Default_settings_are_used", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Delay between labels.
|
||||
/// </summary>
|
||||
internal static string Delay_between_labes {
|
||||
get {
|
||||
return ResourceManager.GetString("Delay_between_labes", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error.
|
||||
/// </summary>
|
||||
internal static string Error {
|
||||
get {
|
||||
return ResourceManager.GetString("Error", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to First S/N trail (9 digits).
|
||||
/// </summary>
|
||||
internal static string First_SN_trail_9_digits {
|
||||
get {
|
||||
return ResourceManager.GetString("First_SN_trail_9_digits", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Interrupt.
|
||||
/// </summary>
|
||||
internal static string Interrupt {
|
||||
get {
|
||||
return ResourceManager.GetString("Interrupt", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to interrupted.
|
||||
/// </summary>
|
||||
internal static string interrupted {
|
||||
get {
|
||||
return ResourceManager.GetString("interrupted", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid.
|
||||
/// </summary>
|
||||
internal static string Invalid {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid first S/N trail.
|
||||
/// </summary>
|
||||
internal static string Invalid_first_SN_trail {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_first_SN_trail", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid language.
|
||||
/// </summary>
|
||||
internal static string Invalid_language {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_language", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid SAP number.
|
||||
/// </summary>
|
||||
internal static string Invalid_SAP_number {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_SAP_number", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid separator.
|
||||
/// </summary>
|
||||
internal static string Invalid_separator {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_separator", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid labels count.
|
||||
/// </summary>
|
||||
internal static string Invalid_SNs_count {
|
||||
get {
|
||||
return ResourceManager.GetString("Invalid_SNs_count", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Labels count.
|
||||
/// </summary>
|
||||
internal static string Labels_count {
|
||||
get {
|
||||
return ResourceManager.GetString("Labels_count", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Language, Sprache, Jazyk.
|
||||
/// </summary>
|
||||
internal static string Language_etc {
|
||||
get {
|
||||
return ResourceManager.GetString("Language_etc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to min..
|
||||
/// </summary>
|
||||
internal static string min {
|
||||
get {
|
||||
return ResourceManager.GetString("min", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Mode.
|
||||
/// </summary>
|
||||
internal static string Mode {
|
||||
get {
|
||||
return ResourceManager.GetString("Mode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Order.
|
||||
/// </summary>
|
||||
internal static string Order {
|
||||
get {
|
||||
return ResourceManager.GetString("Order", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program '{0}' is running already..
|
||||
/// </summary>
|
||||
internal static string Program_0_is_running_already {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_0_is_running_already", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program is running for the 1st time on this PC..
|
||||
/// </summary>
|
||||
internal static string Program_is_running_for_the_1st_time_on_this_PC {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_is_running_for_the_1st_time_on_this_PC", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Program restart is required.
|
||||
/// </summary>
|
||||
internal static string Program_restart_is_required {
|
||||
get {
|
||||
return ResourceManager.GetString("Program_restart_is_required", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to SAP number (8 digits).
|
||||
/// </summary>
|
||||
internal static string SAP_number_8_digits {
|
||||
get {
|
||||
return ResourceManager.GetString("SAP_number_8_digits", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Save.
|
||||
/// </summary>
|
||||
internal static string Save {
|
||||
get {
|
||||
return ResourceManager.GetString("Save", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Separator (3 characters).
|
||||
/// </summary>
|
||||
internal static string Separator_3_characters {
|
||||
get {
|
||||
return ResourceManager.GetString("Separator_3_characters", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Serial number.
|
||||
/// </summary>
|
||||
internal static string Serial_number {
|
||||
get {
|
||||
return ResourceManager.GetString("Serial_number", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Settings.
|
||||
/// </summary>
|
||||
internal static string Settings {
|
||||
get {
|
||||
return ResourceManager.GetString("Settings", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Standalone.
|
||||
/// </summary>
|
||||
internal static string Standalone {
|
||||
get {
|
||||
return ResourceManager.GetString("Standalone", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Start printing.
|
||||
/// </summary>
|
||||
internal static string Start_printing {
|
||||
get {
|
||||
return ResourceManager.GetString("Start_printing", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User login is required.
|
||||
/// </summary>
|
||||
internal static string User_login_is_required {
|
||||
get {
|
||||
return ResourceManager.GetString("User_login_is_required", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Warning.
|
||||
/// </summary>
|
||||
internal static string Warning {
|
||||
get {
|
||||
return ResourceManager.GetString("Warning", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to With a database.
|
||||
/// </summary>
|
||||
internal static string With_database {
|
||||
get {
|
||||
return ResourceManager.GetString("With_database", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} labels printed.
|
||||
/// </summary>
|
||||
internal static string x_labels_printed {
|
||||
get {
|
||||
return ResourceManager.GetString("x_labels_printed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to You are skipping.
|
||||
/// </summary>
|
||||
internal static string You_are_skipping {
|
||||
get {
|
||||
return ResourceManager.GetString("You_are_skipping", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Zrušit</value>
|
||||
</data>
|
||||
<data name="Close_it_please" xml:space="preserve">
|
||||
<value>Zavřete ho prosím 'Správcem úloh' (Task manager).</value>
|
||||
</data>
|
||||
<data name="completed" xml:space="preserve">
|
||||
<value>dokončeno</value>
|
||||
</data>
|
||||
<data name="Connection_string_tracing_DB" xml:space="preserve">
|
||||
<value>Konfigurace databáze sledování výroby</value>
|
||||
</data>
|
||||
<data name="Connection_string_users_DB" xml:space="preserve">
|
||||
<value>Konfigurace databáze uživatelů</value>
|
||||
</data>
|
||||
<data name="Database" xml:space="preserve">
|
||||
<value>Databáze</value>
|
||||
</data>
|
||||
<data name="Default_settings_are_used" xml:space="preserve">
|
||||
<value>Použijí sa výchozí nastavení</value>
|
||||
</data>
|
||||
<data name="Delay_between_labes" xml:space="preserve">
|
||||
<value>Zpoždění mezi tiskemm štítků</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Chyba</value>
|
||||
</data>
|
||||
<data name="Interrupt" xml:space="preserve">
|
||||
<value>Prerušit</value>
|
||||
</data>
|
||||
<data name="interrupted" xml:space="preserve">
|
||||
<value>prerušeno</value>
|
||||
</data>
|
||||
<data name="Invalid_first_SN_trail" xml:space="preserve">
|
||||
<value>Neplatný konec sériového čísla</value>
|
||||
</data>
|
||||
<data name="Invalid_SAP_number" xml:space="preserve">
|
||||
<value>Neplatné číslo součástky (SAP číslo)</value>
|
||||
</data>
|
||||
<data name="Invalid_separator" xml:space="preserve">
|
||||
<value>Neplatný oddělovač</value>
|
||||
</data>
|
||||
<data name="Invalid_SNs_count" xml:space="preserve">
|
||||
<value>Neplatný počet štítků</value>
|
||||
</data>
|
||||
<data name="Language_etc" xml:space="preserve">
|
||||
<value>Language, Sprache, Jazyk</value>
|
||||
</data>
|
||||
<data name="min." xml:space="preserve">
|
||||
<value>min.</value>
|
||||
</data>
|
||||
<data name="Mode" xml:space="preserve">
|
||||
<value>Režim činnosti</value>
|
||||
</data>
|
||||
<data name="Program_0_is_running_already" xml:space="preserve">
|
||||
<value>Program '{0}' už běží.</value>
|
||||
</data>
|
||||
<data name="Program_is_running_for_the_1st_time_on_this_PC" xml:space="preserve">
|
||||
<value>Program byl spuštěn na tomto počítači poprvé.</value>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Uložit</value>
|
||||
</data>
|
||||
<data name="Settings" xml:space="preserve">
|
||||
<value>Nastavení</value>
|
||||
</data>
|
||||
<data name="Standalone" xml:space="preserve">
|
||||
<value>Samostatný</value>
|
||||
</data>
|
||||
<data name="Start_printing" xml:space="preserve">
|
||||
<value>Spustit tisk</value>
|
||||
</data>
|
||||
<data name="User_login_is_required" xml:space="preserve">
|
||||
<value>Vyžaduje se prihlášení užívatele</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Upozornení</value>
|
||||
</data>
|
||||
<data name="With_database" xml:space="preserve">
|
||||
<value>S databází</value>
|
||||
</data>
|
||||
<data name="You_are_skipping" xml:space="preserve">
|
||||
<value>Vynechávate</value>
|
||||
</data>
|
||||
<data name="First_SN_trail_9_digits" xml:space="preserve">
|
||||
<value>První konec sériového čísla (9 číslic)</value>
|
||||
</data>
|
||||
<data name="SAP_number_8_digits" xml:space="preserve">
|
||||
<value>SAP číslo (8 číslic)</value>
|
||||
</data>
|
||||
<data name="Separator_3_characters" xml:space="preserve">
|
||||
<value>Oddělovač (3 znaky)</value>
|
||||
</data>
|
||||
<data name="Labels_count" xml:space="preserve">
|
||||
<value>Počet štítků</value>
|
||||
</data>
|
||||
<data name="Program_restart_is_required" xml:space="preserve">
|
||||
<value>Je potřebný restart programu</value>
|
||||
</data>
|
||||
<data name="x_labels_printed" xml:space="preserve">
|
||||
<value>Bylo vytištěných {0} štítků</value>
|
||||
</data>
|
||||
<data name="Invalid" xml:space="preserve">
|
||||
<value>Neplatný</value>
|
||||
</data>
|
||||
<data name="Invalid_language" xml:space="preserve">
|
||||
<value>Neplatný jazyk</value>
|
||||
</data>
|
||||
<data name="Order" xml:space="preserve">
|
||||
<value>Objednávka</value>
|
||||
</data>
|
||||
<data name="Serial_number" xml:space="preserve">
|
||||
<value>Sériové číslo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,237 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Close_it_please" xml:space="preserve">
|
||||
<value>Close it please using 'Task manager'.</value>
|
||||
</data>
|
||||
<data name="Default_settings_are_used" xml:space="preserve">
|
||||
<value>Default settings are used.</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Error</value>
|
||||
</data>
|
||||
<data name="Interrupt" xml:space="preserve">
|
||||
<value>Interrupt</value>
|
||||
</data>
|
||||
<data name="Invalid_first_SN_trail" xml:space="preserve">
|
||||
<value>Invalid first S/N trail</value>
|
||||
</data>
|
||||
<data name="Invalid_SAP_number" xml:space="preserve">
|
||||
<value>Invalid SAP number</value>
|
||||
</data>
|
||||
<data name="Invalid_separator" xml:space="preserve">
|
||||
<value>Invalid separator</value>
|
||||
</data>
|
||||
<data name="Invalid_SNs_count" xml:space="preserve">
|
||||
<value>Invalid labels count</value>
|
||||
</data>
|
||||
<data name="Program_0_is_running_already" xml:space="preserve">
|
||||
<value>Program '{0}' is running already.</value>
|
||||
</data>
|
||||
<data name="Program_is_running_for_the_1st_time_on_this_PC" xml:space="preserve">
|
||||
<value>Program is running for the 1st time on this PC.</value>
|
||||
</data>
|
||||
<data name="Start_printing" xml:space="preserve">
|
||||
<value>Start printing</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Warning</value>
|
||||
</data>
|
||||
<data name="completed" xml:space="preserve">
|
||||
<value>completed</value>
|
||||
</data>
|
||||
<data name="interrupted" xml:space="preserve">
|
||||
<value>interrupted</value>
|
||||
</data>
|
||||
<data name="Are_you_sure" xml:space="preserve">
|
||||
<value>Are you sure?</value>
|
||||
</data>
|
||||
<data name="min" xml:space="preserve">
|
||||
<value>min.</value>
|
||||
</data>
|
||||
<data name="You_are_skipping" xml:space="preserve">
|
||||
<value>You are skipping</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="Connection_string_tracing_DB" xml:space="preserve">
|
||||
<value>Connection string for production tracing database</value>
|
||||
</data>
|
||||
<data name="Connection_string_users_DB" xml:space="preserve">
|
||||
<value>Connection string for database of users</value>
|
||||
</data>
|
||||
<data name="Database" xml:space="preserve">
|
||||
<value>Database</value>
|
||||
</data>
|
||||
<data name="Delay_between_labes" xml:space="preserve">
|
||||
<value>Delay between labels</value>
|
||||
</data>
|
||||
<data name="Language_etc" xml:space="preserve">
|
||||
<value>Language, Sprache, Jazyk</value>
|
||||
</data>
|
||||
<data name="Mode" xml:space="preserve">
|
||||
<value>Mode</value>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Save</value>
|
||||
</data>
|
||||
<data name="Settings" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="Standalone" xml:space="preserve">
|
||||
<value>Standalone</value>
|
||||
</data>
|
||||
<data name="User_login_is_required" xml:space="preserve">
|
||||
<value>User login is required</value>
|
||||
</data>
|
||||
<data name="With_database" xml:space="preserve">
|
||||
<value>With a database</value>
|
||||
</data>
|
||||
<data name="First_SN_trail_9_digits" xml:space="preserve">
|
||||
<value>First S/N trail (9 digits)</value>
|
||||
</data>
|
||||
<data name="SAP_number_8_digits" xml:space="preserve">
|
||||
<value>SAP number (8 digits)</value>
|
||||
</data>
|
||||
<data name="Separator_3_characters" xml:space="preserve">
|
||||
<value>Separator (3 characters)</value>
|
||||
</data>
|
||||
<data name="Labels_count" xml:space="preserve">
|
||||
<value>Labels count</value>
|
||||
</data>
|
||||
<data name="Program_restart_is_required" xml:space="preserve">
|
||||
<value>Program restart is required</value>
|
||||
</data>
|
||||
<data name="x_labels_printed" xml:space="preserve">
|
||||
<value>{0} labels printed</value>
|
||||
</data>
|
||||
<data name="Invalid" xml:space="preserve">
|
||||
<value>Invalid</value>
|
||||
</data>
|
||||
<data name="Invalid_language" xml:space="preserve">
|
||||
<value>Invalid language</value>
|
||||
</data>
|
||||
<data name="Order" xml:space="preserve">
|
||||
<value>Order</value>
|
||||
</data>
|
||||
<data name="Serial_number" xml:space="preserve">
|
||||
<value>Serial number</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,234 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Zrušiť</value>
|
||||
</data>
|
||||
<data name="Close_it_please" xml:space="preserve">
|
||||
<value>Zavrite ho prosím 'Správcom úloh' (Task manager).</value>
|
||||
</data>
|
||||
<data name="completed" xml:space="preserve">
|
||||
<value>dokončené</value>
|
||||
</data>
|
||||
<data name="Connection_string_tracing_DB" xml:space="preserve">
|
||||
<value>Konfigurácia databáze sledovania výroby</value>
|
||||
</data>
|
||||
<data name="Connection_string_users_DB" xml:space="preserve">
|
||||
<value>Konfigurácia databáze užívateľov</value>
|
||||
</data>
|
||||
<data name="Database" xml:space="preserve">
|
||||
<value>Databáza</value>
|
||||
</data>
|
||||
<data name="Default_settings_are_used" xml:space="preserve">
|
||||
<value>Použijú sa základné nastavenia</value>
|
||||
</data>
|
||||
<data name="Delay_between_labes" xml:space="preserve">
|
||||
<value>Oneskorenie medzi tlačením štítkov</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Chyba</value>
|
||||
</data>
|
||||
<data name="Interrupt" xml:space="preserve">
|
||||
<value>Prerušiť</value>
|
||||
</data>
|
||||
<data name="interrupted" xml:space="preserve">
|
||||
<value>prerušené</value>
|
||||
</data>
|
||||
<data name="Invalid_first_SN_trail" xml:space="preserve">
|
||||
<value>Neplatný chvost sériového čísla</value>
|
||||
</data>
|
||||
<data name="Invalid_SAP_number" xml:space="preserve">
|
||||
<value>Neplatné číslo súčiastky (SAP číslo)</value>
|
||||
</data>
|
||||
<data name="Invalid_separator" xml:space="preserve">
|
||||
<value>Neplatný oddelovač</value>
|
||||
</data>
|
||||
<data name="Invalid_SNs_count" xml:space="preserve">
|
||||
<value>Neplatný počet štítkov</value>
|
||||
</data>
|
||||
<data name="Language_etc" xml:space="preserve">
|
||||
<value>Language, Sprache, Jazyk</value>
|
||||
</data>
|
||||
<data name="min." xml:space="preserve">
|
||||
<value>min.</value>
|
||||
</data>
|
||||
<data name="Mode" xml:space="preserve">
|
||||
<value>Režim činnosti</value>
|
||||
</data>
|
||||
<data name="Program_0_is_running_already" xml:space="preserve">
|
||||
<value>Program '{0}' už beží.</value>
|
||||
</data>
|
||||
<data name="Program_is_running_for_the_1st_time_on_this_PC" xml:space="preserve">
|
||||
<value>Program bol spustený na tomto počítači prvý krát.</value>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Uložiť</value>
|
||||
</data>
|
||||
<data name="Settings" xml:space="preserve">
|
||||
<value>Nastavenia</value>
|
||||
</data>
|
||||
<data name="Standalone" xml:space="preserve">
|
||||
<value>Samostatný</value>
|
||||
</data>
|
||||
<data name="Start_printing" xml:space="preserve">
|
||||
<value>Začať tlačiť</value>
|
||||
</data>
|
||||
<data name="User_login_is_required" xml:space="preserve">
|
||||
<value>Vyžaduje sa prihlásenie používateľa</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Upozornenie</value>
|
||||
</data>
|
||||
<data name="With_database" xml:space="preserve">
|
||||
<value>S databázou</value>
|
||||
</data>
|
||||
<data name="You_are_skipping" xml:space="preserve">
|
||||
<value>Vynechávate</value>
|
||||
</data>
|
||||
<data name="First_SN_trail_9_digits" xml:space="preserve">
|
||||
<value>Prvý chvost sériového čísla (9 číslic)</value>
|
||||
</data>
|
||||
<data name="SAP_number_8_digits" xml:space="preserve">
|
||||
<value>SAP číslo (8 číslic)</value>
|
||||
</data>
|
||||
<data name="Separator_3_characters" xml:space="preserve">
|
||||
<value>Oddeľovač (3 znaky)</value>
|
||||
</data>
|
||||
<data name="Labels_count" xml:space="preserve">
|
||||
<value>Počet štítkov</value>
|
||||
</data>
|
||||
<data name="Program_restart_is_required" xml:space="preserve">
|
||||
<value>Je potrebný reštart programu</value>
|
||||
</data>
|
||||
<data name="x_labels_printed" xml:space="preserve">
|
||||
<value>Bolo vytlačených {0} štítkov</value>
|
||||
</data>
|
||||
<data name="Invalid" xml:space="preserve">
|
||||
<value>Neplatný</value>
|
||||
</data>
|
||||
<data name="Invalid_language" xml:space="preserve">
|
||||
<value>Neplatný jazyk</value>
|
||||
</data>
|
||||
<data name="Order" xml:space="preserve">
|
||||
<value>Objednávka</value>
|
||||
</data>
|
||||
<data name="Serial_number" xml:space="preserve">
|
||||
<value>Sériové číslo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,23 +0,0 @@
|
||||
<log4net>
|
||||
<!-- Program log appenders -->
|
||||
<appender name="LabelPrintingLog" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="..\Logs\LabelPrintingLog.txt" />
|
||||
<appendToFile value="true" />
|
||||
<rollingMode value="Date" />
|
||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date %-5level %logger - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger -->
|
||||
<root>
|
||||
<level value="WARN" />
|
||||
</root>
|
||||
|
||||
<!-- Set program loggers -->
|
||||
<logger name="LabelPrinting"> <appender-ref ref="LabelPrintingLog" /> <level value="WARN" /> </logger>
|
||||
|
||||
<!-- Set program logging levels -->
|
||||
<logger name="LabelPrinting.MainWnd"> <level value="INFO" /> </logger>
|
||||
</log4net>
|
||||
Generated
-283
@@ -1,283 +0,0 @@
|
||||
namespace LabelPrinting
|
||||
{
|
||||
partial class SettingsDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.modeGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.tbfLabelPrinterRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.standaloneRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.withDBRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.commonGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.labelPrinterConfigButton = new System.Windows.Forms.Button();
|
||||
this.msLabel = new System.Windows.Forms.Label();
|
||||
this.delayTextBox = new System.Windows.Forms.TextBox();
|
||||
this.delayLabel = new System.Windows.Forms.Label();
|
||||
this.loginRequiredCheckBox = new System.Windows.Forms.CheckBox();
|
||||
this.languageComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.languageLabel = new System.Windows.Forms.Label();
|
||||
this.connStrForTracingGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.tracingDBConnStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.connStrForUsersGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.usersDBConnStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.saveButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.modeGroupBox.SuspendLayout();
|
||||
this.commonGroupBox.SuspendLayout();
|
||||
this.connStrForTracingGroupBox.SuspendLayout();
|
||||
this.connStrForUsersGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// modeGroupBox
|
||||
//
|
||||
this.modeGroupBox.Controls.Add(this.tbfLabelPrinterRadioButton);
|
||||
this.modeGroupBox.Controls.Add(this.standaloneRadioButton);
|
||||
this.modeGroupBox.Controls.Add(this.withDBRadioButton);
|
||||
this.modeGroupBox.Location = new System.Drawing.Point(12, 12);
|
||||
this.modeGroupBox.Name = "modeGroupBox";
|
||||
this.modeGroupBox.Size = new System.Drawing.Size(197, 105);
|
||||
this.modeGroupBox.TabIndex = 15;
|
||||
this.modeGroupBox.TabStop = false;
|
||||
this.modeGroupBox.Text = "Mode";
|
||||
//
|
||||
// tbfLabelPrinterRadioButton
|
||||
//
|
||||
this.tbfLabelPrinterRadioButton.AutoSize = true;
|
||||
this.tbfLabelPrinterRadioButton.Location = new System.Drawing.Point(19, 23);
|
||||
this.tbfLabelPrinterRadioButton.Name = "tbfLabelPrinterRadioButton";
|
||||
this.tbfLabelPrinterRadioButton.Size = new System.Drawing.Size(156, 17);
|
||||
this.tbfLabelPrinterRadioButton.TabIndex = 0;
|
||||
this.tbfLabelPrinterRadioButton.TabStop = true;
|
||||
this.tbfLabelPrinterRadioButton.Text = "TBF compatible label printer";
|
||||
this.tbfLabelPrinterRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// standaloneRadioButton
|
||||
//
|
||||
this.standaloneRadioButton.AutoSize = true;
|
||||
this.standaloneRadioButton.Location = new System.Drawing.Point(18, 46);
|
||||
this.standaloneRadioButton.Name = "standaloneRadioButton";
|
||||
this.standaloneRadioButton.Size = new System.Drawing.Size(143, 17);
|
||||
this.standaloneRadioButton.TabIndex = 1;
|
||||
this.standaloneRadioButton.TabStop = true;
|
||||
this.standaloneRadioButton.Text = "20 char s/n - Standalone";
|
||||
this.standaloneRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// withDBRadioButton
|
||||
//
|
||||
this.withDBRadioButton.AutoSize = true;
|
||||
this.withDBRadioButton.Location = new System.Drawing.Point(18, 69);
|
||||
this.withDBRadioButton.Name = "withDBRadioButton";
|
||||
this.withDBRadioButton.Size = new System.Drawing.Size(158, 17);
|
||||
this.withDBRadioButton.TabIndex = 2;
|
||||
this.withDBRadioButton.TabStop = true;
|
||||
this.withDBRadioButton.Text = "20 char s/n - With database";
|
||||
this.withDBRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// commonGroupBox
|
||||
//
|
||||
this.commonGroupBox.Controls.Add(this.labelPrinterConfigButton);
|
||||
this.commonGroupBox.Controls.Add(this.msLabel);
|
||||
this.commonGroupBox.Controls.Add(this.delayTextBox);
|
||||
this.commonGroupBox.Controls.Add(this.delayLabel);
|
||||
this.commonGroupBox.Controls.Add(this.loginRequiredCheckBox);
|
||||
this.commonGroupBox.Controls.Add(this.languageComboBox);
|
||||
this.commonGroupBox.Controls.Add(this.languageLabel);
|
||||
this.commonGroupBox.Location = new System.Drawing.Point(222, 12);
|
||||
this.commonGroupBox.Name = "commonGroupBox";
|
||||
this.commonGroupBox.Size = new System.Drawing.Size(316, 105);
|
||||
this.commonGroupBox.TabIndex = 16;
|
||||
this.commonGroupBox.TabStop = false;
|
||||
//
|
||||
// labelPrinterConfigButton
|
||||
//
|
||||
this.labelPrinterConfigButton.Location = new System.Drawing.Point(198, 73);
|
||||
this.labelPrinterConfigButton.Name = "labelPrinterConfigButton";
|
||||
this.labelPrinterConfigButton.Size = new System.Drawing.Size(93, 23);
|
||||
this.labelPrinterConfigButton.TabIndex = 6;
|
||||
this.labelPrinterConfigButton.Text = "TBF label config";
|
||||
this.labelPrinterConfigButton.UseVisualStyleBackColor = true;
|
||||
this.labelPrinterConfigButton.Click += new System.EventHandler(this.labelPrinterConfigButton_Click);
|
||||
//
|
||||
// msLabel
|
||||
//
|
||||
this.msLabel.AutoSize = true;
|
||||
this.msLabel.Location = new System.Drawing.Point(262, 51);
|
||||
this.msLabel.Name = "msLabel";
|
||||
this.msLabel.Size = new System.Drawing.Size(20, 13);
|
||||
this.msLabel.TabIndex = 5;
|
||||
this.msLabel.Text = "ms";
|
||||
//
|
||||
// delayTextBox
|
||||
//
|
||||
this.delayTextBox.Location = new System.Drawing.Point(198, 46);
|
||||
this.delayTextBox.Name = "delayTextBox";
|
||||
this.delayTextBox.Size = new System.Drawing.Size(52, 20);
|
||||
this.delayTextBox.TabIndex = 4;
|
||||
//
|
||||
// delayLabel
|
||||
//
|
||||
this.delayLabel.AutoSize = true;
|
||||
this.delayLabel.Location = new System.Drawing.Point(19, 51);
|
||||
this.delayLabel.Name = "delayLabel";
|
||||
this.delayLabel.Size = new System.Drawing.Size(108, 13);
|
||||
this.delayLabel.TabIndex = 3;
|
||||
this.delayLabel.Text = "Delay between labels";
|
||||
//
|
||||
// loginRequiredCheckBox
|
||||
//
|
||||
this.loginRequiredCheckBox.AutoSize = true;
|
||||
this.loginRequiredCheckBox.Location = new System.Drawing.Point(22, 79);
|
||||
this.loginRequiredCheckBox.Name = "loginRequiredCheckBox";
|
||||
this.loginRequiredCheckBox.Size = new System.Drawing.Size(114, 17);
|
||||
this.loginRequiredCheckBox.TabIndex = 2;
|
||||
this.loginRequiredCheckBox.Text = "User login required";
|
||||
this.loginRequiredCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// languageComboBox
|
||||
//
|
||||
this.languageComboBox.FormattingEnabled = true;
|
||||
this.languageComboBox.Location = new System.Drawing.Point(198, 17);
|
||||
this.languageComboBox.Name = "languageComboBox";
|
||||
this.languageComboBox.Size = new System.Drawing.Size(93, 21);
|
||||
this.languageComboBox.TabIndex = 1;
|
||||
//
|
||||
// languageLabel
|
||||
//
|
||||
this.languageLabel.AutoSize = true;
|
||||
this.languageLabel.Location = new System.Drawing.Point(19, 20);
|
||||
this.languageLabel.Name = "languageLabel";
|
||||
this.languageLabel.Size = new System.Drawing.Size(134, 13);
|
||||
this.languageLabel.TabIndex = 0;
|
||||
this.languageLabel.Text = "Language, Sprache, Jazyk";
|
||||
//
|
||||
// connStrForTracingGroupBox
|
||||
//
|
||||
this.connStrForTracingGroupBox.Controls.Add(this.tracingDBConnStringTextBox);
|
||||
this.connStrForTracingGroupBox.Location = new System.Drawing.Point(12, 127);
|
||||
this.connStrForTracingGroupBox.Name = "connStrForTracingGroupBox";
|
||||
this.connStrForTracingGroupBox.Size = new System.Drawing.Size(709, 50);
|
||||
this.connStrForTracingGroupBox.TabIndex = 17;
|
||||
this.connStrForTracingGroupBox.TabStop = false;
|
||||
this.connStrForTracingGroupBox.Text = "Connection string for production tracing records";
|
||||
//
|
||||
// tracingDBConnStringTextBox
|
||||
//
|
||||
this.tracingDBConnStringTextBox.Location = new System.Drawing.Point(19, 18);
|
||||
this.tracingDBConnStringTextBox.Name = "tracingDBConnStringTextBox";
|
||||
this.tracingDBConnStringTextBox.Size = new System.Drawing.Size(672, 20);
|
||||
this.tracingDBConnStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// connStrForUsersGroupBox
|
||||
//
|
||||
this.connStrForUsersGroupBox.Controls.Add(this.usersDBConnStringTextBox);
|
||||
this.connStrForUsersGroupBox.Location = new System.Drawing.Point(12, 186);
|
||||
this.connStrForUsersGroupBox.Name = "connStrForUsersGroupBox";
|
||||
this.connStrForUsersGroupBox.Size = new System.Drawing.Size(709, 50);
|
||||
this.connStrForUsersGroupBox.TabIndex = 18;
|
||||
this.connStrForUsersGroupBox.TabStop = false;
|
||||
this.connStrForUsersGroupBox.Text = "Connection string for central DB of users";
|
||||
//
|
||||
// usersDBConnStringTextBox
|
||||
//
|
||||
this.usersDBConnStringTextBox.Location = new System.Drawing.Point(19, 18);
|
||||
this.usersDBConnStringTextBox.Name = "usersDBConnStringTextBox";
|
||||
this.usersDBConnStringTextBox.Size = new System.Drawing.Size(672, 20);
|
||||
this.usersDBConnStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// saveButton
|
||||
//
|
||||
this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.saveButton.Location = new System.Drawing.Point(559, 18);
|
||||
this.saveButton.Name = "saveButton";
|
||||
this.saveButton.Size = new System.Drawing.Size(74, 47);
|
||||
this.saveButton.TabIndex = 19;
|
||||
this.saveButton.Text = "Save";
|
||||
this.saveButton.UseVisualStyleBackColor = true;
|
||||
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.Location = new System.Drawing.Point(649, 18);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(71, 47);
|
||||
this.cancelButton.TabIndex = 20;
|
||||
this.cancelButton.Text = "Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// SettingsDlg
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(737, 250);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.saveButton);
|
||||
this.Controls.Add(this.connStrForUsersGroupBox);
|
||||
this.Controls.Add(this.connStrForTracingGroupBox);
|
||||
this.Controls.Add(this.commonGroupBox);
|
||||
this.Controls.Add(this.modeGroupBox);
|
||||
this.Name = "SettingsDlg";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "`";
|
||||
this.Load += new System.EventHandler(this.SettingsDlg_Load);
|
||||
this.modeGroupBox.ResumeLayout(false);
|
||||
this.modeGroupBox.PerformLayout();
|
||||
this.commonGroupBox.ResumeLayout(false);
|
||||
this.commonGroupBox.PerformLayout();
|
||||
this.connStrForTracingGroupBox.ResumeLayout(false);
|
||||
this.connStrForTracingGroupBox.PerformLayout();
|
||||
this.connStrForUsersGroupBox.ResumeLayout(false);
|
||||
this.connStrForUsersGroupBox.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox modeGroupBox;
|
||||
private System.Windows.Forms.RadioButton standaloneRadioButton;
|
||||
private System.Windows.Forms.RadioButton withDBRadioButton;
|
||||
private System.Windows.Forms.GroupBox commonGroupBox;
|
||||
private System.Windows.Forms.ComboBox languageComboBox;
|
||||
private System.Windows.Forms.Label languageLabel;
|
||||
private System.Windows.Forms.Label msLabel;
|
||||
private System.Windows.Forms.TextBox delayTextBox;
|
||||
private System.Windows.Forms.Label delayLabel;
|
||||
private System.Windows.Forms.CheckBox loginRequiredCheckBox;
|
||||
private System.Windows.Forms.GroupBox connStrForTracingGroupBox;
|
||||
private System.Windows.Forms.TextBox tracingDBConnStringTextBox;
|
||||
private System.Windows.Forms.GroupBox connStrForUsersGroupBox;
|
||||
private System.Windows.Forms.TextBox usersDBConnStringTextBox;
|
||||
private System.Windows.Forms.Button saveButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.RadioButton tbfLabelPrinterRadioButton;
|
||||
private System.Windows.Forms.Button labelPrinterConfigButton;
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
using TBF.Rig.Output.Printers.Label;
|
||||
using LabelPrinting.Resources;
|
||||
|
||||
namespace LabelPrinting
|
||||
{
|
||||
public partial class SettingsDlg : Form
|
||||
{
|
||||
private readonly LocalSettings ls;
|
||||
private readonly Factory factory;
|
||||
|
||||
public SettingsDlg()
|
||||
{
|
||||
InitializeComponent();
|
||||
factory = new Factory();
|
||||
}
|
||||
|
||||
public SettingsDlg(LocalSettings localSettings)
|
||||
: this()
|
||||
{
|
||||
this.ls = localSettings;
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Settings;
|
||||
modeGroupBox.Text = Strings.Mode;
|
||||
standaloneRadioButton.Text = "20 char s/n - " + Strings.Standalone;
|
||||
withDBRadioButton.Text = "20 char s/n - " + Strings.With_database;
|
||||
languageLabel.Text = Strings.Language_etc;
|
||||
delayLabel.Text = Strings.Delay_between_labes;
|
||||
loginRequiredCheckBox.Text = Strings.User_login_is_required;
|
||||
saveButton.Text = Strings.Save;
|
||||
cancelButton.Text = Strings.Cancel;
|
||||
connStrForTracingGroupBox.Text = Strings.Connection_string_tracing_DB;
|
||||
connStrForUsersGroupBox.Text = Strings.Connection_string_users_DB;
|
||||
}
|
||||
|
||||
private void SettingsDlg_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
languageComboBox.Items.Add("CS");
|
||||
languageComboBox.Items.Add("DE");
|
||||
languageComboBox.Items.Add("EN");
|
||||
languageComboBox.Items.Add("SK");
|
||||
languageComboBox.Items.Add("ZH_CN");
|
||||
languageComboBox.Text = ls.Language;
|
||||
|
||||
if (ls == null) return;
|
||||
|
||||
tbfLabelPrinterRadioButton.Checked = (ls.Mode == Mode.TbfLabelPrinter);
|
||||
standaloneRadioButton.Checked = (ls.Mode == Mode.Standalone);
|
||||
withDBRadioButton.Checked = (ls.Mode == Mode.WithDatabase);
|
||||
|
||||
loginRequiredCheckBox.Checked = ls.IsUserLoginRequired;
|
||||
|
||||
delayTextBox.Text = ls.DelayBetweenLabels.ToString();
|
||||
|
||||
tracingDBConnStringTextBox.Text = ls.TracingDBConnString;
|
||||
usersDBConnStringTextBox.Text = ls.UsersDBConnString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies UI content
|
||||
/// </summary>
|
||||
/// <returns>None-empty string (message) when invalid</returns>
|
||||
string IsUIContentValid()
|
||||
{
|
||||
if (!languageComboBox.Items.Contains(languageComboBox.Text))
|
||||
{
|
||||
return Strings.Invalid_language;
|
||||
}
|
||||
|
||||
int idummy;
|
||||
if (!int.TryParse(delayTextBox.Text, out idummy) || idummy < 0 || idummy > 5000)
|
||||
{
|
||||
return string.Format("{0} {1}", Strings.Invalid, delayLabel.Text);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates settings, checks for differences compared to previous setrtings
|
||||
/// </summary>
|
||||
/// <returns>true when settings are different</returns>
|
||||
bool UpdateSettings()
|
||||
{
|
||||
if (ls == null) return false;
|
||||
|
||||
bool isDifferent = false;
|
||||
|
||||
Mode mode = tbfLabelPrinterRadioButton.Checked ? Mode.TbfLabelPrinter : standaloneRadioButton.Checked ? Mode.Standalone : Mode.WithDatabase;
|
||||
if (ls.Mode != mode)
|
||||
{
|
||||
ls.Mode = mode;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.Language != languageComboBox.Text)
|
||||
{
|
||||
ls.Language = languageComboBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.IsUserLoginRequired != loginRequiredCheckBox.Checked)
|
||||
{
|
||||
ls.IsUserLoginRequired = loginRequiredCheckBox.Checked;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.TracingDBConnString != tracingDBConnStringTextBox.Text)
|
||||
{
|
||||
ls.TracingDBConnString = tracingDBConnStringTextBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
if (ls.UsersDBConnString != usersDBConnStringTextBox.Text)
|
||||
{
|
||||
ls.UsersDBConnString = usersDBConnStringTextBox.Text;
|
||||
isDifferent = true;
|
||||
}
|
||||
|
||||
return isDifferent;
|
||||
}
|
||||
|
||||
private void saveButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
string message = IsUIContentValid();
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
UpdateSettings();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void labelPrinterConfigButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var cmpntEntity = Config.Entities.Component.CreateFromCfg("Printer", factory.ClassName, string.Empty, 1,
|
||||
DebugMode.Normal, LogLevel.Off, ls.LabelPrinterCfg);
|
||||
|
||||
var cfgForm = new TBF.UI.Bench.Components.ComponentParametersDlg(this);
|
||||
cfgForm.ComponentCfgCtrl = new PrinterCfgCtrl();
|
||||
cfgForm.ComponentCfgCtrl.Config = factory.CmpntCfgFromCmpntEntity(cmpntEntity);
|
||||
cfgForm.UnlockAfterStart = true;
|
||||
|
||||
if (cfgForm.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
ls.LabelPrinterCfg = cfgForm.ComponentCfgCtrl.Config.CreateDbEntity().Parameters;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -38,8 +38,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
@@ -62,7 +62,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -48,8 +48,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -49,8 +49,8 @@
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -23,8 +23,6 @@ namespace ProductionTracing
|
||||
{
|
||||
const string OpenFileDlg_SaveFileDlg_Filter = "{0} (*.que)|*.que|{1} (*.*)|*.*";
|
||||
|
||||
ModelessForm modelessForm;
|
||||
|
||||
string[] args;
|
||||
FiltersConfig filtersConfig; /// Serializable configuration of filters and displayed results
|
||||
QueryResults currentQR;
|
||||
@@ -192,9 +190,8 @@ namespace ProductionTracing
|
||||
private void executeQueryBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateAndSaveHistory();
|
||||
|
||||
modelessForm = new ModelessForm(Strings.searching);
|
||||
Thread thread = new Thread(() => Application.Run(modelessForm));
|
||||
|
||||
Thread thread = new Thread(() => Application.Run(new Common.Forms.ModelessForm(Strings.searching)));
|
||||
thread.CurrentCulture = CultureInfo.CurrentCulture;
|
||||
thread.CurrentUICulture = CultureInfo.CurrentUICulture;
|
||||
thread.Start();
|
||||
@@ -223,7 +220,7 @@ namespace ProductionTracing
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (session != null && session.IsOpen) session.Close();
|
||||
if (modelessForm != null) modelessForm.CloseForm();
|
||||
Common.Forms.ModelessForm.CloseForm();
|
||||
MessageBox.Show(exc.Message,
|
||||
Strings.Error,
|
||||
MessageBoxButtons.OK,
|
||||
@@ -236,7 +233,7 @@ namespace ProductionTracing
|
||||
tabControl.TabPages.Add(newTabPage);
|
||||
tabControl.SelectTab(newTabPage);
|
||||
|
||||
if (modelessForm != null) modelessForm.CloseForm();
|
||||
Common.Forms.ModelessForm.CloseForm();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,5 +3,4 @@
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net40" />
|
||||
<package id="Iesi.Collections" version="4.0.0.4000" targetFramework="net40" />
|
||||
<package id="NHibernate" version="4.0.4.4000" targetFramework="net40" />
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -34,8 +34,8 @@
|
||||
<Reference Include="Gma.QrCodeNet.Encoding">
|
||||
<HintPath>..\packages\QrCode.Net.0.4.0.0\net40\Gma.QrCodeNet.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.4.0.4.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -109,7 +109,6 @@ namespace Results.Entities
|
||||
///
|
||||
public virtual string Workflow { get; set; } /// Not mapped to DB !!! Production tracing workflow name
|
||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
public virtual bool PrintLabel { get; set; } /// Not mapped to DB !!!
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
@@ -468,7 +467,6 @@ namespace Results.Entities
|
||||
#if IPERL
|
||||
FWVersion = string.Empty;
|
||||
#endif
|
||||
PrintLabel = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -531,7 +529,6 @@ namespace Results.Entities
|
||||
|
||||
Workflow = src.Workflow; /// Not mapped to DB
|
||||
LastRecordIsNok = src.LastRecordIsNok; /// Not mapped to DB
|
||||
PrintLabel = src.PrintLabel; /// Not mapped to DB
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
@@ -726,7 +723,6 @@ namespace Results.Entities
|
||||
|
||||
writer.Write(Workflow);
|
||||
writer.Write(LastRecordIsNok);
|
||||
writer.Write(PrintLabel);
|
||||
|
||||
/// Save WaterMeterData or WaterMeterData.Id
|
||||
if (WaterMeterData != null && savedWMDatas != null && !savedWMDatas.Contains(WaterMeterData))
|
||||
@@ -827,7 +823,6 @@ namespace Results.Entities
|
||||
|
||||
Workflow = reader.ReadString();
|
||||
LastRecordIsNok = reader.ReadBoolean();
|
||||
PrintLabel = reader.ReadBoolean();
|
||||
|
||||
/// Retrieve TestData
|
||||
if (reader.ReadBoolean())
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Results.Output.Printers.Label
|
||||
readonly Font font;
|
||||
|
||||
/// Data to print
|
||||
Results.Entities.Batch batch;
|
||||
LabelPrinterCfg cfg;
|
||||
Results.Entities.WaterMeter wm;
|
||||
|
||||
@@ -35,10 +36,11 @@ namespace Results.Output.Printers.Label
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
public LabelPrintDocument(LabelPrinterCfg cfg, Results.Entities.WaterMeter wm, string documentName)
|
||||
public LabelPrintDocument(Results.Entities.Batch batch, LabelPrinterCfg cfg, Results.Entities.WaterMeter wm, string documentName)
|
||||
{
|
||||
DocumentName = documentName;
|
||||
|
||||
this.batch = batch;
|
||||
this.cfg = cfg;
|
||||
this.wm = wm;
|
||||
this.itemsToPrint = WMeterRsltItemSpec.FromStrArray(cfg.ItemsToPrint);
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -47,8 +47,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
@@ -65,9 +65,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Oracle.ManagedDataAccess" version="19.11.0" targetFramework="net472" />
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -332,12 +332,6 @@ namespace SchematicDrawing
|
||||
Shapes[DrShIx(Shape.PressM, Sz.M)] = new DrawingShape(Shape.PressM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.L)] = new DrawingShape(Shape.PressM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.PressM, Sz.XL)] = new DrawingShape(Shape.PressM, Sz.XL, 0, 0);
|
||||
|
||||
/// Electric meter
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.S)] = new DrawingShape(Shape.ElectricM, Sz.S, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.M)] = new DrawingShape(Shape.ElectricM, Sz.M, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.L)] = new DrawingShape(Shape.ElectricM, Sz.L, 0, 0);
|
||||
Shapes[DrShIx(Shape.ElectricM, Sz.XL)] = new DrawingShape(Shape.ElectricM, Sz.XL, 0, 0);
|
||||
|
||||
/// Parallel flow meters
|
||||
Shapes[DrShIx(Shape.ParallelFlowM, Sz.S)] = new DrawingShape(Shape.ParallelFlowM, Sz.S, 0, 0);
|
||||
|
||||
@@ -51,7 +51,6 @@ namespace SchematicDrawing
|
||||
Vacuum,
|
||||
Valve,
|
||||
WaterM,
|
||||
ElectricM,
|
||||
|
||||
Count,
|
||||
Custom,
|
||||
|
||||
@@ -108,7 +108,6 @@ namespace SharedDatabase.Entities
|
||||
///
|
||||
public virtual string Workflow { get; set; } /// Not mapped to DB !!! Production tracing workflow name
|
||||
public virtual bool LastRecordIsNok { get; set; } /// Not mapped to DB !!! Previous record verification result
|
||||
public virtual bool PrintLabel { get; set; } /// Not mapped to DB !!!
|
||||
|
||||
public virtual WaterMeterData WaterMeterData { get; set; }
|
||||
public virtual Batch Batch { get; set; }
|
||||
@@ -470,7 +469,6 @@ namespace SharedDatabase.Entities
|
||||
#if IPERL
|
||||
FWVersion = string.Empty;
|
||||
#endif
|
||||
PrintLabel = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +531,6 @@ namespace SharedDatabase.Entities
|
||||
|
||||
Workflow = src.Workflow; /// Not mapped to DB
|
||||
LastRecordIsNok = src.LastRecordIsNok; /// Not mapped to DB
|
||||
PrintLabel = src.PrintLabel; /// Not mapped to DB
|
||||
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
@@ -728,7 +725,6 @@ namespace SharedDatabase.Entities
|
||||
|
||||
writer.Write(Workflow);
|
||||
writer.Write(LastRecordIsNok);
|
||||
writer.Write(PrintLabel);
|
||||
|
||||
/// Save WaterMeterData or WaterMeterData.Id
|
||||
if (WaterMeterData != null && savedWMDatas != null && !savedWMDatas.Contains(WaterMeterData))
|
||||
@@ -829,7 +825,6 @@ namespace SharedDatabase.Entities
|
||||
|
||||
Workflow = reader.ReadString();
|
||||
LastRecordIsNok = reader.ReadBoolean();
|
||||
PrintLabel = reader.ReadBoolean();
|
||||
|
||||
/// Retrieve TestData
|
||||
if (reader.ReadBoolean())
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.15" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34330.188
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBF", "TBF\TBF.csproj", "{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28} = {7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}
|
||||
@@ -100,10 +98,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProductionTracing", "Produc
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S640TestApp", "S640TestApp\S640TestApp.csproj", "{EE097B5A-8162-45B1-9643-4969FC3A8921}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LabelPrinting", "LabelPrinting\LabelPrinting.csproj", "{E4531D13-317C-4D9F-809F-5533B5C3C8BF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TBFTests", "TBFTests\TBFTests.csproj", "{77EB589F-C670-4489-AAD6-2A3C02061FD1}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -438,30 +432,6 @@ Global
|
||||
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{EE097B5A-8162-45B1-9643-4969FC3A8921}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E4531D13-317C-4D9F-809F-5533B5C3C8BF}.Release|x86.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{77EB589F-C670-4489-AAD6-2A3C02061FD1}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.9.2141.1")]
|
||||
[assembly: AssemblyFileVersion("3.9.2141.1")]
|
||||
[assembly: AssemblyVersion("3.9.2130.0")]
|
||||
[assembly: AssemblyFileVersion("3.9.2130.0")]
|
||||
|
||||
Generated
+3
-20
@@ -1,6 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -1256,21 +1257,12 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Current.
|
||||
/// </summary>
|
||||
internal static string Current {
|
||||
get {
|
||||
return ResourceManager.GetString("Current", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to current.
|
||||
/// </summary>
|
||||
internal static string current_ {
|
||||
internal static string current {
|
||||
get {
|
||||
return ResourceManager.GetString("current_", resourceCulture);
|
||||
return ResourceManager.GetString("current", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6821,15 +6813,6 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Voltage.
|
||||
/// </summary>
|
||||
internal static string Voltage {
|
||||
get {
|
||||
return ResourceManager.GetString("Voltage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Volume.
|
||||
/// </summary>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<value>(offline)</value>
|
||||
</data>
|
||||
<data name="About_Test_Bench_Framework" xml:space="preserve">
|
||||
<value>O Test Bench Framework</value>
|
||||
<value>O zkušební stolici Framework</value>
|
||||
</data>
|
||||
<data name="Activity" xml:space="preserve">
|
||||
<value>Činnost</value>
|
||||
@@ -600,9 +600,21 @@
|
||||
<data name="P_in" xml:space="preserve">
|
||||
<value>P up</value>
|
||||
</data>
|
||||
<data name="P_in_end" xml:space="preserve">
|
||||
<value>P up end</value>
|
||||
</data>
|
||||
<data name="P_in_start" xml:space="preserve">
|
||||
<value>P up start</value>
|
||||
</data>
|
||||
<data name="P_out" xml:space="preserve">
|
||||
<value>P down</value>
|
||||
</data>
|
||||
<data name="P_out_end" xml:space="preserve">
|
||||
<value>P down end</value>
|
||||
</data>
|
||||
<data name="P_out_start" xml:space="preserve">
|
||||
<value>P down start</value>
|
||||
</data>
|
||||
<data name="Page" xml:space="preserve">
|
||||
<value>str.</value>
|
||||
</data>
|
||||
@@ -1740,16 +1752,4 @@
|
||||
<data name="Paths" xml:space="preserve">
|
||||
<value>Cesty</value>
|
||||
</data>
|
||||
<data name="About" xml:space="preserve">
|
||||
<value>O</value>
|
||||
</data>
|
||||
<data name="Print" xml:space="preserve">
|
||||
<value>Tisknout</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Proud</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Napětí</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2211,10 +2211,4 @@
|
||||
<data name="Calibration_certificate_validity_expired" xml:space="preserve">
|
||||
<value>Kalibrierschein gültigkeit abgelaufen</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Strom</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Spannung</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2010,10 +2010,4 @@
|
||||
<data name="Fill" xml:space="preserve">
|
||||
<value>Inonder</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Curren</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Tension</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1779,10 +1779,4 @@
|
||||
<data name="Start_cycle" xml:space="preserve">
|
||||
<value>Avviare il ciclo</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Corrente</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltaggio</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1686,10 +1686,4 @@
|
||||
<data name="Uncertainty" xml:space="preserve">
|
||||
<value>Nepevność</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Prąd</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Napięcie</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1813,7 +1813,7 @@
|
||||
<data name="Refresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
<data name="current_" xml:space="preserve">
|
||||
<data name="current" xml:space="preserve">
|
||||
<value>current</value>
|
||||
</data>
|
||||
<data name="Flow" xml:space="preserve">
|
||||
@@ -2449,10 +2449,4 @@
|
||||
<data name="Test_Bench_Framework" xml:space="preserve">
|
||||
<value>Test Bench Framework</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -831,10 +831,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>Evaporare</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1599,10 +1599,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>испарение</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
Generated
-3302
File diff suppressed because it is too large
Load Diff
@@ -1191,10 +1191,4 @@
|
||||
<data name="Evaporation" xml:space="preserve">
|
||||
<value>蒸发</value>
|
||||
</data>
|
||||
<data name="Current" xml:space="preserve">
|
||||
<value>Current</value>
|
||||
</data>
|
||||
<data name="Voltage" xml:space="preserve">
|
||||
<value>Voltage</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -18,9 +18,6 @@ namespace TBF.Rig
|
||||
public IPressureMeter PressMtrUp;
|
||||
public IPressureMeter PressMtrDown;
|
||||
public IPressureMeter PressMtrDelta;
|
||||
public IAdjustableMeter ElectricMtrUp;
|
||||
public IAdjustableMeter ElectricMtrDown;
|
||||
public IAdjustableMeter ElectricMtrDelta;
|
||||
public IValve StopBFValve;
|
||||
public IList<IValve> ValvesOpen;
|
||||
public IList<IValve> ValvesClose;
|
||||
@@ -46,9 +43,6 @@ namespace TBF.Rig
|
||||
PressMtrUp = TbfComponents.FindComponent(entity.PressMtrUp, components) as IPressureMeter;
|
||||
PressMtrDown = TbfComponents.FindComponent(entity.PressMtrDown, components) as IPressureMeter;
|
||||
PressMtrDelta = TbfComponents.FindComponent(entity.PressMtrDelta, components) as IPressureMeter;
|
||||
ElectricMtrUp = TbfComponents.FindComponent(entity.ElectricMtrUp, components) as IAdjustableMeter;
|
||||
ElectricMtrDown = TbfComponents.FindComponent(entity.ElectricMtrDown, components) as IAdjustableMeter;
|
||||
ElectricMtrDelta = TbfComponents.FindComponent(entity.ElectricMtrDelta, components) as IAdjustableMeter;
|
||||
StopBFValve = TbfComponents.FindComponent(entity.StopBFValve, components) as IValve;
|
||||
|
||||
string[] vOpen = entity.ValvesOpen.Split(new char[] { ';' });
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
int bitNr; /// 0 .. 127
|
||||
public UInt128 Mask; /// derived from bitPosition in the constructor
|
||||
|
||||
public bool State { get { return (TBF.Rig.StateMachine.ControlBoardMain.Route & Mask) != 0; } }
|
||||
public bool State { get { return (TBF.Rig.StateMachine.ControlBoard.Route & Mask) != 0; } }
|
||||
|
||||
/// Private fields
|
||||
SerialPort serialPort;
|
||||
@@ -148,7 +148,7 @@ namespace TBF.Rig.Danfoss.VLT2800
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
if (TBF.Rig.StateMachine.ControlBoardMain == null) throw new Exception("Control board is missing");
|
||||
if (TBF.Rig.StateMachine.ControlBoard == null) throw new Exception("Control board is missing");
|
||||
|
||||
bitNr = pumpCfg.BitNr;
|
||||
Mask = (((UInt128)1) << bitNr);
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
public Unit TempUnit { get { return myCfg.TempUnit; } }
|
||||
public Unit PressUnit { get { return myCfg.PressUnit; } }
|
||||
public Unit LengthUnit { get { return myCfg.LenghtUnit; } }
|
||||
public Unit ElectricUnit { get { return myCfg.ElectricUnit; } }
|
||||
|
||||
public ICollection<ProcedureSelection> Sources
|
||||
{
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace TBF.Rig.DataContainer.BenchInfo
|
||||
public ProcedureSelection Source2; /// 21
|
||||
public ProcedureSelection Source3; /// 22
|
||||
public ProcedureSelection Source4; /// 23
|
||||
public Unit ElectricUnit; /// 24
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg() {}
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
public Unit TempUnit { get { return myCfg.TempUnit; } }
|
||||
public Unit PressUnit { get { return myCfg.PressUnit; } }
|
||||
public Unit LengthUnit { get { return myCfg.LenghtUnit; } }
|
||||
public Unit ElectricUnit { get { return myCfg.ElectricUnit; } }
|
||||
public Side Side { get { return myCfg.Side; } }
|
||||
public int MaxTestIndex { get { return myCfg.MaxTestIndex; } } /// (MaxPruefindex % 100) value when to reject water meters completely if they are NOK
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
public ProcedureSelection Source2; /// 23
|
||||
public ProcedureSelection Source3; /// 24
|
||||
public ProcedureSelection Source4; /// 25
|
||||
public Unit ElectricUnit; /// 26
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
public string CalibCertificateNr { get; set; }
|
||||
@@ -100,7 +99,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
Source2 = ProcedureSelection.FromLocalDB;
|
||||
Source3 = ProcedureSelection.None;
|
||||
Source4 = ProcedureSelection.None;
|
||||
ElectricUnit = Unit.A;
|
||||
|
||||
CalibCertificateNr = string.Empty;
|
||||
CalibDate = TBF.UI.Constants.MinDate;
|
||||
@@ -135,7 +133,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
"Procedure selection source 2", /// 23
|
||||
"Procedure selection source 3", /// 24
|
||||
"Procedure selection source 4", /// 25
|
||||
"Preffered electric unit", /// 26
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
@@ -196,13 +193,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
for (ProcedureSelection src = 0; src < ProcedureSelection.Count; src++)
|
||||
list.Add(src.ToDescription());
|
||||
return list;
|
||||
|
||||
case 26:
|
||||
for (Unit unit = 0; unit < Unit.Count; unit++)
|
||||
if (Units.IsQuantity(unit, Quantity.Current) ||
|
||||
Units.IsQuantity(unit, Quantity.Voltage))
|
||||
list.Add(unit.ToDescription());
|
||||
return list;
|
||||
|
||||
default:
|
||||
return null;
|
||||
@@ -239,7 +229,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
case 23: return Source2.ToDescription();
|
||||
case 24: return Source3.ToDescription();
|
||||
case 25: return Source4.ToDescription();
|
||||
case 26: return ElectricUnit.ToDescription();
|
||||
default:
|
||||
return string.Format("{0}: Bench={1}, ID={2}, Mtrs={3}, Lines={4}, Compund mtrs={5}, S1={6}, S2={7}, S3={8}, S4={9}",
|
||||
Name, TestBenchName, TestBenchId, WaterMetersCount, LinesCount, CompoundMetersCount, Source1, Source2, Source3, Source4);
|
||||
@@ -340,10 +329,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
}
|
||||
break;
|
||||
|
||||
case 26:
|
||||
ElectricUnit = Units.FromDescription(str);
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
@@ -403,10 +388,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
if (str == source.ToDescription()) return true;
|
||||
}
|
||||
break;
|
||||
case 26:
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
@@ -444,7 +425,6 @@ namespace TBF.Rig.DataContainer.iPerlBenchInfo
|
||||
prms.Source2 = Source2;
|
||||
prms.Source3 = Source3;
|
||||
prms.Source4 = Source4;
|
||||
prms.ElectricUnit = ElectricUnit;
|
||||
|
||||
prms.CalibCertificateNr = this.CalibCertificateNr;
|
||||
prms.CertPath = this.CertPath;
|
||||
|
||||
@@ -6,22 +6,21 @@ using Common;
|
||||
|
||||
namespace TBF.Rig.DataEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Action of a DataEntry field
|
||||
/// </summary>
|
||||
///
|
||||
/// Ac = Action
|
||||
///
|
||||
public enum Ac
|
||||
{
|
||||
[Description("Clear")] Clear, /// Clear when the form is open, save on OK
|
||||
[Description("Last from history")] HistoryLast,
|
||||
[Description("Load")] Load, /// Load from water meters when the form is open, save on OK
|
||||
[Description("Load (readonly)")] LoadReadOnly, /// Load from water meters when the form is open, prevent changes, do not save
|
||||
[Description("Set")] Set, /// Set to 'yes' when the form is open
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Content of a DataEntry field
|
||||
/// </summary>
|
||||
///
|
||||
/// Ct = Content
|
||||
///
|
||||
public enum Ct
|
||||
{
|
||||
[Description("None")] None,
|
||||
@@ -40,7 +39,6 @@ namespace TBF.Rig.DataEntry
|
||||
[Description("WM Remark")] WmRemark,
|
||||
[Description("Batch remark")] BatchRemark,
|
||||
[Description("Batch and WM remark")] BatchAndWmRemark,
|
||||
[Description("Print label")] PrintLabel,
|
||||
#if ORACLE_DB
|
||||
[Description("Prefix")] Prefix,
|
||||
[Description("Suffix")] Suffix,
|
||||
@@ -48,16 +46,6 @@ namespace TBF.Rig.DataEntry
|
||||
Count
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Function of the multi purpose button
|
||||
/// </summary>
|
||||
public enum MultiPurposeBtnFunction
|
||||
{
|
||||
None,
|
||||
AutoSN,
|
||||
PrintLabelsOnOff,
|
||||
}
|
||||
|
||||
///
|
||||
/// Identifies image instance
|
||||
///
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
///
|
||||
using System.Windows.Forms;
|
||||
using Results.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Rig.DataEntry
|
||||
{
|
||||
@@ -31,10 +30,9 @@ namespace TBF.Rig.DataEntry
|
||||
case Ct.BatchOrder: return (wm.Batch != null && wm.Batch.PurchaseOrder != null) ? wm.Batch.PurchaseOrder : string.Empty;
|
||||
case Ct.BatchAndWmOrder: return (wm.Batch != null && wm.Batch.PurchaseOrder != null) ? wm.Batch.PurchaseOrder : string.Empty;
|
||||
|
||||
case Ct.WmRemark: return (!wm.Disabled && wm.Remark != null) ? wm.Remark : string.Empty;
|
||||
case Ct.BatchRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
|
||||
case Ct.BatchAndWmRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
|
||||
case Ct.PrintLabel: return wm.PrintLabel ? Strings.yes : Strings.no;
|
||||
case Ct.WmRemark: return (!wm.Disabled && wm.Remark != null) ? wm.Remark : string.Empty;
|
||||
case Ct.BatchRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
|
||||
case Ct.BatchAndWmRemark: return (wm.Batch != null && wm.Batch.Remark != null) ? wm.Batch.Remark : string.Empty;
|
||||
#if ORACLE_DB
|
||||
case Ct.Prefix: return (!wm.Disabled && wm.Prefix != null) ? wm.Prefix : string.Empty;
|
||||
case Ct.Suffix: return (!wm.Disabled && wm.Suffix != null) ? wm.Suffix : string.Empty;
|
||||
@@ -79,10 +77,6 @@ namespace TBF.Rig.DataEntry
|
||||
case Ct.BatchAndWmRemark:
|
||||
if (wm.Batch != null) wm.Batch.Remark = value;
|
||||
return;
|
||||
|
||||
case Ct.PrintLabel:
|
||||
wm.PrintLabel = (value == Strings.yes);
|
||||
return;
|
||||
#if ORACLE_DB
|
||||
case Ct.Prefix: wm.Prefix = value; return;
|
||||
case Ct.Suffix: wm.Suffix = value; return;
|
||||
|
||||
@@ -50,9 +50,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
readonly ComboBox[,] comboBoxes; /// Combo boxes for values in columns
|
||||
readonly CheckBox[] checkBoxes; /// Check boxes for water meter enable/disable
|
||||
|
||||
readonly MultiPurposeBtnFunction multiPurposeButtonFn;
|
||||
bool multiPurposeButtonFlag;
|
||||
|
||||
readonly LocalSettings ls;
|
||||
|
||||
bool isHandlersEnabled; /// Initially false, set to true after ComboBoxes are filled with data
|
||||
@@ -127,34 +124,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
comboBoxes = new ComboBox[colItems.Count, wmsCount];
|
||||
checkBoxes = new CheckBox[wmsCount];
|
||||
|
||||
///
|
||||
/// Determine the multi purpose button function
|
||||
///
|
||||
multiPurposeButton.Visible = false;
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.None;
|
||||
int buttonsWidth = 350;
|
||||
for (int k = 0; k < colItems.Count; k++)
|
||||
{
|
||||
if ((colItems[k].Content == Ct.SerialNr || colItems[k].Content == Ct.SerialNrAux) && colItems[k].Action != Ac.LoadReadOnly)
|
||||
{
|
||||
multiPurposeButton.Visible = true;
|
||||
multiPurposeButton.Text = "Auto s/n";
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.AutoSN;
|
||||
buttonsWidth += 147;
|
||||
break;
|
||||
}
|
||||
|
||||
if (colItems[k].Content == Ct.PrintLabel)
|
||||
{
|
||||
multiPurposeButton.Visible = true;
|
||||
multiPurposeButton.Text = string.Format("{0} ({1}/{2})", Strings.Print, Strings.yes, Strings.no);
|
||||
multiPurposeButtonFn = MultiPurposeBtnFunction.PrintLabelsOnOff;
|
||||
multiPurposeButtonFlag = false;
|
||||
buttonsWidth += 147;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// Layout related readonly variables derived from argument 'sz'
|
||||
switch (sz)
|
||||
{
|
||||
@@ -163,7 +132,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
meterHeight = 26; /// Height of a ComboBox control
|
||||
margin = 20;
|
||||
spacing = 8;
|
||||
this.buttonsWidth = buttonsWidth;
|
||||
buttonsWidth = 350;
|
||||
hdrHeight = 120;
|
||||
labelWid = 31;
|
||||
checkBoxWid = 23;
|
||||
@@ -175,7 +144,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
meterHeight = 31; /// Height of a ComboBox control
|
||||
margin = 25;
|
||||
spacing = 10;
|
||||
this.buttonsWidth = buttonsWidth;
|
||||
buttonsWidth = 350;
|
||||
hdrHeight = 140;
|
||||
labelWid = 34;
|
||||
checkBoxWid = 23;
|
||||
@@ -186,7 +155,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
meterHeight = 37; /// Height of a ComboBox control
|
||||
margin = 30;
|
||||
spacing = 12;
|
||||
this.buttonsWidth = buttonsWidth;
|
||||
buttonsWidth = 350;
|
||||
hdrHeight = 160;
|
||||
labelWid = 40;
|
||||
checkBoxWid = 23;
|
||||
@@ -267,8 +236,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
///
|
||||
/// Table
|
||||
///
|
||||
int commonCheckBoxLeft = 0;
|
||||
int commonCheckBoxTop = 0;
|
||||
int columnsTop = Math.Max(hdrHeight, groupBoxHeight + 2 * margin + spacing);
|
||||
for (int j = 0; j < linesCount; j++)
|
||||
{
|
||||
@@ -327,22 +294,14 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
TabIndex = tabIndex++,
|
||||
Parent = this,
|
||||
};
|
||||
|
||||
|
||||
comboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged);
|
||||
comboBox.TextChanged += new System.EventHandler(this.comboBox_TextChanged);
|
||||
comboBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox_KeyPress);
|
||||
|
||||
if (ci.Content == Ct.PrintLabel)
|
||||
{
|
||||
comboBox.Items.Add(Strings.yes);
|
||||
comboBox.Items.Add(Strings.no);
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastVals = GetHistoryFromLS(isEnd, k);
|
||||
comboBox.Items.Add(lastVals.Length > wmPos0 ? lastVals[wmPos0] : string.Empty); /// History in drop-down menu
|
||||
}
|
||||
|
||||
|
||||
var lastVals = GetHistoryFromLS(isEnd, k);
|
||||
comboBox.Items.Add(lastVals.Length > wmPos0 ? lastVals[wmPos0] : string.Empty); /// History in drop-down menu
|
||||
|
||||
left += ci.Width + spacing;
|
||||
comboBoxes[k, wmPos0] = comboBox;
|
||||
this.Controls.Add(comboBox);
|
||||
@@ -357,26 +316,10 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
};
|
||||
checkBoxes[wmPos0] = checkBox;
|
||||
this.Controls.Add(checkBox);
|
||||
|
||||
if (commonCheckBoxLeft == 0)
|
||||
{
|
||||
commonCheckBoxLeft = left;
|
||||
commonCheckBoxTop = columnsTop - meterHeight;
|
||||
}
|
||||
}
|
||||
|
||||
okButton.TabIndex = tabIndex++;
|
||||
clearButton.TabIndex = tabIndex++;
|
||||
|
||||
var commonCheckBox = new CheckBox
|
||||
{
|
||||
Location = new Point(commonCheckBoxLeft, commonCheckBoxTop + 6),
|
||||
Size = new Size(checkBoxWid, 23),
|
||||
TabIndex = tabIndex++,
|
||||
Parent = this,
|
||||
};
|
||||
commonCheckBox.CheckedChanged += new System.EventHandler(commonCheckBox_CheckedChanged);
|
||||
this.Controls.Add(commonCheckBox);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -384,7 +327,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
///
|
||||
Rectangle screenRectangle = this.RectangleToScreen(this.ClientRectangle);
|
||||
int titleBarHeight = screenRectangle.Top - this.Top;
|
||||
Size = new Size(Math.Max(meterWidth * linesCount + margin * (linesCount + 1), margin + groupBoxWidth + this.buttonsWidth),
|
||||
Size = new Size(Math.Max(meterWidth * linesCount + margin * (linesCount + 1), margin + groupBoxWidth + buttonsWidth),
|
||||
titleBarHeight + columnsTop + lineSize * (meterHeight + spacing) + margin);
|
||||
|
||||
Localize();
|
||||
@@ -502,10 +445,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
case Ac.LoadReadOnly:
|
||||
commonComboBoxes[ix].Text = DEUtils.GetContent(commonItems[ix].Content, firstValidWM);
|
||||
break;
|
||||
|
||||
case Ac.Set:
|
||||
commonComboBoxes[ix].Text = Strings.yes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,13 +472,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
comboBoxes[k, i].Text = DEUtils.GetContent(colItems[k].Content, WaterMeters[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case Ac.Set:
|
||||
for (int i = 0; i < wmsCount; i++)
|
||||
{
|
||||
comboBoxes[k, i].Text = (WaterMeters[i] != null && !WaterMeters[i].Disabled) ? Strings.yes : Strings.no;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,120 +577,18 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
}
|
||||
}
|
||||
|
||||
private void commonCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool state = (sender as CheckBox).Checked;
|
||||
for (int i = 0; i < wmsCount; i++)
|
||||
{
|
||||
checkBoxes[i].Checked = state;
|
||||
}
|
||||
InitializeBoxes();
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateWMsFromBoxes();
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
InitializeBoxes();
|
||||
}
|
||||
|
||||
private void multiPurposeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.None) return;
|
||||
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.AutoSN)
|
||||
{
|
||||
///
|
||||
/// Find the 1st enabled water meter
|
||||
///
|
||||
int firstIx;
|
||||
for (firstIx = 0; firstIx < wmsCount; firstIx++)
|
||||
{
|
||||
if (checkBoxes[firstIx].Checked) break;
|
||||
}
|
||||
if (firstIx == wmsCount)
|
||||
{
|
||||
return; /// There is not any enabled water meter
|
||||
}
|
||||
|
||||
char[] digits = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
||||
|
||||
///
|
||||
/// Find a column with serial numbers
|
||||
///
|
||||
for (int k = 0; k < colItems.Count; k++)
|
||||
{
|
||||
if ((colItems[k].Content == Ct.SerialNr || colItems[k].Content == Ct.SerialNrAux) && colItems[k].Action != Ac.LoadReadOnly)
|
||||
{
|
||||
///
|
||||
/// Column with serial numbers found => perform an auto s/n assignment
|
||||
///
|
||||
string firstSN = comboBoxes[k, firstIx].Text;
|
||||
|
||||
int firstSnNr;
|
||||
int startIx = firstSN.IndexOfAny(digits);
|
||||
if (startIx >= 0)
|
||||
{
|
||||
int lastDigitPosPlus1 = startIx + 1;
|
||||
var listOfDigits = new List<char>(digits);
|
||||
while (lastDigitPosPlus1 < firstSN.Length && listOfDigits.Contains(firstSN[lastDigitPosPlus1]))
|
||||
{
|
||||
lastDigitPosPlus1++;
|
||||
}
|
||||
int digitsCount = lastDigitPosPlus1 - startIx;
|
||||
|
||||
if (int.TryParse(firstSN.Substring(startIx, digitsCount), out firstSnNr) && firstSnNr >= 0)
|
||||
{
|
||||
for (int ix = firstIx + 1; ix < wmsCount; ix++)
|
||||
{
|
||||
if (checkBoxes[ix].Checked)
|
||||
{
|
||||
firstSnNr++;
|
||||
string newSN = firstSnNr.ToString();
|
||||
int len = newSN.Length;
|
||||
if (len <= digitsCount)
|
||||
{
|
||||
comboBoxes[k, ix].Text = firstSN.Substring(0, startIx + digitsCount - len) + newSN + firstSN.Substring(startIx + digitsCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBoxes[k, ix].Text = firstSN.Substring(0, startIx) + newSN + firstSN.Substring(startIx + digitsCount); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (multiPurposeButtonFn == MultiPurposeBtnFunction.PrintLabelsOnOff)
|
||||
{
|
||||
///
|
||||
/// Find a column with Ct.PrintLabel
|
||||
///
|
||||
for (int k = 0; k < colItems.Count; k++)
|
||||
{
|
||||
if (colItems[k].Content == Ct.PrintLabel)
|
||||
{
|
||||
for (int ix = 0; ix < wmsCount; ix++)
|
||||
{
|
||||
if (WaterMeters[ix] != null && !WaterMeters[ix].Disabled)
|
||||
{
|
||||
comboBoxes[k, ix].Text = multiPurposeButtonFlag ? Strings.yes : Strings.no;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
multiPurposeButtonFlag = !multiPurposeButtonFlag;
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectedIndexChanged(object sndr, EventArgs e)
|
||||
{
|
||||
if (!isHandlersEnabled) return;
|
||||
@@ -769,7 +599,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
|
||||
isHandlersEnabled = false;
|
||||
|
||||
if (k >= 0 && colItems[k].Content != Ct.PrintLabel && comboBoxes[k, j].Text == comboBoxes[k, j].Items[0].ToString())
|
||||
if (k >= 0 && comboBoxes[k, j].Text == comboBoxes[k, j].Items[0].ToString())
|
||||
{
|
||||
for (int i = 0; i < wmsCount; i++)
|
||||
{
|
||||
|
||||
-11
@@ -34,7 +34,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CycleBgEnForm));
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.clearButton = new System.Windows.Forms.Button();
|
||||
this.multiPurposeButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
@@ -53,20 +52,11 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
this.clearButton.UseVisualStyleBackColor = true;
|
||||
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
|
||||
//
|
||||
// multiPurposeButton
|
||||
//
|
||||
resources.ApplyResources(this.multiPurposeButton, "multiPurposeButton");
|
||||
this.multiPurposeButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.multiPurposeButton.Name = "multiPurposeButton";
|
||||
this.multiPurposeButton.UseVisualStyleBackColor = true;
|
||||
this.multiPurposeButton.Click += new System.EventHandler(this.multiPurposeButton_Click);
|
||||
//
|
||||
// CycleBgEnForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.Controls.Add(this.multiPurposeButton);
|
||||
this.Controls.Add(this.clearButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.ForeColor = System.Drawing.Color.Black;
|
||||
@@ -81,6 +71,5 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button clearButton;
|
||||
private System.Windows.Forms.Button multiPurposeButton;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>okButton.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="clearButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
@@ -181,42 +181,6 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>clearButton.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Verdana, 14.25pt</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>648, 26</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 63</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Text" xml:space="preserve">
|
||||
<value>Multi purpose</value>
|
||||
</data>
|
||||
<data name="multiPurposeButton.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name=">>multiPurposeButton.Name" xml:space="preserve">
|
||||
<value>multiPurposeButton</value>
|
||||
</data>
|
||||
<data name=">>multiPurposeButton.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>multiPurposeButton.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>multiPurposeButton.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
|
||||
BgItemContent = new Ct[1] { Ct.BatchAndWmOrder };
|
||||
BgItemCaption = new string[1] { "Order nr." };
|
||||
BgItemAction = new Ac[1] { Ac.HistoryLast };
|
||||
BgItemAction = new Ac[1] { Ac.Clear };
|
||||
BgItemWidth = new int[1] { 200 };
|
||||
|
||||
BgColumnContent = new Ct[1] { Ct.SerialNr };
|
||||
@@ -563,7 +563,6 @@ namespace TBF.Rig.DataEntry.Uni
|
||||
Ct.ArchivePath.ToDescription(),
|
||||
Ct.WmOrder.ToDescription(),
|
||||
Ct.WmRemark.ToDescription(),
|
||||
Ct.PrintLabel.ToDescription(),
|
||||
};
|
||||
}
|
||||
case 2:
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using TBF.Boxes;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.GenericDevices
|
||||
{
|
||||
public interface IAdjustableMeter : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Events: PressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressure">Reference to a variable for the measured pressure in bar</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
IOperation ReadAdjustableOp(ref DoubleBox value);
|
||||
|
||||
/// <summary>
|
||||
/// Events: pressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressure">Reference to a variable for the measured pressure in bar</param>
|
||||
/// <param name="pressureDone">Event returned when measurement done</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
IOperation ReadAdjustableOp(ref DoubleBox value, Event valueDone);
|
||||
|
||||
bool MsrmntAvailable { get; }
|
||||
double MeasuredVal { get; }
|
||||
double MsrdValLimLo { get; }
|
||||
double MsrdValLimHi { get; }
|
||||
string MsrdFormat { get; }
|
||||
Common.Unit MsrdUnit { get; }
|
||||
string AltString { get; }
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,5 @@ namespace TBF.Rig.GenericDevices
|
||||
Unit TempUnit { get; }
|
||||
Unit PressUnit { get; }
|
||||
Unit LengthUnit { get; }
|
||||
Unit ElectricUnit { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ namespace TBF.Rig.MettlerToledo
|
||||
|
||||
if (drainValve == null) throw new Exception(string.Format("{0} is missing a drain valve", Name));
|
||||
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoardMain, null, drainValve);
|
||||
openTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, drainValve, null);
|
||||
closeTheDrainValveOp = new BuiltIn.SetValvesOp(StateMachine.ControlBoard, null, drainValve);
|
||||
waitTankIsEmptyOp = new WaitTankEmptyOp(this);
|
||||
|
||||
Various.TankWithLevelMsrmnt.TankCfg tankCfg = tankDrainingCfg as Various.TankWithLevelMsrmnt.TankCfg;
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Boxes;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.GenericDevices;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class AdjustableMeter : ComponentBase, IAdjustableMeter, IDevice, ISequenceCondition, IDrawingItCmpntWithMeasuredVal
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(AdjustableMeter));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly AdjustableMeterCfg _adjustableMtrCfg;
|
||||
public IDrawingItem DrawingItem { get { return _adjustableMtrCfg as IDrawingItem; } }
|
||||
|
||||
Common.Modbus modbus;
|
||||
|
||||
double receivedValue;
|
||||
double receivedAmpers;
|
||||
|
||||
public bool MsrmntAvailable { get { return true; } }
|
||||
public double MeasuredVal { get { return receivedValue; } }
|
||||
public double MsrdValLimLo { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.MsrdValLimLo); } }
|
||||
public double MsrdValLimHi { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.MsrdValLimHi); } }
|
||||
public Unit MsrdUnit { get { return _adjustableMtrCfg.MsrdUnit; } }
|
||||
public string MsrdFormat { get { return _adjustableMtrCfg.MsrdFormat; } }
|
||||
public string AltString { get { return string.Empty; } }
|
||||
|
||||
int ticketNumber; /// 0 .. number of devices registered for regular polling - 1
|
||||
|
||||
public double CorrectionValLo { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.CorrectionValLo); } }
|
||||
public double CorrectionValHi { get { return Units.ConvertFrom(MsrdUnit, _adjustableMtrCfg.CorrectionValHi); } }
|
||||
|
||||
IList<MeasurementCorrection> CorrectionsLocal;
|
||||
|
||||
|
||||
public AdjustableMeter() { }
|
||||
|
||||
public AdjustableMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
_adjustableMtrCfg = cfg as AdjustableMeterCfg;
|
||||
CreateConditions();
|
||||
}
|
||||
|
||||
///
|
||||
/// IDevice interface
|
||||
///
|
||||
public override void Initialize()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
InitModbus();
|
||||
|
||||
if (CorrectionValLo != 0 || CorrectionValHi != 0 ) {
|
||||
CorrectionsLocal = new List<MeasurementCorrection>();
|
||||
MeasurementCorrection Lo, Hi;
|
||||
Lo = new MeasurementCorrection(1);
|
||||
Lo.Measurement = CorrectionValLo;
|
||||
Lo.Correction = MsrdValLimLo;
|
||||
CorrectionsLocal.Add(Lo);
|
||||
Hi = new MeasurementCorrection(2);
|
||||
Hi.Measurement = CorrectionValHi;
|
||||
Hi.Correction = MsrdValLimHi;
|
||||
CorrectionsLocal.Add(Hi);
|
||||
|
||||
log.FatalFormat("{0} Correction initialised - CorrectionValLo: {1} CorrectionValHi: {2}", Name, CorrectionValLo, CorrectionValHi);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitModbus()
|
||||
{
|
||||
modbus = TbfComponents.FindComponent(_adjustableMtrCfg.ParentName) as Common.Modbus;
|
||||
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
modbus.ComponentNames[_adjustableMtrCfg.ModbusAddress] = Name;
|
||||
ticketNumber = modbus.RegisterForPolling();
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal && modbus.ReceivedTelegrams[_adjustableMtrCfg.ModbusAddress].Count > 0)
|
||||
{
|
||||
byte[] telegram = modbus.ReceivedTelegrams[_adjustableMtrCfg.ModbusAddress].Dequeue();
|
||||
if (telegram.Length == 9 && telegram[1] == 4 && telegram[2] == 4)
|
||||
{
|
||||
/// Swap byte order
|
||||
byte t1 = telegram[3];
|
||||
byte t2 = telegram[4];
|
||||
byte t3 = telegram[5];
|
||||
byte t4 = telegram[6];
|
||||
telegram[3] = t4;
|
||||
telegram[4] = t3;
|
||||
telegram[5] = t2;
|
||||
telegram[6] = t1;
|
||||
|
||||
receivedAmpers = Units.ConvertFrom(Unit.A, System.BitConverter.ToSingle(telegram, 3));
|
||||
if (CorrectionsLocal != null)
|
||||
{
|
||||
receivedValue = GetCorrectionLimitLessHi(receivedAmpers, CorrectionsLocal);
|
||||
}
|
||||
else
|
||||
{
|
||||
receivedValue = receivedAmpers;
|
||||
}
|
||||
|
||||
log.WarnFormat("Adjustable meter: {0}={1} Unit interpolated from Ampers: {2}", Name, receivedValue.ToString("F3"), receivedAmpers.ToString("F3"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a correction from a list of corrections by interpolation.
|
||||
/// It is assumed that values in the list 'corrections' are sorted.
|
||||
/// </summary>
|
||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||
/// <returns>Corrected value</returns>
|
||||
public static double GetCorrectionLimitLessHi(double rawValue, IList<MeasurementCorrection> corrections)
|
||||
{
|
||||
if ((corrections == null) || (corrections.Count == 0)) return 0; /// No correction
|
||||
|
||||
if (rawValue < corrections[0].Measurement)
|
||||
{
|
||||
/// rawValue is below the lowest value in the correction table
|
||||
return corrections[0].Correction;
|
||||
}
|
||||
|
||||
for (int i = 1; i < corrections.Count; i++)
|
||||
{
|
||||
if (rawValue < corrections[i].Measurement)
|
||||
{
|
||||
double d1 = rawValue - corrections[i - 1].Measurement;
|
||||
double d2 = corrections[i].Measurement - rawValue;
|
||||
|
||||
if (d1 + d2 <= float.Epsilon)
|
||||
{
|
||||
/// Neigboring values in the corection table are close to each other -> calculate the average
|
||||
return (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Interpolate the correction from neigboring values in the corection table
|
||||
return (corrections[i - 1].Correction * d2 + corrections[i].Correction * d1) / (d1 + d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int lastCorrection = corrections.Count - 1;
|
||||
if (lastCorrection > 0)
|
||||
{
|
||||
double d1 = rawValue - corrections[lastCorrection - 1].Measurement;
|
||||
double d2 = corrections[lastCorrection].Measurement - rawValue;
|
||||
return (corrections[lastCorrection - 1].Correction * d2 + corrections[lastCorrection].Correction * d1) /
|
||||
(d1 + d2);
|
||||
}
|
||||
|
||||
/// rawValue is above the highest value in the correction table
|
||||
return corrections[corrections.Count - 1].Correction;
|
||||
}
|
||||
|
||||
|
||||
public void RunDeviceAfter()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal && modbus.IsMyTurn(ticketNumber))
|
||||
{
|
||||
const byte Function = 4; /// Read input registers
|
||||
const ushort Address = 0; /// Pressure
|
||||
modbus.SendMessage((byte)_adjustableMtrCfg.ModbusAddress, Function, Address, 2, Name);
|
||||
}
|
||||
}
|
||||
|
||||
public void StopDevice() { }
|
||||
public void StopDevice2() { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the water pressure
|
||||
/// </summary>
|
||||
/// <returns>Pressure in mBar</returns>
|
||||
public double ReadPressure()
|
||||
{
|
||||
if (DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
return MeasurementCorrection.CorrectedValue(receivedValue, Corrections);
|
||||
}
|
||||
else if (DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressureBox">Reference to a variable for the pressure in Bar</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadAdjustableOp(ref DoubleBox value)
|
||||
{
|
||||
return new ReadValueOp(this, ref value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: valueDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pressureBox">Reference to a variable for the pressure in Bar</param>
|
||||
/// <param name="pressureDone">Event returned when measurement done</param>
|
||||
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadAdjustableOp(ref DoubleBox value, Event valueDone)
|
||||
{
|
||||
return new ReadValueOp(this, ref value, valueDone);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// ISequenceCondition interface implementation (conditions in transition sequences)
|
||||
///
|
||||
IList<string> sequenceConditionNames;
|
||||
IList<IOperation> sequenceConditions;
|
||||
|
||||
public int ConditionsCount { get { return sequenceConditions != null ? sequenceConditions.Count : 0; } }
|
||||
|
||||
/// Strings are added to the combo-box for transition sequence condition selection
|
||||
public string ConditionName(int i)
|
||||
{
|
||||
if (sequenceConditionNames != null && i < sequenceConditionNames.Count && i >= 0)
|
||||
return sequenceConditionNames[i];
|
||||
else
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// Operations are executed as a part of a transition sequence
|
||||
public IOperation ConditionOp(int i)
|
||||
{
|
||||
if (sequenceConditions != null && i < sequenceConditions.Count && i >= 0)
|
||||
return sequenceConditions[i];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
void ClearConditions()
|
||||
{
|
||||
sequenceConditionNames = new List<string>();
|
||||
sequenceConditions = new List<IOperation>();
|
||||
}
|
||||
|
||||
void AddCondition(string conditionName, IOperation conditionOperation)
|
||||
{
|
||||
sequenceConditionNames.Add(conditionName);
|
||||
sequenceConditions.Add(conditionOperation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a list of conditions
|
||||
/// </summary>
|
||||
void CreateConditions()
|
||||
{
|
||||
ClearConditions();
|
||||
foreach (var pressLimit in new double[] { 2.18, 2.2, 2.22, 2.24, 2.26, 2.27 })
|
||||
{
|
||||
AddCondition(string.Format("{0} {1} > {2} bar", Strings.Wait_until, Name, pressLimit), new WaitUntilValueIsOp(this, Pr.IsGT, pressLimit));
|
||||
AddCondition(string.Format("{0} {1} < {2} bar", Strings.Wait_until, Name, pressLimit), new WaitUntilValueIsOp(this, Pr.IsLT, pressLimit));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2021-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using SchematicDrawing;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class AdjustableMeterCfg : ComponentCfgBase, IChildComponentCfg, GenericDevices.ICalibInfoCfg, IParamsProvider,
|
||||
IDrawingItemWithMeasuredVal
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AdjustableMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
||||
{
|
||||
var parents = cmpntEntities.Where(x => x.ClassName == "Modbus.Common");
|
||||
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
|
||||
}
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public int ModbusAddress; /// 0 (1..254)
|
||||
public double DefaultPressure; /// 1
|
||||
public string MsrdFormat { get; set; } /// 2
|
||||
public Unit MsrdUnit { get; set; } /// 3
|
||||
public double MsrdValLimLo { get; set; } /// 4
|
||||
public double MsrdValLimHi { get; set; } /// 5
|
||||
public double CorrectionValLo { get ; set; } /// 6
|
||||
public double CorrectionValHi { get ; set; } /// 7
|
||||
|
||||
|
||||
|
||||
/// Calibration info serialized parameters displayed in Metrology tab page
|
||||
public string CalibCertificateNr { get; set; }
|
||||
public string CertPath { get; set; }
|
||||
public DateTime CalibDate { get; set; }
|
||||
public DateTime CalibValidDate { get; set; }
|
||||
|
||||
/// Schematic drawing info
|
||||
public Shape Shape { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public Sz Sz { get; set; }
|
||||
public Orient Orient { get; set; }
|
||||
public bool Flip { get; set; }
|
||||
public int LblX { get; set; }
|
||||
public int LblY { get; set; }
|
||||
public Orient LblOrient { get; set; }
|
||||
public int MsrdX { get; set; }
|
||||
public int MsrdY { get; set; }
|
||||
public Orient MsrdOrient { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
AdjustableMeterCfg()
|
||||
{
|
||||
GNodes = new List<GNode>();
|
||||
}
|
||||
|
||||
public AdjustableMeterCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Shape = Shape.ElectricM;
|
||||
Sz = Sz.M;
|
||||
Factory = factory;
|
||||
Name = "Ad";
|
||||
ParentName = "Modbus";
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
ModbusAddress = 49;
|
||||
DefaultPressure = 2.34;
|
||||
MsrdFormat = "{0:F2} A";
|
||||
MsrdUnit = Unit.A;
|
||||
MsrdValLimLo = -0.1;
|
||||
MsrdValLimHi = 25.0;
|
||||
|
||||
CorrectionValLo = 0.0;
|
||||
CorrectionValHi = 0.0;
|
||||
|
||||
MsrdY = 22;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Modbus address", /// 0
|
||||
"Default value", /// 1
|
||||
"Display format", /// 2
|
||||
"Unit", /// 3
|
||||
"Limit Lo", /// 4
|
||||
"Limit Hi", /// 5
|
||||
"Correction limit Lo", /// 6
|
||||
"Correction limit Hi", /// 7
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public ICollection<string> ParamValues(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 3:
|
||||
return new string[] { "A", "mA", "V", "mV", "Pa", "hPa", "mbar", "kPa", "inHg", "psi", "bar", "MPa" };
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: return ModbusAddress.ToString();
|
||||
case 1: return DefaultPressure.ToString();
|
||||
case 2: return MsrdFormat;
|
||||
case 3: return MsrdUnit.ToDescription();
|
||||
case 4: return MsrdValLimLo.ToString();
|
||||
case 5: return MsrdValLimHi.ToString();
|
||||
case 6: return CorrectionValLo.ToString();
|
||||
case 7: return CorrectionValHi.ToString();
|
||||
default:
|
||||
return string.Format("{0}({1}) address={2}", Name, string.IsNullOrEmpty(ParentName) ? "-" : ParentName, ModbusAddress);
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string str)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: ModbusAddress = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: DefaultPressure = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: MsrdFormat = str; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3:
|
||||
foreach (var u in new Unit[] { Unit.A, Unit.mA, Unit.V, Unit.mV, Unit.Pa, Unit.hPa, Unit.mbar, Unit.kPa, Unit.inHg, Unit.psi, Unit.bar, Unit.MPa })
|
||||
{
|
||||
if (str == u.ToDescription())
|
||||
{
|
||||
MsrdUnit = u;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
}
|
||||
return CfgUpdateFlags.None;
|
||||
case 4: MsrdValLimLo = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: MsrdValLimHi = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: CorrectionValLo = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: CorrectionValHi = Utils.ParseSDouble(str); return CfgUpdateFlags.RestartRqrd;
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string str, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
double dummy;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (int.TryParse(str, out idummy) && idummy >= 1 && idummy <= 254) return true;
|
||||
break;
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
if (TBF.Utils.TryParseSDouble(str, out dummy)) return true;
|
||||
break;
|
||||
case 2:
|
||||
return true;
|
||||
case 3:
|
||||
if (ParamValues(i).Contains(str)) return true;
|
||||
break;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = ParamName(i) + " is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(AdjustableMeterCfg prms)
|
||||
{
|
||||
prms.ParentName = this.ParentName;
|
||||
|
||||
prms.CalibCertificateNr = this.CalibCertificateNr;
|
||||
prms.CertPath = this.CertPath;
|
||||
prms.CalibDate = this.CalibDate;
|
||||
prms.CalibValidDate = this.CalibValidDate;
|
||||
prms.Shape = this.Shape;
|
||||
prms.Sz = this.Sz;
|
||||
prms.Orient = this.Orient;
|
||||
prms.Flip = this.Flip;
|
||||
prms.LblX = this.LblX;
|
||||
prms.LblY = this.LblY;
|
||||
prms.LblOrient = this.LblOrient;
|
||||
prms.MsrdX = this.MsrdX;
|
||||
prms.MsrdY = this.MsrdY;
|
||||
prms.MsrdOrient = this.MsrdOrient;
|
||||
|
||||
prms.ModbusAddress = this.ModbusAddress;
|
||||
prms.DefaultPressure = this.DefaultPressure;
|
||||
prms.MsrdFormat = this.MsrdFormat;
|
||||
prms.MsrdUnit = this.MsrdUnit;
|
||||
prms.MsrdValLimLo = this.MsrdValLimLo;
|
||||
prms.MsrdValLimHi = this.MsrdValLimHi;
|
||||
|
||||
prms.CorrectionValLo = this.CorrectionValLo;
|
||||
prms.CorrectionValHi = this.CorrectionValHi;
|
||||
|
||||
}
|
||||
|
||||
public IParamsProvider Clone()
|
||||
{
|
||||
AdjustableMeterCfg pars = new AdjustableMeterCfg();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public bool UpdateEmbeddedDbEntity()
|
||||
{
|
||||
return true; /// =OK, do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new AdjustableMeter(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new AdjustableMeter(cfg, components); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new AdjustableMeterCfg(this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(AdjustableMeterCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2016-2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public class ReadValueOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadValueOp));
|
||||
public override string ToString() { return string.Format("ReadPressureOp(.,{0},.)", eventDone); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly AdjustableMeter _adjustableMeter;
|
||||
readonly DoubleBox value; /// Box for the measured value
|
||||
readonly Event eventDone;
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureDone or Error
|
||||
/// </summary>
|
||||
/// <param name="adjustableMeter">Pressure meter reference</param>
|
||||
/// <param name="value">Reference to the measured pressure variable, value is in bar</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public ReadValueOp(AdjustableMeter adjustableMeter, ref DoubleBox value, Event eventDone)
|
||||
{
|
||||
if (adjustableMeter == null) throw new ArgumentNullException("adjustableMeter");
|
||||
this._adjustableMeter = adjustableMeter;
|
||||
this.value = value;
|
||||
this.eventDone = eventDone;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
public ReadValueOp(AdjustableMeter adjustableMeter, ref DoubleBox value)
|
||||
: this(adjustableMeter, ref value, Event.PressureDone)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
if (value != null) value.Val = _adjustableMeter.ReadPressure();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.PressureInDone or Event.PressureOutDone
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (value != null) value.Val = _adjustableMeter.ReadPressure();
|
||||
return eventDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop() { }
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2022 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
|
||||
namespace TBF.Rig.Modbus.Meret.AdjustableScale
|
||||
{
|
||||
public enum Pr
|
||||
{
|
||||
IsGT,
|
||||
IsLT,
|
||||
}
|
||||
|
||||
public class WaitUntilValueIsOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(WaitUntilValueIsOp));
|
||||
public override string ToString() { return string.Format("WaitUntilPressureIsOp({0}, {1}, {2:F1}bar)", meter.Name, condition, valueLimit); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly AdjustableMeter meter;
|
||||
readonly double valueLimit;
|
||||
readonly Pr condition;
|
||||
|
||||
/// <summary>
|
||||
/// Events: PressureInDone, PressureOutDone or Error
|
||||
/// </summary>
|
||||
/// <param name="meter">Temp. controller reference</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public WaitUntilValueIsOp(AdjustableMeter meter, Pr condition, double valueLimit)
|
||||
{
|
||||
if (meter == null) throw new ArgumentNullException("tempControl");
|
||||
this.meter = meter;
|
||||
this.valueLimit = valueLimit;
|
||||
this.condition = condition;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start() { }
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
if (condition == Pr.IsGT && meter.ReadPressure() > valueLimit)
|
||||
{
|
||||
return Event.ConditionMet;
|
||||
}
|
||||
else if (condition == Pr.IsLT && meter.ReadPressure() < valueLimit)
|
||||
{
|
||||
return Event.ConditionMet;
|
||||
}
|
||||
|
||||
return Event.ConditionNotMet;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop() { }
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ namespace TBF.Rig.Modbus.TankSelector
|
||||
/// </summary>
|
||||
void RecoverState()
|
||||
{
|
||||
latchedDigitalInputs = StateMachine.ControlBoardMain.DigitalInputs;
|
||||
latchedDigitalInputs = StateMachine.ControlBoard.DigitalInputs;
|
||||
if ((latchedDigitalInputs & (ulong)DigitalInputs.ColdTankSelected) != 0)
|
||||
{
|
||||
if ((latchedDigitalInputs & (ulong)DigitalInputs.Pumping_WaitingLevel) == 0)
|
||||
@@ -228,7 +228,7 @@ namespace TBF.Rig.Modbus.TankSelector
|
||||
/// </summary>
|
||||
void DetectNoTankSelected()
|
||||
{
|
||||
ulong digiIn = StateMachine.ControlBoardMain.DigitalInputs;
|
||||
ulong digiIn = StateMachine.ControlBoard.DigitalInputs;
|
||||
|
||||
if (digiIn == latchedDigitalInputs)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace TBF.Rig.Network.Camera.Roi
|
||||
cameraPulses = NetCamera.GetResult(roiHandle, out cameraTime);
|
||||
}
|
||||
|
||||
wmRefPulses = StateMachine.ControlBoardMain.RefPulses;
|
||||
wmRefPulses = StateMachine.ControlBoard.RefPulses;
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace TBF.Rig.Network.Camera.RoiForFixedStart
|
||||
|
||||
public int WMPulses { get { return (int)(WMVolume / LtrsPerPulse); } }
|
||||
|
||||
public int WMRefPulses { get { return StateMachine.ControlBoardMain.RefPulses; ; } }
|
||||
public int WMRefPulses { get { return StateMachine.ControlBoard.RefPulses; ; } }
|
||||
|
||||
|
||||
public Roi() { }
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Printing;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using Common.Forms;
|
||||
using Results.Output.Printers.Enhanced;
|
||||
using log4net;
|
||||
using Common;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.Enhanced
|
||||
{
|
||||
@@ -32,35 +31,22 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
IList<Results.WMeterRsltItemSpec> testItems;
|
||||
string footer;
|
||||
|
||||
bool printingCompleted = false;
|
||||
bool statusDlgShown = false;
|
||||
ModelessForm modelessForm;
|
||||
|
||||
|
||||
public Printer() { }
|
||||
public Printer() { }
|
||||
|
||||
public Printer(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
printerCfg = cfg as PrinterCfg;
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
ApplyConfig();
|
||||
if (printerCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string message;
|
||||
if (!PrinterStatus.IsOnline(printerCfg.PrinterName, out message)) throw new ApplicationException(message);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyConfig()
|
||||
void ApplyConfig()
|
||||
{
|
||||
header = string.IsNullOrEmpty(printerCfg.Header) ? string.Empty : printerCfg.Header.Replace("~", Environment.NewLine);
|
||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(printerCfg.CommonItems);
|
||||
@@ -146,67 +132,38 @@ namespace TBF.Rig.Output.Printers.Enhanced
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
printingCompleted = false;
|
||||
statusDlgShown = false;
|
||||
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
|
||||
|
||||
if (printerCfg.Culture != Culture.system)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
|
||||
}
|
||||
|
||||
string documentName;
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception());
|
||||
documentName = string.Format(printerCfg.DocName, batch.StartTime, batch.EndTime, batch.BatchNr);
|
||||
}
|
||||
catch
|
||||
{
|
||||
documentName = string.Format("{0:yyyyMMdd-HHmm}", batch.EndTime);
|
||||
}
|
||||
|
||||
PrintResults(batch, documentName);
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = oriCulture;
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
string message;
|
||||
if (printingCompleted || printerCfg.DebugLevel != DebugMode.Normal)
|
||||
{
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else if (PrinterStatus.IsOnline(printerCfg.PrinterName, out message))
|
||||
{
|
||||
if (statusDlgShown)
|
||||
{
|
||||
statusDlgShown = false;
|
||||
if (modelessForm != null) modelessForm.Close();
|
||||
}
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
|
||||
/// Printer is online => Print results now
|
||||
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
|
||||
if (printerCfg.Culture != Culture.system)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
|
||||
}
|
||||
|
||||
string documentName;
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(printerCfg.DocName)) throw (new Exception());
|
||||
documentName = string.Format(printerCfg.DocName, batch.StartTime, batch.EndTime, batch.BatchNr);
|
||||
}
|
||||
catch
|
||||
{
|
||||
documentName = string.Format("{0:yyyyMMdd-HHmm}", batch.EndTime);
|
||||
}
|
||||
|
||||
PrintResults(batch, documentName);
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = oriCulture;
|
||||
|
||||
printingCompleted = true;
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!statusDlgShown)
|
||||
{
|
||||
statusDlgShown = true;
|
||||
modelessForm = new ModelessForm(message);
|
||||
new Thread(() => System.Windows.Forms.Application.Run(modelessForm)).Start();
|
||||
}
|
||||
|
||||
return Event.Busy;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(8); } }
|
||||
public override string ToString() { return ClassName; }
|
||||
|
||||
public IComponent DummyComponent() { return new Printer(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Printer(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new PrinterCfg(this.GetType().Namespace.Substring(15), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(PrinterCfg.Serializer, component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using Config.Resources;
|
||||
using NHibernate;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class GroupPrinterUtils
|
||||
{
|
||||
public static ISession GetCorrespondedEntities(in IList<Component> cmpntEntities, in List<string> itemsToPrint)
|
||||
{
|
||||
ISession session = TBF.DB.CreateSession(DBKind.Config);
|
||||
IList<Component> cmpntEntitiesAll = session.QueryOver<Component>()
|
||||
.OrderBy(x => x.ItemNr).Asc
|
||||
.List<Component>();
|
||||
|
||||
cmpntEntities?.Clear();
|
||||
|
||||
List<PrinterDef> printerDefs = new List<PrinterDef>();
|
||||
if (itemsToPrint != null && itemsToPrint.Count > 0)
|
||||
{
|
||||
foreach (string printer in itemsToPrint)
|
||||
{
|
||||
printerDefs.Add(PrinterDef.fromString(printer));
|
||||
}
|
||||
}
|
||||
|
||||
if (printerDefs.Count > 0)
|
||||
{
|
||||
foreach (PrinterDef printerDef in printerDefs)
|
||||
{
|
||||
foreach (var component in cmpntEntitiesAll)
|
||||
{
|
||||
if (printerDef.Equals(PrinterDef.fromComponent(component)))
|
||||
{
|
||||
cmpntEntities.Add(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
public static string[] GetExpandedGroupPrinters(string[] printers)
|
||||
{
|
||||
List<string> allPrinters = new List<string>();
|
||||
|
||||
ISession session = TBF.DB.CreateSession(DBKind.Config);
|
||||
IList<Component> cmpntEntitiesAll = session.QueryOver<Component>()
|
||||
.OrderBy(x => x.ItemNr).Asc
|
||||
.List<Component>();
|
||||
|
||||
string groupPrinterClassName = new Factory().ClassName;
|
||||
|
||||
foreach (string printer in printers)
|
||||
{
|
||||
foreach (var component in cmpntEntitiesAll)
|
||||
{
|
||||
if (printer.Equals(component.Name))
|
||||
{
|
||||
if (component.ClassName.Equals(groupPrinterClassName))
|
||||
{
|
||||
List<PrinterDef> printersDef = PrinterDef.fromParametersString(component.Parameters);
|
||||
foreach (PrinterDef printerDef in printersDef)
|
||||
{
|
||||
allPrinters.Add(printerDef.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allPrinters.Add(printer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allPrinters.ToArray();
|
||||
}
|
||||
|
||||
public static void UpdateParametersInEntitys(ISession session, IList<Component> cmpntEntities,string definedPrinter)
|
||||
{
|
||||
|
||||
{
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
foreach (Component printerItem in cmpntEntities)
|
||||
{
|
||||
XmlDocument xmlDocument = new XmlDocument();
|
||||
xmlDocument.LoadXml(printerItem.Parameters);
|
||||
XmlNodeList printerCfg = xmlDocument.GetElementsByTagName("PrinterName");
|
||||
|
||||
foreach (XmlNode itemNode in printerCfg)
|
||||
{
|
||||
itemNode.InnerText = definedPrinter;
|
||||
}
|
||||
|
||||
printerItem.Parameters = xmlDocument.OuterXml;
|
||||
|
||||
|
||||
session.SaveOrUpdate(printerItem); /// Save user 'admin'
|
||||
|
||||
}
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using Common;
|
||||
using Common.Forms;
|
||||
using Results.Output.Printers.Label;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class Printer : ComponentBase, IOperation, GenericDevices.IResultsPrinter
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Printer));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly PrinterCfg printerCfg;
|
||||
|
||||
public bool SupressPrinting { get { return (printerCfg.NrOfCopies == 0); } }
|
||||
|
||||
Results.Entities.Batch batch; /// Data to print
|
||||
IList<Results.WMeterRsltItemSpec> commonItems; /// Items to print
|
||||
bool printingCompleted = false;
|
||||
bool statusDlgShown = false;
|
||||
ModelessForm modelessForm;
|
||||
|
||||
public Printer() { }
|
||||
|
||||
public Printer(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
printerCfg = cfg as PrinterCfg;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
ApplyConfig();
|
||||
if (printerCfg.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
string message;
|
||||
if (!PrinterStatus.IsOnline(printerCfg.PrinterName, out message)) throw new ApplicationException(message);
|
||||
log.FatalFormat("{0} initialized: {1}", Name, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.FatalFormat("{0} simulated: {1}", Name, this);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyConfig()
|
||||
{
|
||||
commonItems = Results.WMeterRsltItemSpec.FromStrArray(printerCfg.ItemsToPrint);
|
||||
}
|
||||
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCfgChange(object sender, CfgChangeArgs args)
|
||||
{
|
||||
if (CfgChangeHandler == null) return;
|
||||
try { CfgChangeHandler(sender, args); }
|
||||
catch (Exception e) { log.Error("CfgChangeHandler(...) failed", e); }
|
||||
}
|
||||
|
||||
public static event EventHandler<CfgChangeArgs> CfgChangeHandler;
|
||||
|
||||
public override void StartChangeHandler()
|
||||
{
|
||||
CfgChangeHandler += delegate(object sender, CfgChangeArgs args)
|
||||
{
|
||||
PrinterCfg newCfg = args.Cfg as PrinterCfg;
|
||||
if (newCfg != null && newCfg.Name.Equals(Name))
|
||||
{
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
printerCfg.Template = newCfg.Template;
|
||||
printerCfg.PageOrientation = newCfg.PageOrientation;
|
||||
printerCfg.PaperWidth = newCfg.PaperWidth;
|
||||
printerCfg.PaperHeight = newCfg.PaperHeight;
|
||||
printerCfg.ItemsToPrint = newCfg.ItemsToPrint;
|
||||
printerCfg.FontFamily = newCfg.FontFamily;
|
||||
printerCfg.FontSize = newCfg.FontSize;
|
||||
printerCfg.FontStyle = newCfg.FontStyle;
|
||||
printerCfg.Culture = newCfg.Culture;
|
||||
printerCfg.NrOfCopies = newCfg.NrOfCopies;
|
||||
printerCfg.GoodOnly = newCfg.GoodOnly;
|
||||
printerCfg.BarcodeType = newCfg.BarcodeType;
|
||||
printerCfg.BarcodeLeft = newCfg.BarcodeLeft;
|
||||
printerCfg.BarcodeTop = newCfg.BarcodeTop;
|
||||
printerCfg.BarcodeWidth = newCfg.BarcodeWidth;
|
||||
printerCfg.BarcodeHeight = newCfg.BarcodeHeight;
|
||||
|
||||
ApplyConfig();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Prints the test cycle results, Events: Event.ResultsPrinted
|
||||
/// </summary>
|
||||
/// <param name="batch">Batch results to print</param>
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public IOperation ProcessResultsOp(Results.Entities.Batch batch)
|
||||
{
|
||||
this.batch = batch;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
printingCompleted = false;
|
||||
statusDlgShown = false;
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
string message;
|
||||
if (printingCompleted || printerCfg.DebugLevel != DebugMode.Normal)
|
||||
{
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else if (PrinterStatus.IsOnline(printerCfg.PrinterName, out message))
|
||||
{
|
||||
if (statusDlgShown)
|
||||
{
|
||||
statusDlgShown = false;
|
||||
if (modelessForm != null) modelessForm.Close();
|
||||
}
|
||||
|
||||
/// Printer is online => Print results now
|
||||
CultureInfo oriCulture = Thread.CurrentThread.CurrentCulture;
|
||||
if (printerCfg.Culture != Culture.system)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo(printerCfg.Culture.ToString());
|
||||
}
|
||||
|
||||
foreach (var wm in batch.WaterMeters)
|
||||
{
|
||||
if (wm != null && !wm.Disabled && wm.PrintLabel && (!printerCfg.GoodOnly || wm.Passed))
|
||||
{
|
||||
PrintResults(wm, string.Format("{0}-{1}", batch.BatchNr, wm.WMPosition));
|
||||
}
|
||||
}
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = oriCulture;
|
||||
|
||||
printingCompleted = true;
|
||||
return Event.ResultsPrinted;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!statusDlgShown)
|
||||
{
|
||||
statusDlgShown = true;
|
||||
modelessForm = new ModelessForm(message);
|
||||
new Thread(() => System.Windows.Forms.Application.Run(modelessForm)).Start();
|
||||
}
|
||||
|
||||
return Event.Busy;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void PrintResults(Results.Entities.WaterMeter wm, string documentName)
|
||||
{
|
||||
LabelPrinterCfg cfg = new LabelPrinterCfg
|
||||
{
|
||||
Template = printerCfg.Template,
|
||||
PageOrientation = printerCfg.PageOrientation,
|
||||
PaperWidth = printerCfg.PaperWidth,
|
||||
PaperHeight = printerCfg.PaperHeight,
|
||||
ItemsToPrint = printerCfg.ItemsToPrint,
|
||||
FontFamily = printerCfg.FontFamily,
|
||||
FontSize = printerCfg.FontSize,
|
||||
FontStyle = printerCfg.FontStyle,
|
||||
CultureInfo = (printerCfg.Culture == Culture.system) ? Thread.CurrentThread.CurrentCulture : new CultureInfo(printerCfg.Culture.ToString()),
|
||||
GoodOnly = printerCfg.GoodOnly,
|
||||
BarcodeType = printerCfg.BarcodeType,
|
||||
BarcodeLeft = printerCfg.BarcodeLeft,
|
||||
BarcodeTop = printerCfg.BarcodeTop,
|
||||
BarcodeWidth = printerCfg.BarcodeWidth,
|
||||
BarcodeHeight = printerCfg.BarcodeHeight,
|
||||
};
|
||||
|
||||
for (int i = 1; i <= printerCfg.NrOfCopies; i++)
|
||||
{
|
||||
string docNameEx = string.Format((printerCfg.NrOfCopies == 1) ? "{0}" : "{0}_{1}", documentName, i);
|
||||
var pd = new LabelPrintDocument(cfg, wm, docNameEx);
|
||||
if (!string.IsNullOrEmpty(printerCfg.PrinterName)) pd.PrinterSettings.PrinterName = printerCfg.PrinterName;
|
||||
pd.Print();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using Common;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PrinterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new PrinterCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string PrinterName;
|
||||
public string Template; /// Full path to a 'png' file
|
||||
public PageOrientation PageOrientation;
|
||||
public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count
|
||||
public string[] ItemsToPrint;
|
||||
public string FontFamily;
|
||||
public int FontSize;
|
||||
public int FontStyle;
|
||||
public Culture Culture;
|
||||
public int NrOfCopies;
|
||||
public bool GoodOnly;
|
||||
|
||||
public Results.Output.Printers.BarcodeType BarcodeType;
|
||||
public int BarcodeLeft;
|
||||
public int BarcodeTop;
|
||||
public int BarcodeWidth;
|
||||
public int BarcodeHeight;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
PrinterCfg()
|
||||
{
|
||||
}
|
||||
|
||||
public PrinterCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Name = name;
|
||||
this.Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
|
||||
Template = string.Empty;
|
||||
PageOrientation = PageOrientation.Portrait;
|
||||
PaperWidth = 827; /// A4 width
|
||||
PaperHeight = 1169; /// A4 height
|
||||
FontFamily = "Arial";
|
||||
FontSize = 10;
|
||||
FontStyle = 0;
|
||||
NrOfCopies = 1;
|
||||
GoodOnly = false;
|
||||
BarcodeType = Results.Output.Printers.BarcodeType.None;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Orientation={1}, PaperWidth={2}, PaperHeight={3}, TemplateFile={4}, GoodOnly={5}, Barcode={6}",
|
||||
Name,
|
||||
PageOrientation,
|
||||
PaperWidth,
|
||||
PaperHeight,
|
||||
Template,
|
||||
GoodOnly ? "yes" : "no",
|
||||
BarcodeType.ToString()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2023 Sensus Slovensko a.s.
|
||||
///
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Printing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Common;
|
||||
using Config.Entities;
|
||||
using FluentNHibernate.Conventions;
|
||||
using log4net.Repository.Hierarchy;
|
||||
using NHibernate;
|
||||
using TBF.Resources;
|
||||
using TBF.Rig.Generic;
|
||||
using TBF.Rig.Configs;
|
||||
|
||||
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
public partial class PrinterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PrinterCfgCtrl));
|
||||
|
||||
public bool ShowMore
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
IList<Component> cmpntEntities;
|
||||
private ISession session;
|
||||
|
||||
PrinterCfg config;
|
||||
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as PrinterCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> itemsToPrint;
|
||||
|
||||
public PrinterCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
Localize();
|
||||
}
|
||||
|
||||
private void PrinterCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
printerComboBox.Items.Add(Strings.default_printer);
|
||||
foreach (var p in PrinterSettings.InstalledPrinters) printerComboBox.Items.Add(p);
|
||||
|
||||
EnableEdit(false);
|
||||
|
||||
InintComponents();
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
// if (printerComboBox.Enabled && !printerComboBox.Text.IsEmpty())
|
||||
// {
|
||||
// GroupPrinterUtils.UpdateParametersInEntitys(session, cmpntEntities, printerComboBox.Text);
|
||||
// }
|
||||
}
|
||||
|
||||
void InintComponents()
|
||||
{
|
||||
cmpntEntities = cmpntEntities == null ? new List<Component>() : cmpntEntities;
|
||||
itemsToPrint = config.ItemsToPrint?.ToList();
|
||||
session = GroupPrinterUtils.GetCorrespondedEntities(in cmpntEntities, in itemsToPrint);
|
||||
|
||||
RedrawAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
printerComboBox.Text =
|
||||
string.IsNullOrEmpty(config.PrinterName) ? Strings.default_printer : config.PrinterName;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
EnableEdit(true);
|
||||
}
|
||||
|
||||
private void EnableEdit(bool bEnable)
|
||||
{
|
||||
nameTextBox.Enabled = bEnable;
|
||||
printerComboBox.Enabled = bEnable;
|
||||
selectPrinterButton.Enabled = bEnable;
|
||||
btListAdd.Enabled = bEnable;
|
||||
btListRemove.Enabled = bEnable;
|
||||
btMoveUp.Enabled = bEnable;
|
||||
btMoveDown.Enabled = bEnable;
|
||||
listViewEx.Enabled = bEnable;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
|
||||
if (config.Name != nameTextBox.Text)
|
||||
{
|
||||
config.Name = nameTextBox.Text;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
string newPrinter = (printerComboBox.Text == Strings.default_printer) ? string.Empty : printerComboBox.Text;
|
||||
if (config.PrinterName != newPrinter)
|
||||
{
|
||||
config.PrinterName = newPrinter;
|
||||
flags |= (CfgUpdateFlags.RestartRqrd | CfgUpdateFlags.AnyChange);
|
||||
}
|
||||
|
||||
if ((flags & CfgUpdateFlags.InvokeCfgChange) != 0)
|
||||
{
|
||||
Printer.OnCfgChange(this, new CfgChangeArgs(CfgChangeCmd.CfgChange, config));
|
||||
}
|
||||
|
||||
|
||||
List<string> itemsComponent = new List<string>();
|
||||
foreach (Component entity in cmpntEntities)
|
||||
{
|
||||
itemsComponent.Add(PrinterDef.fromComponent(entity).ToString());
|
||||
}
|
||||
|
||||
config.ItemsToPrint = itemsComponent.ToArray();
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCmdResponse(object sender, CmdResponseArgs args)
|
||||
{
|
||||
if (CmdResponseHandler == null) return;
|
||||
try
|
||||
{
|
||||
CmdResponseHandler(sender, args);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("CmdResponseHandler(...) failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static event EventHandler<CmdResponseArgs> CmdResponseHandler;
|
||||
|
||||
public void StartResponseHandler()
|
||||
{
|
||||
}
|
||||
|
||||
public void StopResponseHandler()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
|
||||
private void selectPrinterButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrintDialog dlg = new PrintDialog();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
printerComboBox.Text = dlg.PrinterSettings.PrinterName;
|
||||
}
|
||||
}
|
||||
|
||||
private void btListAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
PrinterTestBenchComponentSelectorDlg dlg = new PrinterTestBenchComponentSelectorDlg();
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (cmpntEntities == null)
|
||||
{
|
||||
cmpntEntities = new List<Component>();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cmpntEntities.Any(com => com.ItemNr == dlg.SelectedComponent.ItemNr))
|
||||
{
|
||||
MessageBox.Show("Item is in list included already!", "Warning", MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cmpntEntities.Add(dlg.SelectedComponent);
|
||||
RedrawAll();
|
||||
}
|
||||
}
|
||||
|
||||
void RedrawAll()
|
||||
{
|
||||
listViewEx.Items.Clear();
|
||||
foreach (var cmpnt in cmpntEntities) DrawOne(cmpnt);
|
||||
}
|
||||
|
||||
void DrawOne(Component cmpnt)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(cmpnt.ItemNr.ToString());
|
||||
lvi.Tag = cmpnt;
|
||||
lvi.SubItems.Add(cmpnt.Name);
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
|
||||
private void btListRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
if (MessageBox.Show($"Do you want remove {cmpntEntity.Name} from list?", "Remove Action",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
{
|
||||
cmpntEntities.Remove(cmpntEntity);
|
||||
listViewEx.Items.RemoveAt(selectedIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btMoveUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
if (selectedIndex > 0)
|
||||
{
|
||||
int newItemIndex = (selectedIndex - 1);
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
|
||||
cmpntEntities.Insert(newItemIndex, cmpntEntity);
|
||||
cmpntEntities.RemoveAt(selectedIndex + 1);
|
||||
|
||||
RedrawAll();
|
||||
listViewEx.Items[newItemIndex].Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btMoveDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewEx.SelectedItems.Count > 0)
|
||||
{
|
||||
int selectedIndex = listViewEx.SelectedIndices[0];
|
||||
if (selectedIndex < listViewEx.Items.Count - 1)
|
||||
{
|
||||
Component cmpntEntity = cmpntEntities[selectedIndex];
|
||||
|
||||
int newItemIndex = selectedIndex + 2;
|
||||
cmpntEntities.Insert(newItemIndex, cmpntEntity);
|
||||
cmpntEntities.RemoveAt(selectedIndex);
|
||||
|
||||
RedrawAll();
|
||||
listViewEx.Items[newItemIndex - 1].Selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.Rig.Output.Printers.GroupPrinting.Single
|
||||
{
|
||||
partial class PrinterCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.printerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.selectPrinterButton = new System.Windows.Forms.Button();
|
||||
this.printerLabel = new System.Windows.Forms.Label();
|
||||
this.listViewEx = new Common.Forms.ListViewEx();
|
||||
this.columnItem = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnName = new System.Windows.Forms.ColumnHeader();
|
||||
this.btListAdd = new System.Windows.Forms.Button();
|
||||
this.btListRemove = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.btMoveUp = new System.Windows.Forms.Button();
|
||||
this.btMoveDown = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(183, 63);
|
||||
this.nameTextBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(340, 26);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(12, 68);
|
||||
this.nameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(51, 20);
|
||||
this.nameLabel.TabIndex = 1;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(178, 26);
|
||||
this.classNameLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(92, 20);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "Class name";
|
||||
//
|
||||
// printerComboBox
|
||||
//
|
||||
this.printerComboBox.Enabled = false;
|
||||
this.printerComboBox.FormattingEnabled = true;
|
||||
this.printerComboBox.Location = new System.Drawing.Point(183, 98);
|
||||
this.printerComboBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.printerComboBox.Name = "printerComboBox";
|
||||
this.printerComboBox.Size = new System.Drawing.Size(340, 28);
|
||||
this.printerComboBox.TabIndex = 59;
|
||||
//
|
||||
// selectPrinterButton
|
||||
//
|
||||
this.selectPrinterButton.Enabled = false;
|
||||
this.selectPrinterButton.Location = new System.Drawing.Point(105, 97);
|
||||
this.selectPrinterButton.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.selectPrinterButton.Name = "selectPrinterButton";
|
||||
this.selectPrinterButton.Size = new System.Drawing.Size(75, 34);
|
||||
this.selectPrinterButton.TabIndex = 58;
|
||||
this.selectPrinterButton.Text = "Select";
|
||||
this.selectPrinterButton.UseVisualStyleBackColor = true;
|
||||
this.selectPrinterButton.Click += new System.EventHandler(this.selectPrinterButton_Click);
|
||||
//
|
||||
// printerLabel
|
||||
//
|
||||
this.printerLabel.AutoSize = true;
|
||||
this.printerLabel.Location = new System.Drawing.Point(12, 103);
|
||||
this.printerLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.printerLabel.Name = "printerLabel";
|
||||
this.printerLabel.Size = new System.Drawing.Size(55, 20);
|
||||
this.printerLabel.TabIndex = 57;
|
||||
this.printerLabel.Text = "Printer";
|
||||
//
|
||||
// listViewEx
|
||||
//
|
||||
this.listViewEx.AllowColumnReorder = true;
|
||||
this.listViewEx.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnItem, this.columnName });
|
||||
this.listViewEx.DoubleClickActivation = false;
|
||||
this.listViewEx.FullRowSelect = true;
|
||||
this.listViewEx.HideSelection = false;
|
||||
this.listViewEx.Location = new System.Drawing.Point(183, 136);
|
||||
this.listViewEx.Name = "listViewEx";
|
||||
this.listViewEx.Size = new System.Drawing.Size(340, 344);
|
||||
this.listViewEx.TabIndex = 60;
|
||||
this.listViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewEx.View = System.Windows.Forms.View.Details;
|
||||
//
|
||||
// columnItem
|
||||
//
|
||||
this.columnItem.Text = "No";
|
||||
this.columnItem.Width = 40;
|
||||
//
|
||||
// columnName
|
||||
//
|
||||
this.columnName.Text = "Name";
|
||||
this.columnName.Width = 321;
|
||||
//
|
||||
// btListAdd
|
||||
//
|
||||
this.btListAdd.Location = new System.Drawing.Point(24, 165);
|
||||
this.btListAdd.Name = "btListAdd";
|
||||
this.btListAdd.Size = new System.Drawing.Size(115, 30);
|
||||
this.btListAdd.TabIndex = 61;
|
||||
this.btListAdd.Text = "Add";
|
||||
this.btListAdd.UseVisualStyleBackColor = true;
|
||||
this.btListAdd.Click += new System.EventHandler(this.btListAdd_Click);
|
||||
//
|
||||
// btListRemove
|
||||
//
|
||||
this.btListRemove.Location = new System.Drawing.Point(24, 201);
|
||||
this.btListRemove.Name = "btListRemove";
|
||||
this.btListRemove.Size = new System.Drawing.Size(115, 30);
|
||||
this.btListRemove.TabIndex = 62;
|
||||
this.btListRemove.Text = "Remove";
|
||||
this.btListRemove.UseVisualStyleBackColor = true;
|
||||
this.btListRemove.Click += new System.EventHandler(this.btListRemove_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 136);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(166, 26);
|
||||
this.label3.TabIndex = 63;
|
||||
this.label3.Text = "List of Print Assembly";
|
||||
//
|
||||
// btMoveUp
|
||||
//
|
||||
this.btMoveUp.Location = new System.Drawing.Point(24, 237);
|
||||
this.btMoveUp.Name = "btMoveUp";
|
||||
this.btMoveUp.Size = new System.Drawing.Size(115, 30);
|
||||
this.btMoveUp.TabIndex = 64;
|
||||
this.btMoveUp.Text = "Move Up";
|
||||
this.btMoveUp.UseVisualStyleBackColor = true;
|
||||
this.btMoveUp.Click += new System.EventHandler(this.btMoveUp_Click);
|
||||
//
|
||||
// btMoveDown
|
||||
//
|
||||
this.btMoveDown.Location = new System.Drawing.Point(24, 273);
|
||||
this.btMoveDown.Name = "btMoveDown";
|
||||
this.btMoveDown.Size = new System.Drawing.Size(115, 30);
|
||||
this.btMoveDown.TabIndex = 65;
|
||||
this.btMoveDown.Text = "Move Down";
|
||||
this.btMoveDown.UseVisualStyleBackColor = true;
|
||||
this.btMoveDown.Click += new System.EventHandler(this.btMoveDown_Click);
|
||||
//
|
||||
// PrinterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btMoveDown);
|
||||
this.Controls.Add(this.btMoveUp);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.btListRemove);
|
||||
this.Controls.Add(this.btListAdd);
|
||||
this.Controls.Add(this.listViewEx);
|
||||
this.Controls.Add(this.printerComboBox);
|
||||
this.Controls.Add(this.selectPrinterButton);
|
||||
this.Controls.Add(this.printerLabel);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.Name = "PrinterCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(558, 593);
|
||||
this.Load += new System.EventHandler(this.PrinterCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
private System.Windows.Forms.Button btMoveUp;
|
||||
private System.Windows.Forms.Button btMoveDown;
|
||||
|
||||
private System.Windows.Forms.ColumnHeader columnItem;
|
||||
private System.Windows.Forms.ColumnHeader columnName;
|
||||
|
||||
private System.Windows.Forms.Label label3;
|
||||
|
||||
private Common.Forms.ListViewEx listViewEx;
|
||||
private System.Windows.Forms.Button btListAdd;
|
||||
private System.Windows.Forms.Button btListRemove;
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.ComboBox printerComboBox;
|
||||
private System.Windows.Forms.Button selectPrinterButton;
|
||||
private System.Windows.Forms.Label printerLabel;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user