00001
00010 #include <stdlib.h>
00011 #include <stdio.h>
00012 #include <errno.h>
00013 #include <math.h>
00014 #include <iostream>
00015 using namespace std;
00016
00017 #include "line.h"
00018
00019 CLASS* line_spacing::oclass = NULL;
00020 CLASS* line_spacing::pclass = NULL;
00021
00022 line_spacing::line_spacing(MODULE *mod) : powerflow_library(mod)
00023 {
00024 if(oclass == NULL)
00025 {
00026 oclass = gl_register_class(mod,"line_spacing",sizeof(line_spacing),0x00);
00027 if(oclass == NULL)
00028 GL_THROW("unable to register line_spacing class implemented by %s",__FILE__);
00029
00030 if(gl_publish_variable(oclass,
00031 PT_double, "distance_AB[ft]",PADDR(distance_AtoB),
00032 PT_double, "distance_BC[ft]",PADDR(distance_BtoC),
00033 PT_double, "distance_AC[ft]",PADDR(distance_AtoC),
00034 PT_double, "distance_AN[ft]",PADDR(distance_AtoN),
00035 PT_double, "distance_BN[ft]",PADDR(distance_BtoN),
00036 PT_double, "distance_CN[ft]",PADDR(distance_CtoN),
00037 NULL) < 1) GL_THROW("unable to publish line_spacing properties in %s",__FILE__);
00038 }
00039 }
00040
00041 int line_spacing::create()
00042 {
00043
00044 distance_AtoB = 0.0;
00045 distance_BtoC = 0.0;
00046 distance_AtoC = 0.0;
00047 distance_AtoN = 0.0;
00048 distance_BtoN = 0.0;
00049 distance_CtoN = 0.0;
00050
00051 return 1;
00052 }
00053
00054 int line_spacing::isa(char *classname)
00055 {
00056 return strcmp(classname,"line_spacing")==0;
00057 }
00058
00060
00062
00070 EXPORT int create_line_spacing(OBJECT **obj, OBJECT *parent)
00071 {
00072 try
00073 {
00074 *obj = gl_create_object(line_spacing::oclass);
00075 if (*obj!=NULL)
00076 {
00077 line_spacing *my = OBJECTDATA(*obj,line_spacing);
00078 gl_set_parent(*obj,parent);
00079 return my->create();
00080 }
00081 }
00082 catch (const char *msg)
00083 {
00084 gl_error("create_line_spacing: %s", msg);
00085 }
00086 return 0;
00087 }
00088 EXPORT TIMESTAMP sync_line_spacing(OBJECT *obj, TIMESTAMP t1, PASSCONFIG pass)
00089 {
00090 return TS_NEVER;
00091 }
00092
00093 EXPORT int isa_line_spacing(OBJECT *obj, char *classname)
00094 {
00095 return strcmp(classname,"line_spacing") == 0;
00096 }
00097