diff --git a/Step.Config/Config/userSoftKeyConfig.xml b/Step.Config/Config/userSoftKeyConfig.xml index 3ef57249..4049c059 100644 --- a/Step.Config/Config/userSoftKeyConfig.xml +++ b/Step.Config/Config/userSoftKeyConfig.xml @@ -1,7 +1,8 @@  - true + false + false 1 true 1 @@ -12,6 +13,7 @@ true + true 1 false 1 @@ -22,6 +24,7 @@ true + true 1 true @@ -29,12 +32,13 @@ Ita - 1 - 1 + 1 + 1 false + true 2 false @@ -42,12 +46,13 @@ Ita - 1 - 1 + 1 + 1 true + true 2 false @@ -55,11 +60,12 @@ Ita - 1 + 1 true + true 2 false @@ -67,12 +73,13 @@ Ita - 1 - 1 + 1 + 1 true + true 2 false @@ -80,13 +87,14 @@ Ita - 1 - 1 - 1 + 1 + 1 + 1 true + true 2 false @@ -94,16 +102,17 @@ Ita - 1 - 2 - 3 - 4 - 5 - 6 + 1 + 2 + 3 + 4 + 5 + 6 true + true 3 false @@ -111,15 +120,16 @@ Ita - 1 - 2 - 3 - 4 - 5 + 1 + 2 + 3 + 4 + 5 true + true 3 false @@ -127,16 +137,17 @@ Ita - A - B - C - D - E - V + A + B + C + D + E + V true + true 3 true 1 @@ -147,6 +158,7 @@ true + true 3 true 1 @@ -157,6 +169,7 @@ true + true 3 true 1 @@ -167,6 +180,7 @@ true + true 3 true 1 @@ -177,6 +191,7 @@ true + true 3 true 1 @@ -187,6 +202,7 @@ true + true 3 true 1 @@ -197,6 +213,7 @@ true + true 3 true 1 @@ -207,6 +224,7 @@ true + true 3 true 1 @@ -217,6 +235,7 @@ true + true 3 false @@ -224,16 +243,17 @@ Ita - A - B - C - D - E - V + A + B + C + D + E + V true + true 3 true 1 @@ -244,6 +264,7 @@ true + true 3 true 1 @@ -254,6 +275,7 @@ true + true 3 true 1 @@ -264,6 +286,7 @@ true + true 3 true 1 @@ -274,6 +297,7 @@ true + true 3 true 1 @@ -284,6 +308,7 @@ true + true 3 true 1 @@ -294,6 +319,7 @@ true + true 3 true 1 @@ -304,6 +330,7 @@ true + true 3 true 1 @@ -314,6 +341,7 @@ true + true 3 true 1 @@ -324,6 +352,7 @@ true + true 3 true 1 @@ -334,6 +363,7 @@ true + true 3 true 1 @@ -344,6 +374,7 @@ true + true 3 true 1 @@ -354,6 +385,7 @@ true + true 3 true 1 @@ -364,6 +396,7 @@ true + true 3 true 1 @@ -374,6 +407,7 @@ true + true 3 true 1 @@ -384,6 +418,7 @@ true + true 3 true 1 @@ -394,6 +429,7 @@ true + true 3 true 1 @@ -404,6 +440,7 @@ true + true 3 true 1 @@ -414,6 +451,7 @@ true + true 7 false @@ -421,12 +459,12 @@ Ita - A - B - C - D - E - V + A + B + C + D + E + V diff --git a/Step.Config/Config/userSoftKeyConfigValidator.xsd b/Step.Config/Config/userSoftKeyConfigValidator.xsd index d4b25de2..d96b4068 100644 --- a/Step.Config/Config/userSoftKeyConfigValidator.xsd +++ b/Step.Config/Config/userSoftKeyConfigValidator.xsd @@ -29,6 +29,7 @@ + @@ -47,6 +48,7 @@ + @@ -61,6 +63,7 @@ + @@ -79,6 +82,7 @@ + diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index d603c0c8..9f6d1b27 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -328,14 +328,17 @@ namespace Step.Config Id = id++, // autoincrement Id PlcId = Convert.ToInt32(x.Element("plcId")?.Value), // If exists IsActive = Convert.ToBoolean(x.Element("active").Value), + IsVisible = Convert.ToBoolean(x.Element("visible").Value), Category = Convert.ToInt32(x.Element("category").Value), LocalizedNames = x.Element("localizedNames").Elements().ToDictionary( // Read localized names and convert into a dictionary y => y.Attribute("langKey").Value, y => y.Value ), - SubKeys = x.Element("subKeys")?.Elements().Select(y => new SubKeysModel() // Populate subkeys if exist + SubKeys = x.Element("subKeys")?.Elements().Where(y => Convert.ToBoolean(y.Attribute("active").Value) == true) // Filter for active softkey + .Select(y => new SubKeysModel() // Populate subkeys if exist { Id = id++, + IsActive = Convert.ToBoolean(y.Attribute("active").Value), PlcId = Convert.ToInt32(y.Attribute("plcId").Value), Text = y.Value }).ToList(), diff --git a/Step.Model/ConfigModels/UserSoftKeyConfigModel.cs b/Step.Model/ConfigModels/UserSoftKeyConfigModel.cs index c4477daf..67b0fea1 100644 --- a/Step.Model/ConfigModels/UserSoftKeyConfigModel.cs +++ b/Step.Model/ConfigModels/UserSoftKeyConfigModel.cs @@ -9,6 +9,7 @@ namespace Step.Model.ConfigModels public Dictionary LocalizedNames { get; set; } public int Category { get; set; } public bool IsActive { get; set; } + public bool IsVisible { get; set; } public bool OperatorConfirmationNeeded { get; set; } public List SubKeys { get; set; } public int PlcId { get; set; } @@ -19,6 +20,7 @@ namespace Step.Model.ConfigModels { public int Id; public int PlcId; + public bool IsActive; public string Text; } } diff --git a/Step.Model/DTOModels/DTONcGenericDataModel.cs b/Step.Model/DTOModels/DTONcGenericDataModel.cs index dac0aa57..c517f058 100644 --- a/Step.Model/DTOModels/DTONcGenericDataModel.cs +++ b/Step.Model/DTOModels/DTONcGenericDataModel.cs @@ -19,12 +19,19 @@ namespace Step.Model.DTOModels public string ServerVersion { get; set; } public string CoreLibraryVersion { get; set; } + private DateTime buildDate; + private Version v; + public DTONcGenericDataModel(string machineName) { // Get Machine model from config MachineModel = machineName; + + v = Assembly.GetEntryAssembly().GetName().Version; + buildDate = new DateTime(2000, 1, 1).AddDays(v.Build).AddSeconds(v.Revision * 2); + // Get Server version - ServerVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + ServerVersion = $"{v} ({buildDate.ToString("d")})"; //Get Library Version CoreLibraryVersion = "2.0.0"; } diff --git a/Step.Model/DTOModels/DTOUserSoftKeyModel.cs b/Step.Model/DTOModels/DTOUserSoftKeyModel.cs index af991d64..8283adcc 100644 --- a/Step.Model/DTOModels/DTOUserSoftKeyModel.cs +++ b/Step.Model/DTOModels/DTOUserSoftKeyModel.cs @@ -21,6 +21,7 @@ namespace Step.Model.DTOModels public int Id { get; set; } public int Category { get; set; } public bool Active { get; set; } + public bool Visible { get; set; } public bool Value { get; set; } public override bool Equals(object obj) diff --git a/Step.Model/Properties/AssemblyInfo.cs b/Step.Model/Properties/AssemblyInfo.cs index d5e23549..66ec38fa 100644 --- a/Step.Model/Properties/AssemblyInfo.cs +++ b/Step.Model/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ using System.Runtime.InteropServices; // // 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.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 1e63c8fb..13677a0c 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -1240,6 +1240,13 @@ namespace Step.NC Value = plcSoftKey.Value }); } + + softKeys.Add(new DTOUserSoftKeyModel() + { + Id = softKey.Id, + Category = softKey.Category, + Visible = softKey.IsVisible + }); } else { @@ -1250,7 +1257,7 @@ namespace Step.NC Id = softKey.Id, Active = plcSoftKey.Active, Category = softKey.Category, - Value = plcSoftKey.Value + Visible = softKey.IsVisible }); } } diff --git a/Step/Properties/AssemblyInfo.cs b/Step/Properties/AssemblyInfo.cs index ef6ebaa6..607a6558 100644 --- a/Step/Properties/AssemblyInfo.cs +++ b/Step/Properties/AssemblyInfo.cs @@ -31,5 +31,4 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.*")] diff --git a/Step/Step.csproj b/Step/Step.csproj index 983138bd..6351b561 100644 --- a/Step/Step.csproj +++ b/Step/Step.csproj @@ -20,6 +20,7 @@ Latest true + True true diff --git a/Step/wwwroot/assets/styles/base/plc-softkeys.less b/Step/wwwroot/assets/styles/base/plc-softkeys.less index 6b0c4a23..3b83ba28 100644 --- a/Step/wwwroot/assets/styles/base/plc-softkeys.less +++ b/Step/wwwroot/assets/styles/base/plc-softkeys.less @@ -209,6 +209,10 @@ // &.menuopened:after{ // content: ""; // } + &.notVisible { + background-color: #4e585e; + cursor: auto; + } &.disabled::after, &:disabled::after { content: " "; diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 620be513..fcc1479b 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -5224,6 +5224,10 @@ footer .container button.big:before { background-color: #808e96; -webkit-tap-highlight-color: transparent; } +.soft-key.notVisible { + background-color: #4e585e; + cursor: auto; +} .soft-key.disabled::after, .soft-key:disabled::after { content: " "; diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.ts b/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.ts index 15dddcc5..230f9ef4 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.ts +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.ts @@ -85,6 +85,13 @@ export default class softKeys extends Vue { return false; } + public getSoftKeyVisible(id: number): boolean { + var sk = this.$store.getters.getSoftKeyStatus(id); + if (sk) + return sk.visible; + return false; + } + public getSubKeysActive(keys: object): object { let result = {}; for (const key in keys) { diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.vue b/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.vue index 6744001a..c1ead884 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.vue +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/plc-softkeys.vue @@ -41,6 +41,7 @@ :class="{opened: b.id == selectedMenuItem}" :confirmationNeeded="b.operatorConfirmationNeeded" :starred="starSelected(b)" + :visible="getSoftKeyVisible(b.id)" @subkeyClick="softKeyChanged" @position="setSoftKeyPosition" @selectedItem="enableSelected ? addItemSelectPrefered(b) : null" @@ -51,11 +52,13 @@ :selected="isSelected(b)" :starred="starSelected(b)" :checked="getSoftKeyStatus(b.id)" + :visible="getSoftKeyVisible(b.id)" @selectedItem="enableSelected ? addItemSelectPrefered(b) : null" @checkChanged="!enableSelected ? softKeyChanged(b.id, b.operatorConfirmationNeeded) : addItemSelectPrefered(b)"> -
-
{{title}}
-
-
- - +
+
{{title}}
+
+
+
+
+ +
- {{getSubKeyText(k)}} + {{getSubKeyText(k)}}    
- @@ -32,10 +50,11 @@ export default { subkeysStatus: {}, menuOpened: { default: false }, positionIndex: { default: 0 }, - verticalIndex:{default:0}, + verticalIndex: { default: 0 }, // disabled: { default: false }, selected: { default: false }, - confirmationNeeded: { default: false } + confirmationNeeded: { default: false }, + visible: { default: false } }, computed: { keys() { @@ -48,28 +67,26 @@ export default { disabled() { var _disabled = true; - if(this.checkSecurityDisabled('userSoftkeys')) return true; + if (this.checkSecurityDisabled("userSoftkeys")) return true; for (const key in this.activeSubKeys) { if (this.activeSubKeys[key]) _disabled = false; } return _disabled; }, - subkeyslength(){ + subkeyslength() { var c = 0; - for(const k in this.subkeys) - c++; + for (const k in this.subkeys) c++; return c; } - }, methods: { - menuVerticalPosition(){ - if(this.positionIndex<4) return "bottom"; + menuVerticalPosition() { + if (this.positionIndex < 4) return "bottom"; return "top"; }, - menuHorizontalPosition(){ - if(this.positionIndex%4 == 0) return "left"; - if(this.positionIndex%4 == 3) return "right"; + menuHorizontalPosition() { + if (this.positionIndex % 4 == 0) return "left"; + if (this.positionIndex % 4 == 3) return "right"; return "center"; }, getSoftKeyStatus(id) { @@ -84,17 +101,21 @@ export default { return this.subkeys[value]; }, toggleMenu() { - this.$emit("click"); - this.$emit("position", this.$refs.sk); + if(this.visible){ + this.$emit("click"); + this.$emit("position", this.$refs.sk); + } }, sendSubKey(id) { - this.$emit("subkeyClick", id, this.confirmationNeeded); - this.toggleMenu(); + if(this.visible){ + this.$emit("subkeyClick", id, this.confirmationNeeded); + this.toggleMenu(); + } }, toggleStar: function() { this.$emit("toggleStar"); }, - selectedItem: function(){ + selectedItem: function() { this.$emit("selectedItem"); } } diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue b/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue index 6071c9de..0f1c6e0e 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue @@ -1,16 +1,24 @@