Esempio n. 1
0
    private void encoderButtonsSensitive(encoderSensEnum option)
    {
        LogB.Debug(option.ToString());

        //columns
        //c0 button_encoder_capture, hbox_encoder_sup_capture_analyze_two_buttons,
        //	hbox_encoder_configuration, hbox_encoder_capture_options
        //c1 button_encoder_recalculate
        //c2 button_encoder_load_signal
        //c3 hbox_encoder_capture_curves_save_all_none, menuitem_export_encoder_signal
        //	button_encoder_delete_signal, vbox_encoder_signal_comment,
        //	and images: image_encoder_capture , image_encoder_analyze.Sensitive. Update: both NOT managed here
        //UNUSED c4 button_encoder_save_curve, entry_encoder_curve_comment
        //c5 button_encoder_analyze
        //c6 hbox_encoder_user_curves
        //c7 button_encoder_capture_cancel and button_encoder_analyze_cancel (on capture and analyze)
        //c8 button_encoder_capture_finish (only on capture)

        //other dependencies
        //c5 True needs
        //	(signal && treeviewEncoder has rows) ||
        //	(! radio_encoder_analyze_individual_current_set.Active && user has curves))
        //c6 True needs ! radio_encoder_analyze_individual_current_set.Active

        if(option != encoderSensEnum.PROCESSINGCAPTURE && option != encoderSensEnum.PROCESSINGR)
            encoderSensEnumStored = option;

        //columns		 	 0  1  2  3  4  5  6  7  8
        int [] noSession = 		{0, 0, 0, 0, 0, 0, 0, 0, 0};
        int [] noPerson = 		{0, 0, 0, 0, 0, 0, 0, 0, 0};
        int [] yesPerson = 		{1, 0, 1, 0, 0, 1, 1, 0, 0};
        int [] processingCapture = 	{0, 0, 0, 0, 0, 0, 1, 1, 1};
        int [] processingR = 		{0, 0, 0, 0, 0, 0, 1, 0, 0};
        int [] doneNoSignal = 		{1, 1, 1, 0, 0, 1, 1, 0, 0};
        int [] doneYesSignal = 		{1, 1, 1, 1, 0, 1, 1, 0, 0};
        int [] table = new int[7];

        switch(option) {
            case encoderSensEnum.NOSESSION:
                table = noSession;
                break;
            case encoderSensEnum.NOPERSON:
                table = noPerson;
                break;
            case encoderSensEnum.YESPERSON:
                table = yesPerson;
                break;
            case encoderSensEnum.PROCESSINGCAPTURE:
                table = processingCapture;
                break;
            case encoderSensEnum.PROCESSINGR:
                table = processingR;
                break;
            case encoderSensEnum.DONENOSIGNAL:
                table = doneNoSignal;
                break;
            case encoderSensEnum.DONEYESSIGNAL:
                table = doneYesSignal;
                break;
        }

        button_encoder_capture.Sensitive = Util.IntToBool(table[0]);
        hbox_encoder_sup_capture_analyze_two_buttons.Sensitive = Util.IntToBool(table[0]);
        hbox_encoder_configuration.Sensitive = Util.IntToBool(table[0]);
        hbox_encoder_capture_options.Sensitive = Util.IntToBool(table[0]);

        button_encoder_recalculate.Sensitive = Util.IntToBool(table[1]);

        button_encoder_load_signal.Sensitive = Util.IntToBool(table[2]);
        button_encoder_load_signal_on_analyze.Sensitive = Util.IntToBool(table[2]);

        hbox_encoder_capture_curves_save_all_none.Sensitive = Util.IntToBool(table[3]);
        menuitem_export_encoder_signal.Sensitive = Util.IntToBool(table[3]);
        button_encoder_delete_signal.Sensitive = Util.IntToBool(table[3]);
        vbox_encoder_signal_comment.Sensitive = Util.IntToBool(table[3]);
        //image_encoder_capture.Sensitive = Util.IntToBool(table[3]);
        //image_encoder_analyze.Sensitive = Util.IntToBool(table[3]);

        //button_encoder_save_curve.Sensitive = Util.IntToBool(table[4]);
        //entry_encoder_curve_comment.Sensitive = Util.IntToBool(table[4]);

        bool analyze_sensitive =
            (
             Util.IntToBool(table[5]) &&
             (
              (radio_encoder_analyze_individual_current_set.Active &&
               UtilGtk.CountRows(encoderCaptureListStore) > 0)
              ||
              ( ! radio_encoder_analyze_individual_current_set.Active &&
               Convert.ToInt32(label_encoder_user_curves_all_num.Text) >0)
              )
             );
        //max 12 graphs on side compare
        if(analyze_sensitive && radiobutton_encoder_analyze_side.Active) {
            analyze_sensitive = curvesNumOkToSideCompare();
            label_encoder_analyze_side_max.Visible = ! analyze_sensitive;
        } else
            label_encoder_analyze_side_max.Visible = false;

        button_encoder_analyze.Sensitive = analyze_sensitive;

        hbox_encoder_user_curves.Visible =
            (Util.IntToBool(table[6]) && ! radio_encoder_analyze_individual_current_set.Active);

        button_encoder_capture_cancel.Sensitive = Util.IntToBool(table[7]);
        button_encoder_analyze_cancel.Sensitive = Util.IntToBool(table[7]);

        button_encoder_capture_finish.Sensitive = Util.IntToBool(table[8]);
        button_encoder_capture_finish_cont.Sensitive = Util.IntToBool(table[8]);
    }
