int ses_loop_function(ScfEfunction* f, scf_vector_t* loops);
-int ses_analyse_function(ScfEfunction* f, int64_t ns, int64_t count);
+int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count);
#endif
--- /dev/null
+#include"ses_core.h"
+
+static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count)
+{
+ ScfEcomponent* c;
+ ScfEfunction* f;
+ ScfEline* el;
+ ScfEpin* p;
+
+ size_t i;
+ size_t j;
+ size_t k;
+
+ c = f->components[0];
+ c->V = 5;
+
+ p = c->pins[SCF_EDA_Battery_POS];
+ el = f->elines[p->lid];
+ el->V = 5;
+
+ p = c->pins[SCF_EDA_Battery_NEG];
+ el = f->elines[p->lid];
+ el->V = 0;
+
+ return 0;
+}
+
+ses_step_t ses_step_battery =
+{
+ .name = "battery",
+
+ .handler = _battery_handler,
+};
#include"ses_core.h"
+static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count)
+{
+ ScfEcomponent* c;
+ ScfEfunction* f;
+ ScfEline* el;
+ ScfEpin* p;
+
+ size_t i;
+ size_t j;
+ size_t k;
+
+ for (i = 0; i < f->n_elines; i++) {
+ el = f->elines[i];
+
+ for (j = 0; j + 1 < el->n_pins; j += 2) {
+
+ c = f->components[el->pins[j]];
+ p = c->pins [el->pins[j + 1]];
+
+ if (SCF_EDA_PIN_IN & p->flags) {
+ }
+ }
+ }
+
+}
-ses_step_t ses_step_dc_input =
+ses_step_t ses_step_dc_input =
{
- .name = "dc_input",
+ .name = "dc_input",
+ .handler = _dc_input_handler,
};
#include"ses_core.h"
+extern ses_step_t ses_step_battery;
+
extern ses_step_t ses_step_dc_input;
//extern ses_step_t ses_step_ac_start;
static ses_step_t* ses_steps[] =
{
- &ses_step_dc_input,
+ &ses_step_battery,
+ &ses_step_dc_input,
&ses_step_dc_diode,
&ses_step_dc_transistor,
};
-int ses_analyse_function(ScfEfunction* f, int64_t ns, int64_t count)
+int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count)
{
if (!f || ns <= 0 || count < 0)
return -EINVAL;