Compare commits

...
17 changed files with 302 additions and 37 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
-2
View File
@@ -12,9 +12,7 @@ namespace Results.Mappings
{
Id(x => x.Id);
Map(x => x.Name);
#if TEST_PROFILES
Map(x => x.Qtg);
#endif
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.TargetVolume);
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+25 -6
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -50,7 +50,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -60,7 +60,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -70,7 +70,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -101,8 +101,8 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U">
<HintPath>..\packages\ControlBoard\iPerlST\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -2386,6 +2386,7 @@
<Compile Include="UI\Settings\DatabaseSettingsDlg.designer.cs">
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
</Compile>
<Compile Include="UI\Settings\GroupTableRow.cs" />
<Compile Include="UI\Settings\LanguageDlg.cs">
<SubType>Form</SubType>
</Compile>
@@ -3426,6 +3427,24 @@
<None Include="Resources\RoiStyle1.bmp" />
<None Include="Resources\RoiStyle2.bmp" />
<None Include="Resources\RoiStyle3.bmp" />
<Content Include="libgcc_s_dw2-1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid2.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid3.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid4.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libstdc++-6.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Pictures\forward_dir_left.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF.UI
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl6();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl48();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.UI.ResultsMI.ResultsTabPageCtrl();
+19
View File
@@ -0,0 +1,19 @@
///
/// Copyright (c) 2020 Sensus slovensko a.s.
///
namespace TBF.UI.Settings
{
public class GroupTableRow
{
public int GroupId;
public Users.Entities.GID Gid;
public int UserId;
public GroupTableRow(int groupId, Users.Entities.GID gid, int userId)
{
GroupId = groupId;
Gid = gid;
UserId = userId;
}
}
}
+32 -14
View File
@@ -44,6 +44,7 @@
this.upgradeDb_218_222_Button = new System.Windows.Forms.Button();
this.upgradeDb_NFC_button = new System.Windows.Forms.Button();
this.upgradeDb_222_224_Button = new System.Windows.Forms.Button();
this.upgradeDb_224_225_Button = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// upgradeDb_215_216_Button
@@ -52,7 +53,7 @@
this.upgradeDb_215_216_Button.Name = "upgradeDb_215_216_Button";
this.upgradeDb_215_216_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_215_216_Button.TabIndex = 6;
this.upgradeDb_215_216_Button.Text = "Upgrade database from ver. 2.15 to ver. 2.16";
this.upgradeDb_215_216_Button.Text = "Upgrade DB from v.2.15 to v.2.16";
this.upgradeDb_215_216_Button.UseVisualStyleBackColor = true;
this.upgradeDb_215_216_Button.Click += new System.EventHandler(this.upgradeDb_215_216_Button_Click);
//
@@ -62,7 +63,7 @@
this.upgradeDb_216_217_Button.Name = "upgradeDb_216_217_Button";
this.upgradeDb_216_217_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_216_217_Button.TabIndex = 7;
this.upgradeDb_216_217_Button.Text = "Upgrade database from ver. 2.16 to ver. 2.17";
this.upgradeDb_216_217_Button.Text = "Upgrade DB from v.2.16 to v.2.17";
this.upgradeDb_216_217_Button.UseVisualStyleBackColor = true;
this.upgradeDb_216_217_Button.Click += new System.EventHandler(this.upgradeDb_216_217_Button_Click);
//
@@ -72,7 +73,7 @@
this.upgradeDb_212_215_Button.Name = "upgradeDb_212_215_Button";
this.upgradeDb_212_215_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_212_215_Button.TabIndex = 5;
this.upgradeDb_212_215_Button.Text = "Upgrade database from ver. 2.12 to ver. 2.15";
this.upgradeDb_212_215_Button.Text = "Upgrade DB from v.2.12 to v.2.15";
this.upgradeDb_212_215_Button.UseVisualStyleBackColor = true;
this.upgradeDb_212_215_Button.Click += new System.EventHandler(this.upgradeDb_212_215_Button_Click);
//
@@ -82,7 +83,7 @@
this.upgradeDb_217_218_Button.Name = "upgradeDb_217_218_Button";
this.upgradeDb_217_218_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_217_218_Button.TabIndex = 8;
this.upgradeDb_217_218_Button.Text = "Upgrade database from ver. 2.17 to ver. 2.18";
this.upgradeDb_217_218_Button.Text = "Upgrade DB from v.2.17 to v.2.18";
this.upgradeDb_217_218_Button.UseVisualStyleBackColor = true;
this.upgradeDb_217_218_Button.Click += new System.EventHandler(this.upgradeDb_217_218_Button_Click);
//
@@ -92,7 +93,7 @@
this.upgradeDb_29_212_Button.Name = "upgradeDb_29_212_Button";
this.upgradeDb_29_212_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_29_212_Button.TabIndex = 4;
this.upgradeDb_29_212_Button.Text = "Upgrade database from ver. 2.9 to ver. 2.12";
this.upgradeDb_29_212_Button.Text = "Upgrade DB from v.2.9 to v.2.12";
this.upgradeDb_29_212_Button.UseVisualStyleBackColor = true;
this.upgradeDb_29_212_Button.Click += new System.EventHandler(this.upgradeDb_29_212_Button_Click);
//
@@ -119,7 +120,8 @@
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox1.Location = new System.Drawing.Point(94, 431);
this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(94, 471);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 11;
@@ -127,7 +129,8 @@
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textBox2.Location = new System.Drawing.Point(94, 457);
this.textBox2.Enabled = false;
this.textBox2.Location = new System.Drawing.Point(94, 497);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 13;
@@ -136,7 +139,8 @@
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 434);
this.label1.Enabled = false;
this.label1.Location = new System.Drawing.Point(12, 474);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 13);
this.label1.TabIndex = 10;
@@ -146,7 +150,8 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 460);
this.label2.Enabled = false;
this.label2.Location = new System.Drawing.Point(12, 500);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(60, 13);
this.label2.TabIndex = 12;
@@ -155,7 +160,8 @@
// pressureRepresentationButton
//
this.pressureRepresentationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pressureRepresentationButton.Location = new System.Drawing.Point(207, 431);
this.pressureRepresentationButton.Enabled = false;
this.pressureRepresentationButton.Location = new System.Drawing.Point(207, 471);
this.pressureRepresentationButton.Name = "pressureRepresentationButton";
this.pressureRepresentationButton.Size = new System.Drawing.Size(65, 42);
this.pressureRepresentationButton.TabIndex = 14;
@@ -169,7 +175,7 @@
this.upgradeDb_24_29_Button.Name = "upgradeDb_24_29_Button";
this.upgradeDb_24_29_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_24_29_Button.TabIndex = 3;
this.upgradeDb_24_29_Button.Text = "Upgrade database from ver. 2.4 to ver. 2.9";
this.upgradeDb_24_29_Button.Text = "Upgrade DB from v.2.4 to v.2.9";
this.upgradeDb_24_29_Button.UseVisualStyleBackColor = true;
this.upgradeDb_24_29_Button.Click += new System.EventHandler(this.upgradeDb_24_29_Button_Click);
//
@@ -179,7 +185,7 @@
this.upgradeDb_218_222_Button.Name = "upgradeDb_218_222_Button";
this.upgradeDb_218_222_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_218_222_Button.TabIndex = 9;
this.upgradeDb_218_222_Button.Text = "Upgrade database from ver. 2.18 to ver. 2.22";
this.upgradeDb_218_222_Button.Text = "Upgrade DB from v.2.18 to v.2.22";
this.upgradeDb_218_222_Button.UseVisualStyleBackColor = true;
this.upgradeDb_218_222_Button.Click += new System.EventHandler(this.upgradeDb_218_222_Button_Click);
//
@@ -199,15 +205,26 @@
this.upgradeDb_222_224_Button.Name = "upgradeDb_222_224_Button";
this.upgradeDb_222_224_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_222_224_Button.TabIndex = 15;
this.upgradeDb_222_224_Button.Text = "Upgrade database from ver. 2.22 to ver. 2.24";
this.upgradeDb_222_224_Button.Text = "Upgrade DB from v.2.22 to v.2.24";
this.upgradeDb_222_224_Button.UseVisualStyleBackColor = true;
this.upgradeDb_222_224_Button.Click += new System.EventHandler(this.upgradeDb_222_224_Button_Click);
//
// upgradeDb_224_225_Button
//
this.upgradeDb_224_225_Button.Location = new System.Drawing.Point(12, 417);
this.upgradeDb_224_225_Button.Name = "upgradeDb_224_225_Button";
this.upgradeDb_224_225_Button.Size = new System.Drawing.Size(260, 34);
this.upgradeDb_224_225_Button.TabIndex = 16;
this.upgradeDb_224_225_Button.Text = "Upgrade DB from v.2.24 to v.2.25 (users)";
this.upgradeDb_224_225_Button.UseVisualStyleBackColor = true;
this.upgradeDb_224_225_Button.Click += new System.EventHandler(this.upgradeDb_224_225_Button_Click);
//
// UpgradeSelectionDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 493);
this.ClientSize = new System.Drawing.Size(284, 533);
this.Controls.Add(this.upgradeDb_224_225_Button);
this.Controls.Add(this.upgradeDb_222_224_Button);
this.Controls.Add(this.upgradeDb_NFC_button);
this.Controls.Add(this.upgradeDb_218_222_Button);
@@ -249,6 +266,7 @@
private System.Windows.Forms.Button upgradeDb_218_222_Button;
private System.Windows.Forms.Button upgradeDb_NFC_button;
private System.Windows.Forms.Button upgradeDb_222_224_Button;
private System.Windows.Forms.Button upgradeDb_224_225_Button;
}
}
+195 -4
View File
@@ -1,4 +1,7 @@
using System;
///
/// Copyright (c) 2016-2020 Sensus slovensko a.s.
///
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
@@ -596,7 +599,75 @@ namespace TBF.UI.Settings
string[] configDbCommands = new string[]
{
"ALTER TABLE `user` ADD `Password2` VARCHAR(255) NULL DEFAULT NULL AFTER `Password`, ADD `Password3` VARCHAR(255) NULL DEFAULT NULL AFTER `Password2`;",
/// Table profile
"CREATE TABLE IF NOT EXISTS `profile` (" +
"`Id` int(11) NOT NULL," +
" `ItemNr` int(11) DEFAULT NULL," +
" `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" `Description` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" `CreationUser` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" `CreationTime` datetime DEFAULT NULL," +
" `LastChgUser` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" `LastChgTime` datetime DEFAULT NULL," +
" `ProfileType` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" `ErrorLimitType` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL," +
" PRIMARY KEY (`Id`));",
/// Table ptest
"CREATE TABLE IF NOT EXISTS `ptest` (" +
"`Id` int(11) NOT NULL," +
" `ItemNr` int(11) DEFAULT NULL," +
" `Name` varchar(255) DEFAULT NULL," +
" `Part` int(11) NOT NULL DEFAULT '0'," +
" `CoefQfrom` double NOT NULL DEFAULT '0'," +
" `CoefQto` double NOT NULL DEFAULT '0'," +
" `ErrLimLo` double NOT NULL DEFAULT '0'," +
" `ErrLimHi` double NOT NULL DEFAULT '0'," +
" `TempLimLo` double NOT NULL DEFAULT '0'," +
" `TempLimHi` double NOT NULL DEFAULT '0'," +
" `PressLimLo` double NOT NULL DEFAULT '0'," +
" `PressLimHi` double NOT NULL DEFAULT '0'," +
" `Publish` tinyint(4) NOT NULL DEFAULT '1'," +
" `Evaluate` boolean NULL DEFAULT TRUE," +
" `E1` tinyint(4) NOT NULL DEFAULT '0'," +
" `E2` tinyint(4) NOT NULL DEFAULT '0'," +
" `E3` tinyint(4) NOT NULL DEFAULT '0'," +
" `E4` tinyint(4) NOT NULL DEFAULT '0'," +
" `E5` tinyint(4) NOT NULL DEFAULT '0'," +
" `E6` tinyint(4) NOT NULL DEFAULT '0'," +
" `E7` tinyint(4) NOT NULL DEFAULT '0'," +
" `E8` tinyint(4) NOT NULL DEFAULT '0'," +
" `E9` tinyint(4) NOT NULL DEFAULT '0'," +
" `E10` tinyint(4) NOT NULL DEFAULT '0'," +
" `E11` tinyint(4) NOT NULL DEFAULT '0'," +
" `E12` tinyint(4) NOT NULL DEFAULT '0'," +
" `E13` tinyint(4) NOT NULL DEFAULT '0'," +
" `E14` tinyint(4) NOT NULL DEFAULT '0'," +
" `E15` tinyint(4) NOT NULL DEFAULT '0'," +
" `E16` tinyint(4) NOT NULL DEFAULT '0'," +
" `E21` tinyint(4) NOT NULL DEFAULT '0'," +
" `Delta_Q_pct` double NOT NULL DEFAULT '0'," +
" `Delta_T` double NOT NULL DEFAULT '0'," +
" `Delta_Tup_Tdn` double NOT NULL DEFAULT '0'," +
" `TestTime_min` double NOT NULL DEFAULT '0'," +
" `TestTime_max` double NOT NULL DEFAULT '0'," +
" `AmbTemp_min` double NOT NULL DEFAULT '0'," +
" `AmbTemp_max` double NOT NULL DEFAULT '0'," +
" `Coef_E9` double NOT NULL DEFAULT '0'," +
" `Coef_E10` double NOT NULL DEFAULT '0'," +
" `Coef_E11` double NOT NULL DEFAULT '0'," +
" `Coef_E12` double NOT NULL DEFAULT '0'," +
" `Offset_E9` double NOT NULL DEFAULT '0'," +
" `Offset_E12` double NOT NULL DEFAULT '0'," +
" `Profile_id` int(11) NOT NULL DEFAULT '0'," +
" PRIMARY KEY (`Id`));",
/// Table test
"ALTER TABLE `test` ADD `Qtg` FLOAT NULL DEFAULT NULL AFTER `Evaluate`;",
"ALTER TABLE `test` CHANGE `RelTransAfter` `Profile` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;",
"UPDATE `test` SET Profile = 'UserDefined';",
/// Table uncertainty
"CREATE TABLE IF NOT EXISTS `uncertainty` (" +
" `Id` int(11) NOT NULL AUTO_INCREMENT," +
" `Measurement` float NOT NULL DEFAULT '0'," +
@@ -608,13 +679,29 @@ namespace TBF.UI.Settings
" `Component_id` int(11) DEFAULT NULL," +
" PRIMARY KEY (`Id`)," +
" KEY `Component_id` (`Component_id`)" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;",
"UPDATE `test` SET `RelTransAfter`='UserDefined';",
");",
/// Table user
"ALTER TABLE `user` ADD `Password2` VARCHAR(255) NULL DEFAULT NULL AFTER `Password`, ADD `Password3` VARCHAR(255) NULL DEFAULT NULL AFTER `Password2`, ADD `Password4` VARCHAR(255) NULL DEFAULT NULL AFTER `Password3`;",
/// Tables watermeter and wmtype
"DROP TABLE `watermeter`",
"DROP TABLE `wmtype`",
//"ALTER TABLE `procedure` DROP `ProtocolTitle`",
};
string[] resultsDbCommands = new string[]
{
"ALTER TABLE `testdata` ADD `Qtg` DOUBLE NULL DEFAULT NULL AFTER `Name`;",
"ALTER TABLE `testrslt` ADD `Uncertnt` FLOAT NOT NULL DEFAULT '0' AFTER `FlowMax`, ADD `UncertntScale` FLOAT NOT NULL DEFAULT '0' AFTER `Uncertnt`, ADD `UncertntDensity` FLOAT NOT NULL DEFAULT '0' AFTER `UncertntScale`, ADD `UncertntTemp` FLOAT NOT NULL DEFAULT '0' AFTER `UncertntDensity`, ADD `UncertntPressure` FLOAT NOT NULL DEFAULT '0' AFTER `UncertntTemp`;",
"ALTER TABLE `testrslt` CHANGE `ErrorFlags` `ErrorFlags` BIGINT(20) NOT NULL DEFAULT '0', CHANGE `ErrorFlagsMd` `InfoFlags` BIGINT(20) NOT NULL DEFAULT '0';",
"ALTER TABLE `watermeter` CHANGE `ErrorFlags` `ErrorFlags` BIGINT(20) NOT NULL DEFAULT '0', ADD `InfoFlags` BIGINT NOT NULL DEFAULT '0' AFTER `ErrorFlags`;",
#if IPERL
"ALTER TABLE `watermeter` DROP `Q2CorrectionDone`, DROP `Q2Correction`;",
#endif
};
ActivityStart();
@@ -632,6 +719,110 @@ namespace TBF.UI.Settings
}
}
private void upgradeDb_224_225_Button_Click(object sender, EventArgs e)
{
MySqlConnection dbConn = null;
MySqlCommand cmd;
ActivityStart();
bool success = false;
try
{
dbConn = new MySqlConnection(Config.Data.CurrentBench.ProceduresDBSettings.ConnectionString);
dbConn.Open();
cmd = dbConn.CreateCommand();
cmd.CommandText = "CREATE TABLE IF NOT EXISTS `usersgroups` ( `Group_id` int(11) NOT NULL, `User_id` int(11) NOT NULL );";
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = dbConn.CreateCommand();
cmd.CommandText = "ALTER TABLE `usersgroups` ADD KEY `User_id` (`User_id`), ADD KEY `Group_id` (`Group_id`)," +
" ADD CONSTRAINT `FKEC3AF23393C4061C` FOREIGN KEY (`Group_id`) REFERENCES `group` (`Id`)," +
" ADD CONSTRAINT `FKEC3AF23373767C99` FOREIGN KEY (`User_id`) REFERENCES `user` (`Id`);";
cmd.ExecuteNonQuery();
cmd.Dispose();
int[] groupIdsToKeep = new int[(int)Users.Entities.GID.NrOfGroups];
IList<GroupTableRow> groupTable = new List<GroupTableRow>();
cmd = dbConn.CreateCommand();
cmd.CommandText = "SELECT `Id`, `Gid`, `User_id` FROM `group`;";
MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
int groupId = dr.GetInt32(0);
Users.Entities.GID gid = (Users.Entities.GID)dr.GetInt32(1);
int userId = dr.GetInt32(2);
groupTable.Add(new GroupTableRow(groupId, gid, userId));
if ((gid >= 0) && (gid < Users.Entities.GID.NrOfGroups) && (groupIdsToKeep[(int)gid] == 0))
{
groupIdsToKeep[(int)gid] = groupId;
}
}
dr.Close();
foreach (var groupTableRow in groupTable)
{
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("INSERT INTO `usersgroups` (`Group_id`, `User_id`) VALUES ({0}, {1});",
groupIdsToKeep[(int)groupTableRow.Gid],
groupTableRow.UserId);
cmd.ExecuteNonQuery();
cmd.Dispose();
}
//foreach (var groupTableRow in groupTable)
//{
// bool deleteThisRow = true;
// for (int i = 0; i < groupIdsToKeep.Length; i++)
// {
// if (groupTableRow.GroupId == groupIdsToKeep[i])
// {
// deleteThisRow = false;
// break;
// }
// }
// if (deleteThisRow)
// {
// cmd = dbConn.CreateCommand();
// cmd.CommandText = string.Format("DELETE FROM `group` WHERE `Id` = {0}", groupTableRow.GroupId);
// cmd.ExecuteNonQuery();
// cmd.Dispose();
// }
//}
cmd = dbConn.CreateCommand();
cmd.CommandText = string.Format("ALTER TABLE `group` ADD `AccessFlags` BIGINT NOT NULL DEFAULT '0' AFTER `Name`;");
cmd.ExecuteNonQuery();
cmd.Dispose();
success = true;
}
catch (Exception exc)
{
log.ErrorFormat(string.Format("Exception when upgrading DB: {0}", exc.Message));
if (exc.InnerException != null) log.ErrorFormat(string.Format("Inner exception: {0}", exc.InnerException.Message));
ActivityEnd();
MessageBox.Show(string.Format("Exception {0}", exc.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
finally
{
if (dbConn != null) dbConn.Close();
}
if (success)
{
ActivityEnd();
MessageBox.Show("DB succesfully upgraded", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
upgradeDb_224_225_Button.Enabled = false;
}
}
private void pressureRepresentationButton_Click(object sender, EventArgs e)
{
try
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21 -1
View File
@@ -48,7 +48,25 @@ namespace Users.Forms
try
{
displayedGroups = session.QueryOver<Group>().List();
IList<Group> allGroups = session.QueryOver<Group>().List();
///
/// Selects groups to be displayed (so that each GID is present only once)
///
Group[] dspGroups = new Group[(int)Users.Entities.GID.NrOfGroups];
foreach (var group in allGroups)
{
if ((group.GID >= 0) && (group.GID < Users.Entities.GID.NrOfGroups) && (dspGroups[(int)group.GID] == null))
{
dspGroups[(int)group.GID] = group;
}
}
displayedGroups = new List<Group>();
foreach (var group in dspGroups)
{
if (group != null) displayedGroups.Add(group);
}
listOfUsers = session.QueryOver<User>().List();
}
catch (Exception)
@@ -56,6 +74,8 @@ namespace Users.Forms
if (displayedGroups == null) displayedGroups = new List<Group>();
if (listOfUsers == null) listOfUsers = new List<User>();
}
}
private void UserManagementDlg_Load(object sender, EventArgs e)
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>DEBUG;TRACE;TURA_IPERL;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -28,7 +28,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;TURA_IPERL;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>