|
|
@ -57,12 +57,12 @@ void edit_event(temp_set_window *widgets) {
|
|
|
|
g_signal_connect(G_OBJECT(widgets->chbTempRead), "toggled", G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->chbTempRead), "toggled", G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->chbTempWrite), "toggled", G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->chbTempWrite), "toggled", G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionTemp),"changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spiSevereRestrictionTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionTemp),"changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinSevereRestrictionTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinPaddingFLTemp),"changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinPaddingFLTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinCPULimitTemp),"changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinCPULimitTemp),"value-changed",G_CALLBACK(edit_init_windows), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinTempRead),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinTempRead),"value-changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinTempWrite),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->spinTempWrite),"value-changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spiSevereRestrictionTemp);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spiSevereRestrictionTemp);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spinSevereRestrictionTemp);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmbSevereRestrictionTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spinSevereRestrictionTemp);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmbPaddingFLTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spinPaddingFLTemp);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->cmbPaddingFLTemp),"changed",G_CALLBACK(wrapper_edit_init_windows_size_memory), widgets->spinPaddingFLTemp);
|
|
|
@ -98,16 +98,11 @@ void edit_show(GtkWidget *self, char* glade_path) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void wrapper_edit_init_windows_size_memory(GtkWidget *spin) {
|
|
|
|
void wrapper_edit_init_windows_size_memory() {
|
|
|
|
if (spin != NULL) {
|
|
|
|
|
|
|
|
// gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
philos_set_active_widgets_device_io(edit_widgets->cbtTempDevice,edit_widgets->chbTempWrite, edit_widgets->spinTempWrite, edit_widgets->cbtTempWrite);
|
|
|
|
|
|
|
|
philos_set_active_widgets_device_io(edit_widgets->cbtTempDevice,edit_widgets->chbTempRead, edit_widgets->spinTempRead, edit_widgets->cbtTempRead);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
philos_temp_add_disk(edit_widgets, &obj_edit_config);
|
|
|
|
philos_temp_add_disk(edit_widgets, &obj_edit_config);
|
|
|
|
philos_temp_del_disk(edit_widgets, &obj_edit_config);
|
|
|
|
philos_temp_del_disk(edit_widgets, &obj_edit_config);
|
|
|
|
edit_init_windows();
|
|
|
|
edit_init_windows();
|
|
|
|
|
|
|
|
philos_temp_generate_cmd(edit_widgets, &obj_edit_config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void edit_init_windows() {
|
|
|
|
void edit_init_windows() {
|
|
|
@ -202,6 +197,10 @@ char*** edit_get_select_device() {
|
|
|
|
obj_edit_config.disk = yon_char_parsed_append(obj_edit_config.disk,&index, "-");
|
|
|
|
obj_edit_config.disk = yon_char_parsed_append(obj_edit_config.disk,&index, "-");
|
|
|
|
obj_edit_config.disk = yon_char_parsed_append(obj_edit_config.disk,&index, NULL);
|
|
|
|
obj_edit_config.disk = yon_char_parsed_append(obj_edit_config.disk,&index, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
|
|
|
obj_edit_config.disk = yon_char_parsed_append(obj_edit_config.disk,&obj_edit_config.size, NULL);
|
|
|
|
|
|
|
|
obj_edit_config.size--;
|
|
|
|
|
|
|
|
}
|
|
|
|
return &obj_edit_config.disk;
|
|
|
|
return &obj_edit_config.disk;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int edit_get_soft() {
|
|
|
|
int edit_get_soft() {
|
|
|
@ -230,11 +229,28 @@ void edit_set_select_device(char*** str_value) {
|
|
|
|
if ((*str_value)[0] == NULL) {
|
|
|
|
if ((*str_value)[0] == NULL) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_char_parsed_copy(&obj_edit_config.disk, str_value);
|
|
|
|
if (str_value) {
|
|
|
|
int index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, (*str_value)[0]);
|
|
|
|
if ((*str_value)) {
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
if ((*str_value)[0] != NULL && strstr((*str_value)[0], "-") == NULL) {
|
|
|
|
|
|
|
|
yon_char_parsed_copy(&obj_edit_config.disk, str_value);
|
|
|
|
|
|
|
|
int index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, (*str_value)[0]);
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
obj_edit_config.size = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
obj_edit_config.size = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
obj_edit_config.size = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_read_device(int* str_value, int* pow_mem) {
|
|
|
|
void edit_set_read_device(int* str_value, int* pow_mem) {
|
|
|
@ -244,13 +260,17 @@ void edit_set_read_device(int* str_value, int* pow_mem) {
|
|
|
|
if (str_value[0] == -2 || pow_mem[0] == -2) {
|
|
|
|
if (str_value[0] == -2 || pow_mem[0] == -2) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempRead,
|
|
|
|
if (str_value && pow_mem) {
|
|
|
|
|
|
|
|
if (str_value[0] != -2 && pow_mem[0] != -2 && pow_mem[0] != -3) {
|
|
|
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read, &str_value);
|
|
|
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read_size, &pow_mem);
|
|
|
|
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempRead,
|
|
|
|
edit_widgets->spinTempRead,
|
|
|
|
edit_widgets->spinTempRead,
|
|
|
|
edit_widgets->cbtTempRead);
|
|
|
|
edit_widgets->cbtTempRead);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempRead), 1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempRead), 1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read, &str_value);
|
|
|
|
}
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read_size, &pow_mem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_write_device(int* str_value, int* pow_mem) {
|
|
|
|
void edit_set_write_device(int* str_value, int* pow_mem) {
|
|
|
|
if (str_value == NULL || pow_mem == NULL) {
|
|
|
|
if (str_value == NULL || pow_mem == NULL) {
|
|
|
@ -262,11 +282,15 @@ void edit_set_write_device(int* str_value, int* pow_mem) {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempWrite,
|
|
|
|
if (str_value && pow_mem) {
|
|
|
|
edit_widgets->spinTempWrite,
|
|
|
|
if (str_value[0] != -2 && pow_mem[0] != -2 && pow_mem[0] != -3) {
|
|
|
|
edit_widgets->cbtTempWrite);
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempWrite,
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write, &str_value);
|
|
|
|
edit_widgets->spinTempWrite,
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write_size, &pow_mem);
|
|
|
|
edit_widgets->cbtTempWrite);
|
|
|
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write, &str_value);
|
|
|
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write_size, &pow_mem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_size_arrays(size_t size_array) {
|
|
|
|
void edit_set_size_arrays(size_t size_array) {
|
|
|
|
obj_edit_config.size = size_array;
|
|
|
|
obj_edit_config.size = size_array;
|
|
|
|