Merge remote-tracking branch 'CMS/develop' into develop

This commit is contained in:
=
2021-03-09 14:58:09 +01:00
24 changed files with 258 additions and 41 deletions
@@ -71,7 +71,6 @@ namespace Thermo.Active.Controllers.WebApi
// recupero dati paginati
libraryError = ncAdapter.GetCycleLog(from, to, out currCycleLog);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetCycleLog error | {libraryError.exception}");
@@ -81,7 +80,34 @@ namespace Thermo.Active.Controllers.WebApi
return Ok(currCycleLog);
}
[ResponseType(typeof(DTOChannelsIO))]
[ResponseType(typeof(bool))]
[Route("GetAxesAdvMode"), HttpGet]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult GetAxesAdvMode()
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | ForceChAO | {libraryError.exception}");
return InternalServerError();
}
// chiamo scrittura
bool advMode = false;
libraryError = ncAdapter.GetAxesAdvMode(out advMode);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetCycleLog error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// ritorno solo fatto!
return Ok(advMode);
}
[ResponseType(typeof(DTOChannelsIO))]
[Route("channels_io"), HttpGet]
public IHttpActionResult GetChannelsIO()
{
@@ -309,6 +335,25 @@ namespace Thermo.Active.Controllers.WebApi
}
}
[Route("SetAxesAdvMode"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult SetAxesAdvMode(bool value)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | ForceChAO | {libraryError.exception}");
return InternalServerError();
}
// chiamo scrittura
ncAdapter.SetAxesAdvMode(value);
// ritorno solo fatto!
return Ok();
}
[Route("io_sample_fast"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.WRITE)]
public IHttpActionResult SetFastSample(bool value)
+1 -1
View File
@@ -30,4 +30,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.1.175")]
[assembly: AssemblyVersion("1.1.176")]
+1
View File
@@ -333,6 +333,7 @@ declare module Recipe {
options_thermoregulator_9_setpoint?: IValue,
options_thermoregulator_10_enabled?: IValue,
options_thermoregulator_10_setpoint?: IValue,
extraction_main_drawing_enabled?: IValue,
}
}
@@ -31,6 +31,15 @@
</div>
<slider v-model="recipe.extraction_main_manual"></slider>
</template>
<template v-if="recipe.extraction_main_drawing_enabled.status.visible" >
<div class="input-area" style="margin-top: 30px;">
<label>{{'extraction_main_drawing_enabled'|localize('Drawing Enabled')}}</label>
<toggle-button
v-model="recipe.extraction_main_drawing_enabled.setpointHMI"
:status="recipe.extraction_main_drawing_enabled.status"
></toggle-button>
</div>
</template>
</div>
</div>
</aside>
@@ -51,7 +51,8 @@ export default class ShowEstrazioneInfo extends Vue {
(this.recipe.extraction_main_delay.status.visible && this.recipe.extraction_main_delay.status.hasError) ||
(this.recipe.extraction_main_1_chart_setpointx.status.visible && this.recipe.extraction_main_1_chart_setpointx.status.hasError) ||
(this.recipe.extraction_main_1_chart_setpointy.status.visible && this.recipe.extraction_main_1_chart_setpointy.status.hasError) ||
(this.recipe.extraction_main_manual.status.visible && this.recipe.extraction_main_manual.status.hasError);
(this.recipe.extraction_main_manual.status.visible && this.recipe.extraction_main_manual.status.hasError) ||
(this.recipe.extraction_main_drawing_enabled.status.visible && this.recipe.extraction_main_drawing_enabled.status.hasError);
}
get auxHasErrors() {
return (this.recipe.extraction_aux_enabled.status.visible && this.recipe.extraction_aux_enabled.status.hasError) ||
@@ -74,6 +75,7 @@ export default class ShowEstrazioneInfo extends Vue {
extraction_aux_1_chart_setpointx: this.recipe.extraction_aux_1_chart_setpointx,
extraction_aux_1_chart_setpointy: this.recipe.extraction_aux_1_chart_setpointy,
extraction_aux_manual: this.recipe.extraction_aux_manual,
extraction_main_drawing_enabled: this.recipe.extraction_main_drawing_enabled,
};
}
@@ -117,6 +119,7 @@ export default class ShowEstrazioneInfo extends Vue {
'extraction_main_1_chart_setpointx',
'extraction_main_1_chart_setpointy',
'extraction_main_manual',
'extraction_main_drawing_enabled',
)
}
@@ -0,0 +1,13 @@
.labelOnOff {
display: flex;
flex-flow: row;
justify-content: center;
align-items: center;
color: #e8e8e8;
font-size: 18px;
}
.labelOnOff label {
width: 200px;
text-align: end;
padding-right: 10px;
}
@@ -1 +1,16 @@
@import "../../../variable.less";
.labelOnOff{
display: flex;
flex-flow: row;
justify-content: center;
align-items: center;
color: #e8e8e8;
font-size: 18px;
label{
width: 200px;
text-align: end;
padding-right: 10px;
}
}
@@ -2,8 +2,45 @@ import { Component, Vue } from "vue-property-decorator";
import Header from "../../../header/my-header.vue";
import MenuSx from "../../../menu-sx/menu-sx.vue";
import AssiTable from "../../../Assi/components/tables/assi-table/assi-table.vue";
import { underTheHoodService } from "@/services/underTheHoodService";
import { awaiter, messageService } from "@/_base";
import { Modal as modal, ModalHelper } from "@/components/modals";
@Component({
components: { Header, MenuSx, AssiTable }
})
export default class Assi extends Vue {}
export default class Assi extends Vue {
isEditable = false;
isComunicating = false;
async mounted(){
this.isComunicating = true;
this.isEditable = await awaiter (underTheHoodService.GetAxesAdvMode());
this.isComunicating = false;
}
async enableDisable(evt){
this.isComunicating = true;
evt.preventDefault();
if(!this.isEditable)
{
ModalHelper.AskConfirm( this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"),
this.$options.filters.localize("softkey_confirm", "Confirm?"),
async() => {
await awaiter (underTheHoodService.SetAxesAdvMode(!this.isEditable));
this.isEditable = !this.isEditable;
}, null, "modal");
}
else
{
await awaiter (underTheHoodService.SetAxesAdvMode(!this.isEditable));
this.isEditable = !this.isEditable;
}
this.isComunicating = false;
}
}
@@ -1,6 +1,21 @@
<template>
<div class="column-page-one-column">
<AssiTable></AssiTable>
<AssiTable :isEditable="isEditable"></AssiTable>
<div class="menu">
<div class="load">
</div>
<div class="toReload">
<div class="labelOnOff">
<label>{{'underthehood_label_axis_enabled' | localize('Enabled')}}</label>
<div class="togglebutton">
<label>
<input type="checkbox" :checked="isEditable" :disabled="this.isComunicating" @click='enableDisable'>
<span class="toggle">{{isEditable ?"ON":"OFF"}}</span>
</label>
</div>
</div>
</div>
</div>
</div>
</template>
<style lang="less">
@@ -19,8 +19,10 @@ export default class AsseRowItem extends Vue {
@Prop()
isSlave: boolean;
isSendingCMD = false;
@Prop()
isEditable: boolean;
isSendingCMD = false;
get forcedValue() { return { setpointHMI: this.item.axPos, range: { min: -32768, max: 32767 } }; }
@@ -33,7 +35,7 @@ export default class AsseRowItem extends Vue {
}
getNumber(value){
return value.toFixed(2);;
return value.toFixed(1);
}
openCollapse(){
@@ -41,6 +43,9 @@ export default class AsseRowItem extends Vue {
}
async sendCommand(cmd,ax){
if(!this.isEditable)
return;
this.isSendingCMD = true;
if(this.forcedValue.setpointHMI)
await awaiter (underTheHoodService.sendAxisCommand(ax.id,cmd,this.forcedValue.setpointHMI));
@@ -24,31 +24,26 @@
v-model="forcedValue"
keyboard-position="left"
/>
<button v-if="isvisible(item.enabledWord,1)" @click="sendCommand('MoveAbsolute',item)" :disabled="isSendingCMD">
<button v-if="isvisible(item.enabledWord,1)" @click="sendCommand('MoveAbsolute',item)" :disabled="isSendingCMD || !isEditable">
<label>{{'underthehood_btn_move' | localize("Move")}}</label>
</button>
<button v-if="isvisible(item.enabledWord,8)" @click="sendCommand('Align',item)" :disabled="isSendingCMD">
<button v-if="isvisible(item.enabledWord,8)" @click="sendCommand('Align',item)" :disabled="isSendingCMD || !isEditable">
<label>{{'underthehood_btn_align' | localize("Align")}}</label>
</button>
<button v-if="isvisible(item.enabledWord,16)" @click="sendCommand('Probe',item)" :disabled="isSendingCMD">
<button v-if="isvisible(item.enabledWord,16)" @click="sendCommand('Probe',item)" :disabled="isSendingCMD || !isEditable">
<label>{{'underthehood_btn_probe' | localize("Probe")}}</label>
</button>
<button v-if="isvisible(item.enabledWord,32)" @click="sendCommand('SetSlavePosition',item)" :disabled="isSendingCMD">
<button v-if="isvisible(item.enabledWord,32)" @click="sendCommand('SetSlavePosition',item)" :disabled="isSendingCMD || !isEditable">
<label>{{'underthehood_btn_setslaves' | localize("Set slaves position")}}</label>
</button>
<button v-if="isvisible(item.enabledWord,64)" @click="sendCommand('Reset',item)" :disabled="isSendingCMD">
<button v-if="isvisible(item.enabledWord,64)" @click="sendCommand('Reset',item)" :disabled="isSendingCMD || !isEditable">
<label>{{'underthehood_btn_zero' | localize("Zero")}}</label>
</button>
<button v-if="isvisible(item.enabledWord,2)" @click="sendCommand('JogIncMinus',item)" :disabled="isSendingCMD">
<span class="controlli-icon pointer">
<img src="assets/icons/sotto-cofano/png/ico-bt-minus.png" />
</span>
<button v-if="isvisible(item.enabledWord,2)" @click="sendCommand('JogIncMinus',item)" :disabled="isSendingCMD || !isEditable">
<i class="fa fa-minus"></i>
</button>
<button v-if="isvisible(item.enabledWord,4)" @click="sendCommand('JogIncPlus',item)" :disabled="isSendingCMD">
<span class="controlli-icon pointer">
<img src="assets/icons/sotto-cofano/png/ico-bt-plus.png" />
</span>
<button v-if="isvisible(item.enabledWord,4)" @click="sendCommand('JogIncPlus',item)" :disabled="isSendingCMD || !isEditable">
<i class="fa fa-plus"></i>
</button>
</span>
</td>
@@ -59,6 +59,9 @@
font-size: 18px;
padding: 0 10px;
}
.assi-table .buttons-container > button i {
margin: 0px 10px;
}
.assi-table .buttons-container > button:disabled {
background-image: none;
background-color: #818a8f;
@@ -69,6 +69,9 @@
color: @very-light-pink;
font-size: 18px;
padding: 0 10px;
i{
margin: 0px 10px;
}
&:disabled{
background-image: none;
background-color: #818a8f;
@@ -1,12 +1,17 @@
import { Component, Vue } from "vue-property-decorator";
import { AppModel } from "@/store";
import { underTheHoodService } from "@/services/underTheHoodService";
import { Prop, Watch } from "vue-property-decorator";
import AsseRowItem from "./asse-row-item.vue";
@Component({
components: { AsseRowItem }
})
export default class AssiTable extends Vue {
@Prop()
isEditable: boolean;
groupVisible: string[] = [];
get axis() {
@@ -23,6 +23,7 @@
:hasSlave="hasSlave(item.id)"
:isSlave="false"
:isOpened="groupVisible.includes(item.id)"
:isEditable="isEditable"
@openCollapse="openCollapse(item.id)"
/>
@@ -34,6 +35,7 @@
:hasSlave="false"
:isSlave="true"
:isOpened="groupVisible.includes(item.id)"
:isEditable="isEditable"
@openCollapse="openCollapse(item.id)"
/>
</template>
@@ -33,9 +33,8 @@ export default class Sottocofano extends Vue {
@Watch("isLifted")
@Watch("panel")
async liftedChanged() {
this.ioTimeout = await underTheHoodService.setFastSample(this.isLifted)
if(this.isLifted && this.panel== "io" ){
this.ioTimeout = await underTheHoodService.setFastSample(this.isLifted && this.panel == "io")
if(this.isLifted && this.panel == "io" ){
clearInterval(this.interval);
this.interval = setInterval(() => {
this.checkFastSample();
@@ -7,12 +7,12 @@ export class LogsService extends baseRestService {
async getPage(from,to) {
let result = await this.Get((await this.BASE_URL()) + `CycleLog?from=${from}&to=${to}`) ;
let result = await this.Get((await this.BASE_URL()) + `CycleLog?from=${from}&to=${to}`, true) ;
return result;
}
async Update() {
let result = await this.Get((await this.BASE_URL()) + "CycleLogRefresh");
let result = await this.Get((await this.BASE_URL()) + "CycleLogRefresh", true);
return result;
}
@@ -6,32 +6,41 @@ import { baseRestService } from "@/_base/baseRestService";
export class UnderTheHoodService extends baseRestService {
BASE_URL = async () => (await CONFIGURATION).api.apiServerUrl;
async getChannels() {
let result = await this.Get<server.channels>((await this.BASE_URL()) + "/api/underthehood/channels_io");
let result = await this.Get<server.channels>((await this.BASE_URL()) + "/api/underthehood/channels_io", true);
underTheHoodActions.SetIOChannels(store, result);
return result;
}
async getChannelsConfig() {
let result = await this.Get<{ [id: string]: number[] }>((await this.BASE_URL()) + "/api/configuration/configIO");
let result = await this.Get<{ [id: string]: number[] }>((await this.BASE_URL()) + "/api/configuration/configIO", true);
underTheHoodActions.SetIOChannelsConfig(store, result);
return result;
}
async forceChannel(group: string, item: server.channel, value: number) {
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_force_ch_${group}`, [{ id: item.id, value }]);
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_force_ch_${group}`, [{ id: item.id, value }], true);
}
async resetChannel(group: string, item: server.channel) {
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_reset_ch_${group}`, [item.id]);
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_reset_ch_${group}`, [item.id], true);
}
async setFastSample(value: boolean) {
let result = await this.Put<Date>((await this.BASE_URL()) + `/api/underthehood/io_sample_fast?value=${value}`, {});
let result = await this.Put<Date>((await this.BASE_URL()) + `/api/underthehood/io_sample_fast?value=${value}`, {}, true);
return result;
}
async sendAxisCommand(axisId: number,currCommand: string ,axPos: number) {
await this.Put((await this.BASE_URL()) + `/api/underthehood/SendAxisCommand?AxisId=${axisId}&currCommand=${currCommand}&TargetPos=${axPos}`, {});
await this.Put((await this.BASE_URL()) + `/api/underthehood/SendAxisCommand?AxisId=${axisId}&currCommand=${currCommand}&TargetPos=${axPos}`, {}, true);
}
async SetAxesAdvMode(value: boolean) {
let result = await this.Put((await this.BASE_URL()) + `/api/underthehood/SetAxesAdvMode?value=${value}`, {}, true);
}
async GetAxesAdvMode() {
let result = await this.Get<boolean>((await this.BASE_URL()) + "/api/underthehood/GetAxesAdvMode", true);
return result;
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 KiB

After

Width:  |  Height:  |  Size: 684 KiB