Added OriginPosition

Fixed fanuc TT
& Minorfixes
This commit is contained in:
Lucio Maranta
2018-11-30 13:26:46 +01:00
parent 00c7297ee2
commit 0f15f2e367
17 changed files with 202 additions and 175 deletions
@@ -147,14 +147,6 @@ namespace Step.Database.Controllers
List<DTONcShankModel> dtoShanks = dbShanks
.Select(x => (DTONcShankModel)x)
.ToList();
// new List<DTONcShankModel>();
//foreach (var shank in dbShanks)
//{
// //dbCtx.Shanks.Attach(shank);
// DTONcShankModel dtoShank = (DTONcShankModel)shank;
// dtoShanks.Add(dtoShank);
//}
return dtoShanks;
}
@@ -447,7 +439,10 @@ namespace Step.Database.Controllers
// Set ids with new positions
shank.MagazineId = magazineId;
shank.PositionId = positionId;
// Set original Ids
shank.OriginMagazineId = magazineId;
shank.OriginPositionId = positionId;
dbCtx.SaveChanges();
return FindMagazinePosition(magazineId, positionId);
@@ -459,6 +454,9 @@ namespace Step.Database.Controllers
// set id to null
shank.MagazineId = null;
shank.PositionId = null;
shank.OriginMagazineId = null;
shank.OriginPositionId = null;
dbCtx.SaveChanges();
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ namespace Step.Database.Migrations
string IMigrationMetadata.Id
{
get { return "201811141155184_InitMigration"; }
get { return "201811300854588_InitMigration"; }
}
string IMigrationMetadata.Source
@@ -143,10 +143,12 @@ namespace Step.Database.Migrations
c => new
{
magazine_id = c.Byte(),
position_id = c.Byte(),
position_id = c.Int(),
id = c.Short(nullable: false),
balluf = c.Int(),
magazine_position_type = c.Byte(nullable: false),
origin_magazine_id = c.Byte(),
origin_position_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.magazine_position", t => new { t.magazine_id, t.position_id })
@@ -157,7 +159,7 @@ namespace Step.Database.Migrations
c => new
{
magazine_id = c.Byte(nullable: false),
position_id = c.Byte(nullable: false),
position_id = c.Int(nullable: false),
type = c.Byte(nullable: false),
disabled = c.Boolean(nullable: false),
})
File diff suppressed because one or more lines are too long
+13 -13
View File
@@ -25,22 +25,22 @@ namespace Step.Database.Migrations
);
context.FunctionsAccess.AddOrUpdate(
// General Function
new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1 },
new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2 },
// General Function, if plcId is 0 then the functionality is not connected to the NC
new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 100, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 10, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1},
new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2},
// Under hood
new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3 },
new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4 },
new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5 },
new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6 },
new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7 },
new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3},
new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4},
new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5},
new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6},
new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7},
new FunctionAccessModel() { Name = TOOL_MANAGER, Area = TOOLING_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 8 },
new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9 }
new FunctionAccessModel() { Name = TOOL_MANAGER, Area = TOOLING_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 8},
new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9}
);
context.SaveChanges();
+5 -5
View File
@@ -81,9 +81,9 @@
<Compile Include="Controllers\MachinesUsersController.cs" />
<Compile Include="Controllers\UserSoftkeysController.cs" />
<Compile Include="DatabaseContext.cs" />
<Compile Include="Migrations\201811141155184_InitMigration.cs" />
<Compile Include="Migrations\201811141155184_InitMigration.Designer.cs">
<DependentUpon>201811141155184_InitMigration.cs</DependentUpon>
<Compile Include="Migrations\201811300854588_InitMigration.cs" />
<Compile Include="Migrations\201811300854588_InitMigration.Designer.cs">
<DependentUpon>201811300854588_InitMigration.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -119,8 +119,8 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Migrations\201811141155184_InitMigration.resx">
<DependentUpon>201811141155184_InitMigration.cs</DependentUpon>
<EmbeddedResource Include="Migrations\201811300854588_InitMigration.resx">
<DependentUpon>201811300854588_InitMigration.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />