Commit 938da4d8 authored by claes's avatar claes

*** empty log message ***

parent fe955489
......@@ -125,6 +125,11 @@ void lng_set( char *str)
Lng::set( str);
}
char *lng_get_language_str()
{
return Lng::get_language_str();
}
//
// c api to co_msgwindow
//
......
......@@ -41,6 +41,7 @@ void user_DevPrivToString( unsigned int priv, char *str, int size);
void lng_get_uid( char *in, char *out);
char *lng_translate( char *str);
void lng_set( char *str);
char *lng_get_language_str();
int crr_signal( void *parent_ctx, char *signalname,
void (*insert_cb)( void *, void *, navc_eItemType, char *, char *, int),
......
......@@ -17,7 +17,7 @@ char Lng::items[][2][40] = {
{"Open Object", "ppna Objekt"},
{"Open Object...", "ppna Objekt"},
{"RtNavigator", "RtNavigatr"},
{"Class Graph", "Klass Bild"},
{"Object Graph", "Objekt Bild"},
{"Crossreferences", "Korsreferenser"},
{"DataSheet", "Datablad"},
{"Collect", "Samla"},
......@@ -28,6 +28,7 @@ char Lng::items[][2][40] = {
{"Photo", "Foto"},
{"Fast", "Snabbkurva"},
{"Trend", "Trendkurva"},
{"CircuitDiagram", "KopplingsSchema"},
{"Block Events...", "Blockera Hndelser..."},
{"Hist Event...", "Historisk lista..."},
{"Alarm List", "Larmlista"},
......@@ -100,6 +101,7 @@ char Lng::items[][2][40] = {
{"Man", "Man"},
{"Auto", "Auto"},
{"Cascade", "Kaskad"},
{"Local", "Lokal"},
{"Extern SetValue", "Externt BrVrde"},
{"Force", "Tvinga"},
{"Set value", "Br vrde"},
......@@ -118,6 +120,33 @@ char Lng::items[][2][40] = {
{"Type", "Typ"},
{"English text not available", "Svensk text finns ej tillgnglig"},
{"Object Reference Manual", "Objekt handbok"},
{"Components", "Komponenter"},
{"Signals", "Signaler"},
{"Methods", "Metoder"},
{"On", "Till"},
{"Off", "Frn"},
{"Tripped", "Utlst"},
{"Temperature", "Temperatur"},
{"Limits", "Grnser"},
{"HighHigh", "HgHg"},
{"High", "Hg"},
{"Low", "Lg"},
{"LowLow", "LgLg"},
{"Used", "Anvnd"},
{"Limit", "Grns"},
{"Hysteresis", "Hysteres"},
{"Delay", "Frdrjning"},
{"Switch open", "Grnslge ppen"},
{"Switch closed", "Grnslge stngd"},
{"Error detected", "Fel detekterat"},
{"Overload", "verlast"},
{"Safety switch", "Skerhetsbrytare"},
{"Ready", "Klar"},
{"Extern interlock","Extern frregling"},
{"Contactor", "Kontaktor"},
{"Circuit breaker","Effektbrytare"},
{"Startlock", "Startsprr"},
{"Frequency converter","Frekvensomriktare"},
};
......
#ifdef OS_ELN
#include stdio
#else
#include <stdio.h>
#endif
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_basecomponentclasses.h"
#include "rt_plc.h"
#include "rt_gdh.h"
#include "co_time.h"
#define ODD(a) (((int)(a) & 1) != 0)
#define EVEN(a) (((int)(a) & 1) == 0)
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
#define min(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
#ifndef __ALPHA
#define abs(Dragon) ((Dragon) >= 0 ? (Dragon) : (-(Dragon)))
#endif
/**
RunTimeCounterFo
@aref runtimecounterfo RunTimeCounterFo
*/
void RunTimeCounterFo_init( pwr_sClass_RunTimeCounterFo *o)
{
pwr_tDlid dlid;
pwr_tStatus sts;
sts = gdh_DLRefObjectInfoAttrref( &o->PlcConnect, (void **)&o->PlcConnectP, &dlid);
if ( EVEN(sts))
o->PlcConnectP = 0;
if ( o->PlcConnectP && o->ResetP == &o->Reset)
((pwr_sClass_RunTimeCounter *)o->PlcConnectP)->AccTripReset = 1;
}
void RunTimeCounterFo_exec( plc_sThread *tp,
pwr_sClass_RunTimeCounterFo *o)
{
pwr_tDeltaTime TimeSince;
pwr_sClass_RunTimeCounter *co = (pwr_sClass_RunTimeCounter *) o->PlcConnectP;
if ( !co)
return;
if ( *o->ResetP)
co->TripReset = 1;
time_FloatToD( &TimeSince, *o->ScanTime);
/* Test if New Trip */
if (co->TripReset) {
co->OldTripNOfStarts = co->TripNOfStarts;
co->OldTripUsage = co->TripUsage;
co->OldTripTime = co->TripTime;
co->OldTripRunTime = co->TripRunTime;
co->TripNOfStarts = 0;
co->TripRunTime.tv_sec = co->TripRunTime.tv_nsec = 0;
co->TripTime.tv_sec = co->TripTime.tv_nsec = 0;
clock_gettime(CLOCK_REALTIME, &co->ResetTime);
co->TripReset = 0;
}
/* Update Calendar time */
time_Dadd( &co->TotalTime, &co->TotalTime, &TimeSince);
time_Dadd( &co->TripTime, &co->TripTime, &TimeSince);
/* Test if running */
o->Start = 0;
if (*o->RunningP) {
/* New start ? */
if ( !o->Running) {
o->Start = 1;
co->TotalNOfStarts++;
co->TripNOfStarts++;
clock_gettime(CLOCK_REALTIME, &co->StartTime);
} /* End if new start */
/* Update Running Time */
time_Dadd( &co->TripRunTime, &co->TripRunTime, &TimeSince);
time_Dadd( &co->TotalRunTime, &co->TotalRunTime, &TimeSince);
} /* End if Running */
o->Running = co->Running = *o->RunningP;
/* Calculate usage % */
if ( co->TotalRunTime.tv_sec)
co->TotalUsage = ((float)co->TotalRunTime.tv_sec) / co->TotalTime.tv_sec * 100;
if ( co->TripTime.tv_sec)
co->TripUsage = ((float)co->TripRunTime.tv_sec) / co->TripTime.tv_sec * 100;
}
......@@ -5131,6 +5131,7 @@ static int rtt_print_value(
if ( flags & PWR_MASK_POINTER )
{
/* Check that it is a rtdb pointer */
if ( value_ptr == 0)
{
/* This is not a rtdb pointer */
if ( init || (strcmp( old_value, "UNDEF PTR") != 0))
......@@ -5539,6 +5540,7 @@ static int rtt_edit_print_value(
if ( menu_ptr->flags & PWR_MASK_POINTER )
{
/* Check that it is a rtdb pointer */
if ( menu_ptr->value_ptr == 0)
{
/* This is not a rtdb pointer */
if ( init || (strcmp( menu_ptr->old_value, "UNDEF PTR") != 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment