|
|
|
@ -226,8 +226,6 @@ gboolean Value_Loop(gpointer data) {
|
|
|
|
|
v.reg = atoi(v_reg);
|
|
|
|
|
v.type = v_type;
|
|
|
|
|
v.sim = v_sim;
|
|
|
|
|
Value_Set (&v);
|
|
|
|
|
|
|
|
|
|
changed = Value_Simulation(&v);
|
|
|
|
|
if (changed) {
|
|
|
|
|
uint16_t regvals[4];
|
|
|
|
@ -235,6 +233,14 @@ gboolean Value_Loop(gpointer data) {
|
|
|
|
|
if (Value_SetValue(v.value, v.type, v.fc, ®stowrite, regvals)) {
|
|
|
|
|
modbussrv.SetRegValue(v.fc, v.reg, regstowrite, (uint16_t*)regvals);
|
|
|
|
|
}
|
|
|
|
|
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
|
|
|
|
|
VALDATA_COL_NAME, v.name.c_str(),
|
|
|
|
|
VALDATA_COL_FC, std::to_string(v.fc).c_str(),
|
|
|
|
|
VALDATA_COL_REGSTART, std::to_string(v.reg).c_str(),
|
|
|
|
|
VALDATA_COL_TYPE, v.type.c_str(),
|
|
|
|
|
VALDATA_COL_VALUE, Value_GetValue(v.fc, v.reg, v.type).c_str(),
|
|
|
|
|
VALDATA_COL_SIM, v.sim.c_str(),
|
|
|
|
|
-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_free(v_name);
|
|
|
|
@ -266,6 +272,7 @@ void Value_Set(GuiValue *g) {
|
|
|
|
|
if (strcmp(v_name, g->name.c_str()) == 0) {
|
|
|
|
|
Value_ModStore(model, &iter, g);
|
|
|
|
|
changed = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
g_free(v_name);
|
|
|
|
|
}
|
|
|
|
@ -312,12 +319,6 @@ void Value_ModStore(GtkTreeModel *model, GtkTreeIter *iter, GuiValue *g) {
|
|
|
|
|
VALDATA_COL_VALUE, Value_GetValue(g->fc, g->reg, g->type).c_str(),
|
|
|
|
|
VALDATA_COL_SIM, g->sim.c_str(),
|
|
|
|
|
-1);
|
|
|
|
|
|
|
|
|
|
// for (int i = 0; i < 10; i++) {
|
|
|
|
|
// float *f = (float *)&modbusdata[2][i];
|
|
|
|
|
// printf ("%f ", *f);
|
|
|
|
|
// }
|
|
|
|
|
// printf ("\n");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|