Generation working and Compilation of MARTe components
This commit is contained in:
1
EC-GN-JA-PCF/.svn/entries
Normal file
1
EC-GN-JA-PCF/.svn/entries
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
1
EC-GN-JA-PCF/.svn/format
Normal file
1
EC-GN-JA-PCF/.svn/format
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
@@ -0,0 +1 @@
|
||||
Last SDD Generation: Tue May 13 15:59:51 UTC 2025
|
||||
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* @file JARampupGAM.h
|
||||
* @brief Header file for class JARampupGAM
|
||||
* @date Jan, 2019
|
||||
* @author rhari
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This header file contains the declaration of the class JARampupGAM
|
||||
* with all of its public, protected and private members. It may also include
|
||||
* definitions for inline methods which need to be visible to the compiler.
|
||||
*/
|
||||
|
||||
#ifndef GAMS_JARampupGAM_H_
|
||||
#define GAMS_JARampupGAM_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "GAM.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Class declaration */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief GAM that rampup output value with specified target value and duration.
|
||||
*
|
||||
* The configuration syntax is (names and signal quantity are only given as an example):
|
||||
* <pre>
|
||||
* +FHPSRampupGAM = {
|
||||
* Class = JARampupGAM
|
||||
* InputSignals = {
|
||||
* Currspv = {
|
||||
* Alias = FHPS_REF
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* Targetv = {
|
||||
* Alias = FHPS_AUTO_TAGV
|
||||
* DataSource = EPICSCAInput
|
||||
* Type = float32
|
||||
* }
|
||||
* Time = {
|
||||
* Alias = FHPS_AUTO_TIME
|
||||
* DataSource = EPICSCAInput
|
||||
* Type = float32
|
||||
* }
|
||||
* Start = {
|
||||
* Alias = FHPS_AUTO_START
|
||||
* DataSource = EPICSCAInput
|
||||
* Type = uint32
|
||||
* }
|
||||
* }
|
||||
* OutputSignals = {
|
||||
* FHPS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
|
||||
class JARampupGAM : public MARTe::GAM, public MARTe::StatefulI {
|
||||
public:
|
||||
CLASS_REGISTER_DECLARATION()
|
||||
|
||||
JARampupGAM();
|
||||
|
||||
virtual ~JARampupGAM();
|
||||
|
||||
virtual bool Initialise(MARTe::StructuredDataI & data);
|
||||
|
||||
virtual bool Setup();
|
||||
|
||||
virtual bool Execute();
|
||||
|
||||
virtual bool PrepareNextState(const MARTe::char8 * const currentStateName,
|
||||
const MARTe::char8 * const nextStateName);
|
||||
|
||||
private:
|
||||
// Input signal containing current current_setpoint
|
||||
MARTe::float32 *current_setpoint;
|
||||
|
||||
// Input signal containing the frequency of the waveform.
|
||||
MARTe::float32 *target_value;
|
||||
|
||||
// Input signal containing the amplitude of the waveform.
|
||||
MARTe::float32 *rampup_time;
|
||||
|
||||
// Input signal containing CCPS_ON_REQUEST
|
||||
MARTe::uint32 *start;
|
||||
|
||||
// Input signal PLC_STANDBY
|
||||
MARTe::uint32 *standby;
|
||||
|
||||
// MANUAL AUTO button
|
||||
MARTe::uint32 *isAuto;
|
||||
|
||||
// Input signal
|
||||
MARTe::float32 *FHPS_PrePro;
|
||||
|
||||
// Output
|
||||
MARTe::float32 *output;
|
||||
// State output
|
||||
MARTe::uint32 *state; //0:NotOperation, 1:InOperation, 2:Finish, 3:Error
|
||||
|
||||
// Internal variables
|
||||
MARTe::float32 rampup_rate;
|
||||
bool inRampup;
|
||||
bool resetFlag;
|
||||
bool inWaitHVON;
|
||||
bool inWaitStandby;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Inline method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* GAMS_JARampupGAM_H_ */
|
||||
@@ -0,0 +1,68 @@
|
||||
#+======================================================================
|
||||
# $HeadURL: https://svnpub.iter.org/codac/iter/codac/dev/units/m-codac-unit-templates/tags/CODAC-CORE-6.0.0/templates/cpp/main/c++/prog/Makefile.template $
|
||||
# $Id: Makefile.template 83098 2018-01-08 13:23:38Z cesnikt $
|
||||
#
|
||||
# Project : CODAC Core System
|
||||
#
|
||||
# Description : gyrotronDAN Makefile
|
||||
#
|
||||
# Author : This file was generated by CODAC development toolkit
|
||||
#
|
||||
# Copyright (c) : 2010-2018 ITER Organization,
|
||||
# CS 90 046
|
||||
# 13067 St. Paul-lez-Durance Cedex
|
||||
# France
|
||||
#
|
||||
# This file is part of ITER CODAC software.
|
||||
# For the terms and conditions of redistribution or use of this software
|
||||
# refer to the file ITER-LICENSE.TXT located in the top level directory
|
||||
# of the distribution package.
|
||||
#
|
||||
#-======================================================================
|
||||
|
||||
PROGNAME=Gyrotron02DAN
|
||||
|
||||
LIBRARIES=ca dan_api dan_client_api dan_stream dan_base xml2 log sdn sdn-core ccs-core rt pthread tcn nixseries
|
||||
LIBRARY_DIRS=
|
||||
INCLUDE_DIRS=. ../include $(CODAC_ROOT)/include $(EPICS_BASE)/include/os/Linux $(EPICS_BASE)/include/compiler/gcc $(EPICS_BASE)/include /usr/include/libxml2 $(SDN_TOPIC_DIRECTORY)
|
||||
|
||||
TARGET=../../../../target
|
||||
BINARY_DIR=$(TARGET)/bin
|
||||
OBJECT_DIR=$(TARGET)/obj/$(PROGNAME)
|
||||
SOURCE_DIR=.
|
||||
|
||||
EXECUTABLE=$(BINARY_DIR)/$(PROGNAME)
|
||||
INCLUDES=$(foreach inc,$(INCLUDE_DIRS),-I$(inc))
|
||||
LDLIBS=-L$(CODAC_ROOT)/lib -L$(EPICS_BASE)/lib/$(EPICS_HOST_ARCH) $(foreach libs,$(LIBRARY_DIRS),-L$(libs) -Wl,-rpath,$(libs)) $(foreach libs,$(LIBRARIES),-l$(libs))
|
||||
SOURCES=$(SOURCE_DIR)/$(PROGNAME).cpp $(SOURCE_DIR)/configure_sdn.cpp
|
||||
# to build executable from all sources in the program directory:
|
||||
#SOURCES=$(wildcard $(SOURCE_DIR)/*.cpp $(SOURCE_DIR)/*.c)
|
||||
OBJECTS=$(addprefix $(OBJECT_DIR)/,$(patsubst %.cpp,%.o,$(notdir $(SOURCES))))
|
||||
|
||||
C=gcc
|
||||
CC=g++
|
||||
CFLAGS=-c -Wall
|
||||
CCFLAGS=-c -Wall -std=c++11
|
||||
LDFLAGS=
|
||||
|
||||
.PHONY: all clean run
|
||||
|
||||
all: $(SOURCES) $(EXECUTABLE)
|
||||
|
||||
clean:
|
||||
rm -rf "$(EXECUTABLE)" "$(OBJECT_DIR)"
|
||||
|
||||
run: $(SOURCES) $(EXECUTABLE)
|
||||
$(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
mkdir -p $(BINARY_DIR)
|
||||
$(CC) $(LDFLAGS) $(LDLIBS) $(OBJECTS) -o $@
|
||||
|
||||
$(OBJECT_DIR)/%.o: $(SOURCE_DIR)/%.cpp
|
||||
mkdir -p $(OBJECT_DIR)
|
||||
$(CC) $(CCFLAGS) $(INCLUDES) $< -o $@
|
||||
|
||||
$(OBJECT_DIR)/%.o: $(SOURCE_DIR)/%.c
|
||||
mkdir -p $(OBJECT_DIR)
|
||||
$(C) $(CFLAGS) $(INCLUDES) $< -o $@
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="PB2F" description="ITER-EC-GN-P01-PB2F" enabled="true" opi_file="./mimics/ITER-EC-GN-P01-PB2F_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-P01-PB2F" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-P01/EC-GN-P01-PB2F" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
record (bo,"EC-GN-P01-PA1F:PSU3000-CON-HV")
|
||||
{
|
||||
field(DESC, "GY1 APS HVON")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PA1F:PSU3000-CON-SW")
|
||||
{
|
||||
field(DESC, "GY1 APS HV SWON")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PA1F:PSU3000-CTRP")
|
||||
{
|
||||
field(DESC, "GY1 APS Shutdonw request")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-PA1F:PSU3000-YFLT")
|
||||
{
|
||||
field(DESC, "GY1 APS Fault")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 1) bitread")
|
||||
field(ONAM, "FAULT")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NORMAL")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-PA1F:PSU3000-YSTA")
|
||||
{
|
||||
field(DESC, "GY1 APS Ready")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 0) bitread")
|
||||
field(ONAM, "READY")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PA1F:STAT-MANM")
|
||||
{
|
||||
field(DESC, "Manual Mode SW for GY1 APS")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "1")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-PA1F:PSU3000-EREF")
|
||||
{
|
||||
field(DESC, "GY1 APS voltage setpoint")
|
||||
field(DRVH, "10")
|
||||
field(DRVL, "-20")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(EGU, "kV")
|
||||
field(HOPR, "10")
|
||||
field(LOPR, "-20")
|
||||
field(OUT, "@asyn(ni6368_1, 1) write_ao")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AO-SIMM")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-PA1F:PSU3000-EREF-MSP")
|
||||
{
|
||||
field(DESC, "GY1 APS voltage manual setpoint")
|
||||
field(DRVH, "10")
|
||||
field(DRVL, "-20")
|
||||
field(EGU, "kV")
|
||||
field(HOPR, "10")
|
||||
field(LOPR, "-20")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-PA1F:PSU3000-EREF-P")
|
||||
{
|
||||
field(ASLO, "2")
|
||||
field(DESC, "GY1 APS P-voltage setpoint")
|
||||
field(DRVH, "0")
|
||||
field(DRVL, "-20")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(EGU, "kV")
|
||||
field(HOPR, "10")
|
||||
field(LOPR, "-20")
|
||||
field(OUT, "@asyn(ni6368_1, 2) write_ao")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AO-SIMM")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PA1F:PSU3000-ET")
|
||||
{
|
||||
field(DESC, "GY1 APS Measured Volatege")
|
||||
field(EGU, "kV")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PA1F:PSU3000-ET-WF")
|
||||
{
|
||||
field(DESC, "GY1 APS Measured Volatege")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PA1F:PSU3000-IT")
|
||||
{
|
||||
field(DESC, "GY1 APS Measued Current")
|
||||
field(EGU, "A")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PA1F:PSU3000-IT-WF")
|
||||
{
|
||||
field(DESC, "GY1 APS Measued Current")
|
||||
field(EGU, "A")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PA1F:STAT-DT-HVON")
|
||||
{
|
||||
field(DESC, "Time diff to GY1 APS Gate ON")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "5000000")
|
||||
field(LOPR, "1000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "500000")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PA1F:STAT-DT-SWON")
|
||||
{
|
||||
field(DESC, "Time diff to GY1 APS SW ON")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "5000000")
|
||||
field(LOPR, "1000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "600000")
|
||||
}
|
||||
|
||||
record (calcout,"EC-GN-P01-PA1F:STAT-EREF-CONV")
|
||||
{
|
||||
field(CALC, "A>0?A:((A>-20)?A/2:-10)")
|
||||
field(DESC, "GYA APS engineer value conversion")
|
||||
field(OOPT, "On Change")
|
||||
field(OUT, "EC-GN-P01-PA1F:PSU3000-EREF PP")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PA1F:STAT-PREP-WF")
|
||||
{
|
||||
field(DESC, "GY1 APS prepro schedule")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "NO")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# CONFIG - Load build configuration data
|
||||
#
|
||||
# Do not make changes to this file!
|
||||
|
||||
# Allow user to override where the build rules come from
|
||||
RULES = $(EPICS_BASE)
|
||||
|
||||
# RELEASE files point to other application tops
|
||||
include $(TOP)/configure/RELEASE
|
||||
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common
|
||||
ifdef T_A
|
||||
-include $(TOP)/configure/RELEASE.Common.$(T_A)
|
||||
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
|
||||
endif
|
||||
|
||||
CONFIG = $(RULES)/configure
|
||||
include $(CONFIG)/CONFIG
|
||||
|
||||
# Override the Base definition:
|
||||
INSTALL_LOCATION = $(TOP)
|
||||
|
||||
# CONFIG_SITE files contain other build configuration settings
|
||||
include $(TOP)/configure/CONFIG_SITE
|
||||
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
|
||||
ifdef T_A
|
||||
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
|
||||
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
############################################################################
|
||||
## Autosave monitor post setup
|
||||
############################################################################
|
||||
|
||||
cd "${TOP}/iocBoot/$(IOC)"
|
||||
create_monitor_set(".req",30,"P=$(AUTOSAVE_SYSM_PV_PREFIX)")
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
record(longin, longin){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
record(longout, longout){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
record(ai, ai){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
record(ao, ao){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
record(stringin, stringin){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
record(stringout, stringout){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAMessageGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAMessageGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAMessageGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
// from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
var func = display.getPropertyValue("name");
|
||||
var type = widget.getPropertyValue("name");
|
||||
var widgetType = "ellipse";
|
||||
var varName = "XXXXXXX";
|
||||
|
||||
if (type.indexOf("PSH") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("PCF") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("SRV") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("PLC") != -1) {
|
||||
varName = "-PLCHLTS";
|
||||
}
|
||||
if (type.indexOf("COM") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("CHS") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
// if ("IOM" in type.indexOf() != -1) {
|
||||
// varName = "-BS";
|
||||
if (type.indexOf("CUB") != -1) {
|
||||
varName = "-CUBHLTS";
|
||||
}
|
||||
if (type.indexOf("Box") != -1) {
|
||||
widgetType = "rectangle";
|
||||
}
|
||||
|
||||
if (triggerPV.getName().indexOf(varName) != -1) {
|
||||
// ConsoleUtil.writeInfo("Trigger PV found) { " +triggerPV.getName());
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
|
||||
if ("ellipse" == widgetType) {
|
||||
widget.setPropertyValue("foreground_color", color);
|
||||
}
|
||||
|
||||
var tooltip = PVUtil.getString(triggerPV);
|
||||
widget.setPropertyValue("tooltip", tooltip);
|
||||
}
|
||||
|
||||
if (type.indexOf("IOM") != -1) {
|
||||
if (triggerPV.getName().indexOf(".SIMM") == -1) {
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
var color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
else if( s == 4) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
|
||||
widget.setPropertyValue("foreground_color", color);
|
||||
|
||||
var tooltip = PVUtil.getString(triggerPV);
|
||||
widget.setPropertyValue("tooltip", tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
/**
|
||||
* @file JAEPICSCAInput.cpp
|
||||
* @brief Source file for class JAEPICSCAInput
|
||||
* @date 20/04/2017
|
||||
* @author Andre Neto
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JAEPICSCAInput (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "JAEPICSCAInput.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "MemoryMapInputBroker.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
namespace MARTe {
|
||||
/**
|
||||
* @brief Callback function for the ca_create_subscription. Single point of access which
|
||||
* delegates the events to the corresponding JAEPICSPV instance.
|
||||
*/
|
||||
static FastPollingMutexSem eventCallbackFastMux;
|
||||
/*lint -e{1746} function must match required prototype and thus cannot be changed to constant reference.*/
|
||||
void JAEPICSCAInputEventCallback(struct event_handler_args const args) {
|
||||
(void) eventCallbackFastMux.FastLock();
|
||||
PVWrapper *pv = static_cast<PVWrapper *>(args.usr);
|
||||
if (pv != NULL_PTR(PVWrapper *)) {
|
||||
(void) MemoryOperationsHelper::Copy(pv->memory, args.dbr, pv->memorySize);
|
||||
}
|
||||
eventCallbackFastMux.FastUnLock();
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
namespace MARTe {
|
||||
JAEPICSCAInput::JAEPICSCAInput() :
|
||||
DataSourceI(), EmbeddedServiceMethodBinderI(), executor(*this) {
|
||||
pvs = NULL_PTR(PVWrapper *);
|
||||
stackSize = THREADS_DEFAULT_STACKSIZE * 4u;
|
||||
cpuMask = 0xffu;
|
||||
eventCallbackFastMux.Create();
|
||||
}
|
||||
|
||||
/*lint -e{1551} must stop the SingleThreadService in the destructor.*/
|
||||
JAEPICSCAInput::~JAEPICSCAInput() {
|
||||
if (!executor.Stop()) {
|
||||
if (!executor.Stop()) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "Could not stop SingleThreadService.");
|
||||
}
|
||||
}
|
||||
(void) eventCallbackFastMux.FastLock();
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
uint32 n;
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
if (pvs[n].memory != NULL_PTR(void *)) {
|
||||
GlobalObjectsDatabase::Instance()->GetStandardHeap()->Free(pvs[n].memory);
|
||||
}
|
||||
}
|
||||
delete[] pvs;
|
||||
}
|
||||
eventCallbackFastMux.FastUnLock();
|
||||
}
|
||||
|
||||
bool JAEPICSCAInput::Initialise(StructuredDataI & data) {
|
||||
bool ok = DataSourceI::Initialise(data);
|
||||
if (ok) {
|
||||
if (!data.Read("CPUs", cpuMask)) {
|
||||
REPORT_ERROR(ErrorManagement::Information, "No CPUs defined. Using default = %d", cpuMask);
|
||||
}
|
||||
if (!data.Read("StackSize", stackSize)) {
|
||||
REPORT_ERROR(ErrorManagement::Information, "No StackSize defined. Using default = %d", stackSize);
|
||||
}
|
||||
executor.SetStackSize(stackSize);
|
||||
executor.SetCPUMask(cpuMask);
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.MoveRelative("Signals");
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Could not move to the Signals section");
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Copy(originalSignalInformation);
|
||||
}
|
||||
if (ok) {
|
||||
ok = originalSignalInformation.MoveToRoot();
|
||||
}
|
||||
//Do not allow to add signals in run-time
|
||||
if (ok) {
|
||||
ok = signalsDatabase.MoveRelative("Signals");
|
||||
}
|
||||
if (ok) {
|
||||
ok = signalsDatabase.Write("Locked", 1u);
|
||||
}
|
||||
if (ok) {
|
||||
ok = signalsDatabase.MoveToAncestor(1u);
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.MoveToAncestor(1u);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAEPICSCAInput::SetConfiguredDatabase(StructuredDataI & data) {
|
||||
bool ok = DataSourceI::SetConfiguredDatabase(data);
|
||||
//Check the signal index of the timing signal.
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (ok) {
|
||||
ok = (nOfSignals > 0u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "At least one signal shall be defined");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
//Do not allow samples
|
||||
uint32 functionNumberOfSignals = 0u;
|
||||
uint32 n;
|
||||
if (GetFunctionNumberOfSignals(InputSignals, 0u, functionNumberOfSignals)) {
|
||||
for (n = 0u; (n < functionNumberOfSignals) && (ok); n++) {
|
||||
uint32 nSamples;
|
||||
ok = GetFunctionSignalSamples(InputSignals, 0u, n, nSamples);
|
||||
if (ok) {
|
||||
ok = (nSamples == 1u);
|
||||
}
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "The number of samples shall be exactly 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
pvs = new PVWrapper[nOfSignals];
|
||||
uint32 n;
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
pvs[n].memory = NULL_PTR(void *);
|
||||
}
|
||||
for (n = 0u; (n < nOfSignals) && (ok); n++) {
|
||||
//Note that the RealTimeApplicationConfigurationBuilder is allowed to change the order of the signals w.r.t. to the originalSignalInformation
|
||||
StreamString orderedSignalName;
|
||||
ok = GetSignalName(n, orderedSignalName);
|
||||
if (ok) {
|
||||
//Have to mix and match between the original setting of the DataSource signal
|
||||
//and the ones which are later added by the RealTimeApplicationConfigurationBuilder
|
||||
ok = originalSignalInformation.MoveRelative(orderedSignalName.Buffer());
|
||||
}
|
||||
StreamString pvName;
|
||||
if (ok) {
|
||||
ok = originalSignalInformation.Read("PVName", pvName);
|
||||
if (!ok) {
|
||||
uint32 nn = n;
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "No PVName specified for signal at index %d", nn);
|
||||
}
|
||||
}
|
||||
TypeDescriptor td = GetSignalType(n);
|
||||
if (ok) {
|
||||
(void) StringHelper::CopyN(&pvs[n].pvName[0], pvName.Buffer(), PV_NAME_MAX_SIZE);
|
||||
if (td == CharString) {
|
||||
pvs[n].pvType = DBR_STRING;
|
||||
}
|
||||
else if (td == Character8Bit) {
|
||||
pvs[n].pvType = DBR_STRING;
|
||||
}
|
||||
else if (td == SignedInteger8Bit) {
|
||||
pvs[n].pvType = DBR_CHAR;
|
||||
}
|
||||
else if (td == UnsignedInteger8Bit) {
|
||||
pvs[n].pvType = DBR_CHAR;
|
||||
}
|
||||
else if (td == SignedInteger16Bit) {
|
||||
pvs[n].pvType = DBR_SHORT;
|
||||
}
|
||||
else if (td == UnsignedInteger16Bit) {
|
||||
pvs[n].pvType = DBR_SHORT;
|
||||
}
|
||||
else if (td == SignedInteger32Bit) {
|
||||
pvs[n].pvType = DBR_LONG;
|
||||
}
|
||||
else if (td == UnsignedInteger32Bit) {
|
||||
pvs[n].pvType = DBR_LONG;
|
||||
}
|
||||
else if (td == Float32Bit) {
|
||||
pvs[n].pvType = DBR_FLOAT;
|
||||
}
|
||||
else if (td == Float64Bit) {
|
||||
pvs[n].pvType = DBR_DOUBLE;
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Type %s is not supported", TypeDescriptor::GetTypeNameFromTypeDescriptor(td));
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
uint32 numberOfElements = 1u;
|
||||
if (ok) {
|
||||
ok = GetSignalNumberOfElements(n, numberOfElements);
|
||||
}
|
||||
if (ok) {
|
||||
if (pvs[n].pvType == DBR_STRING) {
|
||||
ok = (numberOfElements == 40u);
|
||||
}
|
||||
if (!ok) {
|
||||
//Could support arrays of strings with multiples of char8[40]
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Strings shall be defined with 40 elements char8[40]. Arrays of strings are not currently supported");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
pvs[n].numberOfElements = numberOfElements;
|
||||
}
|
||||
if (ok) {
|
||||
pvs[n].memorySize = td.numberOfBits;
|
||||
pvs[n].memorySize /= 8u;
|
||||
pvs[n].memorySize *= numberOfElements;
|
||||
pvs[n].memory = GlobalObjectsDatabase::Instance()->GetStandardHeap()->Malloc(pvs[n].memorySize);
|
||||
ok = originalSignalInformation.MoveToAncestor(1u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
ok = (executor.Start() == ErrorManagement::NoError);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAEPICSCAInput::AllocateMemory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAInput::GetNumberOfMemoryBuffers() {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: The signalAddress is independent of the bufferIdx.*/
|
||||
bool JAEPICSCAInput::GetSignalMemoryBuffer(const uint32 signalIdx, const uint32 bufferIdx, void*& signalAddress) {
|
||||
bool ok = (pvs != NULL_PTR(PVWrapper *));
|
||||
if (ok) {
|
||||
ok = (signalIdx < GetNumberOfSignals());
|
||||
}
|
||||
if (ok) {
|
||||
//lint -e{613} pvs cannot as otherwise ok would be false
|
||||
signalAddress = pvs[signalIdx].memory;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: The brokerName only depends on the direction */
|
||||
const char8* JAEPICSCAInput::GetBrokerName(StructuredDataI& data, const SignalDirection direction) {
|
||||
const char8* brokerName = "";
|
||||
if (direction == InputSignals) {
|
||||
brokerName = "MemoryMapInputBroker";
|
||||
}
|
||||
return brokerName;
|
||||
}
|
||||
|
||||
bool JAEPICSCAInput::GetInputBrokers(ReferenceContainer& inputBrokers, const char8* const functionName, void* const gamMemPtr) {
|
||||
ReferenceT<MemoryMapInputBroker> broker("MemoryMapInputBroker");
|
||||
bool ok = broker->Init(InputSignals, *this, functionName, gamMemPtr);
|
||||
if (ok) {
|
||||
ok = inputBrokers.Insert(broker);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: OutputBrokers are not supported. Function returns false irrespectively of the parameters.*/
|
||||
bool JAEPICSCAInput::GetOutputBrokers(ReferenceContainer& outputBrokers, const char8* const functionName, void* const gamMemPtr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: NOOP at StateChange, independently of the function parameters.*/
|
||||
bool JAEPICSCAInput::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ErrorManagement::ErrorType JAEPICSCAInput::Execute(ExecutionInfo& info) {
|
||||
ErrorManagement::ErrorType err = ErrorManagement::NoError;
|
||||
if (info.GetStage() == ExecutionInfo::StartupStage) {
|
||||
(void) eventCallbackFastMux.FastLock();
|
||||
/*lint -e{9130} -e{835} -e{845} -e{747} Several false positives. lint is getting confused here for some reason.*/
|
||||
if (ca_context_create(ca_enable_preemptive_callback) != ECA_NORMAL) {
|
||||
err = ErrorManagement::FatalError;
|
||||
REPORT_ERROR(err, "ca_enable_preemptive_callback failed");
|
||||
}
|
||||
|
||||
uint32 n;
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
/*lint -e{9130} -e{835} -e{845} -e{747} Several false positives. lint is getting confused here for some reason.*/
|
||||
if (ca_create_channel(&pvs[n].pvName[0], NULL_PTR(caCh *), NULL_PTR(void *), 20u, &pvs[n].pvChid) != ECA_NORMAL) {
|
||||
err = ErrorManagement::FatalError;
|
||||
REPORT_ERROR(err, "ca_create_channel failed for PV with name %s", pvs[n].pvName);
|
||||
}
|
||||
if (err.ErrorsCleared()) {
|
||||
/*lint -e{9130} -e{835} -e{845} -e{747} Several false positives. lint is getting confused here for some reason.*/
|
||||
if (ca_create_subscription(pvs[n].pvType, pvs[n].numberOfElements, pvs[n].pvChid, DBE_VALUE, &JAEPICSCAInputEventCallback, &pvs[n],
|
||||
&pvs[n].pvEvid) != ECA_NORMAL) {
|
||||
err = ErrorManagement::FatalError;
|
||||
REPORT_ERROR(err, "ca_create_subscription failed for PV %s", pvs[n].pvName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
eventCallbackFastMux.FastUnLock();
|
||||
}
|
||||
else if (info.GetStage() != ExecutionInfo::BadTerminationStage) {
|
||||
Sleep::Sec(1.0F);
|
||||
}
|
||||
else {
|
||||
(void) eventCallbackFastMux.FastLock();
|
||||
uint32 n;
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
(void) ca_clear_subscription(pvs[n].pvEvid);
|
||||
(void) ca_clear_event(pvs[n].pvEvid);
|
||||
(void) ca_clear_channel(pvs[n].pvChid);
|
||||
}
|
||||
}
|
||||
ca_detach_context();
|
||||
ca_context_destroy();
|
||||
eventCallbackFastMux.FastUnLock();
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAInput::GetStackSize() const {
|
||||
return stackSize;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAInput::GetCPUMask() const {
|
||||
return cpuMask;
|
||||
}
|
||||
|
||||
bool JAEPICSCAInput::Synchronise() {
|
||||
return false;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JAEPICSCAInput, "1.0")
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="GCPS" description="ITER-EC-GN-P01-GAF-GCPS" enabled="true" opi_file="./mimics/ITER-EC-GN-P01-GAF-GCPS_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-P01-GAF-GCPS" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-P01/EC-GN-P01-GAF/EC-GN-P01-GAF-GCPS" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Last SDD Generation: Tue May 13 15:51:08 UTC 2025
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JABitSumGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JABitSumGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JABitSumGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,53 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=NI6528.x
|
||||
|
||||
PACKAGE=DataSources
|
||||
|
||||
ROOT_DIR=../../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(CODAC_ROOT)/include/
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/NI6528$(LIBEXT) \
|
||||
$(BUILD_DIR)/NI6528$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
/**
|
||||
* @file JABitSumGAM.cpp
|
||||
* @brief Source file for class JABitSumGAM
|
||||
* @date Feb 10, 2020
|
||||
* @author kuchida
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JABitSumGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "JABitSumGAM.h"
|
||||
|
||||
#include "AdvancedErrorManagement.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
JABitSumGAM::JABitSumGAM() {
|
||||
//Input signals.
|
||||
input0 = NULL_PTR(MARTe::uint32 *);
|
||||
input1 = NULL_PTR(MARTe::uint32 *);
|
||||
input2 = NULL_PTR(MARTe::uint32 *);
|
||||
input3 = NULL_PTR(MARTe::uint32 *);
|
||||
input4 = NULL_PTR(MARTe::uint32 *);
|
||||
input5 = NULL_PTR(MARTe::uint32 *);
|
||||
input6 = NULL_PTR(MARTe::uint32 *);
|
||||
input7 = NULL_PTR(MARTe::uint32 *);
|
||||
|
||||
//Output signals.
|
||||
output= NULL_PTR(MARTe::uint8 *);
|
||||
}
|
||||
|
||||
JABitSumGAM::~JABitSumGAM() {
|
||||
}
|
||||
|
||||
bool JABitSumGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
//GAM parameters are initialized.
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
if (!ok){
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "ParametersError in init.");
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JABitSumGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
//This method changes internal parameter based on next realtime state.
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JABitSumGAM::Setup() {
|
||||
// Setup memory for input/output signals on the GAM.
|
||||
using namespace MARTe;
|
||||
bool ok = (numberOfInputSignals == 8u);
|
||||
if (ok) {
|
||||
ok = (numberOfOutputSignals == 1u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "One output signal shall be defined");
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Eight input signals shall be defined");
|
||||
}
|
||||
// Do type check for input signals.
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfInputSignals; c++) {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, c);
|
||||
ok = (inputType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32.", signalName.Buffer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// Do type check for output signals
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfOutputSignals; c++) {
|
||||
TypeDescriptor outputType = GetSignalType(OutputSignals, c);
|
||||
ok = (outputType == UnsignedInteger8Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint8.", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do type cast.
|
||||
if (ok) {
|
||||
input0 = reinterpret_cast<uint32 *>(GetInputSignalMemory(0));
|
||||
input1 = reinterpret_cast<uint32 *>(GetInputSignalMemory(1));
|
||||
input2 = reinterpret_cast<uint32 *>(GetInputSignalMemory(2));
|
||||
input3 = reinterpret_cast<uint32 *>(GetInputSignalMemory(3));
|
||||
input4 = reinterpret_cast<uint32 *>(GetInputSignalMemory(4));
|
||||
input5 = reinterpret_cast<uint32 *>(GetInputSignalMemory(5));
|
||||
input6 = reinterpret_cast<uint32 *>(GetInputSignalMemory(6));
|
||||
input7 = reinterpret_cast<uint32 *>(GetInputSignalMemory(7));
|
||||
|
||||
output = reinterpret_cast<uint8 *>(GetOutputSignalMemory(0));
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JABitSumGAM::Execute() {
|
||||
// This method is called every realtime state thread cycle.
|
||||
using namespace MARTe;
|
||||
*output = *input0 + *input1*2 + *input2*4 + *input3*8 + *input4*16 +
|
||||
*input5*32 + *input6*64 + *input7*128;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JABitSumGAM, "1.0")
|
||||
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JASourceChoiseGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JASourceChoiseGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JASourceChoiseGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,27 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuName=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
phyName=row[1]
|
||||
cuName=row[0];
|
||||
# change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if cuName.startswith('P'):
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-PLCDetails.opi", 1, macroInput)
|
||||
else:
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CubiclePLCDetails.opi", 0, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="CCPS" description="ITER-EC-GN-P01-GAF-CCPS" enabled="true" opi_file="./mimics/ITER-EC-GN-P01-GAF-CCPS_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-P01-GAF-CCPS" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-P01/EC-GN-P01-GAF/EC-GN-P01-GAF-CCPS" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="HWCF" description="ITER-EC-GN-HWCF" enabled="true" opi_file="./mimics/ITER-EC-GN-HWCF_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-HWCF" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-HWCF" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuIndex=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
cuIndex=row[0];
|
||||
phyName=row[1]
|
||||
# change $(CU_INDEX) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CubicleDetails.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,6 @@
|
||||
############################################################################
|
||||
## SDD provided PLC or fast controller driver post configuration
|
||||
############################################################################
|
||||
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
@@ -0,0 +1,58 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAEPICSCAOutput.x JAEPICSCAInput.x
|
||||
|
||||
PACKAGE=DataSources
|
||||
|
||||
ROOT_DIR=../../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(EPICS_BASE)/include/
|
||||
INCLUDES += -I$(EPICS_BASE)/include/os/Linux/
|
||||
INCLUDES += -I$(EPICS_BASE)/include/compiler/gcc/
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L5GAMs
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAEPICSCA$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAEPICSCA$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include depends.$(TARGET)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
table = widget.getTable()
|
||||
func = display.getPropertyValue("name")
|
||||
|
||||
i = 0
|
||||
row = 0
|
||||
col = 3
|
||||
# ConsoleUtil.writeInfo("Trigger PV : " + triggerPV.getName());
|
||||
while triggerPV != pvs[i]:
|
||||
# ConsoleUtil.writeInfo("pvs[i] : " + pvs[i].getName());
|
||||
if col == 5:
|
||||
if "PLC-IOCHLTS" in pvs[i+1].getName():
|
||||
col = col+1
|
||||
else:
|
||||
col = 3
|
||||
row = row+1
|
||||
elif col == 3:
|
||||
if "-SYSHLTS" in pvs[i+1].getName() or "-HLTS" in pvs[i+1].getName():
|
||||
col =3
|
||||
row = row+1
|
||||
elif "-IOCHLTS" in pvs[i+1].getName():
|
||||
if "CORE-IOCHLTS" in pvs[i+1].getName():
|
||||
col = 4
|
||||
else:
|
||||
col = 5
|
||||
else:
|
||||
col += 1
|
||||
if col > 5:
|
||||
row += 1
|
||||
col = 3
|
||||
else:
|
||||
col += 1
|
||||
if col > 6:
|
||||
row += 1
|
||||
col = 3
|
||||
i += 1
|
||||
|
||||
table.setCellText(row, col, PVUtil.getString(triggerPV))
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(row, col, color)
|
||||
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JASDNRTStateMachineGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JASDNRTStateMachineGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JASDNRTStateMachineGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,25 @@
|
||||
#======================================================================
|
||||
# Loading DBs
|
||||
#======================================================================
|
||||
cd $(TOP)/db
|
||||
|
||||
|
||||
#======================================================================
|
||||
# Loading Substitution Files
|
||||
#======================================================================
|
||||
cd $(TOP)/iocBoot/$(IOC)
|
||||
|
||||
|
||||
#======================================================================
|
||||
# PLC Communication Monitoring PVs DB Loading
|
||||
#======================================================================
|
||||
cd $(EPICS_ROOT)/db
|
||||
|
||||
|
||||
#======================================================================
|
||||
# IOC Monitor
|
||||
#======================================================================
|
||||
cd $(EPICS_ROOT)/db
|
||||
#dbLoadRecords("iocmon.db","CBS=EC-GN-SYSM, CTRLTYPE=À¹Z°Ï, IDX=0, IOCTYPE=CUB, PP=, PPPP=, NNNN=, TTT=")
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
@@ -0,0 +1,52 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAModeControlGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAModeControlGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAModeControlGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAConditionalSignalUpdateGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAConditionalSignalUpdateGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAConditionalSignalUpdateGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
#======================================================================
|
||||
# Loading DBs
|
||||
#======================================================================
|
||||
cd $(TOP)/db
|
||||
|
||||
|
||||
#======================================================================
|
||||
# Loading Substitution Files
|
||||
#======================================================================
|
||||
cd $(TOP)/iocBoot/$(IOC)
|
||||
|
||||
|
||||
#======================================================================
|
||||
# PLC Communication Monitoring PVs DB Loading
|
||||
#======================================================================
|
||||
cd $(EPICS_ROOT)/db
|
||||
|
||||
|
||||
#======================================================================
|
||||
# IOC Monitor
|
||||
#======================================================================
|
||||
cd $(EPICS_ROOT)/db
|
||||
#dbLoadRecords("iocmon.db","CBS=EC-GN-SYSM, CTRLTYPE=À GäY, IDX=0, IOCTYPE=CUB, PP=, PPPP=, NNNN=, TTT=")
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
@@ -0,0 +1,42 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
SPB = RandomDataSource.x NI6528.x JAEPICSCA.x
|
||||
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) check-env
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
check-env:
|
||||
ifndef MARTe2_DIR
|
||||
$(error MARTe2_DIR is undefined)
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAPreProgrammedGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAPreProgrammedGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAPreProgrammedGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
/**
|
||||
* @file JAWFRecordGAM.cpp
|
||||
* @brief Source file for class JAWFRecordGAM
|
||||
* @date Jan, 2019
|
||||
* @author rhari
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JAWFRecordGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "JAWFRecordGAM.h"
|
||||
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "CLASSMETHODREGISTER.h"
|
||||
#include "File.h"
|
||||
#include "MessageI.h"
|
||||
#include "RegisteredMethodsMessageFilter.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
// How often output signals are updated.
|
||||
const MARTe::uint32 cycleMs = 10u;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
JAWFRecordGAM::JAWFRecordGAM() :
|
||||
GAM() {
|
||||
filenameSignalIndex = 0u;
|
||||
timeSignal = NULL_PTR(MARTe::int32 *);
|
||||
loadTriggerSignal = NULL_PTR(MARTe::uint32 *);
|
||||
valueSignals = NULL_PTR(MARTe::float32 **);
|
||||
maxElements = 0u;
|
||||
readOnce = true;
|
||||
}
|
||||
|
||||
JAWFRecordGAM::~JAWFRecordGAM() {
|
||||
if (valueSignals != NULL_PTR(MARTe::float32 **)) {
|
||||
delete[] valueSignals;
|
||||
}
|
||||
}
|
||||
|
||||
bool JAWFRecordGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
if (ok) {
|
||||
ok = data.Read("Directory", directory);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The Directory shall be specified");
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAWFRecordGAM::Setup() {
|
||||
using namespace MARTe;
|
||||
bool ok = (numberOfInputSignals == 2u);
|
||||
if (ok) {
|
||||
ok = (numberOfOutputSignals > 1u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "At least two output signal shall be defined");
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Two input signal with the filename and file load trigger shall be defined");
|
||||
}
|
||||
if (ok) {
|
||||
StreamString signalName = "Filename";
|
||||
ok = GetSignalIndex(InputSignals, filenameSignalIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Filename input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, filenameSignalIndex);
|
||||
ok = (inputType == CharString);
|
||||
if (!ok) {
|
||||
ok = (inputType == Character8Bit);
|
||||
}
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, filenameSignalIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as string", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
StreamString signalName = "CSV_LOAD";
|
||||
uint32 loadSignalIndex;
|
||||
ok = GetSignalIndex(InputSignals, loadSignalIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "CSV_LOAD input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, loadSignalIndex);
|
||||
ok = (inputType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, loadSignalIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32", signalName.Buffer());
|
||||
} else {
|
||||
loadTriggerSignal = reinterpret_cast<uint32 *>(GetInputSignalMemory(loadSignalIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
TypeDescriptor timeType = GetSignalType(OutputSignals, 0);
|
||||
|
||||
ok = (timeType == SignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, 0, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as int32", signalName.Buffer());
|
||||
}
|
||||
|
||||
uint32 i;
|
||||
for (i = 1u; (i < numberOfOutputSignals) && (ok); i++) {
|
||||
TypeDescriptor outputType = GetSignalType(OutputSignals, i);
|
||||
ok = (outputType == Float32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(OutputSignals, i, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as float32", signalName.Buffer());
|
||||
}
|
||||
else {
|
||||
uint32 dimentionsCount;
|
||||
ok = GetSignalNumberOfDimensions(OutputSignals, 0u, dimentionsCount);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Output signals shall have 1 dimension.");
|
||||
}
|
||||
else {
|
||||
uint32 elementsCount;
|
||||
ok = GetSignalNumberOfElements(OutputSignals, 0u, elementsCount);
|
||||
if (maxElements == 0) {
|
||||
maxElements = elementsCount;
|
||||
}
|
||||
else {
|
||||
ok = (maxElements == elementsCount);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Output signals shall have consistent number of elements.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
valueSignals = new float32*[numberOfOutputSignals - 1u];
|
||||
uint32 i;
|
||||
for (i = 1u; i < numberOfOutputSignals; i++) {
|
||||
valueSignals[i - 1] = reinterpret_cast<float32 *>(GetOutputSignalMemory(i));
|
||||
}
|
||||
timeSignal = reinterpret_cast<int32 *>(GetOutputSignalMemory(0));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAWFRecordGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
if (strcmp(nextStateName, "WaitReady") == 0) {
|
||||
// Reset read once flag when reentering WaitReady state.
|
||||
readOnce = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void JAWFRecordGAM::LoadFile() {
|
||||
using namespace MARTe;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
const char8 * const filenameSignal = reinterpret_cast<const char8 * const >(GetInputSignalMemory(filenameSignalIndex));
|
||||
StreamString filename = directory;
|
||||
filename += DIRECTORY_SEPARATOR;
|
||||
filename += filenameSignal;
|
||||
REPORT_ERROR(ErrorManagement::Debug, "Opening file %s", filename.Buffer());
|
||||
|
||||
File f;
|
||||
ok = f.Open(filename.Buffer(), BasicFile::ACCESS_MODE_R);
|
||||
|
||||
uint32 numberOfPreProgrammedTimeRows = 0u;
|
||||
int32 *preProgrammedTime;
|
||||
float32 **preProgrammedValues;
|
||||
uint32 numberOfPreProgrammedValues = 0u;
|
||||
|
||||
if (ok) {
|
||||
StreamString tokenLine;
|
||||
while (f.GetLine(tokenLine)) {
|
||||
if (tokenLine[0] != '#') {
|
||||
numberOfPreProgrammedTimeRows++;
|
||||
}
|
||||
tokenLine = "";
|
||||
}
|
||||
f.Seek(0);
|
||||
uint32 t = 0u;
|
||||
tokenLine = "";
|
||||
while ((ok) && (f.GetLine(tokenLine))) {
|
||||
if (tokenLine[0] == '#') {
|
||||
tokenLine = "";
|
||||
continue;
|
||||
}
|
||||
if (numberOfPreProgrammedValues == 0) {
|
||||
StreamString token;
|
||||
char8 ignored;
|
||||
tokenLine.Seek(0);
|
||||
while (tokenLine.GetToken(token, ",", ignored)) {
|
||||
numberOfPreProgrammedValues++;
|
||||
token = "";
|
||||
}
|
||||
ok = numberOfPreProgrammedValues == numberOfOutputSignals;
|
||||
// Remove time from pre-programmed values count.
|
||||
numberOfPreProgrammedValues -= 1u;
|
||||
if (ok) {
|
||||
preProgrammedTime = new int32[maxElements];
|
||||
memset(preProgrammedTime, 0, maxElements * sizeof(int32));
|
||||
preProgrammedValues = new float32*[numberOfPreProgrammedValues];
|
||||
uint32 j;
|
||||
for (j = 0u; j < numberOfPreProgrammedValues; j++) {
|
||||
preProgrammedValues[j] = new float32[maxElements];
|
||||
memset(preProgrammedValues[j], 0, maxElements * sizeof(float32));
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Number of columns in csv file (%d) is not consistent with the number of output signals (%d)", numberOfPreProgrammedValues,
|
||||
numberOfOutputSignals - 1u);
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
StreamString token;
|
||||
char8 ignored;
|
||||
tokenLine.Seek(0);
|
||||
uint32 idx = 0u;
|
||||
while (tokenLine.GetToken(token, ",", ignored)) {
|
||||
if (idx == 0u) {
|
||||
preProgrammedTime[t] = atoi(token.Buffer());
|
||||
}
|
||||
else {
|
||||
ok = ((idx - 1) < numberOfPreProgrammedValues);
|
||||
if (ok) {
|
||||
preProgrammedValues[idx - 1][t] = static_cast<float32>(atof(token.Buffer()));
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "Number of columns in csv file is not consistent with the number of output signals in line %d", t);
|
||||
}
|
||||
}
|
||||
token = "";
|
||||
idx++;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
tokenLine = "";
|
||||
}
|
||||
f.Close();
|
||||
} else {
|
||||
REPORT_ERROR(ErrorManagement::Debug, "Cannot open the file %s", filename.Buffer());
|
||||
return;
|
||||
}
|
||||
if (numberOfPreProgrammedTimeRows > maxElements) {
|
||||
REPORT_ERROR(ErrorManagement::Warning, "Only %d (out of %d) of pre-programmed values will be written to waveform record.",
|
||||
maxElements, numberOfPreProgrammedTimeRows);
|
||||
}
|
||||
ok = MemoryOperationsHelper::Copy(timeSignal, preProgrammedTime, maxElements * sizeof(int32));
|
||||
uint32 i;
|
||||
for (i = 0u; (i < numberOfPreProgrammedValues) && (ok); ++i) {
|
||||
ok = MemoryOperationsHelper::Copy(valueSignals[i], preProgrammedValues[i], maxElements * sizeof(float32));
|
||||
}
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::Warning, "Failed to write data to waveform record.");
|
||||
}
|
||||
|
||||
if (preProgrammedValues != NULL_PTR(float32 **)) {
|
||||
uint32 i;
|
||||
for (i = 0u; i < numberOfPreProgrammedValues; i++) {
|
||||
delete preProgrammedValues[i];
|
||||
}
|
||||
delete[] preProgrammedValues;
|
||||
}
|
||||
if (preProgrammedTime != NULL_PTR(int32 *)) {
|
||||
delete[] preProgrammedTime;
|
||||
}
|
||||
}
|
||||
|
||||
bool JAWFRecordGAM::Execute() {
|
||||
if (*loadTriggerSignal == 1u) {
|
||||
if (readOnce) {
|
||||
LoadFile();
|
||||
readOnce = false;
|
||||
}
|
||||
} else {
|
||||
// Reset read once flag when loadTriggerSignal is reset.
|
||||
readOnce = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JAWFRecordGAM, "1.0")
|
||||
@@ -0,0 +1,31 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
|
||||
var selectedrow= table.getSelection();
|
||||
var cuIndex=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
var loc=selectedrow[0][5];
|
||||
var pppp=selectedrow[0][6];
|
||||
var pp=selectedrow[0][7];
|
||||
var nnnn=selectedrow[0][8];
|
||||
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("PPPP", pppp)
|
||||
macroInput.put("PP", pp)
|
||||
macroInput.put("NNNN", nnnn)
|
||||
macroInput.put("CUB_LOC", "Location: "+loc)
|
||||
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CubicleDetails.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,375 @@
|
||||
/**
|
||||
* @file EPICSCAOutput.cpp
|
||||
* @brief Source file for class EPICSCAOutput
|
||||
* @date 20/04/2017
|
||||
* @author Andre Neto
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class EPICSCAOutput (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "JAEPICSCAOutput.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "MemoryMapAsyncOutputBroker.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
namespace MARTe {
|
||||
JAEPICSCAOutput::JAEPICSCAOutput() :
|
||||
DataSourceI() {
|
||||
pvs = NULL_PTR(PVWrapper *);
|
||||
stackSize = THREADS_DEFAULT_STACKSIZE * 4u;
|
||||
cpuMask = 0xffu;
|
||||
numberOfBuffers = 0u;
|
||||
ignoreBufferOverrun = 1u;
|
||||
threadContextSet = false;
|
||||
}
|
||||
|
||||
/*lint -e{1551} must free the memory allocated to the different PVs.*/
|
||||
JAEPICSCAOutput::~JAEPICSCAOutput() {
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
uint32 n;
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
if (pvs[n].pvChid != NULL_PTR(chid)) {
|
||||
(void) ca_clear_channel(pvs[n].pvChid);
|
||||
}
|
||||
if (pvs[n].memory != NULL_PTR(void *)) {
|
||||
GlobalObjectsDatabase::Instance()->GetStandardHeap()->Free(pvs[n].memory);
|
||||
GlobalObjectsDatabase::Instance()->GetStandardHeap()->Free(pvs[n].previousValue);
|
||||
}
|
||||
}
|
||||
delete[] pvs;
|
||||
}
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::Initialise(StructuredDataI & data) {
|
||||
bool ok = DataSourceI::Initialise(data);
|
||||
if (ok) {
|
||||
ok = data.Read("NumberOfBuffers", numberOfBuffers);
|
||||
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "NumberOfBuffers shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
if (!data.Read("CPUs", cpuMask)) {
|
||||
REPORT_ERROR(ErrorManagement::Information, "No CPUs defined. Using default = %d", cpuMask);
|
||||
}
|
||||
if (!data.Read("StackSize", stackSize)) {
|
||||
REPORT_ERROR(ErrorManagement::Information, "No StackSize defined. Using default = %d", stackSize);
|
||||
}
|
||||
if (!data.Read("IgnoreBufferOverrun", ignoreBufferOverrun)) {
|
||||
REPORT_ERROR(ErrorManagement::Information, "No IgnoreBufferOverrun defined. Using default = %d", ignoreBufferOverrun);
|
||||
}
|
||||
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.MoveRelative("Signals");
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Could not move to the Signals section");
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Copy(originalSignalInformation);
|
||||
}
|
||||
if (ok) {
|
||||
ok = originalSignalInformation.MoveToRoot();
|
||||
}
|
||||
//Do not allow to add signals in run-time
|
||||
if (ok) {
|
||||
ok = signalsDatabase.MoveRelative("Signals");
|
||||
}
|
||||
if (ok) {
|
||||
ok = signalsDatabase.Write("Locked", 1u);
|
||||
}
|
||||
if (ok) {
|
||||
ok = signalsDatabase.MoveToAncestor(1u);
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.MoveToAncestor(1u);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::SetConfiguredDatabase(StructuredDataI & data) {
|
||||
bool ok = DataSourceI::SetConfiguredDatabase(data);
|
||||
//Check the signal index of the timing signal.
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (ok) {
|
||||
ok = (nOfSignals > 0u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "At least one signal shall be defined");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
//Do not allow samples
|
||||
uint32 functionNumberOfSignals = 0u;
|
||||
uint32 n;
|
||||
if (GetFunctionNumberOfSignals(OutputSignals, 0u, functionNumberOfSignals)) {
|
||||
for (n = 0u; (n < functionNumberOfSignals) && (ok); n++) {
|
||||
uint32 nSamples;
|
||||
ok = GetFunctionSignalSamples(OutputSignals, 0u, n, nSamples);
|
||||
if (ok) {
|
||||
ok = (nSamples == 1u);
|
||||
}
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "The number of samples shall be exactly 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Only one and one GAM allowed to interact with this DataSourceI
|
||||
if (ok) {
|
||||
ok = (GetNumberOfFunctions() == 1u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Exactly one Function allowed to interact with this DataSourceI");
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
pvs = new PVWrapper[nOfSignals];
|
||||
uint32 n;
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
pvs[n].memory = NULL_PTR(void *); //value to write PV
|
||||
pvs[n].previousValue = NULL_PTR(void *); //written value
|
||||
pvs[n].pvChid = NULL_PTR(chid);
|
||||
|
||||
}
|
||||
for (n = 0u; (n < nOfSignals) && (ok); n++) {
|
||||
//Note that the RealTimeApplicationConfigurationBuilder is allowed to change the order of the signals w.r.t. to the originalSignalInformation
|
||||
StreamString orderedSignalName;
|
||||
ok = GetSignalName(n, orderedSignalName);
|
||||
if (ok) {
|
||||
//Have to mix and match between the original setting of the DataSource signal
|
||||
//and the ones which are later added by the RealTimeApplicationConfigurationBuilder
|
||||
ok = originalSignalInformation.MoveRelative(orderedSignalName.Buffer());
|
||||
}
|
||||
StreamString pvName;
|
||||
if (ok) {
|
||||
ok = originalSignalInformation.Read("PVName", pvName);
|
||||
if (!ok) {
|
||||
uint32 nn = n;
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "No PVName specified for signal at index %d", nn);
|
||||
}
|
||||
}
|
||||
TypeDescriptor td = GetSignalType(n);
|
||||
|
||||
if (ok) {
|
||||
(void) StringHelper::CopyN(&pvs[n].pvName[0], pvName.Buffer(), PV_NAME_MAX_SIZE);
|
||||
if (td == CharString) {
|
||||
pvs[n].pvType = DBR_STRING;
|
||||
}
|
||||
else if (td == Character8Bit) {
|
||||
pvs[n].pvType = DBR_STRING;
|
||||
}
|
||||
else if (td == SignedInteger8Bit) {
|
||||
pvs[n].pvType = DBR_CHAR;
|
||||
}
|
||||
else if (td == UnsignedInteger8Bit) {
|
||||
pvs[n].pvType = DBR_CHAR;
|
||||
}
|
||||
else if (td == SignedInteger16Bit) {
|
||||
pvs[n].pvType = DBR_SHORT;
|
||||
}
|
||||
else if (td == UnsignedInteger16Bit) {
|
||||
pvs[n].pvType = DBR_SHORT;
|
||||
}
|
||||
else if (td == SignedInteger32Bit) {
|
||||
pvs[n].pvType = DBR_LONG;
|
||||
}
|
||||
else if (td == UnsignedInteger32Bit) {
|
||||
pvs[n].pvType = DBR_LONG;
|
||||
}
|
||||
else if (td == Float32Bit) {
|
||||
pvs[n].pvType = DBR_FLOAT;
|
||||
}
|
||||
else if (td == Float64Bit) {
|
||||
pvs[n].pvType = DBR_DOUBLE;
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Type %s is not supported", TypeDescriptor::GetTypeNameFromTypeDescriptor(td));
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
uint32 numberOfElements = 1u;
|
||||
if (ok) {
|
||||
ok = GetSignalNumberOfElements(n, numberOfElements);
|
||||
}
|
||||
if (ok) {
|
||||
if (pvs[n].pvType == DBR_STRING) {
|
||||
ok = (numberOfElements == 40u);
|
||||
}
|
||||
if (!ok) {
|
||||
//Could support arrays of strings with multiples of char8[40]
|
||||
REPORT_ERROR(ErrorManagement::ParametersError,
|
||||
"Strings shall be defined with 40 elements char8[40]. Arrays of strings are not currently supported");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
pvs[n].numberOfElements = numberOfElements;
|
||||
}
|
||||
if (ok) {
|
||||
pvs[n].memorySize = td.numberOfBits;
|
||||
pvs[n].memorySize /= 8u;
|
||||
pvs[n].memorySize *= numberOfElements;
|
||||
pvs[n].memory = GlobalObjectsDatabase::Instance()->GetStandardHeap()->Malloc(pvs[n].memorySize);
|
||||
pvs[n].previousValue = GlobalObjectsDatabase::Instance()->GetStandardHeap()->Malloc(pvs[n].memorySize);
|
||||
ok = originalSignalInformation.MoveToAncestor(1u);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::AllocateMemory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAOutput::GetNumberOfMemoryBuffers() {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: The signalAddress is independent of the bufferIdx.*/
|
||||
bool JAEPICSCAOutput::GetSignalMemoryBuffer(const uint32 signalIdx, const uint32 bufferIdx, void*& signalAddress) {
|
||||
bool ok = (pvs != NULL_PTR(PVWrapper *));
|
||||
if (ok) {
|
||||
ok = (signalIdx < GetNumberOfSignals());
|
||||
}
|
||||
if (ok) {
|
||||
//lint -e{613} pvs cannot as otherwise ok would be false
|
||||
signalAddress = pvs[signalIdx].memory;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: The brokerName only depends on the direction */
|
||||
const char8* JAEPICSCAOutput::GetBrokerName(StructuredDataI& data, const SignalDirection direction) {
|
||||
const char8* brokerName = "";
|
||||
if (direction == OutputSignals) {
|
||||
brokerName = "MemoryMapAsyncOutputBroker";
|
||||
}
|
||||
return brokerName;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: InputBrokers are not supported. Function returns false irrespectively of the parameters.*/
|
||||
bool JAEPICSCAOutput::GetInputBrokers(ReferenceContainer& inputBrokers, const char8* const functionName, void* const gamMemPtr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::GetOutputBrokers(ReferenceContainer& outputBrokers, const char8* const functionName, void* const gamMemPtr) {
|
||||
ReferenceT<MemoryMapAsyncOutputBroker> broker("MemoryMapAsyncOutputBroker");
|
||||
bool ok = broker->InitWithBufferParameters(OutputSignals, *this, functionName, gamMemPtr, numberOfBuffers, cpuMask, stackSize);
|
||||
if (ok) {
|
||||
ok = outputBrokers.Insert(broker);
|
||||
broker->SetIgnoreBufferOverrun(ignoreBufferOverrun == 1u);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*lint -e{715} [MISRA C++ Rule 0-1-11], [MISRA C++ Rule 0-1-12]. Justification: NOOP at StateChange, independently of the function parameters.*/
|
||||
bool JAEPICSCAOutput::PrepareNextState(const char8* const currentStateName, const char8* const nextStateName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAOutput::GetStackSize() const {
|
||||
return stackSize;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAOutput::GetCPUMask() const {
|
||||
return cpuMask;
|
||||
}
|
||||
|
||||
uint32 JAEPICSCAOutput::GetNumberOfBuffers() const {
|
||||
return numberOfBuffers;
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::Synchronise() {
|
||||
bool ok = true;
|
||||
uint32 n;
|
||||
uint32 nOfSignals = GetNumberOfSignals();
|
||||
if (!threadContextSet) {
|
||||
ok = (ca_context_create(ca_enable_preemptive_callback) == ECA_NORMAL);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "ca_enable_preemptive_callback failed");
|
||||
}
|
||||
threadContextSet = ok;
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
ok = (ca_create_channel(&pvs[n].pvName[0], NULL_PTR(caCh *), NULL_PTR(void *), 20u, &pvs[n].pvChid) == ECA_NORMAL);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "ca_create_channel failed for PV with name %s", pvs[n].pvName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Allow to write event at the first time!
|
||||
if (threadContextSet) {
|
||||
if (pvs != NULL_PTR(PVWrapper *)) {
|
||||
for (n = 0u; (n < nOfSignals); n++) {
|
||||
bool isNewValue = true;
|
||||
if (pvs[n].pvType == DBR_STRING) {
|
||||
if(strcmp((char*)pvs[n].memory,(char*)pvs[n].previousValue)==0){
|
||||
isNewValue = false;
|
||||
continue;
|
||||
}
|
||||
if(isNewValue){
|
||||
ok = (ca_put(pvs[n].pvType, pvs[n].pvChid, pvs[n].memory) == ECA_NORMAL);
|
||||
memcpy(pvs[n].previousValue,pvs[n].memory, pvs[n].numberOfElements);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(memcmp(pvs[n].memory, pvs[n].previousValue, pvs[n].numberOfElements)==0){
|
||||
isNewValue = false;
|
||||
continue;
|
||||
}
|
||||
if(isNewValue){
|
||||
ok = (ca_array_put(pvs[n].pvType, pvs[n].numberOfElements, pvs[n].pvChid, pvs[n].memory) == ECA_NORMAL);
|
||||
memcpy(pvs[n].previousValue, pvs[n].memory, pvs[n].numberOfElements);
|
||||
}
|
||||
}
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::FatalError, "ca_put failed for PV: %s", pvs[n].pvName);
|
||||
}
|
||||
(void) ca_pend_io(0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAEPICSCAOutput::IsIgnoringBufferOverrun() const {
|
||||
return (ignoreBufferOverrun == 1u);
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JAEPICSCAOutput, "1.0")
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
epicsEnvSet("AUTOSAVE_SYSM_PV_PREFIX", "EC-GN-SYSM:PSH0CUB-")
|
||||
epicsEnvSet("IOCSH_PS1", "${IOC}> ")
|
||||
epicsEnvSet("STREAM_PROTOCOL_PATH", "$(TOP)/db:$(EPICS_ROOT)/db")
|
||||
epicsEnvSet("IPPort_priority","0")
|
||||
epicsEnvSet("IPPort_noAutoConnect", "0")
|
||||
epicsEnvSet("IPPort_noProcessEos", "0")
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
def test_standby():
|
||||
"""
|
||||
In the WaitStandby State, simulate PLC STANDBY signal.
|
||||
Turn on FHPS by push auto-on button.
|
||||
Turn on SCM PSs automatically.
|
||||
State transition condition is checked at last.
|
||||
"""
|
||||
print '---------- Start WatiStandby test ----------'
|
||||
print '1. Simulate SELECT signal. State should go to WatiStandby from Disabled.'
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1.SVAL 1', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2 1', shell=True)
|
||||
print 'Enter to continue test'
|
||||
inpval = raw_input()
|
||||
print '2. Set MCPS rampup parameter(target current, sweep rate.)'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-TRG-CURR-SET-MI 4', shell=True) #For A
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-TRG-SWPR-SET 1.69', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-TRG-CURR-SET-MI 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-TRG-SWPR-SET 1.0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-TRG-CURR-SET-MI 4', shell=True) #For B
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-TRG-SWPR-SET 1.69', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-TRG-CURR-SET-MI 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-TRG-SWPR-SET 1.0', shell=True)
|
||||
time.sleep(1)
|
||||
print '3. Simulate STANDBY signal. MCPS, GCPS, FHPS rampup must be started.'
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R.SVAL 1', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R 1', shell=True)
|
||||
print 'Enter to continue test'
|
||||
inpval = raw_input()
|
||||
print '4. Set FHPS rampup parameter and start it.'
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-TAGV 6', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-RU-TIME 60', shell=True) #in second.
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-START 1', shell=True) #in second.
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-TAGV 6', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-RU-TIME 60', shell=True) #in second.
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-START 1', shell=True) #in second.
|
||||
print 'Enter to continue test'
|
||||
inpval = raw_input()
|
||||
print '5. Simulate FHPS, MCPS and GCPS state.'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB.SVAL 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON.SVAL 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON 4', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-ACT-RB.SVAL 3', shell=True) #turn off for GCPS test
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-ACT-RB 3', shell=True) #turn off for GCPS test
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-CURR-MON.SVAL 4', shell=True)#turn off for GCPS test
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-CURR-MON 4', shell=True) #turn off for GCPS test
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-OUTON-RB.SVAL 1', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-OUTON-RB 1', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-MEAS-ACV.SVAL 6', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-MEAS-ACV 6', shell=True)
|
||||
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-ACT-RB.SVAL 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-ACT-RB 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-CURR-MON.SVAL 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-CURR-MON 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-ACT-RB.SVAL 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-ACT-RB 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-CURR-MON.SVAL 4', shell=True)#turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-CURR-MON 4', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-OUTON-RB.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-OUTON-RB 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-MEAS-ACV.SVAL 6', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-MEAS-ACV 6', shell=True)
|
||||
time.sleep(1)
|
||||
print '6. Confirm FHPS and SCM ramp-up complete. The state goes to WaitREADY from WaitStandby.'
|
||||
print '---------- END WaitStandby test ----------'
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @file JASourceChoiseGAM.h
|
||||
* @brief Header file for class JASourceChoiseGAM
|
||||
* @date Mar 04, 2019
|
||||
* @author kuchida
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This header file contains the declaration of the class JASourceChoiseGAM
|
||||
* with all of its public, protected and private members. It may also include
|
||||
* definitions for inline methods which need to be visible to the compiler.
|
||||
*/
|
||||
|
||||
#ifndef GAMS_JASourceChoiseGAM_H_
|
||||
#define GAMS_JASourceChoiseGAM_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "GAM.h"
|
||||
#include <vector>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Class declaration */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
class JASourceChoiseGAM : public MARTe::GAM, public MARTe::StatefulI {
|
||||
public:
|
||||
CLASS_REGISTER_DECLARATION()
|
||||
|
||||
JASourceChoiseGAM();
|
||||
|
||||
virtual ~JASourceChoiseGAM();
|
||||
|
||||
virtual bool Initialise(MARTe::StructuredDataI & data);
|
||||
|
||||
virtual bool Setup();
|
||||
|
||||
virtual bool Execute();
|
||||
|
||||
virtual bool PrepareNextState(const MARTe::char8 * const currentStateName,
|
||||
const MARTe::char8 * const nextStateName);
|
||||
|
||||
private:
|
||||
//The list of possible states
|
||||
//GAM fixed parameters.
|
||||
MARTe::uint32 numberOfPVs;
|
||||
|
||||
// Input signals
|
||||
std::vector<MARTe::uint32 *> inputUInt32;
|
||||
std::vector<MARTe::float32 *> inputFloat32;
|
||||
std::vector<MARTe::uint32 *> choise;
|
||||
|
||||
// Output signals
|
||||
std::vector<MARTe::uint32 *> outputUInt32;
|
||||
std::vector<MARTe::float32 *> outputFloat32;
|
||||
|
||||
// Previous Input value
|
||||
std::vector<MARTe::uint32> prevUInt32;
|
||||
std::vector<MARTe::float32> prevFloat32;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Inline method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* GAMS_JASourceChoiseGAM_H_ */
|
||||
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JARampupGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JARampupGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JARampupGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,103 @@
|
||||
#test configuration file2,,,,,,
|
||||
#Time,MHVPS,BPS,APS,MC,GC,FHPS
|
||||
0,60,45,0,10,10,10
|
||||
10,55,40,-2,9,9,9
|
||||
20,50,35,-4,8,8,8
|
||||
30,45,30,-6,7,7,7
|
||||
40,40,25,-8,6,6,6
|
||||
50,35,20,-10,5,5,5
|
||||
60,30,15,-12,4,4,4
|
||||
70,25,10,-14,3,3,3
|
||||
80,20,5,-16,2,2,2
|
||||
90,15,0,-18,1,1,1
|
||||
100,10,-5,-20,0,0,0
|
||||
110,5,0,-22,1,1,1
|
||||
120,0,5,-20,2,2,2
|
||||
130,-5,10,-18,3,3,3
|
||||
140,0,15,-16,4,4,4
|
||||
150,5,20,-14,5,5,5
|
||||
160,10,25,-12,6,6,6
|
||||
170,15,30,-10,7,7,7
|
||||
180,20,35,-8,8,8,8
|
||||
190,25,40,-6,9,9,9
|
||||
200,30,45,-4,10,10,10
|
||||
210,35,40,-2,9,9,9
|
||||
220,40,35,0,8,8,8
|
||||
230,45,30,-2,7,7,7
|
||||
240,50,25,-4,6,6,6
|
||||
250,55,20,-6,5,5,5
|
||||
260,60,15,-8,4,4,4
|
||||
270,55,10,-10,3,3,3
|
||||
280,50,5,-12,2,2,2
|
||||
290,45,0,-14,1,1,1
|
||||
300,40,-5,-16,0,0,0
|
||||
310,35,0,-18,1,1,1
|
||||
320,30,5,-20,2,2,2
|
||||
330,25,10,-25,3,3,3
|
||||
340,20,15,-20,4,4,4
|
||||
350,15,20,-18,5,5,5
|
||||
360,10,25,-16,6,6,6
|
||||
370,5,30,-14,7,7,7
|
||||
380,0,35,-12,8,8,8
|
||||
390,-5,40,-10,9,9,9
|
||||
400,0,45,-8,10,10,10
|
||||
410,5,40,-6,9,9,9
|
||||
420,10,35,-4,8,8,8
|
||||
430,15,30,-2,7,7,7
|
||||
440,20,25,0,6,6,6
|
||||
450,25,20,-2,5,5,5
|
||||
460,30,15,-4,4,4,4
|
||||
470,35,10,-6,3,3,3
|
||||
480,40,5,-8,2,2,2
|
||||
490,45,0,-10,1,1,1
|
||||
500,50,-5,-12,0,0,0
|
||||
510,55,0,-14,1,1,1
|
||||
520,60,5,-16,2,2,2
|
||||
530,55,10,-18,3,3,3
|
||||
540,50,15,-20,4,4,4
|
||||
550,45,20,-30,5,5,5
|
||||
560,40,25,-20,6,6,6
|
||||
570,35,30,-18,7,7,7
|
||||
580,30,35,-16,8,8,8
|
||||
590,25,40,-14,9,9,9
|
||||
600,20,45,-12,10,10,10
|
||||
610,15,40,-10,9,9,9
|
||||
620,10,35,-8,8,8,8
|
||||
630,5,30,-6,7,7,7
|
||||
640,0,25,-4,6,6,6
|
||||
650,-5,20,-2,5,5,5
|
||||
660,0,15,0,4,4,4
|
||||
670,5,10,-2,3,3,3
|
||||
680,10,5,-4,2,2,2
|
||||
690,15,0,-6,1,1,1
|
||||
700,20,-5,-8,0,0,0
|
||||
710,25,0,-10,1,1,1
|
||||
720,30,5,-12,2,2,2
|
||||
730,35,10,-14,3,3,3
|
||||
740,40,15,-16,4,4,4
|
||||
750,45,20,-18,5,5,5
|
||||
760,50,25,-20,6,6,6
|
||||
770,55,30,-22,7,7,7
|
||||
780,60,35,-20,8,8,8
|
||||
790,55,40,-18,9,9,9
|
||||
800,50,45,-16,10,10,10
|
||||
810,45,40,-14,9,9,9
|
||||
820,40,35,-12,8,8,8
|
||||
830,35,30,-10,7,7,7
|
||||
840,30,25,-8,6,6,6
|
||||
850,25,20,-6,5,5,5
|
||||
860,20,15,-4,4,4,4
|
||||
870,15,10,-2,3,3,3
|
||||
880,10,5,0,2,2,2
|
||||
890,5,0,-2,1,1,1
|
||||
900,0,-5,-4,0,0,0
|
||||
910,-5,0,-6,1,1,1
|
||||
920,0,5,-8,2,2,2
|
||||
930,5,10,-10,3,3,3
|
||||
940,10,15,-12,4,4,4
|
||||
950,15,20,-14,5,5,5
|
||||
960,20,25,-16,6,6,6
|
||||
970,25,30,-18,7,7,7
|
||||
980,30,35,-20,8,8,8
|
||||
990,35,40,-22,9,9,9
|
||||
1000,40,45,-20,10,10,10
|
||||
@@ -0,0 +1,58 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAEPICSCAOutput.x JAEPICSCAInput.x
|
||||
|
||||
PACKAGE=DataSources
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(EPICS_BASE)/include/
|
||||
INCLUDES += -I$(EPICS_BASE)/include/os/Linux/
|
||||
INCLUDES += -I$(EPICS_BASE)/include/compiler/gcc/
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L5GAMs
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAEPICSCA$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAEPICSCA$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include depends.$(TARGET)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,463 @@
|
||||
**********
|
||||
* EXAMLE *
|
||||
**********
|
||||
|
||||
State1 // RT application state name
|
||||
==========
|
||||
1. // Numbered GAMs in order of execution
|
||||
if (signal_A == 1) // Execution function of the GAM
|
||||
{
|
||||
set signal_B = 3
|
||||
change state to State2
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
|
||||
*****************
|
||||
* RT APP STATES *
|
||||
*****************
|
||||
|
||||
WaitStandby
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-GAF:PLC4110-CON-OPGY1 == 0) //If a Gyrotron is not selected by PLC.
|
||||
{
|
||||
change state to Disabled
|
||||
}
|
||||
----------
|
||||
2. // DONE
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST1R == 1) //If STANDBY signal come from PLC, start Coil&Fil PSs.
|
||||
{
|
||||
// TODO should these signals be set only once every time this state is entered?
|
||||
set signal EC-GN-P01-GAF-MCPS:PSU2120-ACT-SP = 1
|
||||
set signal EC-GN-P01-GAF-GCPS:PSU2130-ACT-SP = 1
|
||||
set signal EC-GN-P01-GAF-FHPS:PSU2610-AUTO-START = 1
|
||||
}
|
||||
----------
|
||||
3. // DONE
|
||||
if (EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB == 1
|
||||
AND
|
||||
EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON > 0
|
||||
AND
|
||||
EC-GN-P01-GAF-FHPS:PSU2610-OUTON-RB == 1
|
||||
AND
|
||||
EC-GN-P01-GAF-FHPS:PSU2610-CURR-RB > 0)
|
||||
{
|
||||
change state to Offline
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
|
||||
Disabled
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-GAF:PLC4110-CON-OPGY1 == 1)
|
||||
{
|
||||
change state to WaitStandby
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
|
||||
Offline
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-GAF:PLC4110-CON-OPGY1 == 0) //If Gyrotron selection is turned off.
|
||||
{
|
||||
change state to Disabled
|
||||
}
|
||||
----------
|
||||
2. // DONE
|
||||
// If READY signal come from PLC is equal 1, app starts CCPS.
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST2R == 1
|
||||
AND
|
||||
EC-GN-P01-GAF-CCPS:PLC4110-YON-CCPS1 == 1)
|
||||
{
|
||||
// TODO should this signal be set only once every time this state is entered?
|
||||
set signal EC-GN-P01-GAF-CCPS:PSU2320-OUTON-SP = 1
|
||||
}
|
||||
----------
|
||||
3. // DONE (with a temporary signal that needs to be changed when the record is added)
|
||||
// TODO: Do we also have to check, that GAM 2. executed? So do we also have to check that EC-GN-P01-GPF:PLC4110-YTS-ST2R == 1?
|
||||
if (EC-GN-P01-GAF-CCPS:PSU2320-STAT == 1) // TODO: there is no signal named EC-GN-P01-GAF-CCPS:PSU2320-STAT
|
||||
// MEMO: I need add this record to check whether CCPS in running or stop.
|
||||
{
|
||||
change state to WaitPermit
|
||||
}
|
||||
----------
|
||||
4. // DONE
|
||||
// Wait CSV-LOAD trigger. When the app detect it, save data into the app.
|
||||
if (EC-GN-P01-GAF:STAT-CSV-LOAD == 1)
|
||||
{
|
||||
open csv file (file name: EC-GN-P01-GAF:STAT-CSV-NAME)
|
||||
load time series data into memory
|
||||
write data into EPICS waveform PSs.(EC-GN-P01-???:STAT-PREP-WF) // TODO do we realy write first data here or do we wait for PreHeating?
|
||||
set signal EC-GN-P01-GAF:STAT-CSV-LOADED = 1 // TODO do we write 1 here?
|
||||
If there is error, write EC-GN-P01-GAF:STAT-CSV-ERROR. // TODO there is no signal named EC-GN-P01-GAF:STAT-CSV-ERROR
|
||||
}
|
||||
|
||||
|
||||
WaitPermit
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-GAF:PLC4110-CON-OPGY1 == 0) //If Gyrotron is un-selected.
|
||||
{
|
||||
change state to Disabled
|
||||
}
|
||||
----------
|
||||
2. // DONE
|
||||
if (EC-GN-P01-GAF:STAT-PREP-MODE == 1
|
||||
AND
|
||||
EC-GN-P01-GAF:PLC4110-CON-GY1PRM == 1)
|
||||
{
|
||||
change state to PreHeating
|
||||
}
|
||||
----------
|
||||
3. // DONE
|
||||
if (EC-GN-P01-GAF:STAT-PREP-MODE == 0
|
||||
AND
|
||||
EC-GN-P01-GAF:PLC4110-CON-GY1PRM == 1)
|
||||
{
|
||||
change state to WaitReady
|
||||
}
|
||||
----------
|
||||
4. // DONE
|
||||
if (EC-GN-P01-GAF:STAT-CSV-LOAD == 1)
|
||||
{
|
||||
open csv file (file name: EC-GN-P01-GAF:STAT-CSV-NAME)
|
||||
load time series data into memory
|
||||
write data into EPICS waveform PSs.(EC-GN-P01-???:STAT-PREP-WF)
|
||||
set signal EC-GN-P01-GAF:STAT-CSV-LOADED = 1
|
||||
If there is error, write EC-GN-P01-GAF:STAT-CSV-ERROR.
|
||||
}
|
||||
|
||||
PreHeating
|
||||
==========
|
||||
1. // DONE
|
||||
every 10 ms do
|
||||
{
|
||||
else
|
||||
{
|
||||
// TODO do we use float32 for the type of waveform signals?
|
||||
// TODO is this the right order of columns? Time point is in column 1.
|
||||
// TODO on what signal do we write time?
|
||||
set signal EC-GN-P01-PB1F:PSU1000-EREF = setpoint column 2
|
||||
set signal EC-GN-P01-PA1F:PSU3000-EREF = setpoint column 3 // TODO there are two EC-GN-P01-PA1F:PSU3000-EREF signals. One ending with -P and one with -N.
|
||||
set signal EC-GN-P01-GAF-MCPS:PSU2120-TRG-CURR-SET = setpoint column 4
|
||||
set signal EC-GN-P01-GAF-GCPS:PSU2130-TRG-CURR-SET = setpoint column 5
|
||||
set signal EC-GN-P01-GAF-FHPS:PSU2320-EREF = setpoint column 6
|
||||
}
|
||||
}
|
||||
----------
|
||||
2. // DONE
|
||||
if (time == 0)
|
||||
{
|
||||
change state to WaitReady
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
WaitReady
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-PB1F:PSU1000-YSTA == 1
|
||||
AND
|
||||
EC-GN-P01-PA1F:PSU3000-YSTA == 1)
|
||||
{
|
||||
change state to WaitHVON
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
WaitHVON
|
||||
==========
|
||||
1. // DONE
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST3R == 1)// Check ON signal from PLC. This signal come when PLC check the operation operation possible conditions.
|
||||
{
|
||||
change state to HVArming
|
||||
}
|
||||
----------
|
||||
2. // DONE
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST3R == 1)
|
||||
{
|
||||
start HVON timer
|
||||
}
|
||||
----------
|
||||
|
||||
|
||||
|
||||
HVArming //HVArming is a state to startup HV generation in APS and BPS.
|
||||
==========
|
||||
1.
|
||||
at specified time // TODO: Where do I get this specified time? And is it a countdown time or what?
|
||||
// MEMO: Time is specified by PVs (EC-GN-P01-PB1F:STAT-DT-HVON). When app detect HVON from PLC, it is t=0.
|
||||
{
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-HV = 1
|
||||
}
|
||||
----------
|
||||
2.
|
||||
at specified time // TODO: Where do I get this specified time? And is it a countdown time or what?
|
||||
// MEMO: Time is specified by PVs (EC-GN-P01-PA1F:STAT-DT-HVON)
|
||||
{
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-HV = 1
|
||||
}
|
||||
----------
|
||||
3.
|
||||
if (EC-GN-P01-PB1F:PSU1000-CON-HV == 1
|
||||
AND
|
||||
EC-GN-P01-PA1F:PSU3000-CON-HV == 1
|
||||
AND
|
||||
EC-GN-P01-GPF::PLC4110-YSTA-MPSS == 0) // MEMO: Both HV PVs are 1. i.e.Both PSs are charged HV. and is in async mode.
|
||||
{
|
||||
change state to HVArmed
|
||||
}
|
||||
----------
|
||||
4.
|
||||
if (EC-GN-P01-PB1F:PSU1000-CON-HV == 1
|
||||
AND
|
||||
EC-GN-P01-PA1F:PSU3000-CON-HV == 1
|
||||
AND
|
||||
EC-GN-P01-GPF::PLC4110-YSTA-MPSS == 1) // MEMO: HVPS HVs are ON and is in SYNC mode.
|
||||
{
|
||||
Change state to HVArmedESDN
|
||||
}
|
||||
----------
|
||||
5.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
|
||||
|
||||
HVArmed
|
||||
==========
|
||||
1.
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST3R == 0) // TODO: when do we go from HVArmed to Offline?
|
||||
// MEMO: move to Offline when ON signal from PLC is turned off.
|
||||
{
|
||||
change state to Offline
|
||||
}
|
||||
----------
|
||||
2.
|
||||
// TODO: "(Entry) Write EC-GN-P01-GAF:PCF4210-YTS-GA1" What does Entry mean? Does it mean to do something
|
||||
// only on the first cycle when we enter this state? What do I write to signal EC-GN-P01-GAF:PCF4210-YTS-GA1?
|
||||
// MEMO: EC-GN-P01-GAF:PCF4210-YTS-GA1 is a PV that fast controller notifies Gyrotron operation state to PLC.
|
||||
// When enter the HVArmed state, App writes 1 to this EPICS PV.
|
||||
----------
|
||||
3.
|
||||
if (EC-GN-P01-PB1F:PSU1000-CON-SW == 1) // TODO: when do we go from HVArmed to HVInjectionBPS?
|
||||
// MEMO: If MHVPS HV is turned ON first, goto this state.
|
||||
{
|
||||
change state to HVInjectionBPS
|
||||
}
|
||||
----------
|
||||
4.
|
||||
if (EC-GN-P01-PMF:PSU0000-CON-SW == 1) // TODO: when do we go from HVArmed to HVInjectionMHVPS?
|
||||
// MEMO: If BPS HV is turned ON first, goto this state.
|
||||
{
|
||||
change state to HVInjectionMHVPS
|
||||
}
|
||||
----------
|
||||
5.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
----------
|
||||
6.
|
||||
if (EC-GN-P01-GPF::PLC4110-YSTA-MPSS == 1) //When SYNC mode turned ON.
|
||||
{
|
||||
change state to HVArmedESDN
|
||||
}
|
||||
----------
|
||||
|
||||
HVArmedESDN // Start ESDN command, waveform subscription.
|
||||
==========
|
||||
1.
|
||||
if (EC-GN-P01-GPF:PLC4110-YTS-ST3R == 0)
|
||||
{
|
||||
change state to Offline
|
||||
}
|
||||
----------
|
||||
2.
|
||||
if (EC-GN-P01-PB1F:PSU1000-CON-SW == 1)
|
||||
{
|
||||
change state to HVInjectionBPSESDN
|
||||
}
|
||||
----------
|
||||
3.
|
||||
if (EC-GN-P01-PMF:PSU0000-CON-SW == 1)
|
||||
{
|
||||
change state to HVInjectionMHVPSESDN
|
||||
}
|
||||
----------
|
||||
4.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
----------
|
||||
6.
|
||||
if (EC-GN-P01-GPF::PLC4110-YSTA-MPSS == 0) //When SYNC mode turned ON.
|
||||
{
|
||||
change state to HVArmed
|
||||
}
|
||||
----------
|
||||
|
||||
HVInjectionBPS
|
||||
==========
|
||||
HVInjectionMHVPS
|
||||
==========
|
||||
1.
|
||||
// MEMO: Write Gyrotron state PV (HVInjection) to notify PLC.
|
||||
Write 1 to EC-GN-P01-GAF:PCF4210-YTS-GA2.
|
||||
----------
|
||||
// TODO: Following questions/states are for ALL of the above states
|
||||
2. (Exist in HVInjection BPS)
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-SW = 1 // TODO when do we set this signal
|
||||
// MEMO: Countdown time for EC-GN-P01-PA1F:STAT-DT-SWON
|
||||
----------
|
||||
2. (Exist in HVInjection MHVPS)
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-SW = 1 // TODO when do we set this signal
|
||||
// MEMO: Countdown time for EC-GN-P01-PB1F:STAT-DT-SWON
|
||||
----------
|
||||
3.
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 1 // TODO when do we set this signal
|
||||
// MEMO: Countdown time for EC-GN-P01-PMF:STAT-DT-SWON
|
||||
----------
|
||||
4.
|
||||
// TODO when to switch to RFON?
|
||||
// MEMO: Go to RFON state when All switch PVs are 1. and the mode is async.
|
||||
if (EC-GN-P01-PA1F:PSU3000-CON-SW == 1 AND
|
||||
EC-GN-P01-PB1F:PSU1000-CON-SW == 1 AND
|
||||
EC-GN-P01-PMF:PSU0000-CON-SW == 1)
|
||||
{
|
||||
change state to RFON
|
||||
}
|
||||
----------
|
||||
5.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
----------
|
||||
|
||||
HVInjectionESDN
|
||||
==========
|
||||
1.
|
||||
// MEMO: Write Gyrotron state PV (HVInjection) to notify PLC.
|
||||
Write 1 to EC-GN-P01-GAF:PCF4210-YTS-GA2.
|
||||
----------
|
||||
2.
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-SW = 1
|
||||
// Write 1 when ESDN command give a command.
|
||||
----------
|
||||
3.
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-SW = 1
|
||||
// Write 1 when ESDN command give a command.
|
||||
----------
|
||||
4.
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 1
|
||||
// Write 1 when ESDN command give a command.
|
||||
----------
|
||||
5.
|
||||
// TODO when to switch to RFONESDN?
|
||||
// MEMO: Go to RFON state when All switch PVs are 1. and the mode is sync.i,e. change from HVInjectionxxxESDN
|
||||
if (EC-GN-P01-PA1F:PSU3000-CON-SW == 1 AND
|
||||
EC-GN-P01-PB1F:PSU1000-CON-SW == 1 AND
|
||||
EC-GN-P01-PMF:PSU0000-CON-SW == 1)
|
||||
{
|
||||
change state to RFONESDN
|
||||
}
|
||||
----------
|
||||
|
||||
RFON
|
||||
==========
|
||||
// TODO is this correct?
|
||||
1.
|
||||
// This only executes on the last cycle before we move to HVArmed
|
||||
if (EC-GN-P01-GAF:STAT-BEAMON-TIME >= EC-GN-P01-GAF:STAT-DT-SHOTLEN)
|
||||
{
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-SW = 0
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-SW = 0
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 0
|
||||
}
|
||||
----------
|
||||
2.
|
||||
if (EC-GN-P01-GAF:STAT-BEAMON-TIME >= EC-GN-P01-GAF:STAT-DT-SHOTLEN)
|
||||
{
|
||||
change state to HVArmed
|
||||
}
|
||||
----------
|
||||
3.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
----------
|
||||
4.
|
||||
When enter the state beam-on timer is set to 0.
|
||||
count up beam-on time. write the time into EC-GN-P01-GAF:STAT-BEAMON-TIME
|
||||
----------
|
||||
|
||||
|
||||
|
||||
RFONESDN
|
||||
==========
|
||||
// TODO is this correct?
|
||||
// MEMO: In the ESDN sync mode, HVPS turned off by ESDN packet.
|
||||
// In both mode, there is mode_limit which is given by (EC-GN-P01-GPF:PLC4110-YTS-MD1,2,3,4).
|
||||
1.
|
||||
// This only executes on the last cycle before we move to HVArmed
|
||||
if (EC-GN-P01-GAF:STAT-BEAMON-TIME >= t_mode_limit) // TODO: where do I get t_mode_limit?
|
||||
{
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-SW = 0
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-SW = 0
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 0
|
||||
}
|
||||
----------
|
||||
2.
|
||||
if (EC-GN-P01-GAF:STAT-BEAMON-TIME >= t_mode_limit) // TODO: where do I get t_mode_limit?
|
||||
{
|
||||
change state to HVArmedESDN
|
||||
}
|
||||
----------
|
||||
3.
|
||||
Subscribe ESDN commands. When GAM detect Beam-off command. It turn all HVPS SW OFF.
|
||||
And change state to HVArmedESDN
|
||||
----------
|
||||
4.
|
||||
count up elapsed time (time from HVON detection)
|
||||
Write time to EC-GN-P01-GAF:STAT-ELAPSED
|
||||
----------
|
||||
5.
|
||||
When enter the state beam-on timer is set to 0.
|
||||
count up beam-on time. write the time into EC-GN-P01-GAF:STAT-BEAMON-TIME
|
||||
----------
|
||||
|
||||
|
||||
Error
|
||||
==========
|
||||
1.
|
||||
// Only execute on the first cycle after entering this state
|
||||
if (first)
|
||||
{
|
||||
set first = false
|
||||
|
||||
set signal EC-GN-P01-PA1F:PUS3000-CON-HV = 0 // TODO: there is no signal named EC-GN-P01-PA1F:PUS3000-CON-HV
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CON-SW = 0
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-HV = 0
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CON-SW = 0
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 0
|
||||
// MEMO: PA2F and PB2F are component type for gyrotron B. I will remove following action.
|
||||
set signal EC-GN-P01-PA2F:PUS4000-CON-HV = 0 // TODO: there is no signal named EC-GN-P01-PA2F:PUS4000-CON-HV
|
||||
set signal EC-GN-P01-PA2F:PSU4000-CON-SW = 0 // TODO: signal EC-GN-P01-PA2F:PSU4000-CON-SW missing in configuration file
|
||||
set signal EC-GN-P01-PB2F:PSU2000-CON-HV = 0 // TODO: signal EC-GN-P01-PB2F:PSU2000-CON-HV missing in configuration file
|
||||
set signal EC-GN-P01-PB2F:PSU2000-CON-SW = 0 // TODO: signal EC-GN-P01-PB2F:PSU2000-CON-SW missing in configuration file
|
||||
|
||||
set signal EC-GN-P01-PMF:PSU0000-CON-SW = 1
|
||||
set signal EC-GN-P01-PA1F:PSU3000-CTRP = 1
|
||||
set signal EC-GN-P01-PB1F:PSU1000-CTRP = 1
|
||||
// MEMO: PA2F and PB2F are component type for gyrotron B. I will remove following action.
|
||||
set signal EC-GN-P01-PA2F:PSU4000-CTRP = 1 // TODO: signal EC-GN-P01-PA2F:PSU4000-CTRP missing in configuration file
|
||||
set signal EC-GN-P01-PB2F:PSU1000-CTRP = 1 // TODO: there is no signal named EC-GN-P01-PB2F:PSU1000-CTRP
|
||||
}
|
||||
----------
|
||||
2.
|
||||
if (EC-GN-P01-GPF:STAT-RST-FLT == 1 && ) // TODO: when do we go to Offline state?
|
||||
{
|
||||
change state to Offline
|
||||
}
|
||||
----------
|
||||
@@ -0,0 +1,14 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=display.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
ScriptUtil.openOPI(display.getWidget("GeneralTable"), "/opt/codac/opi/epics-sysmon/boy/ITER-SYSM-PLC_Mimic.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,460 @@
|
||||
/**
|
||||
* @file JAPreProgrammedGAM.cpp
|
||||
* @brief Source file for class JAPreProgrammedGAM
|
||||
* @date Jan, 2019
|
||||
* @author rhari
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JAPreProgrammedGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "CLASSMETHODREGISTER.h"
|
||||
#include "File.h"
|
||||
#include "JAPreProgrammedGAM.h"
|
||||
#include "MessageI.h"
|
||||
#include "RegisteredMethodsMessageFilter.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
// How often output signals are updated.
|
||||
const MARTe::uint32 cycleMs = 10u;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
JAPreProgrammedGAM::JAPreProgrammedGAM() :
|
||||
GAM() {
|
||||
using namespace MARTe;
|
||||
filenameSignalIndex = 0u;
|
||||
timeSignal = NULL_PTR(MARTe::int32 *);
|
||||
loadTriggerSignal = NULL_PTR(MARTe::uint32 *);
|
||||
fhpsrefSignal = NULL_PTR(MARTe::float32 *);
|
||||
rfonStateSignal = NULL_PTR(MARTe::uint32 *);
|
||||
|
||||
valueSignals = NULL_PTR(MARTe::float32 **);
|
||||
preProgrammedValues = NULL_PTR(MARTe::float32 **);
|
||||
preProgrammedTime = NULL_PTR(MARTe::int32 *);
|
||||
fileLoadedSignal = NULL_PTR(MARTe::uint32 *);
|
||||
fileLoadErrorOutput = NULL_PTR(MARTe::uint32 *);
|
||||
|
||||
startTime = 0u;
|
||||
numberOfPreProgrammedValues = 0u;
|
||||
numberOfPreProgrammedTimeRows = 0u;
|
||||
currentRow = 0u;
|
||||
mode = None;
|
||||
preProgrammedExecutaionPeriodMs = 0u;
|
||||
msCounter = 0u;
|
||||
preProgrammedRow = 0u;
|
||||
resetOutputSignals = false;
|
||||
readOnce = true;
|
||||
}
|
||||
|
||||
JAPreProgrammedGAM::~JAPreProgrammedGAM() {
|
||||
DeleteArrays();
|
||||
if (valueSignals != NULL_PTR(MARTe::float32 **)) {
|
||||
delete[] valueSignals;
|
||||
}
|
||||
}
|
||||
|
||||
bool JAPreProgrammedGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
if (ok) {
|
||||
ok = data.Read("Directory", directory);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The Directory shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Read("PreProgrammedPeriodMs", preProgrammedExecutaionPeriodMs);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The Directory shall be specified");
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAPreProgrammedGAM::Setup() {
|
||||
using namespace MARTe;
|
||||
//Signal number check.
|
||||
bool ok = (numberOfInputSignals == 4u);
|
||||
if (ok) {
|
||||
ok = (numberOfOutputSignals > 2u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "At least two output signal shall be defined");
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Four input signals with the filename and file load trigger shall be defined");
|
||||
}
|
||||
//Input signals type consistency check.
|
||||
if (ok) {
|
||||
StreamString signalName = "Filename";
|
||||
ok = GetSignalIndex(InputSignals, filenameSignalIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Filename input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, filenameSignalIndex);
|
||||
ok = (inputType == CharString);
|
||||
if (!ok) {
|
||||
ok = (inputType == Character8Bit);
|
||||
}
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, filenameSignalIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as string", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
StreamString signalName = "CSV_LOAD";
|
||||
uint32 loadSignalIndex;
|
||||
ok = GetSignalIndex(InputSignals, loadSignalIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "CSV_LOAD input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, loadSignalIndex);
|
||||
ok = (inputType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, loadSignalIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32", signalName.Buffer());
|
||||
} else {
|
||||
loadTriggerSignal = reinterpret_cast<uint32 *>(GetInputSignalMemory(loadSignalIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
StreamString signalName = "FHPS_REF";
|
||||
uint32 fhpsrefIndex;
|
||||
ok = GetSignalIndex(InputSignals, fhpsrefIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "FHPS_REF input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, fhpsrefIndex);
|
||||
ok = (inputType == Float32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, fhpsrefIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as float32", signalName.Buffer());
|
||||
} else {
|
||||
fhpsrefSignal = reinterpret_cast<float32 *>(GetInputSignalMemory(fhpsrefIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
StreamString signalName = "RFON";
|
||||
uint32 rfonIndex;
|
||||
ok = GetSignalIndex(InputSignals, rfonIndex, signalName.Buffer());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "RFON input signal shall be defined");
|
||||
}
|
||||
else {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, rfonIndex);
|
||||
ok = (inputType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, rfonIndex, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as float32", signalName.Buffer());
|
||||
} else {
|
||||
rfonStateSignal = reinterpret_cast<uint32 *>(GetInputSignalMemory(rfonIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Output signals type check.
|
||||
if (ok) {
|
||||
TypeDescriptor timeType = GetSignalType(OutputSignals, 0);
|
||||
ok = (timeType == SignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, 0, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as int32", signalName.Buffer());
|
||||
}
|
||||
|
||||
uint32 i;
|
||||
for (i = 1u; (i <= 6) && (ok); i++) {
|
||||
TypeDescriptor outputType = GetSignalType(OutputSignals, i);
|
||||
ok = (outputType == Float32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(OutputSignals, i, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as float32", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
TypeDescriptor fileLoadedType = GetSignalType(OutputSignals, 7u);
|
||||
ok = (fileLoadedType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(OutputSignals, 6u, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
TypeDescriptor fileLoadErrorOutputType = GetSignalType(OutputSignals, 8u);
|
||||
ok = (fileLoadErrorOutputType == UnsignedInteger32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(OutputSignals, 7u, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Register signal memory
|
||||
if (ok) {
|
||||
timeSignal = reinterpret_cast<int32 *>(GetOutputSignalMemory(0));
|
||||
valueSignals = new float32*[6u];
|
||||
uint32 i;
|
||||
for (i = 1u; i <= 6u; i++) {
|
||||
valueSignals[i - 1] = reinterpret_cast<float32 *>(GetOutputSignalMemory(i));
|
||||
}
|
||||
fileLoadedSignal = reinterpret_cast<uint32 *>(GetOutputSignalMemory(7u));
|
||||
fileLoadErrorOutput = reinterpret_cast<uint32 *>(GetOutputSignalMemory(8u));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAPreProgrammedGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
bool ok = true;
|
||||
if (strcmp(nextStateName, "WaitReady") == 0) {
|
||||
mode = LoadFileMode;
|
||||
resetOutputSignals = true;
|
||||
// Reset read once flag when reentering WaitReady state.
|
||||
readOnce = true;
|
||||
} else if (strcmp(nextStateName, "WaitPermit") == 0) {
|
||||
mode = LoadFileMode;
|
||||
resetOutputSignals = true;
|
||||
currentRow = 0u;
|
||||
} else if (strcmp(nextStateName, "WaitHVON_PREP") == 0 || strcmp(nextStateName, "WaitHVON_SDN_PREP") == 0) {
|
||||
ok = numberOfPreProgrammedTimeRows > 0;
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::IllegalOperation, "Entering PreProgrammed mode without any waveform data.");
|
||||
}
|
||||
mode = PreProgrammedMode;
|
||||
msCounter = cycleMs;
|
||||
currentRow = 0u;
|
||||
} else {
|
||||
mode = None;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAPreProgrammedGAM::LoadFile() {
|
||||
using namespace MARTe;
|
||||
|
||||
DeleteArrays();
|
||||
|
||||
bool ok = true;
|
||||
|
||||
const MARTe::char8 * const filenameSignal = reinterpret_cast<const char8 * const >(GetInputSignalMemory(filenameSignalIndex));
|
||||
//Prepare full path to the configuration file.
|
||||
StreamString filename = directory;
|
||||
filename += DIRECTORY_SEPARATOR;
|
||||
filename += filenameSignal;
|
||||
REPORT_ERROR(MARTe::ErrorManagement::Debug, "Opening file %s", filename.Buffer());
|
||||
|
||||
//parse prepro configuration file into two arrays(time, values).
|
||||
File f;
|
||||
ok = f.Open(filename.Buffer(), BasicFile::ACCESS_MODE_R);
|
||||
if (ok) {
|
||||
//Count up number of file Rows.
|
||||
numberOfPreProgrammedTimeRows = 0u;
|
||||
StreamString tokenLine;
|
||||
while (f.GetLine(tokenLine)) {
|
||||
if (tokenLine[0] != '#' && tokenLine[0] != '-') {
|
||||
numberOfPreProgrammedTimeRows++;
|
||||
}
|
||||
tokenLine = "";
|
||||
}
|
||||
//Count up number of file lines
|
||||
numberOfPreProgrammedValues = 0u;
|
||||
f.Seek(0);
|
||||
uint32 t = 0u;
|
||||
tokenLine = "";
|
||||
while ((ok) && (f.GetLine(tokenLine))) {
|
||||
// Skip comment line and minus time
|
||||
if (tokenLine[0] == '#' || tokenLine[0] == '-') {
|
||||
tokenLine = "";
|
||||
continue;
|
||||
}
|
||||
// Prepare two arrays at first.
|
||||
if (numberOfPreProgrammedValues == 0) {
|
||||
StreamString token;
|
||||
char8 ignored;
|
||||
tokenLine.Seek(0);
|
||||
while (tokenLine.GetToken(token, ",", ignored)) {
|
||||
numberOfPreProgrammedValues++;
|
||||
token = "";
|
||||
}
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError,"numberOfPreProgrammedVal %d", numberOfPreProgrammedValues);
|
||||
ok = (numberOfPreProgrammedValues == 7u);//From time row to FHPS row.
|
||||
numberOfPreProgrammedValues -= 1u; //From MHVPS row to FHPS row.
|
||||
if (ok) {
|
||||
preProgrammedTime = new int32[numberOfPreProgrammedTimeRows];
|
||||
preProgrammedValues = new float32*[numberOfPreProgrammedTimeRows];
|
||||
uint32 j;
|
||||
for (j = 0u; j < numberOfPreProgrammedTimeRows; j++) {
|
||||
preProgrammedValues[j] = new float32[numberOfPreProgrammedValues];
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError,
|
||||
"Number of columns in csv file (%d) is not consistent with the number of output signals (%d)",
|
||||
numberOfPreProgrammedValues, 6u);
|
||||
*fileLoadErrorOutput = 1;
|
||||
}
|
||||
}
|
||||
// Add loaded data into two arrays.
|
||||
if (ok) {
|
||||
StreamString token;
|
||||
char8 ignored;
|
||||
tokenLine.Seek(0);
|
||||
uint32 idx = 0u;
|
||||
while (tokenLine.GetToken(token, ",", ignored)) {
|
||||
if (idx == 0u) {
|
||||
preProgrammedTime[t] = atoi(token.Buffer());
|
||||
if (t == 0 && preProgrammedTime[0] != 0) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::Debug, "Prepro start from none zero time.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
ok = ((idx - 1) < numberOfPreProgrammedValues);
|
||||
if (ok) {
|
||||
preProgrammedValues[t][idx - 1] = static_cast<float32>(atof(token.Buffer()));
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::FatalError, "Number of columns in csv file is not consistent with the number of output signals in line %d", t);
|
||||
*fileLoadErrorOutput = 1;
|
||||
}
|
||||
}
|
||||
token = "";
|
||||
idx++;
|
||||
}
|
||||
t++;
|
||||
}
|
||||
tokenLine = "";
|
||||
}
|
||||
f.Close();
|
||||
}
|
||||
if (ok) {
|
||||
currentRow = 0u;
|
||||
}
|
||||
else {
|
||||
numberOfPreProgrammedTimeRows = 0u;
|
||||
REPORT_ERROR(ErrorManagement::Warning, "Failed to read waveform data from file.");
|
||||
*fileLoadErrorOutput = 2;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAPreProgrammedGAM::Execute() {
|
||||
using namespace MARTe;
|
||||
bool ok = true;
|
||||
|
||||
switch (mode) {
|
||||
case LoadFileMode: {
|
||||
if (*loadTriggerSignal == 1u) {
|
||||
if (readOnce) {
|
||||
*fileLoadErrorOutput = 0;
|
||||
*fileLoadedSignal = LoadFile() ? 1 : 0;
|
||||
readOnce = false;
|
||||
}
|
||||
} else {
|
||||
// Reset read once flag when loadTriggerSignal is reset.
|
||||
readOnce = true;
|
||||
}
|
||||
|
||||
if (resetOutputSignals) {
|
||||
// Write default values to output signals
|
||||
*timeSignal = 0u;
|
||||
*valueSignals[FHPS-1] = *fhpsrefSignal;
|
||||
resetOutputSignals = false;
|
||||
} else {
|
||||
*valueSignals[FHPS-1] = *fhpsrefSignal; //copy input(2) to val_arr(4)
|
||||
}
|
||||
} break;
|
||||
|
||||
case PreProgrammedMode: {
|
||||
ok = numberOfPreProgrammedTimeRows > 0;
|
||||
|
||||
//add 20210105. Before RFON, prepro setpoints should be same as the values listed at csv first line.
|
||||
if (ok && *rfonStateSignal == 0) {
|
||||
uint32 j;
|
||||
for (j = 0u; j < FHPS; j++) {
|
||||
*valueSignals[j] = preProgrammedValues[0][j];
|
||||
}
|
||||
}
|
||||
//end 20210105
|
||||
|
||||
if (ok && currentRow < numberOfPreProgrammedTimeRows && *rfonStateSignal == 1) {
|
||||
if (msCounter >= cycleMs) {
|
||||
msCounter -= cycleMs;
|
||||
int32 currentTime = preProgrammedTime[currentRow];
|
||||
//REPORT_ERROR(MARTe::ErrorManagement::Debug, "Write Time at %d",currentRow);
|
||||
// Write to output signals
|
||||
*timeSignal = currentTime;
|
||||
uint32 j;
|
||||
for (j = 0u; j < FHPS; j++) {
|
||||
*valueSignals[j] = preProgrammedValues[currentRow][j];
|
||||
//REPORT_ERROR(MARTe::ErrorManagement::Debug, "Write Value %f at row %d",preProgrammedValues[currentRow][j], currentRow);
|
||||
}
|
||||
//REPORT_ERROR(MARTe::ErrorManagement::Debug, "Writing pre programmed data for time %d", currentTime);
|
||||
|
||||
// Update row
|
||||
++currentRow;
|
||||
}
|
||||
msCounter += preProgrammedExecutaionPeriodMs;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
// Nothing to do.
|
||||
REPORT_ERROR(MARTe::ErrorManagement::Warning, "Unhandled mode.");
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
void JAPreProgrammedGAM::DeleteArrays() {
|
||||
if (preProgrammedValues != NULL_PTR(MARTe::float32 **)) {
|
||||
MARTe::uint32 i;
|
||||
for (i = 0u; i < numberOfPreProgrammedValues; i++) {
|
||||
delete preProgrammedValues[i];
|
||||
}
|
||||
delete[] preProgrammedValues;
|
||||
}
|
||||
if (preProgrammedTime != NULL_PTR(MARTe::int32 *)) {
|
||||
delete[] preProgrammedTime;
|
||||
}
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JAPreProgrammedGAM, "1.0")
|
||||
@@ -0,0 +1,49 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
# from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
table = widget.getTable()
|
||||
|
||||
#Fill PV Name only once
|
||||
if widget.getVar("firstTime") == None:
|
||||
widget.setVar("firstTime", True)
|
||||
i=0
|
||||
# Fill table only with non EGU pv's
|
||||
for pv in pvs:
|
||||
# earlier when by default pv.getName() was giving name with 'epics://' prefix. Ripping it off before showing was done below
|
||||
table.setCellText(i, 0, pv.getName().strip())
|
||||
if not pv.isConnected():
|
||||
table.setCellText(i/2, 1, "Disconnected")
|
||||
i+=1
|
||||
# Based on value of macro SHOW_PLC_IOC, enable visibility of PLCIOCDetailsTable
|
||||
if widget.getPropertyValue("name") == 'PLCIOCDetailsTable':
|
||||
if display.getMacroValue("SHOW_PLC_IOC") == "true":
|
||||
widget.setPropertyValue("visible", "true")
|
||||
display.getWidget("PLCIOCDetailsLabel").setPropertyValue("visible", "true")
|
||||
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
pvValue = PVUtil.getString(triggerPV).strip();
|
||||
eugValue = table.getCellText(i, 4);
|
||||
if eugValue != "":
|
||||
pvValue = pvValue+" "+eugValue;
|
||||
table.setCellText(i, 1, pvValue)
|
||||
table.setCellText(i, 2, PVUtil.getStatus(triggerPV).strip())
|
||||
table.setCellText(i, 3, PVUtil.getSeverityString(triggerPV).strip())
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i, 3, color)
|
||||
@@ -0,0 +1,35 @@
|
||||
# Makefile at top of application tree
|
||||
TOP = .
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
# Directories to build, any order
|
||||
DIRS += configure
|
||||
DIRS += $(wildcard *Sup)
|
||||
DIRS += $(wildcard *App)
|
||||
DIRS += $(wildcard *Top)
|
||||
DIRS += $(wildcard iocBoot)
|
||||
|
||||
# The build order is controlled by these dependency rules:
|
||||
|
||||
# All dirs except configure depend on configure
|
||||
$(foreach dir, $(filter-out configure, $(DIRS)), \
|
||||
$(eval $(dir)_DEPEND_DIRS += configure))
|
||||
|
||||
# Any *App dirs depend on all *SharedTemplateApp dirs
|
||||
$(foreach dir, $(filter-out %SharedTemplateApp, $(filter %App, $(DIRS))), \
|
||||
$(eval $(dir)_DEPEND_DIRS += $(filter %SharedTemplateApp, $(DIRS))))
|
||||
|
||||
# Any *App dirs depend on all *Sup dirs
|
||||
$(foreach dir, $(filter %App, $(DIRS)), \
|
||||
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))
|
||||
|
||||
# Any *Top dirs depend on all *Sup and *App dirs
|
||||
$(foreach dir, $(filter %Top, $(DIRS)), \
|
||||
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))
|
||||
|
||||
# iocBoot depends on all *App dirs
|
||||
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))
|
||||
|
||||
# Add any additional dependency rules here:
|
||||
|
||||
include $(TOP)/configure/RULES_TOP
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
def test_standby():
|
||||
"""
|
||||
In the WaitStandby State, simulate PLC STANDBY signal.
|
||||
Turn on FHPS by push auto-on button.
|
||||
Turn on SCM PSs automatically.
|
||||
State transition condition is checked at last.
|
||||
"""
|
||||
print '---------- Start WatiStandby test ----------'
|
||||
print '1. Simulate SELECT signal. State should go to WatiStandby from Disabled.'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2 1', shell=True)
|
||||
time.sleep(1)
|
||||
print '2. Set MCPS rampup parameter(target current, sweep rate.)'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-TRG-CURR-SET-MI 4', shell=True) #For A
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-TRG-SWPR-SET 1.5', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-TRG-CURR-SET-MI 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-TRG-SWPR-SET 1.5', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-TRG-CURR-SET-MI 4', shell=True) #For B
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-TRG-SWPR-SET 1.5', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-TRG-CURR-SET-MI 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-TRG-SWPR-SET 1.5', shell=True)
|
||||
time.sleep(1)
|
||||
print '3. Simulate STANDBY signal. MCPS, GCPS, FHPS rampup must be started.'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R 1', shell=True)
|
||||
time.sleep(1)
|
||||
print '4. Set FHPS rampup parameter and start it.'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-TAGV 6', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-RU-TIME 10', shell=True) #in second.
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-AUTO-START 1', shell=True) #in second.
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-TAGV 6', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-RU-TIME 10', shell=True) #in second.
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-AUTO-START 1', shell=True) #in second.
|
||||
time.sleep(10)
|
||||
print '5. Simulate FHPS, MCPS and GCPS state.'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB.SVAL 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-ACT-RB 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON.SVAL 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:PSU2120-CURR-MON 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-ACT-RB.SVAL 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-ACT-RB 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-CURR-MON.SVAL 4', shell=True)#turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:PSU2130-CURR-MON 4', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-OUTON-RB.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-OUTON-RB 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-MEAS-ACV.SVAL 6', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:PSU2610-MEAS-ACV 6', shell=True)
|
||||
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-ACT-RB.SVAL 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-ACT-RB 3', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-CURR-MON.SVAL 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:PSU2120-CURR-MON 4', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-ACT-RB.SVAL 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-ACT-RB 3', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-CURR-MON.SVAL 4', shell=True)#turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:PSU2130-CURR-MON 4', shell=True) #turn off for GCPS test
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-OUTON-RB.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-OUTON-RB 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-MEAS-ACV.SVAL 6', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:PSU2610-MEAS-ACV 6', shell=True)
|
||||
time.sleep(1)
|
||||
print '6. Confirm FHPS and SCM ramp-up complete. The state goes to WaitREADY from WaitStandby.'
|
||||
print '---------- END WaitStandby test ----------'
|
||||
|
||||
@@ -0,0 +1,347 @@
|
||||
/**
|
||||
* @file JAMessageGAM.cpp
|
||||
* @brief Source file for class JAMessageGAM
|
||||
* @date Jan, 2019
|
||||
* @author rhari
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JAMessageGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "JAMessageGAM.h"
|
||||
#include "MessageI.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class T, class U>
|
||||
bool Compare(JAMessageGAM::ComparisonMode comparator, void *inputSignal, U expectedValue) {
|
||||
switch (comparator) {
|
||||
case JAMessageGAM::Equals:
|
||||
return *static_cast<T *>(inputSignal) == expectedValue;
|
||||
case JAMessageGAM::Not:
|
||||
return *static_cast<T *>(inputSignal) != expectedValue;
|
||||
case JAMessageGAM::Greater:
|
||||
return *static_cast<T *>(inputSignal) > expectedValue;
|
||||
case JAMessageGAM::EqualsOrGreater:
|
||||
return *static_cast<T *>(inputSignal) >= expectedValue;
|
||||
case JAMessageGAM::Less:
|
||||
return *static_cast<T *>(inputSignal) < expectedValue;
|
||||
default: // case EqualsOrLess:
|
||||
return *static_cast<T *>(inputSignal) <= expectedValue;
|
||||
}
|
||||
}
|
||||
|
||||
JAMessageGAM::JAMessageGAM() {
|
||||
inputSignals = NULL_PTR(void **);
|
||||
inputSignalTypes = NULL_PTR(MARTe::TypeDescriptor *);
|
||||
operation = And;
|
||||
needsReset = false;
|
||||
expectedValuesInt = NULL_PTR(MARTe::uint64 *);
|
||||
expectedValuesFloat = NULL_PTR(MARTe::float64 *);
|
||||
intValuesCount = 0u;
|
||||
floatValuesCount = 0u;
|
||||
comparators = NULL_PTR(ComparisonMode *);
|
||||
}
|
||||
|
||||
JAMessageGAM::~JAMessageGAM() {
|
||||
if (inputSignals != NULL_PTR(void **)) {
|
||||
delete[] inputSignals;
|
||||
}
|
||||
if (inputSignalTypes != NULL_PTR(MARTe::TypeDescriptor *)) {
|
||||
delete[] inputSignalTypes;
|
||||
}
|
||||
if (expectedValuesInt != NULL_PTR(MARTe::uint64 *)) {
|
||||
delete[] expectedValuesInt;
|
||||
}
|
||||
if (expectedValuesFloat != NULL_PTR(MARTe::float64 *)) {
|
||||
delete[] expectedValuesFloat;
|
||||
}
|
||||
if (comparators != NULL_PTR(ComparisonMode *)) {
|
||||
delete[] comparators;
|
||||
}
|
||||
}
|
||||
|
||||
bool JAMessageGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
if (ok) {
|
||||
// Read expected integer values.
|
||||
AnyType valuesArray = data.GetType("ExpectedIntValues");
|
||||
bool intValuesProvided = (valuesArray.GetDataPointer() != NULL);
|
||||
|
||||
if (intValuesProvided) {
|
||||
intValuesCount = valuesArray.GetNumberOfElements(0u);
|
||||
}
|
||||
if (intValuesProvided) {
|
||||
expectedValuesInt = new uint64[intValuesCount];
|
||||
|
||||
Vector<uint64> valuesVector(expectedValuesInt, intValuesCount);
|
||||
ok = (data.Read("ExpectedIntValues", valuesVector));
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Failed to read ExpectedIntValues.");
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
// Read expected float values.
|
||||
valuesArray = data.GetType("ExpectedFloatValues");
|
||||
bool floatValuesProvided = (valuesArray.GetDataPointer() != NULL);
|
||||
|
||||
if (floatValuesProvided) {
|
||||
floatValuesCount = valuesArray.GetNumberOfElements(0u);
|
||||
}
|
||||
if (floatValuesProvided) {
|
||||
expectedValuesFloat = new float64[floatValuesCount];
|
||||
|
||||
Vector<float64> valuesVector(expectedValuesFloat, floatValuesCount);
|
||||
ok = (data.Read("ExpectedFloatValues", valuesVector));
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Failed to read ExpectedFloatValues.");
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
||||
ok = (floatValuesCount + intValuesCount) > 0u;
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "ExpectedFloatValues and or ExpectedIntValues shall be defined.");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
// Read comparators.
|
||||
AnyType comparatorsArray = data.GetType("Comparators");
|
||||
if (comparatorsArray.GetDataPointer() != NULL) {
|
||||
uint32 count = comparatorsArray.GetNumberOfElements(0u);
|
||||
ok = count == (intValuesCount + floatValuesCount);
|
||||
if (ok) {
|
||||
comparators = new ComparisonMode[count];
|
||||
StreamString* comp = new StreamString[count];
|
||||
Vector<StreamString> compVector(comp, count);
|
||||
|
||||
ok = (data.Read("Comparators", compVector));
|
||||
|
||||
if (ok) {
|
||||
for (uint32 i = 0; i < count; ++i) {
|
||||
if (comp[i] == "EQUALS") {
|
||||
comparators[i] = Equals;
|
||||
} else if (comp[i] == "NOT") {
|
||||
comparators[i] = Not;
|
||||
} else if (comp[i] == "GREATER") {
|
||||
comparators[i] = Greater;
|
||||
} else if (comp[i] == "EQUALS_OR_GREATER") {
|
||||
comparators[i] = EqualsOrGreater;
|
||||
} else if (comp[i] == "LESS") {
|
||||
comparators[i] = Less;
|
||||
} else if (comp[i] == "EQUALS_OR_LESS") {
|
||||
comparators[i] = EqualsOrLess;
|
||||
} else {
|
||||
ok = false;
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Comparator %s is not defined.", comp[i].Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Expected values and operators shall have the same "
|
||||
"number of elements.");
|
||||
}
|
||||
} else {
|
||||
uint32 count = intValuesCount + floatValuesCount;
|
||||
if (ok) {
|
||||
// Create default comparators (equals) when they aren't provided in the configuration.
|
||||
comparators = new ComparisonMode[count];
|
||||
for (uint32 i = 0; i < count; ++i) {
|
||||
comparators[i] = Equals;
|
||||
}
|
||||
} else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Expected values and operators shall have the same "
|
||||
"number of elements.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
MARTe::StreamString operationStr;
|
||||
if (data.Read("Operation", operationStr)) {
|
||||
if (operationStr == "AND") {
|
||||
operation = And;
|
||||
}
|
||||
else if (operationStr == "OR") {
|
||||
operation = Or;
|
||||
}
|
||||
else if (operationStr == "NOR") {
|
||||
operation = Nor;
|
||||
}
|
||||
else if (operationStr == "XOR") {
|
||||
operation = Xor;
|
||||
}
|
||||
else {
|
||||
ok = false;
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Operation %s is not defined", operationStr.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = (Size() == 1);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "A Message object shall be added to this container");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
eventMsg = Get(0);
|
||||
ok = (eventMsg.IsValid());
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "A valid Message shall be added to this container");
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAMessageGAM::Setup() {
|
||||
using namespace MARTe;
|
||||
bool ok = numberOfInputSignals == (intValuesCount + floatValuesCount);
|
||||
if (ok) {
|
||||
ok = numberOfInputSignals > 0u;
|
||||
if (ok) {
|
||||
inputSignals = new void*[numberOfInputSignals];
|
||||
uint32 i;
|
||||
for (i = 0u; i < numberOfInputSignals; i++) {
|
||||
inputSignals[i] = GetInputSignalMemory(i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "At least one input signal shall be defined");
|
||||
}
|
||||
} else {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Number of input signals shall be the same as "
|
||||
"number of expected values.");
|
||||
}
|
||||
if (ok) {
|
||||
inputSignalTypes = new TypeDescriptor[numberOfInputSignals];
|
||||
uint32 i;
|
||||
for (i = 0u; (i < numberOfInputSignals) && (ok); i++) {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, i);
|
||||
inputSignalTypes[i] = inputType;
|
||||
ok = (inputType == UnsignedInteger32Bit) || (inputType == SignedInteger32Bit) ||
|
||||
(inputType == UnsignedInteger16Bit) || (inputType == SignedInteger16Bit) ||
|
||||
(inputType == UnsignedInteger8Bit) || (inputType == SignedInteger8Bit) ||
|
||||
(inputType == Float64Bit) || (inputType == Float32Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, i, signalName);
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "Signal %s shall be defined as 32/16/8 bit signed/unsigned integer "
|
||||
"or as 64/32 float.", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAMessageGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
needsReset = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JAMessageGAM::Execute() {
|
||||
using namespace MARTe;
|
||||
bool ok = true;
|
||||
bool eventDetected = false;
|
||||
uint32 inputPortIndex = 0;
|
||||
uint32 intIndex = 0;
|
||||
uint32 floatIndex = 0;
|
||||
if (operation == Or) {
|
||||
for (inputPortIndex = 0; (inputPortIndex < numberOfInputSignals) && (!eventDetected); inputPortIndex++) {
|
||||
eventDetected = Compare(inputPortIndex, floatIndex, intIndex);
|
||||
}
|
||||
}
|
||||
else if (operation == Nor) {
|
||||
for (inputPortIndex = 0; (inputPortIndex < numberOfInputSignals) && (!eventDetected); inputPortIndex++) {
|
||||
eventDetected = Compare(inputPortIndex, floatIndex, intIndex);
|
||||
}
|
||||
eventDetected = !eventDetected;
|
||||
}
|
||||
else if (operation == And) {
|
||||
eventDetected = Compare(0, floatIndex, intIndex);
|
||||
for (inputPortIndex = 1; (inputPortIndex < numberOfInputSignals); inputPortIndex++) {
|
||||
eventDetected &= Compare(inputPortIndex, floatIndex, intIndex);
|
||||
}
|
||||
}
|
||||
else if (operation == Xor) {
|
||||
uint32 eventDetectedUInt32 = Compare(inputPortIndex, floatIndex, intIndex);
|
||||
for (inputPortIndex = 1; (inputPortIndex < numberOfInputSignals); inputPortIndex++) {
|
||||
eventDetectedUInt32 ^= Compare(inputPortIndex, floatIndex, intIndex);
|
||||
}
|
||||
eventDetected = (eventDetectedUInt32 == 1u);
|
||||
}
|
||||
if (eventDetected) {
|
||||
if (!needsReset) {
|
||||
ok = (MessageI::SendMessage(eventMsg, this) == ErrorManagement::NoError);
|
||||
needsReset = true;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JAMessageGAM::Compare(MARTe::uint32 inputPortIndex, MARTe::uint32 &floatValueIndex, MARTe::uint32 &intValueIndex) {
|
||||
using namespace MARTe;
|
||||
bool ret = false;
|
||||
if (inputSignalTypes[inputPortIndex] == UnsignedInteger32Bit) {
|
||||
ret = ::Compare<uint32>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == SignedInteger32Bit) {
|
||||
ret = ::Compare<int32>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == UnsignedInteger16Bit) {
|
||||
ret = ::Compare<uint16>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == SignedInteger16Bit) {
|
||||
ret = ::Compare<int16>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == UnsignedInteger8Bit) {
|
||||
ret = ::Compare<uint8>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == SignedInteger8Bit) {
|
||||
ret = ::Compare<int8>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesInt[intValueIndex]);
|
||||
++intValueIndex;
|
||||
}
|
||||
else if (inputSignalTypes[inputPortIndex] == Float64Bit) {
|
||||
ret = ::Compare<float64>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesFloat[floatValueIndex]);
|
||||
++floatValueIndex;
|
||||
}
|
||||
else {
|
||||
ret = ::Compare<float32>(comparators[inputPortIndex], inputSignals[inputPortIndex], expectedValuesFloat[floatValueIndex]);
|
||||
++floatValueIndex;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JAMessageGAM, "1.0")
|
||||
@@ -0,0 +1,27 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
#############################################################
|
||||
export TARGET=x86-linux
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
taskset -c 8-11 ./Main.sh -f ../Configurations/JAGyrotronA_FY19_P1.cfg -l RealTimeLoader -m StateMachine:Start
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAModeControlGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAModeControlGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAModeControlGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,56 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JATriangleWaveGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JATriangleWaveGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JATriangleWaveGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
importClass(Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuName=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
var plcIocHlts =selectedrow[0][6];
|
||||
var cuType=selectedrow[0][7];
|
||||
// change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(true)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("CU_TYPE", cuType)
|
||||
if (plcIocHlts == "") {
|
||||
macroInput.put("SHOW_PLC_IOC", "false")
|
||||
}
|
||||
else {
|
||||
macroInput.put("SHOW_PLC_IOC", "true")
|
||||
}
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if (cuType == "POC with CA") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-POCWithCADetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "POC without CA") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-POCWithoutCADetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Plant System Host") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PSHDetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Fast Controller") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PCFDetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Server") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-SRVDetails.opi", 1, macroInput)
|
||||
}
|
||||
else {
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CtrlUnitDetails.opi", 1, macroInput)
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,87 @@
|
||||
<!--
|
||||
$HeadURL: https://svnpub.codac.iter.org/codac/iter/codac/dev/units/m-codac-unit-api/branches/codac-core-6.1/src/main/resources/pom-unit.xml $
|
||||
$Id: pom-unit.xml 96475 2019-01-09 13:47:38Z sivecm $
|
||||
|
||||
Project : CODAC Core System
|
||||
|
||||
Description : Project description file for a CODAC Core System subsystem
|
||||
|
||||
Authors : This file was generated by CODAC development toolkit
|
||||
|
||||
Copyright (c) : 2010-2019 ITER Organization,
|
||||
CS 90 046
|
||||
13067 St. Paul-lez-Durance Cedex
|
||||
France
|
||||
|
||||
This file is part of ITER CODAC software.
|
||||
For the terms and conditions of redistribution or use of this software.
|
||||
refer to the file ITER-LICENSE.TXT located in the top level directory.
|
||||
of the distribution package..
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.iter.codac.units</groupId>
|
||||
<artifactId>EC-GN</artifactId>
|
||||
<packaging>codac</packaging>
|
||||
<version>1.0.0</version>
|
||||
<name>CODAC Core System EC-GN subsystem</name>
|
||||
<description>CODAC Core System EC-GN subsystem</description>
|
||||
<url>http://www.iter.org/</url>
|
||||
|
||||
<!-- project properties -->
|
||||
<properties>
|
||||
<unit.type>subsystem</unit.type>
|
||||
<project.type>iandc</project.type>
|
||||
<rpm.vcs.url>%(/opt/tools/get-vcs-url.sh --path=${project.basedir})</rpm.vcs.url>
|
||||
</properties>
|
||||
|
||||
<!-- parent pom.xml -->
|
||||
<parent>
|
||||
<groupId>org.iter.codac.units</groupId>
|
||||
<artifactId>maven-iter-settings</artifactId>
|
||||
<version>6.3.0</version>
|
||||
</parent>
|
||||
|
||||
<!-- unit owner and developers -->
|
||||
<developers>
|
||||
<developer>
|
||||
<id>ferrog</id>
|
||||
<roles>
|
||||
<role>unit owner</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<!-- configuration of how the project is built -->
|
||||
<build>
|
||||
<!-- default phase is compile -->
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
<!-- this command is executed if you just write 'mvn' -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-iter-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<packaging>
|
||||
<rpmspec file="unit.spec">
|
||||
<source>src</source>
|
||||
<define
|
||||
macroname="project_artifactId">${project.artifactId}</define>
|
||||
<define macroname="project_version">${project.version}</define>
|
||||
<define
|
||||
macroname="project_description">${project.description}</define>
|
||||
</rpmspec>
|
||||
<package name="EC-GN-PSH0PCF-ioc">
|
||||
<url>${rpm.vcs.url}</url>
|
||||
<include name="EC-GN-PSH0PCF" type="ioc" />
|
||||
</package>
|
||||
<package name="EC-GN-PCF0SYSM-ioc">
|
||||
<include name="EC-GN-PCF0SYSM" type="ioc" />
|
||||
</package>
|
||||
</packaging>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,56 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAPreProgrammedGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAPreProgrammedGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAPreProgrammedGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
|
||||
table = widget.getTable()
|
||||
nbColPVs=4
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
table.setCellText(i/nbColPVs, i%nbColPVs +3, PVUtil.getString(triggerPV))
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i/nbColPVs, i%nbColPVs + 3, color)
|
||||
@@ -0,0 +1,146 @@
|
||||
/**
|
||||
* @file RandomDataSource.cpp
|
||||
* @brief Source file for class RandomDataSource
|
||||
* @date 01/03/2017
|
||||
* @author Andre Neto
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class RandomDataSource (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "CompilerTypes.h"
|
||||
#include "RandomDataSource.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
RandomDataSource::RandomDataSource() :
|
||||
MARTe::DataSourceI() {
|
||||
using namespace MARTe;
|
||||
seed = 0u;
|
||||
signalPtr = NULL_PTR(MARTe::char8 *);
|
||||
signalTypeDescriptor = UnsignedInteger8Bit;
|
||||
}
|
||||
|
||||
RandomDataSource::~RandomDataSource() {
|
||||
using namespace MARTe;
|
||||
if (signalPtr) {
|
||||
delete[] signalPtr;
|
||||
}
|
||||
}
|
||||
|
||||
bool RandomDataSource::SetConfiguredDatabase(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = (DataSourceI::SetConfiguredDatabase(data));
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "DataSourceI::SetConfiguredDatabas() failed");
|
||||
}
|
||||
if (ok) {
|
||||
ok = (GetNumberOfSignals() == 1u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "GetNumberOfSignals() != 1u");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
signalTypeDescriptor = GetSignalType(0u);
|
||||
ok = (signalTypeDescriptor.type == UnsignedInteger);
|
||||
if (!ok) {
|
||||
ok = (signalTypeDescriptor.type == SignedInteger);
|
||||
}
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "GetSignalType(0u) != Un/SignedInteger");
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RandomDataSource::Initialise(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = DataSourceI::Initialise(data);
|
||||
if (ok) {
|
||||
ok = data.Read("Seed", seed);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(ErrorManagement::ParametersError, "The Seed shall be specified");
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool RandomDataSource::Synchronise() {
|
||||
using namespace MARTe;
|
||||
|
||||
if (signalTypeDescriptor.numberOfBits == 8u) {
|
||||
GetValue<uint8>();
|
||||
}
|
||||
if (signalTypeDescriptor.numberOfBits == 16u) {
|
||||
GetValue<uint16>();
|
||||
}
|
||||
if (signalTypeDescriptor.numberOfBits == 32u) {
|
||||
GetValue<uint32>();
|
||||
}
|
||||
if (signalTypeDescriptor.numberOfBits == 64u) {
|
||||
GetValue<uint64>();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RandomDataSource::AllocateMemory() {
|
||||
signalPtr = new MARTe::char8[signalTypeDescriptor.numberOfBits];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RandomDataSource::GetSignalMemoryBuffer(const MARTe::uint32 signalIdx, const MARTe::uint32 bufferIdx, void *&signalAddress) {
|
||||
signalAddress = &signalPtr[0];
|
||||
return true;
|
||||
}
|
||||
|
||||
const MARTe::char8 *RandomDataSource::GetBrokerName(MARTe::StructuredDataI &data, const MARTe::SignalDirection direction) {
|
||||
using namespace MARTe;
|
||||
|
||||
static bool firstTime = true;
|
||||
const char8 * broker;// = NULL_PTR(const char8 *);
|
||||
if (firstTime) {
|
||||
broker = "MemoryMapSynchronisedInputBroker";
|
||||
}
|
||||
else {
|
||||
firstTime = false;
|
||||
broker = "MemoryMapInputBroker";
|
||||
}
|
||||
return broker;
|
||||
}
|
||||
|
||||
bool RandomDataSource::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(RandomDataSource, "1.0")
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<display typeId="org.csstudio.opibuilder.Display" version="1.0.0">
|
||||
<actions hook="false" hook_all="false" />
|
||||
<auto_scale_widgets>
|
||||
<auto_scale_widgets>false</auto_scale_widgets>
|
||||
<min_width>-1</min_width>
|
||||
<min_height>-1</min_height>
|
||||
</auto_scale_widgets>
|
||||
<auto_zoom_to_fit_all>false</auto_zoom_to_fit_all>
|
||||
<background_color>
|
||||
<color name="IO Background" red="235" green="235" blue="235" />
|
||||
</background_color>
|
||||
<boy_version>5.0.0.201512210936</boy_version>
|
||||
<foreground_color>
|
||||
<color name="IO Grid" red="215" green="215" blue="215" />
|
||||
</foreground_color>
|
||||
<grid_space>1</grid_space>
|
||||
<height>1760</height>
|
||||
<macros>
|
||||
<include_parent_macros>true</include_parent_macros>
|
||||
</macros>
|
||||
<name>MAIN DISPLAY AREA - MIMIC</name>
|
||||
<rules />
|
||||
<scripts />
|
||||
<show_close_button>true</show_close_button>
|
||||
<show_edit_range>true</show_edit_range>
|
||||
<show_grid>true</show_grid>
|
||||
<show_ruler>true</show_ruler>
|
||||
<snap_to_geometry>true</snap_to_geometry>
|
||||
<widget_type>Display</widget_type>
|
||||
<width>3236</width>
|
||||
<wuid>-14a921ec:134b2495e46:-7f53</wuid>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<widget typeId="org.csstudio.opibuilder.widgets.groupingContainer" version="1.0.0">
|
||||
<actions hook="false" hook_all="false" />
|
||||
<background_color>
|
||||
<color name="IO Background" red="235" green="235" blue="235" />
|
||||
</background_color>
|
||||
<border_color>
|
||||
<color name="IO Border" red="0" green="0" blue="0" />
|
||||
</border_color>
|
||||
<border_style>0</border_style>
|
||||
<border_width>1</border_width>
|
||||
<enabled>true</enabled>
|
||||
<fc>false</fc>
|
||||
<font>
|
||||
<opifont.name fontName="DejaVu Sans Mono" height="36" style="0">IO Title</opifont.name>
|
||||
</font>
|
||||
<foreground_color>
|
||||
<color name="IO Foreground" red="0" green="0" blue="0" />
|
||||
</foreground_color>
|
||||
<height>1760</height>
|
||||
<lock_children>false</lock_children>
|
||||
<macros>
|
||||
<include_parent_macros>true</include_parent_macros>
|
||||
</macros>
|
||||
<name>MAIN DISPLAY AREA - MIMIC</name>
|
||||
<rules />
|
||||
<scale_options>
|
||||
<width_scalable>false</width_scalable>
|
||||
<height_scalable>false</height_scalable>
|
||||
<keep_wh_ratio>false</keep_wh_ratio>
|
||||
</scale_options>
|
||||
<scripts />
|
||||
<show_scrollbar>false</show_scrollbar>
|
||||
<tooltip></tooltip>
|
||||
<transparent>true</transparent>
|
||||
<visible>true</visible>
|
||||
<widget_type>Grouping Container</widget_type>
|
||||
<width>3236</width>
|
||||
<wuid>-28c93393:14b0cb4ebee:-6a50</wuid>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<widget typeId="org.csstudio.opibuilder.widgets.groupingContainer" version="1.0.0">
|
||||
<actions hook="false" hook_all="false" />
|
||||
<background_color>
|
||||
<color name="IO Background" red="235" green="235" blue="235" />
|
||||
</background_color>
|
||||
<border_color>
|
||||
<color name="IO Border" red="0" green="0" blue="0" />
|
||||
</border_color>
|
||||
<border_style>0</border_style>
|
||||
<border_width>2</border_width>
|
||||
<enabled>true</enabled>
|
||||
<fc>false</fc>
|
||||
<font>
|
||||
<opifont.name fontName="DejaVu Sans Mono" height="18" style="0">IO Title</opifont.name>
|
||||
</font>
|
||||
<foreground_color>
|
||||
<color name="IO Foreground" red="0" green="0" blue="0" />
|
||||
</foreground_color>
|
||||
<height>1760</height>
|
||||
<lock_children>false</lock_children>
|
||||
<macros>
|
||||
<include_parent_macros>true</include_parent_macros>
|
||||
</macros>
|
||||
<name>Information Layer</name>
|
||||
<rules>
|
||||
<rule name="MakeLayerVisible" prop_id="visible" out_exp="false">
|
||||
<exp bool_exp="pv0==0">
|
||||
<value>false</value>
|
||||
</exp>
|
||||
<pv trig="true">loc://$(DID)_INFO_SHOW(0)</pv>
|
||||
</rule>
|
||||
</rules>
|
||||
<scale_options>
|
||||
<width_scalable>false</width_scalable>
|
||||
<height_scalable>false</height_scalable>
|
||||
<keep_wh_ratio>false</keep_wh_ratio>
|
||||
</scale_options>
|
||||
<scripts />
|
||||
<show_scrollbar>false</show_scrollbar>
|
||||
<tooltip>$(name)</tooltip>
|
||||
<transparent>true</transparent>
|
||||
<visible>true</visible>
|
||||
<widget_type>Grouping Container</widget_type>
|
||||
<width>3236</width>
|
||||
<wuid>-1e0f3b69:149c8d6d12f:-432f</wuid>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
</widget>
|
||||
<widget typeId="org.csstudio.opibuilder.widgets.groupingContainer" version="1.0.0">
|
||||
<actions hook="false" hook_all="false" />
|
||||
<background_color>
|
||||
<color name="IO Background" red="235" green="235" blue="235" />
|
||||
</background_color>
|
||||
<border_color>
|
||||
<color name="IO Border" red="0" green="0" blue="0" />
|
||||
</border_color>
|
||||
<border_style>0</border_style>
|
||||
<border_width>2</border_width>
|
||||
<enabled>true</enabled>
|
||||
<fc>false</fc>
|
||||
<font>
|
||||
<opifont.name fontName="DejaVu Sans Mono" height="18" style="0">IO Title</opifont.name>
|
||||
</font>
|
||||
<foreground_color>
|
||||
<color name="IO Foreground" red="0" green="0" blue="0" />
|
||||
</foreground_color>
|
||||
<height>1760</height>
|
||||
<lock_children>false</lock_children>
|
||||
<macros>
|
||||
<include_parent_macros>true</include_parent_macros>
|
||||
</macros>
|
||||
<name>Static Data Layer</name>
|
||||
<rules />
|
||||
<scale_options>
|
||||
<width_scalable>false</width_scalable>
|
||||
<height_scalable>false</height_scalable>
|
||||
<keep_wh_ratio>false</keep_wh_ratio>
|
||||
</scale_options>
|
||||
<scripts />
|
||||
<show_scrollbar>true</show_scrollbar>
|
||||
<tooltip>$(name)</tooltip>
|
||||
<transparent>true</transparent>
|
||||
<visible>true</visible>
|
||||
<widget_type>Grouping Container</widget_type>
|
||||
<width>3236</width>
|
||||
<wuid>-1e0f3b69:149c8d6d12f:-4384</wuid>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
</widget>
|
||||
<widget typeId="org.csstudio.opibuilder.widgets.checkbox" version="1.0.0">
|
||||
<actions hook="false" hook_all="false" />
|
||||
<alarm_pulsing>false</alarm_pulsing>
|
||||
<auto_size>true</auto_size>
|
||||
<backcolor_alarm_sensitive>true</backcolor_alarm_sensitive>
|
||||
<background_color>
|
||||
<color name="IO Background" red="235" green="235" blue="235" />
|
||||
</background_color>
|
||||
<bit>0</bit>
|
||||
<border_alarm_sensitive>false</border_alarm_sensitive>
|
||||
<border_color>
|
||||
<color name="IO Border" red="0" green="0" blue="0" />
|
||||
</border_color>
|
||||
<border_style>0</border_style>
|
||||
<border_width>2</border_width>
|
||||
<enabled>true</enabled>
|
||||
<font>
|
||||
<opifont.name fontName="DejaVu Sans Mono" height="12" style="0">IO Label</opifont.name>
|
||||
</font>
|
||||
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
|
||||
<foreground_color>
|
||||
<color name="IO Text Fg" red="0" green="0" blue="0" />
|
||||
</foreground_color>
|
||||
<height>45</height>
|
||||
<label>Show Info</label>
|
||||
<name>Show/Hide Tickbox</name>
|
||||
<pv_name>loc://$(DID)_INFO_SHOW(0)</pv_name>
|
||||
<pv_value />
|
||||
<rules />
|
||||
<scale_options>
|
||||
<width_scalable>false</width_scalable>
|
||||
<height_scalable>false</height_scalable>
|
||||
<keep_wh_ratio>false</keep_wh_ratio>
|
||||
</scale_options>
|
||||
<scripts />
|
||||
<selected_color>
|
||||
<color name="IO OutputPV Fg" red="0" green="0" blue="0" />
|
||||
</selected_color>
|
||||
<tooltip>$(name)</tooltip>
|
||||
<visible>true</visible>
|
||||
<widget_type>Check Box</widget_type>
|
||||
<width>225</width>
|
||||
<wuid>-17ac9c77:14e0084b99a:2504</wuid>
|
||||
<x>3000</x>
|
||||
<y>0</y>
|
||||
</widget>
|
||||
</widget>
|
||||
</display>
|
||||
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JABitReverseGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JABitReverseGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JABitReverseGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @file JATerminalInterfaceGAM.h
|
||||
* @brief Header file for class JATerminalInterfaceGAM
|
||||
* @date Feb 19, 2020
|
||||
* @author kuchida
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This header file contains the declaration of the class JATerminalInterfaceGAM
|
||||
* with all of its public, protected and private members. It may also include
|
||||
* definitions for inline methods which need to be visible to the compiler.
|
||||
*/
|
||||
|
||||
#ifndef GAMS_JATerminalInterfaceGAM_H_
|
||||
#define GAMS_JATerminalInterfaceGAM_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "GAM.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Class declaration */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief GAM calculates one output value by comparing input value and fixed parameters.
|
||||
*
|
||||
* The configuration syntax is (names and signal quantity are only given as an example):
|
||||
* <pre>
|
||||
*
|
||||
* +terminalInterfaceGAM = {
|
||||
* Class = JATerminalInterfaceGAM
|
||||
* mhvps_hvon_term = 4
|
||||
* aps_hvon_term = 1
|
||||
* aps_swon_term = 16
|
||||
* bps_hvon_term = 2
|
||||
* bps_swon_term = 8
|
||||
* InputSignals = {
|
||||
* MHVPS_HVON = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* APS_HVON = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* APS_SWON = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* BPS_HVON = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* BPS_SWON = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* Value = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* }
|
||||
* OutputSignals = {
|
||||
* Value = {
|
||||
* DataSource = NI6259
|
||||
* Type = uint32
|
||||
* Trigger = 1
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
|
||||
class JATerminalInterfaceGAM : public MARTe::GAM, public MARTe::StatefulI {
|
||||
public:
|
||||
CLASS_REGISTER_DECLARATION()
|
||||
|
||||
JATerminalInterfaceGAM();
|
||||
|
||||
virtual ~JATerminalInterfaceGAM();
|
||||
|
||||
virtual bool Initialise(MARTe::StructuredDataI & data);
|
||||
|
||||
virtual bool Setup();
|
||||
|
||||
virtual bool Execute();
|
||||
|
||||
virtual bool PrepareNextState(const MARTe::char8 * const currentStateName,
|
||||
const MARTe::char8 * const nextStateName);
|
||||
|
||||
private:
|
||||
// Fixed GAM input
|
||||
MARTe::uint32 mhvps_hvon_term;
|
||||
MARTe::uint32 aps_hvon_term;
|
||||
MARTe::uint32 aps_swon_term;
|
||||
MARTe::uint32 bps_hvon_term;
|
||||
MARTe::uint32 bps_swon_term;
|
||||
|
||||
// Input signals
|
||||
//MARTe::uint32 *mhvps_manm;
|
||||
MARTe::uint32 *mhvps_hvon;
|
||||
|
||||
//MARTe::uint32 *aps_manm;
|
||||
MARTe::uint32 *aps_hvon;
|
||||
MARTe::uint32 *aps_swon;
|
||||
|
||||
//MARTe::uint32 *bps_manm;
|
||||
MARTe::uint32 *bps_hvon;
|
||||
MARTe::uint32 *bps_swon;
|
||||
|
||||
MARTe::uint32 *short_pulse_mode;
|
||||
|
||||
MARTe::uint32 *stateMachineOutput;
|
||||
MARTe::uint8 *ni6528p3Value;
|
||||
MARTe::uint8 *ni6528p4Value;
|
||||
|
||||
// Output signals
|
||||
MARTe::uint32 *outputSignalNI6259;
|
||||
MARTe::uint8 *outputSignalNI6528P3;
|
||||
MARTe::uint8 *outputSignalNI6528P4;
|
||||
|
||||
MARTe::uint8 aps_hvon_state;
|
||||
MARTe::uint8 aps_swon_state;
|
||||
MARTe::uint8 mhvps_hvon_state;
|
||||
MARTe::uint8 bps_hvon_state;
|
||||
MARTe::uint8 bps_swon_state;
|
||||
MARTe::uint8 p3Value;
|
||||
MARTe::uint8 p4Value;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Inline method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* GAMS_JATerminalInterfaceGAM_H_ */
|
||||
@@ -0,0 +1,5 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
ARCH = linux-x86_64
|
||||
TARGETS = envPaths
|
||||
include $(TOP)/configure/RULES.ioc
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,206 @@
|
||||
/**
|
||||
* @file JATerminalInterfaceGAM.cpp
|
||||
* @brief Source file for class JATerminalInterfaceGAM
|
||||
* @date Feb 19, 2019
|
||||
* @author kuchida
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JATerminalInterfaceGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "JATerminalInterfaceGAM.h"
|
||||
|
||||
#include "AdvancedErrorManagement.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
JATerminalInterfaceGAM::JATerminalInterfaceGAM() {
|
||||
|
||||
// Fixed GAM input
|
||||
aps_hvon_term = 0;
|
||||
|
||||
// Parameters which get from Input signals.
|
||||
mhvps_hvon = NULL_PTR(MARTe::uint32 *);
|
||||
aps_hvon = NULL_PTR(MARTe::uint32 *);
|
||||
aps_swon = NULL_PTR(MARTe::uint32 *);
|
||||
bps_hvon = NULL_PTR(MARTe::uint32 *);
|
||||
bps_swon = NULL_PTR(MARTe::uint32 *);
|
||||
|
||||
stateMachineOutput = NULL_PTR(MARTe::uint32 *);
|
||||
|
||||
// write out target.
|
||||
outputSignalNI6259 = NULL_PTR(MARTe::uint32 *);
|
||||
outputSignalNI6528P3 = NULL_PTR(MARTe::uint8 *);
|
||||
outputSignalNI6528P4 = NULL_PTR(MARTe::uint8 *);
|
||||
|
||||
aps_hvon_state = 0;
|
||||
aps_swon_state = 0;
|
||||
mhvps_hvon_state = 0;
|
||||
bps_hvon_state = 0;
|
||||
bps_swon_state = 0;
|
||||
p3Value = 0;
|
||||
p4Value = 0;
|
||||
}
|
||||
|
||||
JATerminalInterfaceGAM::~JATerminalInterfaceGAM() {
|
||||
}
|
||||
|
||||
bool JATerminalInterfaceGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
if (ok) {
|
||||
ok = data.Read("mhvps_hvon_term", mhvps_hvon_term);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The mhvps_hvon_term shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Read("aps_hvon_term", aps_hvon_term);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The aps_hvon_term shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Read("aps_swon_term", aps_swon_term);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The aps_swon_term shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Read("bps_hvon_term", bps_hvon_term);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The bps_hvon_term shall be specified");
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
ok = data.Read("bps_swon_term", bps_swon_term);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "The bps_swon_term shall be specified");
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JATerminalInterfaceGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JATerminalInterfaceGAM::Setup() {
|
||||
using namespace MARTe;
|
||||
bool ok = (numberOfInputSignals == 9u);
|
||||
if (ok) {
|
||||
ok = (numberOfOutputSignals == 3u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Three output signals shall be defined");
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Nine input signals shall be defined");
|
||||
}
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfInputSignals; c++) {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, c);
|
||||
ok = (inputType == UnsignedInteger32Bit || inputType == UnsignedInteger8Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32 or uint8", signalName.Buffer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfOutputSignals; c++) {
|
||||
TypeDescriptor outputType = GetSignalType(OutputSignals, c);
|
||||
ok = (outputType == UnsignedInteger32Bit || outputType == UnsignedInteger8Bit);
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32 or uint8", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
//mhvps_manm = reinterpret_cast<uint32 *>(GetInputSignalMemory(0));
|
||||
mhvps_hvon = reinterpret_cast<uint32 *>(GetInputSignalMemory(0));
|
||||
//aps_manm = reinterpret_cast<uint32 *>(GetInputSignalMemory(2));
|
||||
aps_hvon = reinterpret_cast<uint32 *>(GetInputSignalMemory(1));
|
||||
aps_swon = reinterpret_cast<uint32 *>(GetInputSignalMemory(2));
|
||||
//bps_manm = reinterpret_cast<uint32 *>(GetInputSignalMemory(5));
|
||||
bps_hvon = reinterpret_cast<uint32 *>(GetInputSignalMemory(3));
|
||||
bps_swon = reinterpret_cast<uint32 *>(GetInputSignalMemory(4));
|
||||
short_pulse_mode = reinterpret_cast<uint32 *>(GetInputSignalMemory(5));
|
||||
stateMachineOutput = reinterpret_cast<uint32 *>(GetInputSignalMemory(6));
|
||||
ni6528p3Value = reinterpret_cast<uint8 *>(GetInputSignalMemory(7));
|
||||
ni6528p4Value = reinterpret_cast<uint8 *>(GetInputSignalMemory(8));
|
||||
|
||||
outputSignalNI6259 = reinterpret_cast<uint32 *>(GetOutputSignalMemory(0));
|
||||
outputSignalNI6528P3 = reinterpret_cast<uint8 *>(GetOutputSignalMemory(1));
|
||||
outputSignalNI6528P4 = reinterpret_cast<uint8 *>(GetOutputSignalMemory(2));
|
||||
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JATerminalInterfaceGAM::Execute() {
|
||||
using namespace MARTe;
|
||||
uint8 sm = *stateMachineOutput;
|
||||
|
||||
|
||||
//Update HVPS state
|
||||
aps_hvon_state = ((sm >> (0))&1);
|
||||
aps_swon_state = ((sm >> (4))&1);
|
||||
mhvps_hvon_state = ((sm >> (2))&1);
|
||||
bps_hvon_state = ((sm >> (1))&1);
|
||||
bps_swon_state = ((sm >> (3))&1);
|
||||
|
||||
if(*short_pulse_mode == 1){
|
||||
p3Value = 1*aps_hvon_state + 8*bps_hvon_state +16*bps_swon_state;
|
||||
*outputSignalNI6259 = 1*aps_swon_state;
|
||||
//uint8 ni6528p3ValueTemp = 0;//*ni6528p3Value;
|
||||
//ni6528p3ValueTemp &= ~(1<<2); //Does not turn on ni6258 aps switch
|
||||
//Update terminal value
|
||||
//*outputSignalNI6528P3 = ~(ni6528p3ValueTemp | p3Value);
|
||||
*outputSignalNI6528P3 = ~p3Value;
|
||||
//REPORT_ERROR(ErrorManagement::Debug, "short pulse mode with p3: %d.", p3Value);
|
||||
} else {
|
||||
p3Value = 1*aps_hvon_state +2*aps_swon_state + 8*bps_hvon_state +16*bps_swon_state;
|
||||
//REPORT_ERROR(ErrorManagement::Debug, "long pulse mode with p3: %d.", p3Value);
|
||||
}
|
||||
|
||||
p4Value = 8*mhvps_hvon_state;
|
||||
*outputSignalNI6528P4 = ~(*ni6528p4Value | p4Value);
|
||||
return true;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JATerminalInterfaceGAM, "1.0")
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="P01" description="ITER-EC-GN-P01" enabled="true" opi_file="./mimics/ITER-EC-GN-P01_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-P01" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-P01" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
<xi:include href="Navigation_EC-GN-P01-GAF.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-GAFP.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-GBF.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-GBFP.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-GPF.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-GPS.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-PA1F.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-PA2F.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-PB1F.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-PB2F.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
<xi:include href="Navigation_EC-GN-P01-PMF.xml" >
|
||||
<xi:fallback ></xi:fallback>
|
||||
</xi:include>
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
+StateMachine = {
|
||||
Class = StateMachine
|
||||
+INITIAL = {
|
||||
Class = ReferenceContainer
|
||||
+Start = {
|
||||
Class = StateMachineEvent
|
||||
NextState = "WAITSTANDBY"
|
||||
NextStateError = "WAITSTANDBY"
|
||||
+PrepareNextStateMsg = {
|
||||
Class = Message
|
||||
Destination = JAGyrotronRTApp
|
||||
Mode = ExpectsReply
|
||||
Function = PrepareNextState
|
||||
+Parameters = {
|
||||
Class = ConfigurationDatabase
|
||||
param1 = WaitStandby
|
||||
}
|
||||
}
|
||||
+StartNextStateExecutionMsg = {
|
||||
Class = Message
|
||||
Destination = JAGyrotronRTApp
|
||||
Function = StartNextStateExecution
|
||||
Mode = ExpectsReply
|
||||
}
|
||||
}
|
||||
}
|
||||
+WAITSTANDBY = {
|
||||
Class = ReferenceContainer
|
||||
+Stay = {
|
||||
Class = StateMachineEvent
|
||||
NextState = "WAITSTANDBY"
|
||||
NextStateError = "WAITSTANDBY"
|
||||
+StopCurrentStateExecutionMsg = {
|
||||
Class = Message
|
||||
Destination = JAGyrotronRTApp
|
||||
Function = StopCurrentStateExecution
|
||||
Mode = ExpectsReply
|
||||
}
|
||||
+PrepareNextStateMsg = {
|
||||
Class = Message
|
||||
Destination = JAGyrotronRTApp
|
||||
Mode = ExpectsReply
|
||||
Function = PrepareNextState
|
||||
+Parameters = {
|
||||
Class = ConfigurationDatabase
|
||||
param1 = WaitStandby
|
||||
}
|
||||
}
|
||||
+StartNextStateExecutionMsg = {
|
||||
Class = Message
|
||||
Destination = JAGyrotronRTApp
|
||||
Function = StartNextStateExecution
|
||||
Mode = ExpectsReply
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+JAGyrotronRTApp = {
|
||||
Class = RealTimeApplication
|
||||
+Functions = {
|
||||
Class = ReferenceContainer
|
||||
+GAMSDNSubCommand = {
|
||||
Class = IOGAM
|
||||
InputSignals = {
|
||||
Command = {
|
||||
DataSource = SDNSubCommands
|
||||
Type = uint16
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 64
|
||||
Ranges = {{0 0}}
|
||||
Frequency = 1
|
||||
}
|
||||
ESDNTime = {
|
||||
DataSource = SDNSubCommands
|
||||
Type = uint32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNTimeDisplay = {
|
||||
Alias = ESDNTime
|
||||
DataSource = SDNSubCommands
|
||||
Type = uint32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
}
|
||||
OutputSignals = {
|
||||
Command = {
|
||||
DataSource = Display
|
||||
Type = uint16
|
||||
}
|
||||
ESDNTime = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
ESDNTimeDisplay = {
|
||||
DataSource = Display
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
}
|
||||
+GAMSDNSubWaveform = {
|
||||
Class = IOGAM
|
||||
InputSignals = {
|
||||
GYA_FHPS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_MCPS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_CCPS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
MHVPS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_BPS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_APS_SP = {
|
||||
DataSource = SDNSubWaveform
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
WaveformPacketIDFor1kHz = {
|
||||
DataSource = SDNSubWaveform
|
||||
Alias = WaveformPacketID
|
||||
Type = uint16
|
||||
}
|
||||
}
|
||||
OutputSignals = {
|
||||
GYA_FHPS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
GYA_MCPS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
GYA_CCPS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
MHVPS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
GYA_BPS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
GYA_APS_SP = {
|
||||
DataSource = DDB1
|
||||
Type = float32
|
||||
}
|
||||
WaveformPacketIDFor1kHz = {
|
||||
DataSource = DDB1
|
||||
Alias = WaveformPacketID
|
||||
Type = uint16
|
||||
}
|
||||
}
|
||||
}
|
||||
+GAMReply = {
|
||||
Class = IOGAM
|
||||
InputSignals = {
|
||||
ESDNTime = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
WaveformPacketID = {
|
||||
DataSource = DDB1
|
||||
Type = uint16
|
||||
}
|
||||
}
|
||||
OutputSignals = {
|
||||
ESDNTime = {
|
||||
DataSource = SDNReply
|
||||
Type = uint32
|
||||
Trigger = 1
|
||||
}
|
||||
ReplyWaveformAck = {
|
||||
DataSource = SDNReply
|
||||
Type = uint16
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+Data = {
|
||||
Class = ReferenceContainer
|
||||
DefaultDataSource = DDB1
|
||||
+DDB1 = {
|
||||
Class = GAMDataSource
|
||||
}
|
||||
+Timings = {
|
||||
Class = TimingDataSource
|
||||
}
|
||||
+Display = {
|
||||
Class = LoggerDataSource
|
||||
}
|
||||
+SDNSubCommands = {
|
||||
Class = SDN::SDNSubscriber
|
||||
Topic = ECPC2SCUJA
|
||||
Interface = lo
|
||||
CPUs = 0x2
|
||||
Locked = 1
|
||||
Timeout = 1000 // TODO: change to 1 ms
|
||||
Signals = {
|
||||
Header = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 48
|
||||
}
|
||||
ESDNHeaderVersionId = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNHeaderSize = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNStatus = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNDoNotUse = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNTime = {
|
||||
Type = uint32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
Command = {
|
||||
Type = uint16
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 64
|
||||
}
|
||||
}
|
||||
}
|
||||
+SDNReply = {
|
||||
Class = SDN::SDNPublisher
|
||||
Topic = SCUJA2ECPC
|
||||
Interface = lo
|
||||
CPUs = 0x8
|
||||
Locked = 1
|
||||
Signals = {
|
||||
Header = {
|
||||
Type = uint8
|
||||
NumberOfElements = 48
|
||||
}
|
||||
ESDNHeaderVersionId = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNHeaderSize = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNStatus = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNDoNotUse = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNTime = {
|
||||
Type = uint32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ReplyStatus = {
|
||||
Type = uint16
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ReplyWaveformAck = {
|
||||
Type = uint16
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
+SDNSubWaveform = {
|
||||
Class = SDN::SDNSubscriber
|
||||
Topic = ECPC2SCUJAWF
|
||||
Interface = lo
|
||||
Locked = 1
|
||||
Timeout = 1000 // TODO: change to 1 ms
|
||||
Signals = {
|
||||
Header = {
|
||||
Type = uint8
|
||||
NumberOfElements = 48
|
||||
}
|
||||
ESDNHeaderVersionId = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNHeaderSize = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNStatus = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNDoNotUse = {
|
||||
Type = uint8
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
ESDNTime = {
|
||||
Type = uint32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
WaveformPacketID = {
|
||||
Type = uint16
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_MCPS_SP = {
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_CCPS_SP = {
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
MHVPS_SP = {
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_BPS_SP = {
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
GYA_APS_SP = {
|
||||
Type = float32
|
||||
NumberOfDimensions = 1
|
||||
NumberOfElements = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+States = {
|
||||
Class = ReferenceContainer
|
||||
+WaitStandby = {
|
||||
Class = RealTimeState
|
||||
+Threads = {
|
||||
Class = ReferenceContainer
|
||||
+Thread1 = {
|
||||
Class = RealTimeThread
|
||||
Functions = {GAMSDNSubCommand GAMSDNSubWaveform GAMReply}
|
||||
CPUs = 0x1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+Scheduler = {
|
||||
Class = GAMScheduler
|
||||
TimingDataSource = Timings
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
//+======================================================================
|
||||
// $HeadURL: https://svnpub.iter.org/codac/iter/codac/dev/units/m-sdd-translator-parts/tags/CODAC-CORE-6.0.0/org.iter.codac.sdd.translators/src/main/resources/templates/sdn/configure_sdn.cpp.vm $
|
||||
// $Id: configure_sdn.cpp.vm 83098 2018-01-08 13:23:38Z cesnikt $
|
||||
//
|
||||
// Project : CODAC Core System
|
||||
//
|
||||
// Description : SDN Program - Gyrotron01DAN
|
||||
//
|
||||
// Author : Kirti Mahajan, Lana Abadie and TCS (link with velocity and SDD model)
|
||||
//
|
||||
// Copyright (c) : 2010-2018 ITER Organization,
|
||||
// CS 90 046
|
||||
// 13067 St. Paul-lez-Durance Cedex
|
||||
// France
|
||||
//
|
||||
// This file is part of ITER CODAC software.
|
||||
// For the terms and conditions of redistribution or use of this software
|
||||
// refer to the file ITER-LICENSE.TXT located in the top level directory
|
||||
// of the distribution package.
|
||||
//
|
||||
//-======================================================================
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <sdn.h>
|
||||
#include "includetopics.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/* Create variables for the topics on which application is publishing */
|
||||
//+P=====================================================================
|
||||
//-P=====================================================================
|
||||
|
||||
/* Create variables for topics on which application is subscribing */
|
||||
//+S=====================================================================
|
||||
//-S=====================================================================
|
||||
|
||||
int configureSDN()
|
||||
{
|
||||
|
||||
SR_RET sr_ret = SR_OK;
|
||||
|
||||
//+P=====================================================================
|
||||
//-P=====================================================================
|
||||
|
||||
//+S=====================================================================
|
||||
//-S=====================================================================
|
||||
|
||||
return sr_ret;
|
||||
|
||||
}
|
||||
|
||||
int cleanupSDN()
|
||||
{
|
||||
|
||||
SR_RET sr_ret = SR_OK;
|
||||
|
||||
/* Unregister publisher */
|
||||
//+P=====================================================================
|
||||
//-P=====================================================================
|
||||
|
||||
/* Unregister subscriber */
|
||||
//+S=====================================================================
|
||||
//-S=====================================================================
|
||||
|
||||
return sr_ret;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
#!/bin/bash
|
||||
#Arguments -f FILENAME -m MESSAGE [-d cgdb|strace] -x DAN_CONFIG_LOCATION -r root
|
||||
#-f FILENAME=MARTe configuration file
|
||||
#-m MESSAGE=Start message
|
||||
#-d cgdb=Run with cgdb
|
||||
#-d strace=Run with strace
|
||||
#-x DAN_CONFIG_LOCATION=Location of the DANConfig.xml (e.g. ~/Projects/ECJASDN/Configurations/DANTestConfig.xml)
|
||||
#-r run as root
|
||||
|
||||
#Run with cgdb or strace?
|
||||
DEBUG=""
|
||||
|
||||
#Consume input arguments
|
||||
while [[ $# -gt 1 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-f|--file)
|
||||
FILE="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-m|--message)
|
||||
MESSAGE="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-s|--state)
|
||||
STATE="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-d|--debug)
|
||||
DEBUG="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-x|--dan_config)
|
||||
DAN_CONFIG_LOCATION="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-i|--dan_ip)
|
||||
DAN_MASTER_IP="$2"
|
||||
shift # past argument
|
||||
;;
|
||||
-r|--root)
|
||||
RUN_AS_ROOT="root"
|
||||
shift # past argument
|
||||
;;
|
||||
--default)
|
||||
DEFAULT=YES
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift # past argument or value
|
||||
done
|
||||
|
||||
if [ -z ${MARTe2_DIR+x} ]; then
|
||||
echo "Please set the MARTe2_DIR environment variable";
|
||||
exit;
|
||||
fi
|
||||
|
||||
if [ -z ${MARTe2_Components_DIR+x} ]; then
|
||||
#Check if this is a CCS deployment
|
||||
MARTe2_Components_DIR_CSS=$MARTe2_DIR/Build/x86-linux/Components/
|
||||
if [ -d ${MARTe2_Components_DIR_CSS+x} ]; then
|
||||
MARTe2_Components_DIR=$MARTe2_DIR
|
||||
else
|
||||
echo "Please set the MARTe2_Components_DIR environment variable";
|
||||
exit;
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $MARTe2_Components_DIR
|
||||
|
||||
LD_LIBRARY_PATH=.
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_DIR/Build/x86-linux/Core/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/EPICSCA/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/LinuxTimer/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/LoggerDataSource/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/DAN/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/NI6259/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/NI6368/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/SDN/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/UDP/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/MDSWriter/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/RealTimeThreadAsyncBridge/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/RealTimeThreadSynchronisation/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/DataSources/FileDataSource/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/IOGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/BaseLib2GAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/ConversionGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/FilterGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/StatisticsGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/WaveformGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/GAMs/ConstantGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/Interfaces/BaseLib2Wrapper/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/Interfaces/SysLogger/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MARTe2_Components_DIR/Build/x86-linux/Components/Interfaces/EPICS/
|
||||
### Add own datasource lib path
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/DataSources/RandomDataSource/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/DataSources/NI6528/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/DataSources/JAEPICSCA/
|
||||
### Add own GAM lib path
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/ESDNValidationGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAMessageGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAPreProgrammedGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JACountdownGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAWaitStandbyGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAConditionalSignalUpdateGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JATimerGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAESDNProcessCommandGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAModeControlGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JATimedSignalUpdateGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAHVArmedSyncGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JARFONSyncGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JAWFRecordGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JATriangleWaveGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JARampupGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JACounterGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JARTStateMachineGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JASDNRTStateMachineGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JATerminalInterfaceGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JABitSumGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JASourceChoiseGAM/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/JABitReverseGAM/
|
||||
### Add EPICS lib path
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$EPICS_BASE/lib/$EPICS_HOST_ARCH
|
||||
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Build/x86-linux/GAMs/FilterDownsamplingGAM/
|
||||
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mdsplus/lib64/
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SDN_CORE_LIBRARY_DIR
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/codac/lib/
|
||||
|
||||
|
||||
echo $LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
|
||||
|
||||
#Starts the DAN services only if required
|
||||
if [ ! -z "$DAN_CONFIG_LOCATION" ]; then
|
||||
export DAN_ARCHIVE_MASTER=$DAN_MASTER_IP
|
||||
echo $DAN_MASTER_IP
|
||||
/opt/codac/bin/danApiTool api close
|
||||
/opt/codac/bin/danApiTool api init $DAN_CONFIG_LOCATION
|
||||
fi
|
||||
|
||||
NR_CPUS=16
|
||||
#Setup performance
|
||||
#Disable CPU speed changing
|
||||
#service cpuspeed stop
|
||||
#memo:Redirecting to /bin/systemctl stop cpuspeed.service
|
||||
#memo:Failed to stop cpuspeed.service: Unit cpuspeed.service not loaded.
|
||||
#
|
||||
|
||||
# Migrate irq to CPU0
|
||||
#for D in $(ls /proc/irq)
|
||||
#do
|
||||
#if [ -x "/proc/irq/$D" ] && [ $D != "0" ]
|
||||
#then
|
||||
# echo $D
|
||||
# echo 1 > /proc/irq/$D/smp_affinity
|
||||
#fi
|
||||
#done
|
||||
|
||||
|
||||
#Location of the MARTe2 application loader
|
||||
MARTe2APP=$MARTe2_DIR/Build/x86-linux/App/MARTeApp.ex
|
||||
|
||||
#Start with cgdb or with strace
|
||||
if [ "$DEBUG" = "cgdb" ]; then
|
||||
cgdb --args $MARTe2APP -l RealTimeLoader -f $FILE -m $MESSAGE
|
||||
elif [ "$DEBUG" = "strace" ]; then
|
||||
strace -o/tmp/strace.err $MARTe2APP -l RealTimeLoader -f $FILE -m $MESSAGE
|
||||
else
|
||||
if [ -z ${RUN_AS_ROOT+x} ]; then
|
||||
if [ -z ${STATE+x} ]; then
|
||||
echo "taskset was not used."
|
||||
sleep 1
|
||||
$MARTe2APP -l RealTimeLoader -f $FILE -m $MESSAGE
|
||||
else
|
||||
$MARTe2APP -l RealTimeLoader -f $FILE -s $STATE
|
||||
fi
|
||||
else
|
||||
if [ -z ${STATE+x} ]; then
|
||||
echo "taskset was used."
|
||||
sleep 1
|
||||
taskset 1 $MARTe2APP -l RealTimeLoader -f $FILE -m $MESSAGE
|
||||
else
|
||||
taskset 1 $MARTe2APP -l RealTimeLoader -f $FILE -s $STATE
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -z "$DAN_CONFIG_LOCATION" ]; then
|
||||
/opt/codac/bin/danApiTool api close
|
||||
fi
|
||||
@@ -0,0 +1,23 @@
|
||||
importClass(Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name = widget.getPropertyValue("name");
|
||||
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuIndex=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
|
||||
// change $(CU_INDEX) substitution
|
||||
var macroInput = DataUtil.createMacrosInput(true);
|
||||
macroInput.put("CUB", cuIndex);
|
||||
macroInput.put("PHY_NAME", phyName);
|
||||
macroInput.put("FCT_NAME", fct_name);
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(widget, fct_name+"-"+cuIndex+"-CubicleContents.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,53 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=NI6528.x
|
||||
|
||||
PACKAGE=DataSources
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(CODAC_ROOT)/include/
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/NI6528$(LIBEXT) \
|
||||
$(BUILD_DIR)/NI6528$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
#
|
||||
# Some EPICS PVs need to be simulation mode when we test code without PXI board.
|
||||
# When user uses sim mode, new value must be written into PV.SVAL and PV itselfself.
|
||||
#
|
||||
print '### Start State Machine Sequence Test ###'
|
||||
|
||||
def test_setup():
|
||||
"""
|
||||
Setup EPICS PVs for testing.
|
||||
Turn simulation mode ON for unavailable device
|
||||
"""
|
||||
print '---------- Start setup for the test ----------'
|
||||
|
||||
print '1. set PVs to simulation mode'
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-AI-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF:STAT-AI-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DI-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF:STAT-DI-SIMM YES', shell=True)
|
||||
#temporary commentout 2 lines
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-MCPS:STAT-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-MCPS:STAT-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-GCPS:STAT-SIMM YES', shell=True)
|
||||
#temporary commentout following line
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-GCPS:STAT-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-CCPS:STAT-SIMM YES', shell=True)
|
||||
#temporary commentout following line
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-CCPS:STAT-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF-FHPS:STAT-SIMM YES', shell=True)
|
||||
#temporary commentout following line
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF-FHPS:STAT-SIMM YES', shell=True)
|
||||
time.sleep(1)
|
||||
print '2. Change SCAN mode from I/O Inter to Passive to write sumulated values.'
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1.SCAN Passive', shell=True)#SELECT
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2.SCAN Passive', shell=True)#SELECT
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R.SCAN Passive', shell=True) #STANDBY
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST2R.SCAN Passive', shell=True) #READY
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SCAN Passive', shell=True) #ON
|
||||
#res = subprocess.call('caput EC-GN-P01-PMF:PSU0000-TYSTA.SCAN Passive', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YSTA.SCAN Passive', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YSTA.SCAN Passive', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SCAN Passive', shell=True) #PERMIT
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SCAN Passive', shell=True) #PERMIT
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4.SCAN Passive', shell = True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SCAN Passive', shell = True) #SYNC/ASYNC
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YON-CCPS1.SCAN Passive', shell=True) #CCPS ON REQUEST
|
||||
time.sleep(1)
|
||||
print '3. Set pulse length limit mode value and state.'
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 10000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD2-LIM 100000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD3-LIM 1000000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD4-LIM 10000000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4 0', shell = True) #Pulse lenght mode
|
||||
print '4. Set other operation modes'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 0', shell = True) #Pre-pro mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SVAL 0', shell = True) #SYNC/ASYNC mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS 0', shell = True) #SYNC/ASYNC mode
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 0',shell = True) #Short pulse mode
|
||||
time.sleep(1)
|
||||
print '5. Set a beam-on schedule(10ms diff + 100ms pulse)'
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 10000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 20000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 30000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 40000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 50000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 100000', shell=True)
|
||||
time.sleep(1)
|
||||
print '6. Reset PLC INTERLOCK'
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SIMM 1', shell=True) #PLC Interlock
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SCAN 0', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SVAL 0', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP 0', shell=True) #CCPS_IS_OPERATION
|
||||
#res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SIMM 1', shell=True) #cRIO Interlock
|
||||
#res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SCAN 0', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SVAL 0', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP 0', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GPF:STAT-RST-FLT 1', shell=True)
|
||||
print '---------- END setup for the test ----------'
|
||||
@@ -0,0 +1,56 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JAWFRecordGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JAWFRecordGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JAWFRecordGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
+LoggerService = {
|
||||
Class = LoggerService
|
||||
CPUs = 0x1
|
||||
StackSize = 32768
|
||||
NumberOfLogPages = 128
|
||||
+ConLogger = {
|
||||
Class = ConsoleLogger
|
||||
Format = "EtOoFmC"
|
||||
PrintKeys = 1
|
||||
}
|
||||
}
|
||||
+StateMachine = {
|
||||
Class = StateMachine
|
||||
+INITIAL = {
|
||||
Class = ReferenceContainer
|
||||
+START = {
|
||||
Class = StateMachineEvent
|
||||
NextState = "RUNNING"
|
||||
NextStateError = "ERROR"
|
||||
+PrepareNextStateOnOurRTApp = {
|
||||
Class = Message
|
||||
Destination = MyDemoApp
|
||||
Mode = ExpectsReply
|
||||
Function = PrepareNextState
|
||||
+Parameters = {
|
||||
Class = ConfigurationDatabase
|
||||
param1 = State1
|
||||
}
|
||||
}
|
||||
+StartNextStateExecutionMsg = {
|
||||
Class = Message
|
||||
Destination = MyDemoApp
|
||||
Function = StartNextStateExecution
|
||||
Mode = ExpectsReply
|
||||
}
|
||||
}
|
||||
}
|
||||
+RUNNING = {
|
||||
Class = ReferenceContainer
|
||||
+LOCKEDFOREVER = {
|
||||
Class = StateMachineEvent
|
||||
NextState = RUNNING
|
||||
NextStateError = ERROR
|
||||
}
|
||||
}
|
||||
+ERROR = {
|
||||
Class = ReferenceContainer
|
||||
+LOCKEDFOREVER = {
|
||||
Class = StateMachineEvent
|
||||
NextState = ERROR
|
||||
NextStateError = ERROR
|
||||
}
|
||||
}
|
||||
}
|
||||
+MyDemoApp = {
|
||||
Class = RealTimeApplication
|
||||
+Functions = {
|
||||
Class = ReferenceContainer
|
||||
+GAMTimer = {
|
||||
Class = IOGAM
|
||||
InputSignals = {
|
||||
Time = { //Time attribute is updated with us resolution.
|
||||
DataSource = Timer
|
||||
Type = uint32
|
||||
}
|
||||
Counter = {
|
||||
DataSource = Timer
|
||||
Type = uint32
|
||||
Frequency = 10 //in Hz. Cycle for one state execution.
|
||||
}
|
||||
RTThreadPerf = {
|
||||
DataSource = Timings
|
||||
Alias = "State1.Thread1_CycleTime"
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
OutputSignals = {
|
||||
Time = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
Counter = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
RTThreadPerf = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
}
|
||||
+TimerDisplayGAM = {
|
||||
Class = IOGAM
|
||||
InputSignals = {
|
||||
Time = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
Counter = {
|
||||
DataSource = DDB1
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
OutputSignals = {
|
||||
TimeDISP = {
|
||||
DataSource = Display
|
||||
Type = uint32
|
||||
}
|
||||
CounterDISP = {
|
||||
DataSource = Display
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+Data = {
|
||||
Class = ReferenceContainer
|
||||
DefaultDataSource = DDB1
|
||||
+DDB1 = {
|
||||
Class = GAMDataSource
|
||||
}
|
||||
+Timer = {
|
||||
Class = LinuxTimer
|
||||
SleepNature = "Busy"
|
||||
SleepPercentage = 0
|
||||
ExecutionMode = RealTimeThread
|
||||
CPUMask = 0x1
|
||||
Signals = {
|
||||
Counter = {
|
||||
Type = uint32
|
||||
}
|
||||
Time = {
|
||||
Type = uint32
|
||||
}
|
||||
}
|
||||
}
|
||||
+Display = {
|
||||
Class = LoggerDataSource
|
||||
}
|
||||
+Timings = {
|
||||
Class = TimingDataSource
|
||||
}
|
||||
}
|
||||
+States = {
|
||||
Class = ReferenceContainer
|
||||
+State1 = {
|
||||
Class = RealTimeState
|
||||
+Threads = {
|
||||
Class = ReferenceContainer
|
||||
+Thread1 = {
|
||||
Class = RealTimeThread
|
||||
Functions = {GAMTimer TimerDisplayGAM}
|
||||
CPUMask = 0x1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+Scheduler = {
|
||||
Class = GAMScheduler
|
||||
TimingDataSource = Timings
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
############################################################################
|
||||
## CODAC specific environment variables
|
||||
############################################################################
|
||||
|
||||
epicsEnvSet("AUTOSAVE_SYSM_PV_PREFIX","EC-GN-SYSM:PCF0SYSM-")
|
||||
epicsEnvSet("IOCSH_PS1","${IOC}> ")
|
||||
epicsEnvSet("STREAM_PROTOCOL_PATH","$(TOP)/db:$(EPICS_ROOT)/db")
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=NI6528.x
|
||||
|
||||
PACKAGE=DataSources
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(CODAC_ROOT)/include/
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/NI6528$(LIBEXT) \
|
||||
$(BUILD_DIR)/NI6528$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-CON-GY1PRM")
|
||||
{
|
||||
field(DESC, "GY1 Operation Permission")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 18) bitread")
|
||||
field(ONAM, "PERMITED")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-CON-GY2PRM")
|
||||
{
|
||||
field(DESC, "GY2 Operation Permission")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 18) bitread")
|
||||
field(ONAM, "PERMITED")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-CON-OPGY1")
|
||||
{
|
||||
field(DESC, "GY1 Selection")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 19) bitread")
|
||||
field(ONAM, "SELECTED")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-CON-OPGY2")
|
||||
{
|
||||
field(DESC, "GY2 Selection")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 19) bitread")
|
||||
field(ONAM, "SELECTED")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-RV1")
|
||||
{
|
||||
field(DESC, "Reserved for PLC")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 21) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GPS:PLC4110-RV2")
|
||||
{
|
||||
field(DESC, "Reserved for PLC")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GPS:PLC4110-RV3")
|
||||
{
|
||||
field(DESC, "Reserved for PLC")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YON-CCPS1")
|
||||
{
|
||||
field(DESC, "GY1 CCPS Start Operation")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 20) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YON-CCPS2")
|
||||
{
|
||||
field(DESC, "GY2 CCPS Start Operation")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 20) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YSTA-MPSS")
|
||||
{
|
||||
field(DESC, "Sync/Asynchronous Flag")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 21) bitread")
|
||||
field(ONAM, "SYNC")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "ASYNC")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTRP")
|
||||
{
|
||||
field(DESC, "Interlock signal from PLC")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 14) bitread")
|
||||
field(ONAM, "INTERLOCK")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-MD1")
|
||||
{
|
||||
field(DESC, "Operation Mode 1")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 14) bitread")
|
||||
field(ONAM, "VSHORT")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-MD2")
|
||||
{
|
||||
field(DESC, "Operation Mode 2")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 15) bitread")
|
||||
field(ONAM, "SHORT")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-MD3")
|
||||
{
|
||||
field(DESC, "Operation Mode 3")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 16) bitread")
|
||||
field(ONAM, "MIDDLE")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-MD4")
|
||||
{
|
||||
field(DESC, "Operation Mode 4")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 17) bitread")
|
||||
field(ONAM, "LONG")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-ST1R")
|
||||
{
|
||||
field(DESC, "PLC STANDBY state")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 15) bitread")
|
||||
field(ONAM, "STANDBY")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-ST2R")
|
||||
{
|
||||
field(DESC, "PLC READY state")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 16) bitread")
|
||||
field(ONAM, "READY")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GPS:PLC4110-YTS-ST3R")
|
||||
{
|
||||
field(DESC, "PLC ON state")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 17) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
-100,0,0,0,0,0,0
|
||||
-90,1,1,1,1,1,1
|
||||
-80,2,2,2,2,2,2
|
||||
-70,3,3,3,3,3,3
|
||||
-60,4,4,4,4,4,4
|
||||
-50,5,5,5,5,5,5
|
||||
-40,6,6,6,6,6,6
|
||||
-30,7,7,7,7,7,7
|
||||
-20,8,8,8,8,8,8
|
||||
-10,9,9,9,9,9,9
|
||||
0,10,10,10,10,10,10
|
||||
10,9,9,9,9,9,9
|
||||
20,8,8,8,8,8,8
|
||||
30,7,7,7,7,7,7
|
||||
40,6,6,6,6,6,6
|
||||
50,5,5,5,5,5,5
|
||||
60,4,4,4,4,4,4
|
||||
70,3,3,3,3,3,3
|
||||
80,2,2,2,2,2,2
|
||||
90,1,1,1,1,1,1
|
||||
100,0,0,0,0,0,0
|
||||
110,1,1,1,1,1,1
|
||||
120,2,2,2,2,2,2
|
||||
130,3,3,3,3,3,3
|
||||
140,4,4,4,4,4,4
|
||||
150,5,5,5,5,5,5
|
||||
160,6,6,6,6,6,6
|
||||
170,7,7,7,7,7,7
|
||||
180,8,8,8,8,8,8
|
||||
190,9,9,9,9,9,9
|
||||
200,10,10,10,10,10,10
|
||||
210,9,9,9,9,9,9
|
||||
220,8,8,8,8,8,8
|
||||
230,7,7,7,7,7,7
|
||||
240,6,6,6,6,6,6
|
||||
250,5,5,5,5,5,5
|
||||
260,4,4,4,4,4,4
|
||||
270,3,3,3,3,3,3
|
||||
280,2,2,2,2,2,2
|
||||
290,1,1,1,1,1,1
|
||||
300,0,0,0,0,0,0
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JASourceChoiseGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../../obj
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JASourceChoiseGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JASourceChoiseGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
./Main.sh -f ../Configurations/tests/NI6528_test.cfg -l RealTimeLoader -m StateMachine:START
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Alarm configuration
|
||||
Root: CODAC_AlarmHandler
|
||||
CODAC-VERSION: 6.3.2
|
||||
WARNING: This is an automatically generated file. PLEASE DO NOT MODIFY.
|
||||
-->
|
||||
<config name="CODAC_AlarmHandler">
|
||||
<component name="EC">
|
||||
<component name="EC-GN">
|
||||
<component name="EC-GN-SYSM">
|
||||
<pv name="EC-GN-SYSM-52RF-01:PLC4110-PLCHLTS">
|
||||
<description>Connection or frame of the communication for 4110 configuration and state is invalid</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>4110 communication failed</title>
|
||||
<details>The connection for configuration and state to 4110 was broken or the frame is not correct</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Causes related to the alarm</title>
|
||||
<details>Timestamp update error (TIME)
|
||||
Data block header, footer or length mismatch (FERROR)
|
||||
Data block version mismatch (FVERS)
|
||||
Data block alive counter update error (ALIVEC)
|
||||
Frame lost due (FLOST)
|
||||
PLC communication broken (CFGSTAT)
|
||||
Lost a redundant CPU (CPU0-ALIVE, CPU1-ALIVE)</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>Check whether the PLC is running\n Check whether network is ok\n Contact maintenance service (if needed)</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>4110 State Comm. Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-PLCHLTS_Alarm.opi "CBS1=EC, CBS2=GN, PP=01, NNNN=4110, TTT=PLC, PPPP=52RF, ALARM_PV=EC-GN-SYSM-52RF-01:PLC4110-PLCHLTS, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=PLC communication failed, ALARM_GUIDANCE1_DETAILS=The connection for configuration and state to PLC is broken or the frame is not correct."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PLC4110-EVTHLTS" >
|
||||
<description>Connection or frame of the communication for PLC Event is invalid</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>PLC Event communication failed</title>
|
||||
<details>The connection for event to PLC was broken or the frame is not correct</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Causes related to the alarm</title>
|
||||
<details>Event Frame count update error (FRAMEC)
|
||||
PLC Event communication broken (EVTSTAT)</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>Check whether the PLC is running\n Check whether network is ok\n Contact maintenance service (if needed)</details>
|
||||
</guidance>
|
||||
<display >
|
||||
<title>PLC Event Comm. Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-EVTHLTS_Alarm.opi "CBS1=EC, CBS2=GN, CBS3=SYSM, PP=01, NNNN=4110, TTT=PLC, PPPP=52RF, ALARM_PV=EC-GN-SYSM-52RF-01:PLC4110-EVTHLTS, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=PLC Event communication failed, ALARM_GUIDANCE1_DETAILS=The connection for event to PLC was broken or the frame is not correct."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PCF4210-SHLT">
|
||||
<description>Any one of CPU, MEM, Disk, FD, Process of the host is in alarm state</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>System is an abnormal state</title>
|
||||
<details>Check the mentioned alarm load and identify the cause</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>System resources related to the alarm</title>
|
||||
<details>1 - one of CPU, Disk, Memory, FD load is high or necessary process has been stopped
|
||||
2 - two of CPU, Disk, Memory, FD load are high and/or necessary process has been stopped
|
||||
3 - three of CPU, Disk, Memory, FD load are high and/or necessary process has been stopped</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>If any load remains high continuously, contact maintenance service.
|
||||
In addition, check if the necessary processes are running</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Temporary actions to suppress</title>
|
||||
<details>Change the alarm limits or severity for each load in alarm state.
|
||||
|
||||
Ex1) alarm limits
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-CPUUTL.HIGH 90
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-CPUUTL.HIHI 100
|
||||
|
||||
Ex2) alarm severity
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-MEMUTL.HSV NO_ALARM
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-MEMUTL.HHSV NO_ALARM</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>System Health Alarm OPI</title>
|
||||
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-SHLT_Alarm.opi "CBS=EC-GN-SYSM, PPPP=52RF, PP=01, TTT=PCF, NNNN=4210, ALARM_PV=EC-GN-SYSM-52RF-01:PCF4210-SHLT, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=System resource utilization is high, ALARM_GUIDANCE1_DETAILS=Any one of CPU / MEM / Disk / FD / Process of the host is in alarm state. Check the mentioned alarm load and identify the cause. If any load remains high continuously contact maintenance service."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PCF4210-SYSHLTS">
|
||||
<description>Any one of CPU, MEM, Disk or FD of the host is in alarm state</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>System resource utilization is high</title>
|
||||
<details>Check the mentioned alarm load and identify the cause</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>System resources related to the alarm</title>
|
||||
<details>1 - CPU utilization high (CPUUTL) : CPU utilization is high
|
||||
2 - Memory utilization high (MEMUTL) : Memory utilization is high
|
||||
3 - CPU, Mem util high (CPUUTL, MEMUTL) : CPU and Memory utilizations are high
|
||||
4 - Disk utilization high (DISKUTL) : Disk utilizations are high
|
||||
5 - CPU, Disk util high (CPUUTL,DISKUTL) : CPU and Disk utilizations are high
|
||||
6 - Mem, Disk util high (MEMUTL,DISKUTL) : Memory and Disk utilizations are high
|
||||
7 - CPU, Mem, Disk util high (CPUUTL,MEMUTL,DISKUTL) : CPU/Memory/Disk utilizations are high
|
||||
8 - FD utilization high (FDUTL) : FD utilization is high
|
||||
9 - CPU, FD util high (CPUUTL,FDUTL) : CPU and FD are in alarm state
|
||||
10 - Mem, FD util high (MEMUTL,FDUTL) : Memory and FD are in alarm state
|
||||
11 - CPU, Mem, FD alarm (CPUUTL,MEMUTL,FDUTL) : CPU/Memory/FD are in alarm state
|
||||
12 - Disk, FD util high (DISKUTL,FDUTL) : Disk and FD are in alarm state
|
||||
13 - CPU, Disk, FD alarm (CPUUTL,DISKUTL,FDUTL) : CPU/Disk/FD are in alarm state
|
||||
14 - Mem, Disk, FD alarm (MEMUTL,DISKUTL,FDUTL) : Memory/Disk/FD are in alarm state
|
||||
15 - CPU,Mem,Disk,FD alarm (CPUUTL,MEMUTL,DISKUTL,FDUTL) : CPU/Memory/Disk/FD alarm</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>If any load remains high continuously, contact maintenance service</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Temporary actions to suppress</title>
|
||||
<details>Change the alarm limits or severity for each load in alarm state.
|
||||
|
||||
Ex1) alarm limits
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-CPUUTL.HIGH 90
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-CPUUTL.HIHI 100
|
||||
|
||||
Ex2) alarm severity
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-MEMUTL.HSV NO_ALARM
|
||||
% caput EC-GN-SYSM-52RF-01:PCF4210-MEMUTL.HHSV NO_ALARM</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>System Health Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-SYSHLTS_Alarm.opi "CBS=EC-GN-SYSM, PPPP=52RF, PP=01, TTT=PCF, NNNN=4210, ALARM_PV=EC-GN-SYSM-52RF-01:PCF4210-SYSHLTS, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=System resource utilization is high, ALARM_GUIDANCE1_DETAILS=Any one of CPU / MEM / Disk / FD of the host is in alarm state. Check the mentioned alarm load and identify the cause. If any load remains high continuously contact maintenance service."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PCF4210-TSTATUS">
|
||||
<description>Current state of TCNd and the synchronization state of the device</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>System time synchronization is not fully operational</title>
|
||||
<details>If status is N/A, then check that tcnd is running.
|
||||
If status is not operational for some time, please contact maintenance service.</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>Documentation TCNd</title>
|
||||
<details>firefox file:///opt/codac/doc/pdf/TCNd_User_Manual.pdf</details>
|
||||
</display>
|
||||
<display>
|
||||
<title>TCNd Sync. Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-TSTATUS_Alarm.opi "CBS=EC-GN-SYSM, PPPP=52RF, PP=01, TTT=PCF, NNNN=4210, ALARM_PV=EC-GN-SYSM-52RF-01:PCF4210-TSTATUS, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=System clock synchronization with respect to ITER time, ALARM_GUIDANCE1_DETAILS=The computer system clock is synchronized to ITER time using the TCN daemon (TCNd) component of CODAC Core SYstem. Please see TCNd User Manual (ITER_D_MUYNT6 - /opt/codac/doc/pdf/TCNd_User_Manual.pdf).
|
||||
The clock synchronization has been detected to have been in an abnormal state. i.e. STATUS different from 'Operational' after two minutes of uptime."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PSH4410-SHLT">
|
||||
<description>Any one of CPU, MEM, Disk, FD, Process of the host is in alarm state</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>System is an abnormal state</title>
|
||||
<details>Check the mentioned alarm load and identify the cause</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>System resources related to the alarm</title>
|
||||
<details>1 - one of CPU, Disk, Memory, FD load is high or necessary process has been stopped
|
||||
2 - two of CPU, Disk, Memory, FD load are high and/or necessary process has been stopped
|
||||
3 - three of CPU, Disk, Memory, FD load are high and/or necessary process has been stopped</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>If any load remains high continuously, contact maintenance service.
|
||||
In addition, check if the necessary processes are running</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Temporary actions to suppress</title>
|
||||
<details>Change the alarm limits or severity for each load in alarm state.
|
||||
|
||||
Ex1) alarm limits
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-CPUUTL.HIGH 90
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-CPUUTL.HIHI 100
|
||||
Ex2) alarm severity
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-MEMUTL.HSV NO_ALARM
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-MEMUTL.HHSV NO_ALARM</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>System Health Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-SHLT_Alarm.opi "CBS=EC-GN-SYSM, PPPP=52RF, PP=01, TTT=PSH, NNNN=4410, ALARM_PV=EC-GN-SYSM-52RF-01:PSH4410-SHLT, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=System resource utilization is high, ALARM_GUIDANCE1_DETAILS=Any one of CPU / MEM / Disk / FD / Process of the host is in alarm state. Check the mentioned alarm load and identify the cause. If any load remains high continuously contact maintenance service."</details>
|
||||
</display>
|
||||
</pv>
|
||||
<pv name="EC-GN-SYSM-52RF-01:PSH4410-SYSHLTS">
|
||||
<description>Any one of CPU, MEM, Disk or FD of the host is in alarm state</description>
|
||||
<latching>true</latching>
|
||||
<delay>0</delay>
|
||||
<guidance>
|
||||
<title>System resource utilization is high</title>
|
||||
<details>Check the mentioned alarm load and identify the cause</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>System resources related to the alarm</title>
|
||||
<details>1 - CPU utilization high (CPUUTL) : CPU utilization is high
|
||||
2 - Memory utilization high (MEMUTL) : Memory utilization is high
|
||||
3 - CPU, Mem util high (CPUUTL, MEMUTL) : CPU and Memory utilizations are high
|
||||
4 - Disk utilization high (DISKUTL) : Disk utilizations are high
|
||||
5 - CPU, Disk util high (CPUUTL,DISKUTL) : CPU and Disk utilizations are high
|
||||
6 - Mem, Disk util high (MEMUTL,DISKUTL) : Memory and Disk utilizations are high
|
||||
7 - CPU, Mem, Disk util high (CPUUTL,MEMUTL,DISKUTL) : CPU/Memory/Disk utilizations are high
|
||||
8 - FD utilization high (FDUTL) : FD utilization is high
|
||||
9 - CPU, FD util high (CPUUTL,FDUTL) : CPU and FD are in alarm state
|
||||
10 - Mem, FD util high (MEMUTL,FDUTL) : Memory and FD are in alarm state
|
||||
11 - CPU, Mem, FD alarm (CPUUTL,MEMUTL,FDUTL) : CPU/Memory/FD are in alarm state
|
||||
12 - Disk, FD util high (DISKUTL,FDUTL) : Disk and FD are in alarm state
|
||||
13 - CPU, Disk, FD alarm (CPUUTL,DISKUTL,FDUTL) : CPU/Disk/FD are in alarm state
|
||||
14 - Mem, Disk, FD alarm (MEMUTL,DISKUTL,FDUTL) : Memory/Disk/FD are in alarm state
|
||||
15 - CPU,Mem,Disk,FD alarm (CPUUTL,MEMUTL,DISKUTL,FDUTL) : CPU/Memory/Disk/FD alarm</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Corrective action</title>
|
||||
<details>If any load remains high continuously, contact maintenance service</details>
|
||||
</guidance>
|
||||
<guidance>
|
||||
<title>Temporary actions to suppress</title>
|
||||
<details>Change the alarm limits or severity for each load in alarm state.
|
||||
|
||||
Ex1) alarm limits
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-CPUUTL.HIGH 90
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-CPUUTL.HIHI 100
|
||||
|
||||
Ex2) alarm severity
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-MEMUTL.HSV NO_ALARM
|
||||
% caput EC-GN-SYSM-52RF-01:PSH4410-MEMUTL.HHSV NO_ALARM</details>
|
||||
</guidance>
|
||||
<display>
|
||||
<title>System Health Alarm OPI</title>
|
||||
<details>/opt/codac/opi/boy/resources/alarmpages/healthMonitoring/ITER-SYSM-SYSHLTS_Alarm.opi "CBS=EC-GN-SYSM, PPPP=52RF, PP=01, TTT=PSH, NNNN=4410, ALARM_PV=EC-GN-SYSM-52RF-01:PSH4410-SYSHLTS, ALARM_PATH=/CODAC_AlarmHandler/EC/EC-GN/EC-GN-SYSM, LEVEL=ITER-EC-GN-SYSM, ALARM_GUIDANCE1_TITLE=System resource utilization is high, ALARM_GUIDANCE1_DETAILS=Any one of CPU / MEM / Disk / FD of the host is in alarm state. Check the mentioned alarm load and identify the cause. If any load remains high continuously contact maintenance service."</details>
|
||||
</display>
|
||||
</pv>
|
||||
</component>
|
||||
|
||||
<component name="EC-GN-P01">
|
||||
<component name="EC-GN-P01-GAF">
|
||||
|
||||
|
||||
|
||||
|
||||
</component>
|
||||
|
||||
<component name="EC-GN-P01-GBF">
|
||||
|
||||
|
||||
|
||||
|
||||
</component>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</component>
|
||||
</component>
|
||||
</component>
|
||||
</config>
|
||||
@@ -0,0 +1,55 @@
|
||||
#############################################################
|
||||
#
|
||||
# Copyright 2015 F4E | European Joint Undertaking for ITER
|
||||
# and the Development of Fusion Energy ('Fusion for Energy')
|
||||
#
|
||||
# Licensed under the EUPL, Version 1.1 or - as soon they
|
||||
# will be approved by the European Commission - subsequent
|
||||
# versions of the EUPL (the "Licence");
|
||||
# You may not use this work except in compliance with the
|
||||
# Licence.
|
||||
# You may obtain a copy of the Licence at:
|
||||
#
|
||||
# http://ec.europa.eu/idabc/eupl
|
||||
#
|
||||
# Unless required by applicable law or agreed to in
|
||||
# writing, software distributed under the Licence is
|
||||
# distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
# express or implied.
|
||||
# See the Licence for the specific language governing
|
||||
# permissions and limitations under the Licence.
|
||||
#
|
||||
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
|
||||
#
|
||||
#############################################################
|
||||
OBJSX=JARTSampleGAM.x
|
||||
|
||||
PACKAGE=GAMs
|
||||
|
||||
ROOT_DIR=../../
|
||||
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
|
||||
|
||||
INCLUDES += -I.
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
|
||||
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
|
||||
|
||||
|
||||
|
||||
all: $(OBJS) $(SUBPROJ) \
|
||||
$(BUILD_DIR)/JARTSampleGAM$(LIBEXT) \
|
||||
$(BUILD_DIR)/JARTSampleGAM$(DLLEXT)
|
||||
echo $(OBJS)
|
||||
|
||||
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
|
||||
@@ -0,0 +1,18 @@
|
||||
record(bo, "test:do1"){
|
||||
field(SCAN,"Passive")
|
||||
field(ONAM, "ON")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
record(bo, "test:do2"){
|
||||
field(SCAN,"Passive")
|
||||
field(ONAM, "ON")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
record(bo, "test:do3"){
|
||||
field(SCAN,"Passive")
|
||||
field(ONAM, "ON")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
record(longin, test:doValue){
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
record (bi,"EC-GN-P01-GAF:DIO4900-YON")
|
||||
{
|
||||
field(DESC, "GY1 External trigger")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 22) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
{
|
||||
field(DESC, "GY1 AI Simulation Mode SW")
|
||||
field(ONAM, "YES")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-AO-SIMM")
|
||||
{
|
||||
field(DESC, "GY1 AO Simulation Mode SW")
|
||||
field(ONAM, "YES")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-CSV-LOAD")
|
||||
{
|
||||
field(DESC, "File load trigger")
|
||||
field(HIGH, "0.1")
|
||||
field(ONAM, "Loading")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "Load")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-CSV-LOADED")
|
||||
{
|
||||
field(DESC, "File load status")
|
||||
field(ONAM, "Loaded")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "Loading")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
{
|
||||
field(DESC, "GY1 DI Simulation Mode SW")
|
||||
field(ONAM, "YES")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
{
|
||||
field(DESC, "GY1 DO Simulation Mode SW")
|
||||
field(ONAM, "YES")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-DT-SHOTLEN-EGU")
|
||||
{
|
||||
field(DESC, "GY1 egu of shot length")
|
||||
field(FLNK, "EC-GN-P01-GAF:STAT-DT-SHOTLEN-CALC")
|
||||
field(ONAM, "s")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "ms")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-MST-TRIG")
|
||||
{
|
||||
field(DESC, "GY1 Master trigger")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-PREP-MODE")
|
||||
{
|
||||
field(DESC, "GY1 Pre-Pro mode ON")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-SHORT-PULSE")
|
||||
{
|
||||
field(DESC, "GY1 Short Pulse Mode")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GAF:STAT-TRIG-SOUR")
|
||||
{
|
||||
field(DESC, "GY1 External Trigger Mode SW")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:MOE2810-ET")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 1")
|
||||
field(EGU, "V")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-GAF:MOE2810-ET-WF")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 1")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:MOE2820-ET")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 2")
|
||||
field(EGU, "V")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-GAF:MOE2820-ET-WF")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 2")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:MOE2830-ET")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 3")
|
||||
field(EGU, "V")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-GAF:MOE2830-ET-WF")
|
||||
{
|
||||
field(DESC, "GY1 Arc detect signal 3")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:MRF2910-ET")
|
||||
{
|
||||
field(DESC, "GY1 RF Signal")
|
||||
field(EGU, "V")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-GAF:MRF2910-ET-WF")
|
||||
{
|
||||
field(DESC, "GY1 RF Signal")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:STAT-BEAMON-TIME")
|
||||
{
|
||||
field(DESC, "GY1 Beam ON time")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "3600000000")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (mbbo,"EC-GN-P01-GAF:STAT-CSV-ERR")
|
||||
{
|
||||
field(DESC, "File load error status")
|
||||
field(FRST, "Format error")
|
||||
field(FRSV, "MAJOR")
|
||||
field(FRVL, "4")
|
||||
field(FVST, "Out of range")
|
||||
field(FVSV, "MAJOR")
|
||||
field(FVVL, "5")
|
||||
field(ONST, "Successfully loaded")
|
||||
field(ONSV, "NO_ALARM")
|
||||
field(ONVL, "1")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(THST, "Empty data")
|
||||
field(THSV, "MAJOR")
|
||||
field(THVL, "3")
|
||||
field(TWST, "Failed to open")
|
||||
field(TWSV, "MAJOR")
|
||||
field(TWVL, "2")
|
||||
field(VAL, "0")
|
||||
field(ZRST, "Not loaded yet")
|
||||
field(ZRSV, "MINOR")
|
||||
field(ZRVL, "0")
|
||||
}
|
||||
|
||||
record (stringout,"EC-GN-P01-GAF:STAT-CSV-NAME")
|
||||
{
|
||||
field(DESC, "CSV file name")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "shot000000")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:STAT-DT-SHOTLEN")
|
||||
{
|
||||
field(DESC, "GY1 Shot length")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "3600000000")
|
||||
field(LOPR, "100")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "1000000")
|
||||
}
|
||||
|
||||
record (calcout,"EC-GN-P01-GAF:STAT-DT-SHOTLEN-CALC")
|
||||
{
|
||||
field(CALC, "(!A)?1000*B:1000000*B")
|
||||
field(DESC, "GY1 shot length convert")
|
||||
field(FLNK, "EC-GN-P01-GAF:STAT-DT-SHOTLEN")
|
||||
field(INPA, "EC-GN-P01-GAF:STAT-DT-SHOTLEN-EGU")
|
||||
field(INPB, "EC-GN-P01-GAF:STAT-DT-SHOTLEN-DAM")
|
||||
field(OUT, "EC-GN-P01-GAF:STAT-DT-SHOTLEN")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-GAF:STAT-DT-SHOTLEN-DAM")
|
||||
{
|
||||
field(DESC, "GY1 shot length without unit")
|
||||
field(DRVH, "3600")
|
||||
field(DRVL, "0")
|
||||
field(FLNK, "EC-GN-P01-GAF:STAT-DT-SHOTLEN-CALC")
|
||||
field(HOPR, "3600")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "NO")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-GAF:STAT-ELAPSED")
|
||||
{
|
||||
field(DESC, "GY1 Elapsed time")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "4000000000")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (longin,"EC-GN-P01-GAF:STAT-PREHEAT-TIME")
|
||||
{
|
||||
field(DESC, "Pre-heating time")
|
||||
field(HOPR, "999999")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-GAF:STAT-PREP-TIME-WF")
|
||||
{
|
||||
field(DESC, "GY1 prepro time schedule")
|
||||
field(EGU, "ms")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "NO")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
record (fanout,"EC-GN-P01-GAF:STAT-SHOT-FLNK1")
|
||||
{
|
||||
field(DESC, "GY1 fanout1 to AI waveform signal")
|
||||
}
|
||||
|
||||
record (fanout,"EC-GN-P01-GAF:STAT-SHOT-FLNK2")
|
||||
{
|
||||
field(DESC, "GY1 fanout2 to AI waveform signal")
|
||||
}
|
||||
|
||||
record (longin,"EC-GN-P01-GAF:STAT-SHOT-ID")
|
||||
{
|
||||
field(DESC, "GY1 shot ID")
|
||||
field(HOPR, "999999")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (calcout,"EC-GN-P01-GAF:STAT-SHOT-PLOT")
|
||||
{
|
||||
field(CALC, "A andand (B >= C)")
|
||||
field(DESC, "GY1 judge to plot measured values")
|
||||
field(INPA, "EC-GN-P01-GPS:PLC4110-YTS-ST3R")
|
||||
field(INPB, "EC-GN-P01-GAF:STAT-BEAMON-TIME")
|
||||
field(INPC, "6000000")
|
||||
field(OOPT, "Transition To Non-zero")
|
||||
field(OUT, "EC-GN-P01-GAF:STAT-SHOT-FLNK1 PP")
|
||||
field(SCAN, ".1 second")
|
||||
}
|
||||
|
||||
record (mbbi,"EC-GN-P01-GAF:STAT-SM")
|
||||
{
|
||||
field(DESC, "GY#1 state machine")
|
||||
field(EIST, "WaitHVON_SDN")
|
||||
field(EIVL, "8")
|
||||
field(FLNK, "EC-GN-P01-GAF:STAT-SHOT-PLOT")
|
||||
field(FRST, "WaitReady")
|
||||
field(FRVL, "4")
|
||||
field(FVST, "WaitPermit")
|
||||
field(FVVL, "5")
|
||||
field(NIST, "WaitHVON_SDN_PREP")
|
||||
field(NIVL, "9")
|
||||
field(ONST, "Error")
|
||||
field(ONVL, "1")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SVST, "WaitHVON_PREP")
|
||||
field(SVVL, "7")
|
||||
field(SXST, "WaitHVON")
|
||||
field(SXVL, "6")
|
||||
field(THST, "WaitStandby")
|
||||
field(THVL, "3")
|
||||
field(TWST, "Disabled")
|
||||
field(TWVL, "2")
|
||||
field(VAL, "0")
|
||||
field(ZRST, "Init")
|
||||
field(ZRVL, "0")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
def test_sync():
|
||||
"""Test Sync Mode"""
|
||||
print '1. Set beam-on schedule'
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 500000', shell=True)
|
||||
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-HVON 100000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-HVON 200000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-SWON 400000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-SWON 500000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 300000000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF:STAT-DT-SHOTLEN 300000000', shell=True)
|
||||
print '2. Set SYNC flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SVAL 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS 1', shell = True)
|
||||
print '3. Set Mode 1 flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 600000000', shell = True)
|
||||
print '4. Write PERMIT'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 1', shell=True)
|
||||
time.sleep(1)
|
||||
print '5. Write HVON'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True)
|
||||
print '6. Wait SDN commands.'
|
||||
print 'Enter to stop operation(Trun off PLC_HVON)'
|
||||
inpval = raw_input()
|
||||
print '7. Write 0 to HVON'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
|
||||
time.sleep(2)
|
||||
print '8. Reset PERMIT'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 0', shell=True)
|
||||
print '9. Reset Mode 1 flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 0', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 0', shell = True)
|
||||
print 'end of sequence.'
|
||||
|
||||
def test_sync_prepro():
|
||||
"""Test Sync PrePro Mode"""
|
||||
print '1. Set beam-on schedule'
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 500000', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 300000000', shell=True)
|
||||
print '2. Set SYNC flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SVAL 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS 1', shell = True)
|
||||
print '3. Set Mode 1 flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 600000000', shell = True)
|
||||
print '4.Set Pre-Pro flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 1', shell = True)
|
||||
time.sleep(1)
|
||||
print '5. Write PERMIT'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
|
||||
time.sleep(1)
|
||||
print '6. Write HVON'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True)
|
||||
print '7. Wait SDN commands.'
|
||||
print 'Enter to stop operation(Trun off PLC_HVON)'
|
||||
inpval = raw_input()
|
||||
print '8. Write 0 to HVON'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
|
||||
time.sleep(2)
|
||||
print '9. Reset PERMIT'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
|
||||
print '10.Reset Pre-Pro flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 0', shell = True)
|
||||
time.sleep(1)
|
||||
print '11. Reset Mode 1 flag'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 0', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 0', shell = True)
|
||||
print 'end of sequence.'
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
./Main.sh -f ../Configurations/tests/NI6528_NI6259_test.cfg -l RealTimeLoader -m StateMachine:START
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
############################################################################
|
||||
## Save and restore
|
||||
############################################################################
|
||||
|
||||
### save_restore setup
|
||||
# status-PV prefix
|
||||
save_restoreSet_status_prefix("$(AUTOSAVE_SYSM_PV_PREFIX)")
|
||||
|
||||
# Use status-PV
|
||||
save_restoreSet_UseStatusPVs(1)
|
||||
|
||||
# Debug-output level
|
||||
save_restoreSet_Debug(0)
|
||||
|
||||
# Ok to save/restore save sets with missing values (no CA connection to PV)?
|
||||
save_restoreSet_IncompleteSetsOk(1)
|
||||
# Save dated backup files?
|
||||
save_restoreSet_DatedBackupFiles(1)
|
||||
|
||||
# Number of sequenced backup files to write
|
||||
save_restoreSet_NumSeqFiles(3)
|
||||
# Time interval between sequenced backups
|
||||
save_restoreSet_SeqPeriodInSeconds(300)
|
||||
|
||||
# specify where save files should be
|
||||
set_savefile_path("$(EPICS_AUTOSAVE_VAR)/$(UNIT_NAME)")
|
||||
|
||||
# specify what save files should be restored. Note these files must be
|
||||
# in the directory specified in set_savefile_path(), or, if that function
|
||||
# has not been called, from the directory current when iocInit is invoked
|
||||
|
||||
# Save files associated with the request files 'auto-output.req' and
|
||||
# 'auto-input.req'. These files are the standard way to use autosave
|
||||
|
||||
set_pass1_restoreFile("iocEC-GN-PSH0PCF.sav")
|
||||
|
||||
# specify directories in which to to search for included request files
|
||||
set_requestfile_path("./")
|
||||
|
||||
dbLoadRecords("$(EPICS_ROOT)/db/save_restoreStatus.db", "P=$(AUTOSAVE_SYSM_PV_PREFIX)")
|
||||
|
||||
#- End-of-file marker - do not delete or add lines below!
|
||||
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* @file JABitReverseGAM.cpp
|
||||
* @brief Source file for class JABitReverseGAM
|
||||
* @date Nov 26, 2018
|
||||
* @author aneto
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This source file contains the definition of all the methods for
|
||||
* the class JABitReverseGAM (public, protected, and private). Be aware that some
|
||||
* methods, such as those inline could be defined on the header file, instead.
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "JABitReverseGAM.h"
|
||||
|
||||
#include "AdvancedErrorManagement.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Static definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
JABitReverseGAM::JABitReverseGAM() {
|
||||
//Input signals.
|
||||
input1 = NULL_PTR(MARTe::uint8 *);
|
||||
|
||||
//Output signals.
|
||||
output1= NULL_PTR(MARTe::uint8 *);
|
||||
}
|
||||
|
||||
JABitReverseGAM::~JABitReverseGAM() {
|
||||
}
|
||||
|
||||
bool JABitReverseGAM::Initialise(MARTe::StructuredDataI & data) {
|
||||
//GAM parameters are initialized.
|
||||
using namespace MARTe;
|
||||
bool ok = GAM::Initialise(data);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JABitReverseGAM::PrepareNextState(const MARTe::char8 * const currentStateName, const MARTe::char8 * const nextStateName) {
|
||||
//This method changes internal parameter based on next realtime state.
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JABitReverseGAM::Setup() {
|
||||
// Setup memory for input/output signals on the GAM.
|
||||
using namespace MARTe;
|
||||
bool ok = (numberOfInputSignals == 1u);
|
||||
if (ok) {
|
||||
ok = (numberOfOutputSignals == 1u);
|
||||
if (!ok) {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "One output signal shall be defined");
|
||||
}
|
||||
}
|
||||
else {
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "One input signals shall be defined");
|
||||
}
|
||||
// Do type check for input signals.
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfInputSignals; c++) {
|
||||
TypeDescriptor inputType = GetSignalType(InputSignals, c);
|
||||
ok = ((inputType == UnsignedInteger8Bit));
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint8.", signalName.Buffer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// Do type check for output signals
|
||||
if (ok) {
|
||||
uint32 c;
|
||||
for (c = 0u; c < numberOfOutputSignals; c++) {
|
||||
TypeDescriptor outputType = GetSignalType(OutputSignals, c);
|
||||
ok = ((outputType == UnsignedInteger8Bit));
|
||||
if (!ok) {
|
||||
StreamString signalName;
|
||||
(void) GetSignalName(InputSignals, c, signalName);
|
||||
REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint8.", signalName.Buffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do type cast.
|
||||
if (ok) {
|
||||
input1 = reinterpret_cast<uint8 *>(GetInputSignalMemory(0));
|
||||
|
||||
output1 = reinterpret_cast<uint8 *>(GetOutputSignalMemory(0));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool JABitReverseGAM::Execute() {
|
||||
// This method is called every realtime state thread cycle.
|
||||
using namespace MARTe;
|
||||
*output1 = ~(*input1);
|
||||
return true;
|
||||
}
|
||||
|
||||
CLASS_REGISTER(JABitReverseGAM, "1.0")
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* @file JABitSumGAM.h
|
||||
* @brief Header file for class JABitSumGAM
|
||||
* @date Feb 10, 2020
|
||||
* @author kuchida
|
||||
*
|
||||
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
|
||||
* the Development of Fusion Energy ('Fusion for Energy').
|
||||
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
|
||||
* by the European Commission - subsequent versions of the EUPL (the "Licence")
|
||||
* You may not use this work except in compliance with the Licence.
|
||||
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
|
||||
*
|
||||
* @warning Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Licence is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the Licence permissions and limitations under the Licence.
|
||||
|
||||
* @details This header file contains the declaration of the class JABitSumGAM
|
||||
* with all of its public, protected and private members. It may also include
|
||||
* definitions for inline methods which need to be visible to the compiler.
|
||||
*/
|
||||
|
||||
#ifndef GAMS_JABitSumGAM_H_
|
||||
#define GAMS_JABitSumGAM_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "GAM.h"
|
||||
#include "stdio.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Class declaration */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
class JABitSumGAM : public MARTe::GAM, public MARTe::StatefulI {
|
||||
public:
|
||||
CLASS_REGISTER_DECLARATION()
|
||||
|
||||
JABitSumGAM();
|
||||
|
||||
virtual ~JABitSumGAM();
|
||||
|
||||
virtual bool Initialise(MARTe::StructuredDataI & data);
|
||||
|
||||
virtual bool Setup();
|
||||
|
||||
virtual bool Execute();
|
||||
|
||||
virtual bool PrepareNextState(const MARTe::char8 * const currentStateName,
|
||||
const MARTe::char8 * const nextStateName);
|
||||
|
||||
private:
|
||||
// Input signals
|
||||
MARTe::uint32 *input0;
|
||||
MARTe::uint32 *input1;
|
||||
MARTe::uint32 *input2;
|
||||
MARTe::uint32 *input3;
|
||||
MARTe::uint32 *input4;
|
||||
MARTe::uint32 *input5;
|
||||
MARTe::uint32 *input6;
|
||||
MARTe::uint32 *input7;
|
||||
|
||||
// Output signals
|
||||
MARTe::uint8 *output;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Inline method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* GAMS_JABitSumGAM_H_ */
|
||||
@@ -0,0 +1,24 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuIndex=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
cuIndex=row[0];
|
||||
phyName=row[1]
|
||||
# change $(CU_INDEX) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-"+cuIndex+"-CubicleContents.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!--
|
||||
BOY Files Navigation
|
||||
CODAC-VERSION: 6.1.2
|
||||
WARNING: This is an SDD generated file. Contact codac-support for any query.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<CBS name="PB1F" description="ITER-EC-GN-P01-PB1F" enabled="true" opi_file="./mimics/ITER-EC-GN-P01-PB1F_Mimic.opi OPI_FILE=/EC-GN/boy/ITER LEVEL=ITER-EC-GN-P01-PB1F" deprecated="false" alarm_root="/CODAC_AlarmHandler/EC/EC-GN/EC-GN-P01/EC-GN-P01-PB1F" xmlns:xi="http://www.w3.org/2001/XInclude" >
|
||||
|
||||
|
||||
|
||||
</CBS>
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
record (bi,"EC-GN-P01-GBFP:FMC4310-RV1")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 11) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GBFP:FMC4310-RV2")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 12) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GBFP:FMC4310-RV3")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 13) bitread")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GBFP:FMC4310-RV5")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GBFP:FMC4310-RV6")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GBFP:FMC4310-RV7")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GBFP:FMC4310-RV8")
|
||||
{
|
||||
field(DESC, "Reserved for cRIO")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-GBFP:FMC4310-YSTA-GBOP")
|
||||
{
|
||||
field(DESC, "GY2 Beam ON Status")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GBFP:FMC4310-YTRP")
|
||||
{
|
||||
field(DESC, "Interlock from fast protection 2")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 9) bitread")
|
||||
field(ONAM, "FAULT")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NORMAL")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-GBFP:FMC4310-YTRP2")
|
||||
{
|
||||
field(DESC, "Pause signal from fast protection 2")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_0, 10) bitread")
|
||||
field(ONAM, "PAUSE")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
generic
|
||||
@@ -0,0 +1,29 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
|
||||
var selectionListener = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuName=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
|
||||
var macroInput = DataUtil.createMacrosInput(true);
|
||||
macroInput.put("CU", cuName);
|
||||
macroInput.put("PHY_NAME", phyName);
|
||||
macroInput.put("FCT_NAME", fct_name);
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if (cuName.indexOf("P") == 0) {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PLCDetails.opi", 1, macroInput);
|
||||
}
|
||||
else {
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CubiclePLCDetails.opi", 0, macroInput);
|
||||
}
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionListener);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user