Esempio n. 2
0
    private void encoderButtonsSensitive(encoderSensEnum option)
    {
        //columns
        //c0 button_encoder_capture
        //c1 button_encoder_recalculate
        //c2 button_encoder_load_signal
        //c3 button_encoder_save_all_curves , button_encoder_update_signal,
        //	button_encoder_delete_signal, entry_encoder_signal_comment,
        //	and images: image_encoder_capture , image_encoder_analyze.Sensitive
        //c4 button_encoder_delete_curve , button_encoder_save_curve, entry_encoder_curve_comment
        //c5 button_encoder_analyze
        //c6 button_encoder_analyze_data_show_user_curves
        //c7 button_cancel (on capture and analyze)

        //other dependencies
        //c5 True needs
        //	(signal && treeviewEncoder has rows) ||
        //	(! radiobutton_encoder_analyze_data_current_signal.Active && user has curves))
        //c6 True needs ! radiobutton_encoder_analyze_data_current_signal.Active

        //columns		 0  1  2  3  4  5  6  7
        int [] noSession = 	{0, 0, 0, 0, 0, 0, 0, 0};
        int [] noPerson = 	{0, 0, 0, 0, 0, 0, 0, 0};
        int [] yesPerson = 	{1, 0, 1, 0, 0, 1, 1, 0};
        int [] processing = 	{0, 0, 0, 0, 0, 0, 0, 1};
        int [] doneNoSignal = 	{1, 0, 1, 0, 0, 1, 1, 0};
        int [] doneYesSignal = 	{1, 1, 1, 1, 0, 1, 1, 0};
        int [] selectedCurve = 	{1, 1, 1, 1, 1, 1, 1, 0};
        int [] table = new int[7];

        switch(option) {
            case encoderSensEnum.NOSESSION:
                table = noSession;
                break;
            case encoderSensEnum.NOPERSON:
                table = noPerson;
                break;
            case encoderSensEnum.YESPERSON:
                table = yesPerson;
                break;
            case encoderSensEnum.PROCESSING:
                table = processing;
                break;
            case encoderSensEnum.DONENOSIGNAL:
                table = doneNoSignal;
                break;
            case encoderSensEnum.DONEYESSIGNAL:
                table = doneYesSignal;
                break;
            case encoderSensEnum.SELECTEDCURVE:
                table = selectedCurve;
                break;
        }

        button_encoder_capture.Sensitive = Util.IntToBool(table[0]);
        button_encoder_recalculate.Sensitive = Util.IntToBool(table[1]);
        button_encoder_load_signal.Sensitive = Util.IntToBool(table[2]);

        button_encoder_save_all_curves.Sensitive = Util.IntToBool(table[3]);
        button_encoder_update_signal.Sensitive = Util.IntToBool(table[3]);
        button_encoder_delete_signal.Sensitive = Util.IntToBool(table[3]);
        entry_encoder_signal_comment.Sensitive = Util.IntToBool(table[3]);
        image_encoder_capture.Sensitive = Util.IntToBool(table[3]);
        image_encoder_analyze.Sensitive = Util.IntToBool(table[3]);

        button_encoder_delete_curve.Sensitive = Util.IntToBool(table[4]);
        button_encoder_save_curve.Sensitive = Util.IntToBool(table[4]);
        entry_encoder_curve_comment.Sensitive = Util.IntToBool(table[3]);

        bool signal = radiobutton_encoder_analyze_data_current_signal.Active;
        button_encoder_analyze.Sensitive =
            (Util.IntToBool(table[5]) &&
             (signal && UtilGtk.CountRows(encoderListStore) > 0 ||
              (! signal && Convert.ToInt32(label_encoder_user_curves_num.Text) >0)));

        button_encoder_analyze_data_show_user_curves.Sensitive =
            (Util.IntToBool(table[6]) && ! radiobutton_encoder_analyze_data_current_signal.Active);

        button_encoder_capture_cancel.Sensitive = Util.IntToBool(table[7]);
        button_encoder_analyze_cancel.Sensitive = Util.IntToBool(table[7]);
    }