window_main.glade~ 0000644 0001750 0001750 00000413130 14101026612 012362 0 ustar pi pi
247
80
1
10
8
119
81
1
10
255
1
10
100
100
1
10
GT800X480A-1303P
GT1280X800A-1303P
Choose Display
255
1
10
100
1
10
255
80
1
10
Off
Single Touch
Multi-touch (10-point)
Select Touch Mode
False
GT-VP Control Center
800
300
applications-system
utility
False
True
True
left
False
True
False
100
30
True
False
Brightness (%)
0.02
0
0
True
True
brightnessAdjustment
1
0
0
1
152
33
True
True
100
brightnessAdjustment
100
0
2
Change Brightness
True
True
True
0
3
Save Brightness
True
True
True
0
4
Save Command
to Text File
True
True
True
0
5
100
30
True
False
Threshold
middle
0.01
1
0
True
False
displayList
0
2
1
0
2
0
Show Factory
Default
True
True
True
2
2
True
True
thresholdAdjustment
1
0
1
1
152
33
True
True
82
thresholdAdjustment
82
1
2
Change Threshold
True
True
True
1
3
Save Threshold
True
True
True
1
4
Save Command
to Text File
True
True
True
1
5
True
False
OLD (DO NOT TEST)
False
True
False
8
8
8
8
vertical
False
True
0
True
False
Display Info
False
True
5
1
True
False
11
True
True
False
Product Type: -----------
0
0
True
False
27
Resolution: ---- x ---
1
0
True
False
4
Memory Checksum: 0xXXXXXXXX
True
2
0
True
False
Boot: ------------
0
1
True
False
36
Firmware: -----------
1
1
True
False
Connection Status: -----------
2
1
True
False
TSP ID: ---------
center
1
2
True
False
TSP Name: --------
True
0
2
True
False
TSP Mem SW Selection: ---------
2
2
False
True
3
2
Exit Tool
True
True
True
False
True
3
Touch Level Tool
True
True
True
False
True
4
1
True
False
Connection/Info
1
False
True
False
8
8
8
vertical
True
False
True
Load Settings
True
True
True
0
0
Save Settings
True
True
True
1
0
Default
True
True
True
2
0
Export
True
True
True
3
0
False
True
10
0
True
False
True
True
False
vertical
5
True
False
True
False
25
Brightness
0
0
True
True
brightnessAdjustment
1
0
False
True
0
True
True
brightnessAdjustment
1
0
False
True
3
1
True
False
Test
True
True
True
0
0
Save Brightness
True
True
True
1
0
False
True
2
0
0
True
False
vertical
5
True
False
I2C Slave Address
False
True
0
True
False
True
True
True
I2CHIDAdjustment
1
0
True
False
47
HID
0
0
False
True
1
True
False
True
True
True
I2CCommandAdjustment
1
0
True
False
23
Command
0
0
False
True
2
1
0
False
True
1
True
False
True
True
False
vertical
5
True
False
True
False
28
Threshold
0
0
True
True
thresholdAdjustment
1
0
False
True
0
True
True
thresholdAdjustment
1
0
False
True
1
True
False
Test
True
True
True
0
0
Save Threshold
True
True
True
1
0
False
True
2
0
0
True
False
vertical
5
True
False
UART
False
True
0
True
False
True
True
False
28
Baudrate
0
0
1
0
False
True
1
True
False
True
True
False
39
Parity
0
0
1
0
False
True
2
1
0
False
True
2
2
True
False
4
Display Settings
2
False
True
False
8
8
8
8
vertical
True
False
12
239
True
True
scrollAdjustment
in
False
True
False
False
scrollAdjustment
False
touchMonitorTextbuffer
False
True
0
True
False
4
True
Start
True
True
True
1
0
0
0
Stop
True
True
True
2
0
False
True
1
True
False
Set touch mode to OFF to access tabs.
center
True
True
2
3
True
False
Touch Monitor
3
False
True
False
8
8
8
8
vertical
True
False
WARNING: Read the Control Center instruction document before using any functions in this tab.
Using an incorrect file may damage the connected module.
True
False
True
0
True
False
True
False
vertical
10
True
True
True
False
0
True
True
False
True
0
True
True
False
0
True
True
TSP0_RadioButton
False
True
1
True
True
False
0
True
True
TSP0_RadioButton
False
True
2
True
True
False
0
True
True
TSP0_RadioButton
False
True
3
True
True
False
0
True
True
TSP0_RadioButton
False
True
4
False
True
0
True
False
vertical
10
True
True
False
0:
3
False
True
0
True
False
1:
3
False
True
1
True
False
2:
3
False
True
2
True
False
3:
3
False
True
3
True
False
4:
3
False
True
4
False
True
1
True
False
vertical
10
True
True
False
Factory Default
16
16
False
True
0
True
False
False
True
1
True
False
False
True
2
True
False
False
True
3
True
False
False
True
4
True
True
10
2
True
False
vertical
False
True
6
3
True
False
vertical
True
False
10
10
vertical
True
False
Open File:
False
True
0
True
False
----------.bin
False
True
1
False
False
0
True
False
True
vertical
7
True
Open TSP File
True
True
True
False
True
0
Upload to Module
True
True
True
False
True
1
Enable TSP File
True
True
True
False
True
2
Save Selection to MSW
True
True
True
False
True
3
False
True
1
True
True
5
True
True
1
4
True
False
Touch Setting Package
4
False
True
False
8
8
8
8
vertical
True
False
True
False
10
10
vertical
3
True
False
Acceptable Noise
False
True
0
True
True
acceptableNoiseAdjustment
False
True
1
True
False
Number of
Measurements
False
True
2
True
True
measurementNumAdjustment
False
True
3
0
0
True
False
10
10
vertical
True
False
Use TSR
False
True
0
True
True
True
False
True
1
Read TSR
State
True
True
True
False
True
2
3
0
True
False
vertical
True
False
gtk-media-play
3
False
True
0
Run Test
True
True
True
False
True
1
1
0
True
False
1
1
True
False
10
10
vertical
True
False
Results
False
True
0
True
False
15
Results Explanation
False
True
1
2
0
False
True
1
True
True
True
True
False
7
7
4
The touch standard reference feature is fairly complex, completely optional, and not recommended to be used unless absolutely necessary. When a test is performed, it will perform a certain number of measurements (indicated by the user) and determine if they were successful based on the user's acceptible noise value. If the tests do come back successful, they are saved as "sane" reference values. TSR use must be enabled in order to reference these "sane" values.
True
20
True
False
What is touch standard reference?
False
True
5
2
5
True
False
center
center
Touch Standard Reference
2
3
0
0
5
False
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
Unable to connect to display.
Verify display product number, power source,
and USB cable connection and try again.
False
True
1
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The chosen TSP file is not compatible with the connected display.
Please choose a compatible TSP file.
False
True
1
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The chosen file is not a touch setting package (TSP) file.
Please choose a TSP file.
Need help?
Contact support.ele@noritake.com for technical support.
False
True
1
False
False
True
center
True
dialog
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
Memory switch values have been read from
the module and will be written to a text file.
The text file will be saved in the same
directory as GT-VP Control Center.
0
False
True
1
False
Brightness Change
False
True
center-always
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
2
True
False
False
True
0
True
False
False
True
1
False
Warning!
False
True
center-always
True
dialog-warning
popup-menu
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
0
True
False
You are about to set your brightness to 0.
This will turn your display off.
Are you sure you would like to do this?
False
True
1
brightnessNoButton
brightnessYesButton
False
False
True
center
True
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The text file will be saved in the same
directory as GT-VP Control Center.
False
True
1
False
False
True
center-always
True
dialog
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
1
True
False
False
True
0
True
False
False
True
1
False
Warning!
False
True
center-always
True
dialog-warning
popup-menu
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
0
True
False
You are about to set your touch sensitivity below 10.
Using a sensitivity value this small may make the
touchscreen behave erroneously.
Are you sure you want to do this?
False
True
1
False
Choose Touch Setting Package File
320
260
dialog
window_main
False
False
False
vertical
2
False
end
Open
True
True
True
True
True
0
Close
True
True
True
True
True
1
False
False
0
window_main.glade 0000644 0001750 0001750 00000413131 14101026612 012165 0 ustar pi pi
247
80
1
10
8
119
81
1
10
255
1
10
100
100
1
10
GT800X480A-1303P
GT1280X800A-1303P
Choose Display
255
1
10
100
1
10
255
80
1
10
Off
Single Touch
Multi-touch (10-point)
Select Touch Mode
False
GT-VP Control Center
800
300
applications-system
utility
False
True
True
left
False
True
False
100
30
True
False
Brightness (%)
0.02
0
0
True
True
brightnessAdjustment
1
0
0
1
152
33
True
True
100
brightnessAdjustment
100
0
2
Change Brightness
True
True
True
0
3
Save Brightness
True
True
True
0
4
Save Command
to Text File
True
True
True
0
5
100
30
True
False
Threshold
middle
0.01
1
0
True
False
displayList
0
2
1
0
2
0
Show Factory
Default
True
True
True
2
2
True
True
thresholdAdjustment
1
0
1
1
152
33
True
True
82
thresholdAdjustment
82
1
2
Change Threshold
True
True
True
1
3
Save Threshold
True
True
True
1
4
Save Command
to Text File
True
True
True
1
5
True
False
OLD (DO NOT TEST)
False
True
False
8
8
8
8
vertical
False
True
0
True
False
Display Info
False
True
5
1
True
False
11
True
True
False
Product Type: -----------
0
0
True
False
27
Resolution: ---- x ---
1
0
True
False
4
Memory Checksum: 0xXXXXXXXX
True
2
0
True
False
Boot: ------------
0
1
True
False
36
Firmware: -----------
1
1
True
False
Connection Status: -----------
2
1
True
False
TSP ID: ---------
center
1
2
True
False
TSP Name: --------
True
0
2
True
False
TSP Mem SW Selection: ---------
2
2
False
True
3
2
Exit Tool
True
True
True
False
True
3
1
True
False
Connection/Info
1
False
True
False
8
8
8
vertical
True
False
True
Load Settings
True
True
True
0
0
Save Settings
True
True
True
1
0
Default
True
True
True
2
0
Export
True
True
True
3
0
False
True
10
0
True
False
True
True
False
vertical
5
True
False
True
False
25
Brightness
0
0
True
True
brightnessAdjustment
1
0
False
True
0
True
True
brightnessAdjustment
1
0
False
True
3
1
True
False
Test
True
True
True
0
0
Save Brightness
True
True
True
1
0
False
True
2
0
0
True
False
vertical
5
True
False
I2C Slave Address
False
True
0
True
False
True
True
True
I2CHIDAdjustment
1
0
True
False
47
HID
0
0
False
True
1
True
False
True
True
True
I2CCommandAdjustment
1
0
True
False
23
Command
0
0
False
True
2
1
0
False
True
1
True
False
True
True
False
vertical
5
True
False
True
False
28
Threshold
0
0
True
True
thresholdAdjustment
1
0
False
True
0
True
True
thresholdAdjustment
1
0
False
True
1
True
False
Test
True
True
True
0
0
Save Threshold
True
True
True
1
0
False
True
2
0
0
True
False
vertical
5
True
False
UART
False
True
0
True
False
True
True
False
28
Baudrate
0
0
1
0
False
True
1
True
False
True
True
False
39
Parity
0
0
1
0
False
True
2
1
0
False
True
2
2
True
False
4
Display Settings
2
False
True
False
8
8
8
8
vertical
True
False
12
239
True
True
scrollAdjustment
in
False
True
False
False
scrollAdjustment
False
touchMonitorTextbuffer
False
True
0
True
False
4
True
Start
True
True
True
1
0
0
0
Stop
True
True
True
2
0
Touch Level Tool
True
True
True
3
0
False
True
1
True
False
Set touch mode to OFF to access tabs.
center
True
True
2
3
True
False
Touch Monitor
3
False
True
False
8
8
8
8
vertical
True
False
WARNING: Read the Control Center instruction document before using any functions in this tab.
Using an incorrect file may damage the connected module.
True
False
True
0
True
False
True
False
vertical
10
True
True
True
False
0
True
True
False
True
0
True
True
False
0
True
True
TSP0_RadioButton
False
True
1
True
True
False
0
True
True
TSP0_RadioButton
False
True
2
True
True
False
0
True
True
TSP0_RadioButton
False
True
3
True
True
False
0
True
True
TSP0_RadioButton
False
True
4
False
True
0
True
False
vertical
10
True
True
False
0:
3
False
True
0
True
False
1:
3
False
True
1
True
False
2:
3
False
True
2
True
False
3:
3
False
True
3
True
False
4:
3
False
True
4
False
True
1
True
False
vertical
10
True
True
False
Factory Default
16
16
False
True
0
True
False
False
True
1
True
False
False
True
2
True
False
False
True
3
True
False
False
True
4
True
True
10
2
True
False
vertical
False
True
6
3
True
False
vertical
True
False
10
10
vertical
True
False
Open File:
False
True
0
True
False
----------.bin
False
True
1
False
False
0
True
False
True
vertical
7
True
Open TSP File
True
True
True
False
True
0
Upload to Module
True
True
True
False
True
1
Enable TSP File
True
True
True
False
True
2
Save Selection to MSW
True
True
True
False
True
3
False
True
1
True
True
5
True
True
1
4
True
False
Touch Setting Package
4
False
True
False
8
8
8
8
vertical
True
False
True
False
10
10
vertical
3
True
False
Acceptable Noise
False
True
0
True
True
acceptableNoiseAdjustment
False
True
1
True
False
Number of
Measurements
False
True
2
True
True
measurementNumAdjustment
False
True
3
0
0
True
False
10
10
vertical
True
False
Use TSR
False
True
0
True
True
True
False
True
1
Read TSR
State
True
True
True
False
True
2
3
0
True
False
vertical
True
False
gtk-media-play
3
False
True
0
Run Test
True
True
True
False
True
1
1
0
True
False
1
1
True
False
10
10
vertical
True
False
Results
False
True
0
True
False
15
Results Explanation
False
True
1
2
0
False
True
1
True
True
True
True
False
7
7
4
The touch standard reference feature is fairly complex, completely optional, and not recommended to be used unless absolutely necessary. When a test is performed, it will perform a certain number of measurements (indicated by the user) and determine if they were successful based on the user's acceptible noise value. If the tests do come back successful, they are saved as "sane" reference values. TSR use must be enabled in order to reference these "sane" values.
True
20
True
False
What is touch standard reference?
False
True
5
2
5
True
False
center
center
Touch Standard Reference
2
3
0
0
5
False
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
Unable to connect to display.
Verify display product number, power source,
and USB cable connection and try again.
False
True
1
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The chosen TSP file is not compatible with the connected display.
Please choose a compatible TSP file.
False
True
1
False
False
True
center
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The chosen file is not a touch setting package (TSP) file.
Please choose a TSP file.
Need help?
Contact support.ele@noritake.com for technical support.
False
True
1
False
False
True
center
True
dialog
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
Memory switch values have been read from
the module and will be written to a text file.
The text file will be saved in the same
directory as GT-VP Control Center.
0
False
True
1
False
Brightness Change
False
True
center-always
True
dialog-warning
normal
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
2
True
False
False
True
0
True
False
False
True
1
False
Warning!
False
True
center-always
True
dialog-warning
popup-menu
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
0
True
False
You are about to set your brightness to 0.
This will turn your display off.
Are you sure you would like to do this?
False
True
1
brightnessNoButton
brightnessYesButton
False
False
True
center
True
normal
False
window_main
False
vertical
2
False
end
OK
True
True
True
True
True
1
False
False
0
True
False
The text file will be saved in the same
directory as GT-VP Control Center.
False
True
1
False
False
True
center-always
True
dialog
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
1
True
False
False
True
0
True
False
False
True
1
False
Warning!
False
True
center-always
True
dialog-warning
popup-menu
False
window_main
False
vertical
2
False
end
No
True
True
True
True
True
0
Yes
True
True
True
True
True
1
False
False
0
True
False
You are about to set your touch sensitivity below 10.
Using a sensitivity value this small may make the
touchscreen behave erroneously.
Are you sure you want to do this?
False
True
1
False
Choose Touch Setting Package File
320
260
dialog
window_main
False
False
False
vertical
2
False
end
Open
True
True
True
True
True
0
Close
True
True
True
True
True
1
False
False
0
Makefile 0000644 0001750 0001750 00000000333 13711027310 010312 0 ustar pi pi controlcenter: main.c GT1P_USB_LIB.c GT1P.c
gcc -o controlcenter main.c GT1P_USB_LIB.c GT1P.c -Wall `pkg-config --cflags --libs gtk+-3.0` -export-dynamic -I/usr/include/libusb-1.0/ -lusb-1.0 -lm -lgthread-2.0 -std=c11
main.h 0000644 0001750 0001750 00000016013 14102310611 007743 0 ustar pi pi /*********************************************************
* Filename: main.h
*
* Purpose:
* Provide the user with an easy-to-use GUI to control the
* GT-VP's internal settings and view module data.
*
* Version: 4.0 (ME-N63-05)
* Date: 8/3/2021
* Website: noritake-elec.com
* (C) 2021 Noritake Co., Inc.
*********************************************************/
#ifndef MAIN_H
#define MAIN_H
#include "GT1P.h"
#include "GT1P_USB_LIB.h"
//GT-VP(1P) Memory switch definitions
#define BRIGHTNESS_MS 5
#define I2C_HID_SLAVE_ADDRESS_MS 46
#define I2C_COMMAND_SLAVE_ADDRESS_MS 47
#define UART_BAUDRATE_MS 48
#define UART_PARITY_MS 49
#define THRESHOLD_MS 59
#define TOUCH_SENS_SELECT_MS 62
#define TSP_SELECT_MS 63
// Maximum filename character to display
// (including ellipsis and null terminator)
#define FILENAME_DISPLAY_MAX 29
// TSP file compatible GT-VP firmware version for 7" and 5" modules
#define TSP_FW 150
// TSP file compatible GT-VP firmware version for 10.1" modules
#define TSP_FW_101 156
//TSP file type sizes
//NOTE: Type-B size is still subject to change
#define TSP_TYPE_A_SIZE 1152
#define TSP_TYPE_B_SIZE 2048
//Product ID definitions
#define GTWV050VHB00P 0x12dd
#define GTWS070VHA00P 0x12d0
#define GT800X480A_1303P 0x12de
#define GT1280X800A_1303P 0x12df
// Struct to store TSP file header information
struct TSP_File {
char fileID[3];
char packageID[5];
char author[17];
char formatType[2];
char productInfo[33];
char specCode[10];
char notes[65];
unsigned char data[1024];
};
struct TSP_File openedTSPFile;
//Struct to store connected module information
struct TFT_Info {
unsigned char boot[7];
unsigned char firm[7];
unsigned char prod[18];
unsigned char width[7];
unsigned char height[7];
unsigned char memCheck[7];
unsigned char TSPName[18];
unsigned char TSPID[4];
};
struct TFT_Info displayInfo;
// Baudrate flag values
enum baudrateSelection {
BR_38400_Default = 0,
BR_4800 = 1,
BR_9600 = 2,
BR_19200 = 3,
BR_38400 = 4,
BR_57600 = 5,
BR_115200 = 6
};
// Parity flag values
enum paritySelection {
parityNone = 0,
parityEven = 1,
parityOdd = 2
};
// TSP file positions
enum TSPPosition {
factoryDefault = 0,
TSPPosition1 = 1,
TSPPosition2 = 2,
TSPPosition3 = 3,
TSPPosition4 = 4
};
/**
* New PN = 0
* Old PN = 1
*/
uint8_t oldPNFlag = 0;
uint8_t compatFWFlag = 0;
//Global GTK Object Pointers
GtkAdjustment *brightnessAdjustment;
GtkAdjustment *thresholdAdjustment;
GtkAdjustment *I2CHIDAdjustment;
GtkAdjustment *I2CCommandAdjustment;
GtkAdjustment *acceptableNoiseAdjustment;
GtkAdjustment *measurementNumAdjustment;
GtkAdjustment *scrollAdjustment;
GtkDialog *brightnessWarningWindow;
GtkDialog *thresholdWarningWindow;
GtkDialog *brightnessSaveWindow;
GtkDialog *thresholdSaveWindow;
GtkDialog *brightnessFileWindow;
GtkDialog *thresholdFileWindow;
GtkDialog *touchPackageChooserDialog;
GtkDialog *TSPFileCompatDialog;
GtkDialog *TSPFileVerifyDialog;
GtkDialog *ConnectFailedDialog;
GtkLabel *brightnessSaveWindowLabel;
GtkLabel *brightnessSaveWindowLabel2;
GtkLabel *thresholdSaveWindowLabel;
GtkLabel *thresholdSaveWindowLabel2;
GtkLabel *bootLabel;
GtkLabel *firmwareLabel;
GtkLabel *productTypeLabel;
GtkLabel *resolutionLabel;
GtkLabel *memoryChecksumLabel;
GtkLabel *connectionStatusLabel;
GtkLabel *TSP_NameLabel;
GtkLabel *TSP_IDLabel;
GtkLabel *TSP_SelectionLabel;
GtkLabel *TSRResultsExplanationLabel;
GtkLabel *displayMenuButtonLabel;
GtkLabel *TSP_FileLabel;
GtkLabel *TSP0_Label;
GtkLabel *TSP1_Label;
GtkLabel *TSP2_Label;
GtkLabel *TSP3_Label;
GtkLabel *TSP4_Label;
GtkLabel *touchMonitorHelpLabel;
GtkLabel *baudrateMenuLabel;
GtkLabel *parityMenuLabel;
GtkListStore *displayList;
GtkWidget *displayCombobox;
GtkWidget *touchMonitorCombobox;
GtkWidget *TouchMonitorMenubutton;
GtkWidget *startTouchMonitorButton;
GtkWidget *stopTouchMonitorButton;
GtkWidget *runTSRTestButton;
GtkWidget *readTSRStateButton;
GtkWidget *acceptableNoiseSpinbutton;
GtkWidget *measurementNumSpinbutton;
GtkWidget *TSR_spinner;
GtkWidget *touchLevelToolButton;
GtkWidget *touchMonitorTextview;
GtkWidget *touchMonitorScrolledWindow;
GtkTextBuffer *touchMonitorTextbuffer;
GtkSwitch *TSRSwitch;
GtkTextMark *mark;
GtkTextIter iter;
GtkNotebook *controlcenterNotebook;
// Touch Setting Package Tab
GtkWidget *TSP0_RadioButton;
GtkWidget *TSP1_RadioButton;
GtkWidget *TSP2_RadioButton;
GtkWidget *TSP3_RadioButton;
GtkWidget *TSP4_RadioButton;
GtkWidget *openTouchSettingPackageButton;
GtkWidget *loadTouchSettingPackageButton;
GtkWidget *selectTouchSettingPackageButton;
GtkWidget *saveTouchSettingPackageSelectionButton;
void initObjects(GtkBuilder *builder);
void on_window_main_destroy();
void getProductInfo();
void brightnessButton_clicked_cb();
void brightnessYesButton_clicked_cb();
void brightnessNoButton_clicked_cb();
void brightnessSaveYesButton_clicked_cb();
void on_brightnessSaveNoButton_clicked();
void thresholdSaveYesButton_clicked_cb();
void thresholdSaveNoButton_clicked_cb();
void thresholdButton_clicked_cb();
void thresholdWarningYesButton_clicked_cb();
void thresholdWarningNoButton_clicked_cb();
void factoryDefaultButton_clicked_cb();
void saveBrightnessButton_clicked_cb();
void saveThresholdButton_clicked_cb();
void brightnessFileDialogOkButton_clicked_cb();
void thresholdFileDialogOkButton_clicked_cb();
void touchMonitorSelect();
void touchMonitor_OFF();
void touchMonitor_Single();
void touchMonitor_Multi();
void scrollTextview(char * stringToAdd);
void *startTouchMonitorThread();
void startTouchMonitorButton_clicked_cb();
void stopTouchMonitorButton_clicked_cb();
void readAllMSButton_clicked_cb();
void writeAllMSButton_clicked_cb();
void defaultMSButton_clicked_cb();
void exportMSButton_clicked_cb();
void runTSRTestButton_clicked_cb();
void TSRSwitch_state_set_cb();
void readTSRStateButton_clicked_cb();
void GTWV050VHB00P_selected();
void GTWS070VHA00P_selected();
void GT800X480A_1303P_selected();
void GT1280X800A_1303P_selected();
void GTWX101VHB00P_selected();
void connectFailedDialogOkButton_clicked_cb();
void enableTSRWidgets(gboolean setting);
void enableTSPWidgets(gboolean setting);
void on_TSP_RadioButton_clicked();
void openTouchPackageButton_clicked_cb();
void TSPFileVerifyDialogOkButton_clicked_cb();
void TSPFileCompatDialogOkButton_clicked_cb();
void closeTouchPackageButton_clicked_cb();
void openTouchPackageButton_clicked_cb();
void loadTouchSettingPackageButton_clicked_cb();
void sendTSP(uint8_t location, GtkLabel *label, char *TSPfilename, const gchar *filename);
void selectTouchSettingPackageButton_clicked_cb();
void resetTSPTab();
void saveTouchSettingPackageSelectionButton_clicked_cb();
void BR_38400bps_Default_selected();
void BR_4800bps_selected();
void BR_9600bps_selected();
void BR_19200bps_selected();
void BR_38400bps_selected();
void BR_57600bps_selected();
void BR_115200bps_selected();
void Parity_None_selected();
void Parity_Even_selected();
void Parity_Odd_selected();
void touchLevelToolButton_clicked_cb();
#endif
main.c 0000644 0001750 0001750 00000252744 14102321150 007753 0 ustar pi pi /*********************************************************
* Filename: main.c
*
* Purpose:
* Provide the user with an easy-to-use GUI to control the
* GT-VP's internal settings and view module data.
*
* Version: 4.0 (ME-N63-05)
* Date: 8/3/2021
* Website: noritake-elec.com
* (C) 2021 Noritake Co., Inc.
*********************************************************/
#include
#include
#include
#include
#include
#include
#include
#include // for basename()
#include "main.h"
// Default memory switch values
gdouble brightnessDefault = 0xff;
gdouble I2CHIDSlaveAddressDefault = 0x51;
gdouble I2CCommandSlaveAddressDefault = 0x50;
gdouble UARTBaudrateDefault = 0x00;
gdouble UARTParityDefault = 0x00;
gdouble thresholdDefault = 0x50;
//Product ID Global Variable
//Extern source found in GT1P_USB_LIB.h
int product_ID;
// Global to keep track of current touch mode
int touchState;
//Global program control flags
int validBrightness = 1;
int validThreshold = 1;
int validSaveBrightness = 1;
int validSaveThreshold = 1;
int touchMode;
int touchLoop;
int touchValid;
int testCount = 0;
int baudrateFlag = 0;
int parityFlag = 0;
int advTouchCompatFlag = 0;
// Touch data text box char arrays
char textBoxText[40];
char textBoxText_released_1[32];
// Touch data text box char pointers
char * textBoxText_UTF;
char * textBoxText_UTF_T1;
char * textBoxText_UTF_R1;
// Touch Setting Package variables
int fileOpenFlag = 0;
unsigned char touchFileBuffer[1152];
char *touchFilename;
unsigned char filenameGlobal[100];
int touchSettingRadioFlag = 0;
int touchSettingSelectFlag = 0;
int touchSettingSaveFlag = 0;
char TSP1_file[50];
char TSP2_file[50];
char TSP3_file[50];
char TSP4_file[50];
/**
* Main function.
*
* Initializes GTK+ 3, constructs the GTK objects, and shows the main
* program window.
*
* @return int Always 0.
*/
int main(int argc, char *argv[])
{
GError *err = NULL;
GtkBuilder *builder;
GtkWidget *window;
gtk_init(&argc, &argv);
builder = gtk_builder_new();
if(!gtk_builder_add_from_file (builder, "window_main.glade", &err))
{
fprintf(stderr, "Error adding build from file. Error: %s\n", err->message);
return -1; //Exit program
}
// Get the main application window object
window = GTK_WIDGET(gtk_builder_get_object(builder, "window_main"));
// Initialize the GTK builder
initObjects(builder);
gtk_builder_connect_signals(builder, NULL);
g_object_unref(builder);
// Set tab to "Connection/Info"
gtk_notebook_set_current_page(controlcenterNotebook, 1);
gtk_notebook_remove_page(controlcenterNotebook, 0);
// Show the main window
gtk_widget_show(window);
// Diable the "Start" button on the Touch Monitor tab
gtk_widget_set_sensitive(startTouchMonitorButton, FALSE);
// Hide the Touch Monitor tab's help label
gtk_widget_hide(GTK_WIDGET(touchMonitorHelpLabel));
gtk_main();
return 0;
}
/**
* Builds all GTK objects.
*
* @param builder The application's GTK builder.
* @return none
*/
void initObjects(GtkBuilder *builder)
{
// Get adjustment objects
brightnessAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "brightnessAdjustment"));
thresholdAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "thresholdAdjustment"));
I2CHIDAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "I2CHIDAdjustment"));
I2CCommandAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "I2CCommandAdjustment"));
acceptableNoiseAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "acceptableNoiseAdjustment"));
measurementNumAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "measurementNumAdjustment"));
scrollAdjustment = GTK_ADJUSTMENT(gtk_builder_get_object(builder, "scrollAdjustment"));
// Get combobox object
displayCombobox = GTK_WIDGET(gtk_builder_get_object(builder, "displayCombobox")); //NOT USED IN V2.0 OR GREATER
touchMonitorCombobox = GTK_WIDGET(gtk_builder_get_object(builder, "touchMonitorCombobox"));
startTouchMonitorButton = GTK_WIDGET(gtk_builder_get_object(builder, "startTouchMonitorButton"));
stopTouchMonitorButton = GTK_WIDGET(gtk_builder_get_object(builder, "stopTouchMonitorButton"));
runTSRTestButton = GTK_WIDGET(gtk_builder_get_object(builder, "runTSRTestButton"));
readTSRStateButton = GTK_WIDGET(gtk_builder_get_object(builder, "readTSRStateButton"));
acceptableNoiseSpinbutton = GTK_WIDGET(gtk_builder_get_object(builder, "acceptableNoiseSpinbutton"));
measurementNumSpinbutton = GTK_WIDGET(gtk_builder_get_object(builder, "measurementNumSpinbutton"));
TouchMonitorMenubutton = GTK_WIDGET(gtk_builder_get_object(builder, "TouchMonitorMenubutton"));
touchLevelToolButton = GTK_WIDGET(gtk_builder_get_object(builder, "touchLevelToolButton"));
// Get switch object
TSRSwitch = GTK_SWITCH(gtk_builder_get_object(builder, "TSRSwitch"));
// Get textview object
touchMonitorTextview = GTK_WIDGET(gtk_builder_get_object(builder, "touchMonitorTextview"));
// Get text buffer object
touchMonitorTextbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(touchMonitorTextview));
gtk_text_buffer_get_end_iter (touchMonitorTextbuffer, &iter);
gtk_text_buffer_create_mark (touchMonitorTextbuffer, "scroll", &iter, TRUE);
// Get the dialog window objects
// NOTE: Some object names are not the same as reference names.
brightnessWarningWindow = GTK_DIALOG(gtk_builder_get_object(builder, "brightnessWarningDialog"));
thresholdWarningWindow = GTK_DIALOG(gtk_builder_get_object(builder, "thresholdWarningDialog"));
brightnessSaveWindow = GTK_DIALOG(gtk_builder_get_object(builder, "brightnessSaveDialog"));
thresholdSaveWindow = GTK_DIALOG(gtk_builder_get_object(builder, "thresholdSaveDialog"));
brightnessFileWindow = GTK_DIALOG(gtk_builder_get_object(builder, "brightnessFileDialog"));
thresholdFileWindow = GTK_DIALOG(gtk_builder_get_object(builder, "thresholdFileDialog"));
touchPackageChooserDialog = GTK_DIALOG(gtk_builder_get_object(builder, "touchPackageChooserDialog"));
TSPFileCompatDialog = GTK_DIALOG(gtk_builder_get_object(builder, "TSPFileCompatDialog"));
TSPFileVerifyDialog = GTK_DIALOG(gtk_builder_get_object(builder, "TSPFileVerifyDialog"));
ConnectFailedDialog = GTK_DIALOG(gtk_builder_get_object(builder, "ConnectFailedDialog"));
// Get window label objects
brightnessSaveWindowLabel = GTK_LABEL(gtk_builder_get_object(builder, "brightnessSaveDialogLabel"));
brightnessSaveWindowLabel2 = GTK_LABEL(gtk_builder_get_object(builder, "brightnessSaveDialogLabel2"));
thresholdSaveWindowLabel = GTK_LABEL(gtk_builder_get_object(builder, "thresholdSaveDialogLabel"));
thresholdSaveWindowLabel2 = GTK_LABEL(gtk_builder_get_object(builder, "thresholdSaveDialogLabel2"));
bootLabel = GTK_LABEL(gtk_builder_get_object(builder, "bootLabel"));
firmwareLabel = GTK_LABEL(gtk_builder_get_object(builder, "firmwareLabel"));
productTypeLabel = GTK_LABEL(gtk_builder_get_object(builder, "productTypeLabel"));
resolutionLabel = GTK_LABEL(gtk_builder_get_object(builder, "resolutionLabel"));
memoryChecksumLabel = GTK_LABEL(gtk_builder_get_object(builder, "memoryChecksumLabel"));
connectionStatusLabel = GTK_LABEL(gtk_builder_get_object(builder, "connectionStatusLabel"));
TSP_NameLabel = GTK_LABEL(gtk_builder_get_object(builder, "TSP_NameLabel"));
TSP_IDLabel = GTK_LABEL(gtk_builder_get_object(builder, "TSP_IDLabel"));
TSP_SelectionLabel = GTK_LABEL(gtk_builder_get_object(builder, "TSP_SelectionLabel"));
TSRResultsExplanationLabel = GTK_LABEL(gtk_builder_get_object(builder, "TSRResultsExplanationLabel"));
displayMenuButtonLabel = GTK_LABEL(gtk_builder_get_object(builder, "displayMenuButtonLabel"));
TSP_FileLabel = GTK_LABEL(gtk_builder_get_object(builder, "TSP_FileLabel"));
TSP0_Label = GTK_LABEL(gtk_builder_get_object(builder, "TSP0_Label"));
TSP1_Label = GTK_LABEL(gtk_builder_get_object(builder, "TSP1_Label"));
TSP2_Label = GTK_LABEL(gtk_builder_get_object(builder, "TSP2_Label"));
TSP3_Label = GTK_LABEL(gtk_builder_get_object(builder, "TSP3_Label"));
TSP4_Label = GTK_LABEL(gtk_builder_get_object(builder, "TSP4_Label"));
touchMonitorHelpLabel = GTK_LABEL(gtk_builder_get_object(builder, "touchMonitorHelpLabel"));
baudrateMenuLabel = GTK_LABEL(gtk_builder_get_object(builder, "baudrateMenuLabel"));
parityMenuLabel = GTK_LABEL(gtk_builder_get_object(builder, "parityMenuLabel"));
// Get buttons
TSP0_RadioButton = GTK_WIDGET(gtk_builder_get_object(builder, "TSP0_RadioButton"));
TSP1_RadioButton = GTK_WIDGET(gtk_builder_get_object(builder, "TSP1_RadioButton"));
TSP2_RadioButton = GTK_WIDGET(gtk_builder_get_object(builder, "TSP2_RadioButton"));
TSP3_RadioButton = GTK_WIDGET(gtk_builder_get_object(builder, "TSP3_RadioButton"));
TSP4_RadioButton = GTK_WIDGET(gtk_builder_get_object(builder, "TSP4_RadioButton"));
openTouchSettingPackageButton = GTK_WIDGET(gtk_builder_get_object(builder, "openTouchSettingPackageButton"));
loadTouchSettingPackageButton = GTK_WIDGET(gtk_builder_get_object(builder, "loadTouchSettingPackageButton"));
selectTouchSettingPackageButton = GTK_WIDGET(gtk_builder_get_object(builder, "selectTouchSettingPackageButton"));
saveTouchSettingPackageSelectionButton = GTK_WIDGET(gtk_builder_get_object(builder, "saveTouchSettingPackageSelectionButton"));
// Get spinner
TSR_spinner = GTK_WIDGET(gtk_builder_get_object(builder, "TSR_spinner"));
// Get notebook object
controlcenterNotebook = GTK_NOTEBOOK(gtk_builder_get_object(builder, "controlcenterNotebook"));
}
/**
* Called when the main window is closed.
* Attempts to disable touch on the connected module.
* Destroys main window on exit.
*
* @return none
*/
void on_window_main_destroy()
{
if(product_ID != 0)
{
if(!USB_start())
{
GT1P_enableTouch(0x00);
touchMode = 0;
release_USB();
} else {
printf("No GT-VP module connected.\n");
}
}
gtk_main_quit();
}
/**
* This function sends requests for the attached module's information.
* The acquired information is then displayed on the "Connection/Info" tab.
*
* NOTE: Touch Setting Package (TSP) functions are not compatible
* with the GT1280X800A-1303P module.
*
* @return none
*/
void getProductInfo()
{
int headerOffset = 3;
if(!USB_start())
{
unsigned char bootRead[7];
char bootInfo[20];
GT1P_productStatusSendBoot(bootRead);
sprintf(bootInfo, "Boot: %c%c%c%c", bootRead[3], bootRead[4], bootRead[5], bootRead[6]);
unsigned char firmRead[7];
char firmInfo[20];
GT1P_productStatusSendFirm(firmRead);
sprintf(firmInfo, "Firmware: %c%c%c%c", firmRead[3], firmRead[4], firmRead[5], firmRead[6]);
unsigned char prodRead[18];
char prodInfo[30];
GT1P_productStatusSendProdType(prodRead);
sprintf(prodInfo, "Product Type: %c%c%c%c%c%c%c ", prodRead[3], prodRead[4], prodRead[5], prodRead[6], prodRead[7], prodRead[8], prodRead[9]);
unsigned char widthRead[7];
GT1P_productStatusSendWidth(widthRead);
unsigned char heightRead[7];
GT1P_productStatusSendHeight(heightRead);
unsigned char memCheckRead[7];
char memCheckInfo[30];
GT1P_productStatusSendMemCheck(0x00, 0xFF, memCheckRead);
sprintf(memCheckInfo, "Memory Checksum: 0x%.2x%.2x%.2x%.2x", memCheckRead[3], memCheckRead[4], memCheckRead[5], memCheckRead[6]);
unsigned char TSPIDRead[7];
char TSPIDInfo[20];
unsigned char TSPNameRead[18];
char TSPNameInfo[30];
char TSPSelectInfo[30];
if(advTouchCompatFlag)
{
// Check if connected module is comptible with advanced touch features.
// Read the appropriate display information.
GT1P_productStatusSendTSPID(TSPIDRead);
sprintf(TSPIDInfo, "TSP ID: %c%c%c%c", TSPIDRead[3], TSPIDRead[4], TSPIDRead[5], TSPIDRead[6]);
GT1P_productStatusSendTSPName(TSPNameRead);
sprintf(TSPNameInfo, "TSP Name: %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", TSPNameRead[3], TSPNameRead[4], TSPNameRead[5],
TSPNameRead[6], TSPNameRead[7], TSPNameRead[8], TSPNameRead[9], TSPNameRead[10], TSPNameRead[11], TSPNameRead[12],
TSPNameRead[13], TSPNameRead[14], TSPNameRead[15], TSPNameRead[16], TSPNameRead[17]);
char TSPSelectRead = GT1P_getMemorySWSetting(TSP_SELECT_MS);
sprintf(TSPSelectInfo, "TSP Mem SW Selection: %i", TSPSelectRead);
} else if(!advTouchCompatFlag)
{
sprintf(TSPNameInfo, "TSP: Not Supported");
sprintf(TSPIDInfo, "TSP: Not Supported");
sprintf(TSPSelectInfo, "TSP: Not Supported");
}
char resInfo[42];
if(product_ID == GT1280X800A_1303P || product_ID == GTWS070VHA00P)
{
sprintf(resInfo, "Resolution: %c%c%c%cx%c%c%c", widthRead[3], widthRead[4], widthRead[5], widthRead[6], heightRead[4], heightRead[5], heightRead[6]);
} else {
sprintf(resInfo, "Resolution: %c%c%cx%c%c%c", widthRead[3], widthRead[4], widthRead[5], heightRead[3], heightRead[4], heightRead[5]);
}
// Update product information labels.
gtk_label_set_text(firmwareLabel, firmInfo);
gtk_label_set_text(productTypeLabel, prodInfo);
gtk_label_set_text(bootLabel, bootInfo);
gtk_label_set_text(resolutionLabel, resInfo);
gtk_label_set_text(memoryChecksumLabel, memCheckInfo);
gtk_label_set_text(connectionStatusLabel, "Connection Status: Stable");
gtk_label_set_text(TSP_NameLabel, TSPNameInfo);
gtk_label_set_text(TSP_IDLabel, TSPIDInfo);
gtk_label_set_text(TSP_SelectionLabel, TSPSelectInfo);
// Save product information into displayInfo struct
for(int i = 0; i < sizeof(bootRead) - headerOffset; i++)
{
displayInfo.boot[i] = bootRead[headerOffset + i];
}
for(int i = 0; i < sizeof(firmRead) - headerOffset; i++)
{
displayInfo.firm[i] = firmRead[headerOffset + i];
}
for(int i = 0; i < sizeof(prodRead) - headerOffset; i++)
{
displayInfo.prod[i] = prodRead[headerOffset + i];
}
for(int i = 0; i < sizeof(widthRead) - headerOffset; i++)
{
displayInfo.width[i] = widthRead[headerOffset + i];
}
for(int i = 0; i < sizeof(heightRead) - headerOffset; i++)
{
displayInfo.height[i] = heightRead[headerOffset + i];
}
//May want to convert to hexadecimal
//Not needed for TSP file logic
for(int i = 0; i < sizeof(memCheckRead) - headerOffset; i++)
{
displayInfo.memCheck[i] = memCheckRead[headerOffset + i];
}
for(int i = 0; i < sizeof(TSPNameRead) - headerOffset; i++)
{
displayInfo.TSPName[i] = TSPNameRead[headerOffset + i];
}
for(int i = 0; i < sizeof(TSPIDRead) - headerOffset; i++)
{
displayInfo.TSPID[i] = TSPIDRead[headerOffset + i];
}
// Check if connected module is using old or new PN
// naming conventions.
if(displayInfo.prod[2] >= '0' && displayInfo.prod[2] <= '9')
{
oldPNFlag = 1;
} else{
oldPNFlag = 0;
}
if((product_ID == GT800X480A_1303P) || (product_ID == GTWV050VHB00P) || (product_ID == GT1280X800A_1303P))
{
char firmTemp[4];
int firmware;
firmTemp[0] = displayInfo.firm[1];
firmTemp[1] = displayInfo.firm[2];
firmTemp[2] = displayInfo.firm[3];
firmTemp[3] = '\0';
firmware = atoi(firmTemp);
//Check if firmware version is compatible with TSP file functions
if(((firmware >= TSP_FW) && (product_ID == GT800X480A_1303P || product_ID == GTWV050VHB00P || product_ID == GTWS070VHA00P))
|| ((firmware >= TSP_FW_101) && (product_ID == GT1280X800A_1303P)))
{
//Firmware is compatible.
compatFWFlag = 1;
advTouchCompatFlag = 1;
enableTSPWidgets(TRUE);
gtk_widget_set_sensitive(touchLevelToolButton, TRUE);
} else{
//Firmware is not compatible.
compatFWFlag = 0;
advTouchCompatFlag = 0;
enableTSPWidgets(FALSE); //Disable TSP widgets
// TODO (V4)
// Disable touch monitor when implemented. (V4)
gtk_widget_set_sensitive(touchLevelToolButton, FALSE);
}
}
resetTSPTab();
release_USB();
} else {
printf("No GT-VP module connected. Factory default values are being used.\n");
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* Retreives the brightness adjustment value and sends it to
* the GT-VP module.
*
* @return none
*/
void brightnessButton_clicked_cb()
{
//Reset brightness flag.
validBrightness = 1;
//Get brightness adjustment value and convert value
gdouble brightness = gtk_adjustment_get_value(brightnessAdjustment);
brightness /= 100;
brightness *= 255;
char brightnessVal = (char)brightness;
//Show a warning dialog box if user is setting brightness to 0
if(brightnessVal == 0)
{
gtk_dialog_run(brightnessWarningWindow);
}
if(!USB_start() && validBrightness == 1)
{
GT1P_setBrightness(brightnessVal);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* Allows the brightness to be set to 0.
* Hides the brightnessWarningWindow.
*
* @return none
*/
void brightnessYesButton_clicked_cb()
{
validBrightness = 1;
gtk_widget_hide(GTK_WIDGET(brightnessWarningWindow));
}
/**
* Prevents the brightness from being set to 0.
* Hides the brightnessWarningWindow.
*
* @return none
*/
void brightnessNoButton_clicked_cb()
{
validBrightness = 0;
gtk_widget_hide(GTK_WIDGET(brightnessWarningWindow));
}
/**
* Allows the current brightness value to be saved to the
* module's memory switch.
* Hides the brightnessSaveWindow.
*
* @return none
*/
void brightnessSaveYesButton_clicked_cb()
{
validSaveBrightness = 1;
gtk_widget_hide(GTK_WIDGET(brightnessSaveWindow));
}
/**
* Prevents the current brightness value from being saved
* to the module's memory switch.
* Hides the brightnessSaveWindow.
*
* @return none
*/
void on_brightnessSaveNoButton_clicked()
{
validSaveBrightness = 0;
gtk_widget_hide(GTK_WIDGET(brightnessSaveWindow));
}
/**
* Allows the current threshold value to be saved to the
* module's memory switch.
* Hides the thresholdSaveWindow.
*
* @return none
*/
void thresholdSaveYesButton_clicked_cb()
{
validSaveThreshold = 1;
gtk_widget_hide(GTK_WIDGET(thresholdSaveWindow));
}
/**
* Prevents the current threshold value from being saved
* to the module's memory switch.
* Hides the thresholdSaveWindow.
*
* @return none
*/
void thresholdSaveNoButton_clicked_cb()
{
validSaveThreshold = 0;
gtk_widget_hide(GTK_WIDGET(thresholdSaveWindow));
}
/**
* Default threshold value is 80 or 0x50.
*
* @return none
*/
void thresholdButton_clicked_cb()
{
//Get the threshold adjustment value
gdouble threshold = gtk_adjustment_get_value(thresholdAdjustment);
char thresholdVal = (char)threshold;
if(threshold < 10)
{
gtk_dialog_run(thresholdWarningWindow);
}
if(!USB_start() && validThreshold)
{
GT1P_setThreshold(thresholdVal);
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x00);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* This function is called when the "Yes" button is clicked on the
* threshold warning window.
*
* @return none
*/
void thresholdWarningYesButton_clicked_cb()
{
validThreshold = 1;
gtk_widget_hide(GTK_WIDGET(thresholdWarningWindow));
}
/**
* This function is called when the "No" button is clicked on the
* threshold warning window.
*
* @return none
*/
void thresholdWarningNoButton_clicked_cb()
{
validThreshold = 0;
gtk_widget_hide(GTK_WIDGET(thresholdWarningWindow));
}
/**
* Set brightness and threshold values back to default.
*
* @return none
*/
void factoryDefaultButton_clicked_cb()
{
gtk_adjustment_set_value(brightnessAdjustment, brightnessDefault);
gtk_adjustment_set_value(thresholdAdjustment, thresholdDefault);
}
/**
* Save brightness setting to module's memory switch.
*
* @return none
*/
void saveBrightnessButton_clicked_cb()
{
// Reset save brightness flag.
validSaveBrightness = 1;
// Get and convert brightness value from application.
gdouble brightness = gtk_adjustment_get_value(brightnessAdjustment);
char bright = (char)brightness;
brightness /= 100;
brightness *= 255;
char brightnessVal = (char)brightness;
//Read brightness memory switch setting from module
gdouble readBrightness;
if(!USB_start())
{
readBrightness = GT1P_getMemorySWSetting(0x05);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Convert brightness value to a percentage.
readBrightness /= 255;
readBrightness *= 100;
char pastBrightnessVal = (char)readBrightness;
//Create label text line 1
char labelText[100];
sprintf(labelText, "You are about to change the module's brightness memory switch from %i", pastBrightnessVal);
//Create label text line 2
char labelText2[50];
sprintf(labelText2, " to %i. Are you sure?", bright);
//Add label text to labels and show brightnessSaveWindow
gtk_label_set_text(brightnessSaveWindowLabel, labelText);
gtk_label_set_text(brightnessSaveWindowLabel2, labelText2);
// Show a pop-up informing the user how they are changing the
// brightness memory switch value.
gtk_dialog_run(brightnessSaveWindow);
//Based on user input, save brightness memory switch setting
if(validSaveBrightness)
{
if(!USB_start())
{
GT1P_memorySWSetting(BRIGHTNESS_MS, brightnessVal);
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x00);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
}
/**
* Save threshold setting to module's memory switch.
* Clicked eventhandler for the saveThresholdButton.
*
* @return none
*/
void saveThresholdButton_clicked_cb()
{
// Reset save threshold flag
validSaveThreshold = 1;
// Get threshold value from application
gdouble threshold = gtk_adjustment_get_value(thresholdAdjustment);
char thresholdVal = (char)threshold;
// Read threshold memory switch value from module
gdouble readThreshold;
char pastThreshold;
if(!USB_start())
{
readThreshold = GT1P_getMemorySWSetting(0x3B);
release_USB();
pastThreshold = (char)readThreshold;
} else {
// Unable to read threahold
printf(" No GT-VP module connected.\n");
gtk_dialog_run(ConnectFailedDialog);
return;
}
// Create label text line 1
char labelText[100];
sprintf(labelText, "You are about to change the module's threshold memory switch from %i", pastThreshold);
// Create label text line 2
char labelText2[50];
sprintf(labelText2, " to %i. Are you sure?", thresholdVal);
// Add text to labels and show thresholdSaveWindow
gtk_label_set_text(thresholdSaveWindowLabel, labelText);
gtk_label_set_text(thresholdSaveWindowLabel2, labelText2);
// Show a pop-up informing the user how they are changing the
// touch threshold memory switch value.
gtk_dialog_run(thresholdSaveWindow);
// Based on user input, save threshold setting
if(validSaveThreshold)
{
if(!USB_start())
{
GT1P_memorySWSetting(THRESHOLD_MS, thresholdVal);
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x00);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
}
/**
* Hides the brightnessFileWindow.
*
* @return none
*/
void brightnessFileDialogOkButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(brightnessFileWindow));
}
/**
* Hides the thresholdFileWindow
*
* @return none
*/
void thresholdFileDialogOkButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(thresholdFileWindow));
}
/**
* Called when touch monitor combo box selects an item.
* Based on the selected item, this function sends the appropriate
* commands to the attached GT-VP module.
*
* @return none
*/
void touchMonitorSelect()
{
// Get the active selection from the touch monitor combobox
gint active = gtk_combo_box_get_active(GTK_COMBO_BOX(touchMonitorCombobox));
if(!USB_start())
{
switch(active){
case 0: // OFF
GT1P_enableTouch(0x00);
touchMode = 0;
break;
case 1: // Single touch
GT1P_setTouchMode(0x00); // Set to single-touch mode
GT1P_enableTouch(0x01); // Enable touch data transmission
touchMode = 1;
break;
case 2: // Multi-touch (10 point)
GT1P_setTouchMode(0x0a); // Set max touches to 10
GT1P_enableTouch(0x01); // Enable touch data transmission
touchMode = 2;
break;
case 3: // Nothing chosen
// Turn touch off just in case
GT1P_enableTouch(0x00);
touchMode = 0;
break;
default:
printf("TM combobox logic error.\n");
break;
}
release_USB();
}else {
printf(" No GT-VP module connected.\n");
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* This function is called when touch is switched OFF in Touch Monitor.
* Touch is disabled.
*
* @return none
*/
void touchMonitor_OFF()
{
// Make sure touch is currently ON. (Single or multi-touch)
if(touchMode != 0)
{
if(!USB_start())
{
// Turn touch data transmission OFF
GT1P_enableTouch(0x00);
touchMode = 0;
release_USB();
// Disable start button, show tabs, and hide help label
gtk_widget_set_sensitive(startTouchMonitorButton, FALSE);
gtk_widget_set_sensitive(touchLevelToolButton, TRUE);
gtk_notebook_set_show_tabs(controlcenterNotebook, TRUE);
gtk_widget_hide(GTK_WIDGET(touchMonitorHelpLabel));
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
}
/**
* This function is called when single-touch is selected in
* Touch Monitor.
* Single touch mode is set and touch is enabled.
*
* @return none
*/
void touchMonitor_Single()
{
if(touchMode != 1)
{
if(!USB_start())
{
// Set single touch mode
GT1P_setTouchMode(0x00);
GT1P_enableTouch(0x01);
touchMode = 1;
release_USB();
// Enable start button, disable tabs, show help label
gtk_widget_set_sensitive(startTouchMonitorButton, TRUE);
gtk_widget_set_sensitive(touchLevelToolButton, FALSE);
gtk_notebook_set_show_tabs(controlcenterNotebook, FALSE);
gtk_widget_show(GTK_WIDGET(touchMonitorHelpLabel));
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
}
/**
* This function is called when multi-touch is selected in
* Touch Monitor.
* The multi-touch mode is set to 10-point and touch is enabled.
*
* @return none
*/
void touchMonitor_Multi()
{
if(touchMode != 2)
{
if(!USB_start())
{
// Enable multi-touch mode
GT1P_enableTouch(0x01);
GT1P_setTouchMode(0x0a);
touchMode = 2;
release_USB();
// Enable start button, hide tabs, and show help label
gtk_widget_set_sensitive(startTouchMonitorButton, TRUE);
gtk_widget_set_sensitive(touchLevelToolButton, FALSE);
gtk_notebook_set_show_tabs(controlcenterNotebook, FALSE);
gtk_widget_show(GTK_WIDGET(touchMonitorHelpLabel));
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
}
/**
* Add passed-in character array to the touch monitor text view.
* Automatically scroll the touch monitor text view.
*
* This function is used in the touch data read child thread.
* It is meant to update the touch monitor text.
*
* @param stringToAdd Passed-in string to add to text view.
* @return none
*/
void scrollTextview(char * stringToAdd)
{
//Scrolling code
testCount++;
gtk_text_buffer_insert_at_cursor(touchMonitorTextbuffer, stringToAdd, -1);
mark = gtk_text_buffer_get_mark(touchMonitorTextbuffer, "scroll");
gtk_text_buffer_get_end_iter(touchMonitorTextbuffer, &iter);
gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(touchMonitorTextview), gtk_text_buffer_get_insert(touchMonitorTextbuffer));
// Let the main gtk process complete pending events
while(gtk_events_pending()){
gtk_main_iteration();
}
}
/**
* Function called by pthread_create.
* This is a thread that continually reads for touch input, parses valid
* touch data, sends the parsed data to the main thread to update the GUI.
*
* @param ptr Void pointer for thread call.
* @return none
*/
void *startTouchMonitorThread(void *ptr)
{
int touchX;
int touchY;
touchLoop = 1;
touchValid = 0;
switch(touchMode)
{
case 1: //Single-touch mode
if(!USB_start())
{
while(touchLoop)
{
unsigned char singleTouchData[6];
if(read_USB(singleTouchData, 18) == 6)
{
// Each touch value is a 16-bit value
// Each value is bit shifted and ORed together
touchX = (singleTouchData[2]) | (singleTouchData[3] << 8);
touchY = (singleTouchData[4]) | (singleTouchData[5] << 8);
// Create a touch value string
sprintf(textBoxText, "X = %d | Y = %d\n", touchX, touchY);
// Convert text to UTF8
textBoxText_UTF = g_locale_to_utf8(textBoxText, -1, NULL, NULL, NULL);
// Update textbox text and scroll
gdk_threads_add_idle((GSourceFunc)scrollTextview, textBoxText_UTF);
}
}
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
break;
case 2: //Multi-touch mode
if(!USB_start())
{
unsigned char multiTouchData[7];
while(touchLoop)
{
int readLength = read_USB(multiTouchData, 18);
if(readLength >= 7)
{
int dataOffset = 0;
int dataRemaining = 1;
while(dataRemaining)
{
touchX = (multiTouchData[dataOffset + 3]) | (multiTouchData[dataOffset + 4] << 8);
touchY = (multiTouchData[dataOffset + 5]) | (multiTouchData[dataOffset + 6] << 8);
int touchNum = multiTouchData[dataOffset + 2];
touchState = multiTouchData[dataOffset + 1];
if(0x11 == touchState)
{
//Touch panel has been touched
touchState = 1;
sprintf(textBoxText, "Touch = %d | Touched | X = %d | Y = %d\n", touchNum, touchX, touchY);
textBoxText_UTF_T1 = g_locale_to_utf8(textBoxText, -1, NULL, NULL, NULL);
g_idle_add_full(0, (GSourceFunc)scrollTextview, textBoxText_UTF_T1, NULL);
}
else if(0x10 == touchState)
{
touchState = 0;
sprintf(textBoxText_released_1, "Touch = %d | Released\n", touchNum);
textBoxText_UTF_R1 = g_locale_to_utf8(textBoxText_released_1, -1, NULL, NULL, NULL);
g_idle_add((GSourceFunc)scrollTextview, textBoxText_UTF_R1);
}
//Account for a data package larger than 7.
readLength -= 7;
if(readLength >= 7)
{
dataRemaining = 1;
dataOffset += 7;
} else {
dataRemaining = 0;
dataOffset = 0;
}
}
}
}
//make sure there is nothing else being
//transmitted from the module
while(read_USB(multiTouchData, 18) > 0);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
break;
default:
break;
}
gtk_widget_set_sensitive(startTouchMonitorButton, TRUE);
gtk_widget_set_sensitive(TouchMonitorMenubutton, TRUE);
return NULL;
}
/**
* Function called when the "Start" button is clicked on the
* "Touch Monitor" tab. This function creates the touch read thread.
*
* @return none
*/
void startTouchMonitorButton_clicked_cb()
{
char *test = "test";
// Disable touch monitor controls
gtk_widget_set_sensitive(startTouchMonitorButton, FALSE);
gtk_widget_set_sensitive(TouchMonitorMenubutton, FALSE);
// Start a new child GTK thread
g_thread_new("thread", startTouchMonitorThread, (void*) test);
}
/**
* Function called when the "Stop" button is clicked on the
* "Touch Monitor" tab. This function stops the touch read thread by
* pulling the thread out of its read loop and allowing it to exit.
*
* @return none
*/
void stopTouchMonitorButton_clicked_cb()
{
touchLoop = 0;
touchValid = 0;
}
/**
* Function called when the "Read All" button is clicked.
* This function reads all of the necessary GT-VP memory switch values
* to fill the memory switch editor page.
*
* @return none
*/
void readAllMSButton_clicked_cb()
{
gdouble brightnessMS;
gdouble I2CHIDSlaveAddressMS;
gdouble I2CCommandSlaveAddressMS;
gdouble UARTBaudrateMS;
gdouble UARTParityMS;
gdouble thresholdMS;
if(!USB_start())
{
// Read memory switch values from connected module
brightnessMS = GT1P_getMemorySWSetting(BRIGHTNESS_MS);
I2CHIDSlaveAddressMS = GT1P_getMemorySWSetting(I2C_HID_SLAVE_ADDRESS_MS);
I2CCommandSlaveAddressMS = GT1P_getMemorySWSetting(I2C_COMMAND_SLAVE_ADDRESS_MS);
UARTBaudrateMS = GT1P_getMemorySWSetting(UART_BAUDRATE_MS);
UARTParityMS = GT1P_getMemorySWSetting(UART_PARITY_MS);
thresholdMS = GT1P_getMemorySWSetting(THRESHOLD_MS);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Calculate brightness percentage.
brightnessMS /= 255.0;
brightnessMS *= 100.0;
// Set GTK adjustment values
gtk_adjustment_set_value(brightnessAdjustment, brightnessMS);
gtk_adjustment_set_value(I2CHIDAdjustment, I2CHIDSlaveAddressMS);
gtk_adjustment_set_value(I2CCommandAdjustment, I2CCommandSlaveAddressMS);
gtk_adjustment_set_value(thresholdAdjustment, thresholdMS);
// Change main baudrate dropdown label
switch((int)UARTBaudrateMS)
{
case BR_38400_Default:
BR_38400bps_Default_selected();
break;
case BR_4800:
BR_4800bps_selected();
break;
case BR_9600:
BR_9600bps_selected();
break;
case BR_19200:
BR_19200bps_selected();
break;
case BR_38400:
BR_38400bps_selected();
break;
case BR_57600:
BR_57600bps_selected();
break;
case BR_115200:
BR_115200bps_selected();
break;
default:
break;
}
// Change main parity dropdown label
switch((int)UARTParityMS)
{
case parityNone:
Parity_None_selected();
break;
case parityEven:
Parity_Even_selected();
break;
case parityOdd:
Parity_Odd_selected();
break;
default:
break;
}
}
/**
* This function is called when the "Write" button is clicked.
* This function writes all memory switch values to the attached GT-VP
* display.
*
* @return none
*/
void writeAllMSButton_clicked_cb()
{
// Get brightness adjustment value
gdouble brightnessMS = gtk_adjustment_get_value(brightnessAdjustment);
// Undo brightness calcuation
brightnessMS /= 100;
brightnessMS *= 255;
char brightnessVal = (char)brightnessMS;
// Get I2C HID slave address adjustment value
gdouble I2CHIDSlaveAddressMS = gtk_adjustment_get_value(I2CHIDAdjustment);
char I2CHIDSlaveAddressVal = (char)I2CHIDSlaveAddressMS;
// Get I2C command slave address adjustment value
gdouble I2CCommandSlaveAddressMS = gtk_adjustment_get_value(I2CCommandAdjustment);
char I2CCommandSlaveAddressVal = (char)I2CCommandSlaveAddressMS;
// Get baudrate selection flag
char UARTBaudrateVal = (char)baudrateFlag;
// Get parity selection flag
char UARTParityVal = (char)parityFlag;
// Get touch threshold adjustment value
gdouble thresholdMS = gtk_adjustment_get_value(thresholdAdjustment);
char thresholdVal = (char)thresholdMS;
if(!USB_start())
{
// Set volatile values
GT1P_setBrightness(brightnessVal);
GT1P_setThreshold(thresholdVal);
// Set memory switches
GT1P_memorySWSetting(BRIGHTNESS_MS, brightnessVal);
GT1P_memorySWSetting(I2C_HID_SLAVE_ADDRESS_MS, I2CHIDSlaveAddressVal);
GT1P_memorySWSetting(I2C_COMMAND_SLAVE_ADDRESS_MS, I2CCommandSlaveAddressVal);
GT1P_memorySWSetting(UART_BAUDRATE_MS, UARTBaudrateVal);
GT1P_memorySWSetting(UART_PARITY_MS, UARTParityVal);
GT1P_memorySWSetting(THRESHOLD_MS, thresholdVal);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* Function called when the "Default" button is pressed.
* This function will change all of the "Memory Switch Editor"
* values to their factory default values as noted in the GT-VP spec.
*
* @return none
*/
void defaultMSButton_clicked_cb()
{
// Set all adjustment values to factory default
gtk_adjustment_set_value(brightnessAdjustment, brightnessDefault);
gtk_adjustment_set_value(I2CHIDAdjustment, I2CHIDSlaveAddressDefault);
gtk_adjustment_set_value(I2CCommandAdjustment, I2CCommandSlaveAddressDefault);
gtk_adjustment_set_value(thresholdAdjustment, thresholdDefault);
BR_38400bps_Default_selected();
Parity_None_selected();
}
/**
* This function is called then the "Export" button is clicked.
* This function reads in all memory switch values from the attached
* module and writes the values to a .txt file and saves the file to
* the local directory.
*
* @return none
*/
void exportMSButton_clicked_cb()
{
char brightnessMS;
char I2CHIDSlaveAddressMS;
char I2CCommandSlaveAddressMS;
char UARTBaudrateMS;
char UARTParityMS;
char thresholdMS;
if(!USB_start())
{
// Read all values from connected device
brightnessMS = GT1P_getMemorySWSetting(BRIGHTNESS_MS);
I2CHIDSlaveAddressMS = GT1P_getMemorySWSetting(I2C_HID_SLAVE_ADDRESS_MS);
I2CCommandSlaveAddressMS = GT1P_getMemorySWSetting(I2C_COMMAND_SLAVE_ADDRESS_MS);
UARTBaudrateMS = GT1P_getMemorySWSetting(UART_BAUDRATE_MS);
UARTParityMS = GT1P_getMemorySWSetting(UART_PARITY_MS);
thresholdMS = GT1P_getMemorySWSetting(THRESHOLD_MS);
// Inform user about file being saved
gtk_dialog_run(brightnessFileWindow);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Write MS data to a text file
FILE *fp = fopen("Memory_Switch_data.txt", "w");
if(fp == NULL){
printf("fopen() ERROR\n");
}else{
char fileBuffer[220];
// Create string to write to file
sprintf(fileBuffer, "Memory Switch Data:\n\nBrightness = 0x%.2x\nThreshold = 0x%.2x\nI2C HID Slave Address = 0x%.2x\nI2C Command Slave Address = 0x%.2x\nUART Baudrate = 0x%.2x\nUART Parity = 0x%.2x\n\nCreated by Noritake Control Center",
brightnessMS, thresholdMS, I2CHIDSlaveAddressMS, I2CCommandSlaveAddressMS, UARTBaudrateMS, UARTParityMS);
// Write string to file.
fprintf(fp, fileBuffer);
fclose(fp);
}
}
/**
* This function is called when the "Run Test" button is clicked.
* This function obtains the noise and measurement values from the
* GUI and sends the appropriate command to the module to run the
* touch standard reference test.
* Once the test is complete, the results are read and displayed on
* the tool.
*
* @return none
*/
void runTSRTestButton_clicked_cb()
{
//TSR only works on 7" and 5" GT-VP modules
if(product_ID == GT800X480A_1303P || product_ID == GTWV050VHB00P)
{
// Get acceptable noise value
gdouble noiseAdj = gtk_adjustment_get_value(acceptableNoiseAdjustment);
char noiseVal = (char)noiseAdj;
// Get measurement number value
gdouble measurementAdj = gtk_adjustment_get_value(measurementNumAdjustment);
char measurementVal = (char)measurementAdj;
// Update lable to show the TSR test is running
gtk_label_set_text(TSRResultsExplanationLabel, "Testing...");
// Refresh gtk widgets
while(gtk_events_pending())
{
gtk_main_iteration();
}
if(!USB_start())
{
// Run TSR test and read results
unsigned char tsrRead[4];
char TSRresults[97];
GT1P_setTSRSetting(noiseVal, measurementVal, tsrRead);
release_USB();
// Switch based on TSR result type
switch(tsrRead[0])
{
case 0: // Success (Noise is within the limit)
sprintf(TSRresults, "Success\n\nNoise value of \nnoisiest channel: %d\n\nNoisiest channel X: %d\nNoisiest channel Y: %d\n", tsrRead[1], tsrRead[2], tsrRead[3]);
gtk_label_set_text(TSRResultsExplanationLabel, TSRresults);
gtk_switch_set_state(TSRSwitch, TRUE);
break;
case 1: // Failure (Noise limit exceeded)
sprintf(TSRresults, "Failure\n\nNoise value of \nnoisiest channel: %d\n\nNoisiest channel X: %d\nNoisiest channel Y: %d\n", tsrRead[1], tsrRead[2], tsrRead[3]);
gtk_label_set_text(TSRResultsExplanationLabel, TSRresults);
gtk_switch_set_state(TSRSwitch, FALSE);
break;
case 2: // Failure (other problems / defects)
sprintf(TSRresults, "Failure");
gtk_label_set_text(TSRResultsExplanationLabel, TSRresults);
gtk_switch_set_state(TSRSwitch, FALSE);
break;
default:
sprintf(TSRresults, "Failure\nPlease try again\nor reconnect module.");
gtk_label_set_text(TSRResultsExplanationLabel, TSRresults);
gtk_switch_set_state(TSRSwitch, FALSE);
printf("No valid return value for TSR.\n");
break;
}
} else {
gtk_dialog_run(ConnectFailedDialog);
}
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* This function is called when the "Use TSR" toggle switch changes
* state.
* This function sets the TSR usage based on the toggle switch state.
*
* @return none
*/
void TSRSwitch_state_set_cb()
{
//TSR only works on 7" and 5" GT-VP modules.
if(product_ID == GT800X480A_1303P || product_ID == GTWV050VHB00P)
{
// Get TSR switch state
gboolean switchState = gtk_switch_get_active(TSRSwitch);
switch(switchState)
{
case TRUE: //TSR usage is ON
if(!USB_start())
{
GT1P_setTSRUsage(0x01); // Enable TSR
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
break;
case FALSE: //TSR usage is OFF
if(!USB_start())
{
GT1P_setTSRUsage(0x00); // Disable TSR
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
break;
default:
printf("Oops, something has gone wrong.\n");
printf("Please restart the Control Center software.\n");
break;
}
}
}
/**
* This function is called when the "Read TSR State" button is clicked.
* This function reads the TSR state from the module and changes the
* TSR toggle switch to reflect that state.
*
* @return none
*/
void readTSRStateButton_clicked_cb()
{
//TSR only works on 7" GT-VP module
if(product_ID == GT800X480A_1303P || product_ID == GTWV050VHB00P)
{
char tsrStatus;
if(!USB_start())
{
tsrStatus = GT1P_setTSRUsageStatusRead();
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Set TSR switch to match the connected module's state
gtk_switch_set_active(TSRSwitch, tsrStatus);
} else {
gtk_dialog_run(ConnectFailedDialog);
}
}
/**
* This function is called when "GTWV050VHB00P" is selected
* on the "Info/Connection" tab.
*
* @return none
*/
void GTWV050VHB00P_selected()
{
product_ID = GTWV050VHB00P;
advTouchCompatFlag = 1;
if(!USB_start())
{
// Update the main module drop down menu label
gtk_label_set_text(displayMenuButtonLabel, "GTWV050VHB00P");
release_USB();
if(gtk_widget_is_sensitive(runTSRTestButton) == FALSE)
{
enableTSRWidgets(TRUE);
}
if(gtk_widget_is_sensitive(TSP0_RadioButton) == FALSE)
{
enableTSPWidgets(TRUE);
}
// Get memory switch info
readAllMSButton_clicked_cb();
getProductInfo();
} else {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
void GTWS070VHA00P_selected()
{
product_ID = GTWS070VHA00P;
advTouchCompatFlag = 1;
if(!USB_start())
{
// Update the main module drop down menu label
gtk_label_set_text(displayMenuButtonLabel, "GTWS070VHA00P");
release_USB();
if(gtk_widget_is_sensitive(runTSRTestButton) == FALSE)
{
enableTSRWidgets(TRUE);
}
if(gtk_widget_is_sensitive(TSP0_RadioButton) == FALSE)
{
enableTSPWidgets(TRUE);
}
// Get memory switch info
readAllMSButton_clicked_cb();
getProductInfo();
} else {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
/**
* This function is called when "GTWV070VHA00P / GT800X480A-1303P" is selected
* on the "Info/Connection" tab.
*
* @return none
*/
void GT800X480A_1303P_selected()
{
product_ID = GT800X480A_1303P;
advTouchCompatFlag = 1;
if(!USB_start())
{
// Update the main module drop down menu label
gtk_label_set_text(displayMenuButtonLabel, "GTWV070VHA00P / GT800X480A-1303P");
release_USB();
if(gtk_widget_is_sensitive(runTSRTestButton) == FALSE)
{
enableTSRWidgets(TRUE);
}
if(gtk_widget_is_sensitive(TSP0_RadioButton) == FALSE)
{
enableTSPWidgets(TRUE);
}
// Get memory switch info
readAllMSButton_clicked_cb();
getProductInfo();
} else {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
/**
* This function is called when "GTWX101VHA00P / GT1280X800A-1303P" is selected
* on the "Info/Connection" tab.
*
* @return none
*/
void GT1280X800A_1303P_selected()
{
product_ID = GT1280X800A_1303P;
advTouchCompatFlag = 0;
if(!USB_start())
{
// Update the main module drop down menu label
gtk_label_set_text(displayMenuButtonLabel, "GTWX101VHA00P / GT1280X800A-1303P");
release_USB();
if(gtk_widget_is_sensitive(runTSRTestButton) == TRUE)
{
//Disable TSR widgets
enableTSRWidgets(FALSE);
}
if(gtk_widget_is_sensitive(TSP0_RadioButton) == TRUE)
{
//Disable TSP widgets
enableTSPWidgets(FALSE);
}
// Get memory switch info
readAllMSButton_clicked_cb();
getProductInfo();
} else {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
void GTWX101VHB00P_selected()
{
product_ID = GT1280X800A_1303P;
advTouchCompatFlag = 1;
if(!USB_start())
{
// Update the main module drop down menu label
gtk_label_set_text(displayMenuButtonLabel, "GTWX101VHB00P");
release_USB();
if(gtk_widget_is_sensitive(runTSRTestButton) == FALSE)
{
enableTSRWidgets(TRUE);
}
if(gtk_widget_is_sensitive(TSP0_RadioButton) == FALSE)
{
enableTSPWidgets(TRUE);
}
// Get memory switch info
readAllMSButton_clicked_cb();
getProductInfo();
} else {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
/**
* Button handler for the "ConnectFailedDialog" box.
* Hides the dialog box.
*
* @return none
*/
void connectFailedDialogOkButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(ConnectFailedDialog));
}
/**
* Enable or disable touch setting reference widgets.
*
* @param setting The desired widget sensitivity setting.
* @return none
*
*/
void enableTSRWidgets(gboolean setting)
{
gtk_widget_set_sensitive(runTSRTestButton, setting);
gtk_widget_set_sensitive(readTSRStateButton, setting);
gtk_widget_set_sensitive(acceptableNoiseSpinbutton, setting);
gtk_widget_set_sensitive(measurementNumSpinbutton, setting);
gtk_widget_set_sensitive(GTK_WIDGET(TSRSwitch), setting);
}
/**
* Enable or disable touch setting package widgets
*
* @param setting The desired widget sensitivity setting.
* @return none
*/
void enableTSPWidgets(gboolean setting)
{
gtk_widget_set_sensitive(TSP0_RadioButton, setting);
gtk_widget_set_sensitive(TSP1_RadioButton, setting);
gtk_widget_set_sensitive(TSP2_RadioButton, setting);
gtk_widget_set_sensitive(TSP3_RadioButton, setting);
gtk_widget_set_sensitive(TSP4_RadioButton, setting);
gtk_widget_set_sensitive(openTouchSettingPackageButton, setting);
gtk_widget_set_sensitive(loadTouchSettingPackageButton, setting);
gtk_widget_set_sensitive(selectTouchSettingPackageButton, setting);
gtk_widget_set_sensitive(saveTouchSettingPackageSelectionButton, setting);
}
/**
* Radio button handler for all radiobuttons in touch setting
* package data tab.
*
* @return none
*/
void on_TSP_RadioButton_clicked()
{
// Change touchSettingRadioFlag based on TSP radiobutton status
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(TSP0_RadioButton)))
{
touchSettingRadioFlag = factoryDefault;
} else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(TSP1_RadioButton)))
{
touchSettingRadioFlag = TSPPosition1;
} else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(TSP2_RadioButton)))
{
touchSettingRadioFlag = TSPPosition2;
} else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(TSP3_RadioButton)))
{
touchSettingRadioFlag = TSPPosition3;
} else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(TSP4_RadioButton)))
{
touchSettingRadioFlag = TSPPosition4;
}
}
/**
* The Open button clicked handler.
* This button is on the "Touch Setting Package" tab.
*
* @return none
*/
void openTouchSettingPackageButton_clicked_cb()
{
FILE *touchFile;
char *touchFilepath;
char *original; // Used to reference original filename pointer
unsigned char *touchFileBuffer_1 = malloc(TSP_TYPE_A_SIZE);
char abbrevFilename[FILENAME_DISPLAY_MAX];
int nameLength = 0;
gboolean fileIDFlag = TRUE;
gboolean authorFlag = TRUE;
// Make sure the touch file buffer is valid
if(touchFileBuffer_1 == NULL)
{
fprintf(stderr, "Out of memory.\n");
free(touchFileBuffer_1);
exit(1);
}
// Show a file chooser so user can choose a TSP file
gtk_dialog_run(touchPackageChooserDialog);
if(fileOpenFlag)
{
// Show file open dialog for TSP file.
GtkFileChooser *chooser = GTK_FILE_CHOOSER(touchPackageChooserDialog);
touchFilepath = gtk_file_chooser_get_filename(chooser);
// Grab filename from path
touchFilename = basename(touchFilepath);
original = touchFilename; // save original filename pointer
// Check filename length
while(*(touchFilename++) != '\0')
{
nameLength++;
}
// Reset filename pointer to start of name
touchFilename = original;
// Decide if the filename must be shortened.
// Minus 4 to account for ellipsis and NULL terminator
if(nameLength > FILENAME_DISPLAY_MAX - 4)
{
sprintf(abbrevFilename, "%.25s...", touchFilename);
} else {
sprintf(abbrevFilename, "%s", touchFilename);
}
touchFile = fopen(touchFilepath, "rb");
if(touchFile == NULL)
{
printf("Touch File Read ERROR\n");
} else {
// Get file size
fseek(touchFile, 0L, SEEK_END);
size_t touchFileSize = ftell(touchFile);
rewind(touchFile); // Go back to start of file
// Check if file is type-A or type-B size
if(touchFileSize == TSP_TYPE_A_SIZE || touchFileSize == TSP_TYPE_B_SIZE)
{
if(touchFileSize == TSP_TYPE_B_SIZE)
{
//Reallocate buffer to hold a type-B TSP file
touchFileBuffer_1 = realloc(touchFileBuffer_1, touchFileSize + 1);
// Make sure the touch file buffer is valid
if(touchFileBuffer_1 == NULL)
{
fprintf(stderr, "Out of memory.\n");
free(touchFileBuffer_1);
exit(1);
}
}
while(!feof(touchFile))
{
fread(touchFileBuffer_1, touchFileSize + 1, 1, touchFile);
}
//Check if file is in TSP format
if((touchFileBuffer_1[0] == 0x54) && (touchFileBuffer_1[1] == 0x53))
{
// Update TSP file name label
gtk_label_set_text(TSP_FileLabel, abbrevFilename);
// Save file ID to TSP file struct
openedTSPFile.fileID[0] = touchFileBuffer_1[0];
openedTSPFile.fileID[1] = touchFileBuffer_1[1];
openedTSPFile.fileID[2] = '\0';
if(!strncmp(openedTSPFile.fileID, "TS", sizeof(openedTSPFile.fileID)))
{
fileIDFlag = TRUE;
} else {
fileIDFlag = FALSE;
}
// Save package ID to TSP file struct
for(int i = 0; i < 4; i++)
{
openedTSPFile.packageID[i] = touchFileBuffer_1[2 + i];
if(i == 3)
{
openedTSPFile.packageID[i + 1] = '\0';
}
}
// Save author name to TSP file struct
for(int i = 0; i < 16; i++)
{
openedTSPFile.author[i] = touchFileBuffer_1[6 + i];
if(i == 15)
{
openedTSPFile.author[i + 1] = '\0';
}
}
// Check if the author field contains Noritake
if(strstr(openedTSPFile.author, "Noritake") != NULL)
{
authorFlag = TRUE;
} else {
authorFlag = FALSE;
}
// Save product information to TSP file struct
for(int i = 0; i < 32; i++)
{
openedTSPFile.productInfo[i] = touchFileBuffer_1[22 + i];
if(i == 31)
{
openedTSPFile.productInfo[i + 1] = '\0';
}
}
// Save format type to TSP file struct
openedTSPFile.formatType[0] = touchFileBuffer_1[54];
openedTSPFile.formatType[1] = '\0';
for(int i = 0; i < 9; i++)
{
openedTSPFile.specCode[i] = touchFileBuffer_1[55 + i];
if(i == 8)
{
openedTSPFile.specCode[i + 1] = '\0';
}
}
// Save notes to TSP file struct
for(int i = 0; i < 64; i++)
{
openedTSPFile.notes[i] = touchFileBuffer_1[64 + i];
if(i == 63)
{
openedTSPFile.notes[i + 1] = '\0';
}
}
// Save TSP file data to TSP file struct
for(int i = 0; i < 1024; i++)
{
openedTSPFile.data[i] = touchFileBuffer_1[128 + i];
}
} else {
// Create pop-up window to notify user of invalid file
gtk_dialog_run(TSPFileVerifyDialog);
fileOpenFlag = 0;
g_free(touchFilepath);
free(touchFileBuffer_1);
return;
}
g_free(touchFilepath);
// Check if file ID and Author are OK
if(!fileIDFlag && !authorFlag)
{
return;
}
//Check TSP file compatibility (new naming convention)
//Check series
//Is it a GT series module?
if((openedTSPFile.productInfo[0] == displayInfo.prod[0]) && (openedTSPFile.productInfo[1] == displayInfo.prod[1]))
{
//printf("Confirmed Compatibility: GT series module.\n");
}
//Check resolution
if(openedTSPFile.productInfo[2] == 'W' && (displayInfo.prod[2] == 'W'))
{
switch(openedTSPFile.productInfo[3])
{
case 'X':
//printf("1280x800 resolution.\n");
break;
case 'V':
//printf("800x480 resolution.\n");
break;
case 'Q':
//printf("480x272 resolution.\n");
break;
default:
printf("ERROR: No resolution match.\n");
break;
}
}
//Check display size
if((openedTSPFile.productInfo[4] == '0') && (openedTSPFile.productInfo[6] == '0'))
{
switch(openedTSPFile.productInfo[5])
{
case '7':
//printf("7 inch display size\n");
break;
case '5':
//printf("5 inch display size\n");
break;
default:
break;
}
} else if(openedTSPFile.productInfo[4] == '0' && openedTSPFile.productInfo[5] == '4' && openedTSPFile.productInfo[6] == '3')
{
//printf("4.3 inch display size\n");
}
//Check module type
switch(openedTSPFile.productInfo[7])
{
case 'V':
//printf("Video input type\n");
break;
case 'C':
//printf("Command type\n");
break;
default:
printf("ERROR: No matching module type.\n");
break;
}
//Check if touch panel
if(openedTSPFile.productInfo[12] == 'P')
{
//printf("Touch Panel\n");
}
if(oldPNFlag)
{
//Check old PN compatibility?
//printf("Using old display, TSP most likely not compatible.\n");
} else {
/*
* Check TSP file compatiblity (new naming convention)
* will TSP files be created using the old naming convention? NO
* What if an old module is connected and has firmware compatible with TSP files?
* Test compatibility based on different parts of PN.
* Should do similar test for new PN to future proof this software.
*/
if(openedTSPFile.productInfo[0] == displayInfo.prod[0] &&
openedTSPFile.productInfo[1] == displayInfo.prod[1] &&
openedTSPFile.productInfo[2] == displayInfo.prod[2] &&
openedTSPFile.productInfo[3] == displayInfo.prod[3] &&
openedTSPFile.productInfo[4] == displayInfo.prod[4] &&
openedTSPFile.productInfo[5] == displayInfo.prod[5] &&
openedTSPFile.productInfo[6] == displayInfo.prod[6] &&
openedTSPFile.productInfo[7] == displayInfo.prod[7] &&
openedTSPFile.productInfo[8] == displayInfo.prod[8] &&
openedTSPFile.productInfo[12] == displayInfo.prod[12])
{
//printf("PNs match!\n");
// Enable TSP file load button
gtk_widget_set_sensitive(loadTouchSettingPackageButton, TRUE);
} else {
// Disable TSP file load button
gtk_widget_set_sensitive(loadTouchSettingPackageButton, FALSE);
// Notify user with a pop-up window.
gtk_dialog_run(TSPFileCompatDialog);
}
}
} else {
// File is not the correct size, notify user.
gtk_dialog_run(TSPFileVerifyDialog);
}
}
}
free(touchFileBuffer_1);
}
/**
* OK button handler for the TSP file verification window.
* (The window that tells the user the selected file is not a
* TSP file)
*
* @return none
*/
void TSPFileVerifyDialogOkButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(TSPFileVerifyDialog));
}
/**
* OK button handler for the TSP file compatibility window.
* (The window that tells the user if the TSP file and
* connected display module are not compatible)
*
* @return none
*/
void TSPFileCompatDialogOkButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(TSPFileCompatDialog));
}
/**
* Close button handler for the touch package file chooser.
*
* @return none
*/
void closeTouchPackageButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(touchPackageChooserDialog));
fileOpenFlag = 0;
}
/**
* Open button handler for the touch package file chooser.
*
* @return none
*/
void openTouchPackageButton_clicked_cb()
{
gtk_widget_hide(GTK_WIDGET(touchPackageChooserDialog));
fileOpenFlag = 1;
}
/**
* Load button handler for the touch setting package tab.
* This button loads touch setting package data to the
* attached GT-VP module.
*
* @return none
*/
void loadTouchSettingPackageButton_clicked_cb()
{
// Update radiobutton logic and get filename label
on_TSP_RadioButton_clicked();
const gchar *filenamelabel = gtk_label_get_label(TSP_FileLabel);
if(fileOpenFlag && advTouchCompatFlag)
{
// Send TSP file data to display based on radio button state
switch(touchSettingRadioFlag)
{
case factoryDefault: // Factory Default
// Don't do anything.
// Cannot change factory default settings.
break;
case TSPPosition1:
sendTSP(TSPPosition1, TSP1_Label, TSP1_file, filenamelabel);
break;
case TSPPosition2:
sendTSP(TSPPosition2, TSP2_Label, TSP2_file, filenamelabel);
break;
case TSPPosition3:
sendTSP(TSPPosition3, TSP3_Label, TSP3_file, filenamelabel);
break;
case TSPPosition4:
sendTSP(TSPPosition4, TSP4_Label, TSP4_file, filenamelabel);
break;
default:
break;
}
}
}
/**
* Helper function to send a TSP file to the connected module and
* save the associated file name to a global pointer.
*
* Used in loadTouchSettingPackageButton_clicked_cb().
*
* @param location Desired TSP file slot for connected module.
* @param label TSP string label for TSP position text.
* @param TSPfilename Global filename pointer of TSP file
* @param filename TSP filename being sent
* @return none
*/
void sendTSP(uint8_t location, GtkLabel *label, char *TSPfilename, const gchar *filename)
{
if(!USB_start())
{
// Send struct TSP data to connected module
GT1P_storeTSP(location, openedTSPFile.data);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Update slot label with filename
gtk_label_set_text(label, filename);
strcpy(TSPfilename, filename);
}
/**
* Select button handler for touch setting package tab.
* This function will select the TSP slot based on the
* radio button state and update the label set format.
*
* @return none
*/
void selectTouchSettingPackageButton_clicked_cb()
{
const char *formatBold = "%s ";
const char *formatUnderline = "%s ";
const char *formatBU = "%s ";
char *markup;
const gchar *TSP1_text = gtk_label_get_label(TSP1_Label);
const gchar *TSP2_text = gtk_label_get_label(TSP2_Label);
const gchar *TSP3_text = gtk_label_get_label(TSP3_Label);
const gchar *TSP4_text = gtk_label_get_label(TSP4_Label);
on_TSP_RadioButton_clicked();
// Works on GT800X480A-1303P and GTWV050VHB00P
if(advTouchCompatFlag)
{
switch(touchSettingRadioFlag)
{
case factoryDefault:
if(touchSettingSelectFlag != factoryDefault && touchSettingSaveFlag != factoryDefault)
{
// Change label to be bold
markup = g_markup_printf_escaped(formatBold, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
touchSettingSelectFlag = factoryDefault;
} else if(touchSettingSaveFlag == factoryDefault)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
touchSettingSelectFlag = factoryDefault;
}
if(!USB_start())
{
// Select TSP position 0 on connected display
GT1P_selectTSP(0x00);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(fileOpenFlag)
{
//Adjust other labels accordingly
if(touchSettingSaveFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSaveFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSaveFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSaveFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
}
break;
case TSPPosition1:
if(strlen(TSP1_text) != 0)
{
if(touchSettingSelectFlag != TSPPosition1 && touchSettingSaveFlag != TSPPosition1)
{
// Change label to be bold
markup = g_markup_printf_escaped(formatBold, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
touchSettingSelectFlag = TSPPosition1;
} else if(touchSettingSaveFlag == TSPPosition1)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
touchSettingSelectFlag = TSPPosition1;
}
if(!USB_start())
{
// Select TSP position 1 on connected display
GT1P_selectTSP(0x01);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Adjust other labels accordingly
if(touchSettingSaveFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSaveFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSaveFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
if(touchSettingSaveFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
}
break;
case TSPPosition2:
if(strlen(TSP2_text) != 0)
{
if(touchSettingSelectFlag != TSPPosition2 && touchSettingSaveFlag != TSPPosition2)
{
// Change label to be bold
markup = g_markup_printf_escaped(formatBold, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
touchSettingSelectFlag = TSPPosition2;
} else if(touchSettingSaveFlag == TSPPosition2)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
touchSettingSelectFlag = TSPPosition2;
}
if(!USB_start())
{
// Select TSP position 2 on connected display
GT1P_selectTSP(0x02);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Adjust other labels accordingly
if(touchSettingSaveFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSaveFlag == TSPPosition3)
{
// Update position 2 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSaveFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
if(touchSettingSaveFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
}
break;
case TSPPosition3:
if(strlen(TSP3_text) != 0)
{
if(touchSettingSelectFlag != TSPPosition3 && touchSettingSaveFlag != TSPPosition3)
{
// Change label to be bold
markup = g_markup_printf_escaped(formatBold, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
touchSettingSelectFlag = TSPPosition3;
} else if(touchSettingSaveFlag == TSPPosition3)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
touchSettingSelectFlag = TSPPosition3;
}
if(!USB_start())
{
// Select TSP position 3 on connected display
GT1P_selectTSP(0x03);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Adjust other labels accordingly
if(touchSettingSaveFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSaveFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSaveFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
if(touchSettingSaveFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
}
break;
case TSPPosition4:
if(strlen(TSP4_text) != 0)
{
if(touchSettingSelectFlag != TSPPosition4 && touchSettingSaveFlag != TSPPosition4)
{
// Change label to be bold
markup = g_markup_printf_escaped(formatBold, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
touchSettingSelectFlag = TSPPosition4;
} else if(touchSettingSaveFlag == TSPPosition4)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
touchSettingSelectFlag = TSPPosition4;
}
if(!USB_start())
{
// Select TSP position 4 on connected display
GT1P_selectTSP(0x04);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
// Adjust other labels accordingly
if(touchSettingSaveFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSaveFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSaveFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSaveFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (underlined)
markup = g_markup_printf_escaped(formatUnderline, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
}
break;
default:
break;
}
}
}
/**
* Rest TSP tab labels and logic.
* This is called in getProductInfo() when a display is successfully
* connected to the tool.
* This is done to prevent confusion when a new display is connected
* within the same tool session.
*
* @return none
*/
void resetTSPTab()
{
// Reset TSP flags
touchSettingRadioFlag = 0;
touchSettingSaveFlag = 0;
touchSettingSelectFlag = 0;
// Reset TSP position filename arrays
memset(TSP1_file, 0, sizeof(TSP1_file));
memset(TSP2_file, 0, sizeof(TSP2_file));
memset(TSP3_file, 0, sizeof(TSP3_file));
memset(TSP4_file, 0, sizeof(TSP4_file));
// Reset TSP position labels
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
/**
* Save button handler for the touch setting package tab.
*
* @return none
*/
void saveTouchSettingPackageSelectionButton_clicked_cb()
{
const char *formatBold = "%s ";
const char *formatUnderline = "%s ";
const char *formatBU = "%s ";
char *markup;
const gchar *TSP1_text = gtk_label_get_label(TSP1_Label);
const gchar *TSP2_text = gtk_label_get_label(TSP2_Label);
const gchar *TSP3_text = gtk_label_get_label(TSP3_Label);
const gchar *TSP4_text = gtk_label_get_label(TSP4_Label);
on_TSP_RadioButton_clicked();
// Works on GT800X480A-1303P and GTWV050VHB00P
if(advTouchCompatFlag)
{
switch(touchSettingRadioFlag)
{
case factoryDefault:
if(touchSettingSelectFlag == factoryDefault)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, "Factory Default");
} else {
// Change label to be underlined
markup = g_markup_printf_escaped(formatUnderline, "Factory Default");
}
touchSettingSaveFlag = factoryDefault;
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
if(!USB_start())
{
// Change memory switch settings to select position 0
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x01);
GT1P_memorySWSetting(TSP_SELECT_MS, 0x00);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(touchSettingSelectFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSelectFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSelectFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSelectFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
break;
case TSPPosition1:
if(strlen(TSP1_text) != 0)
{
if(touchSettingSelectFlag == TSPPosition1)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP1_file);
} else {
// Change label to be underlined
markup = g_markup_printf_escaped(formatUnderline, TSP1_file);
}
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
touchSettingSaveFlag = TSPPosition1;
if(!USB_start())
{
// Change memory switch settings to select position 1
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x01);
GT1P_memorySWSetting(TSP_SELECT_MS, 0x01);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(touchSettingSelectFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
if(touchSettingSelectFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSelectFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSelectFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
}
break;
case TSPPosition2:
if(strlen(TSP2_text) != 0)
{
if(touchSettingSelectFlag == TSPPosition2)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP2_file);
} else {
// Change label to be underlined
markup = g_markup_printf_escaped(formatUnderline, TSP2_file);
}
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
touchSettingSaveFlag = TSPPosition2;
if(!USB_start())
{
// Change memory switch settings to select position 2
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x01);
GT1P_memorySWSetting(TSP_SELECT_MS, 0x02);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(touchSettingSelectFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
if(touchSettingSelectFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSelectFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
if(touchSettingSelectFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
}
break;
case TSPPosition3:
if(strlen(TSP3_text) != 0)
{
if(touchSettingSelectFlag == TSPPosition3)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP3_file);
} else {
// Change label to be underlined
markup = g_markup_printf_escaped(formatUnderline, TSP3_file);
}
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
touchSettingSaveFlag = TSPPosition3;
if(!USB_start())
{
// Change memory switch settings to select position 3
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x01);
GT1P_memorySWSetting(TSP_SELECT_MS, 0x03);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(touchSettingSelectFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
if(touchSettingSelectFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSelectFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSelectFlag == TSPPosition4)
{
// Update position 4 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP4_file);
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
} else {
// Update position 4 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP4_Label), TSP4_file);
}
}
break;
case TSPPosition4:
if(strlen(TSP4_text) != 0)
{
if(touchSettingSelectFlag == TSPPosition4)
{
// Change label to be bold and underlined
markup = g_markup_printf_escaped(formatBU, TSP4_file);
} else {
// Change label to be underlined
markup = g_markup_printf_escaped(formatUnderline, TSP4_file);
}
gtk_label_set_markup(GTK_LABEL(TSP4_Label), markup);
touchSettingSaveFlag = TSPPosition4;
if(!USB_start())
{
// Change memory switch settings to select position 4
GT1P_memorySWSetting(TOUCH_SENS_SELECT_MS, 0x01);
GT1P_memorySWSetting(TSP_SELECT_MS, 0x04);
release_USB();
} else {
gtk_dialog_run(ConnectFailedDialog);
}
if(touchSettingSelectFlag == factoryDefault)
{
// Update position 0 label "Factory Default" with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, "Factory Default");
gtk_label_set_markup(GTK_LABEL(TSP0_Label), markup);
} else {
// Update position 0 label "Factory Default" with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP0_Label), "Factory Default");
}
if(touchSettingSelectFlag == TSPPosition1)
{
// Update position 1 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP1_file);
gtk_label_set_markup(GTK_LABEL(TSP1_Label), markup);
} else {
// Update position 1 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP1_Label), TSP1_file);
}
if(touchSettingSelectFlag == TSPPosition2)
{
// Update position 2 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP2_file);
gtk_label_set_markup(GTK_LABEL(TSP2_Label), markup);
} else {
// Update position 2 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP2_Label), TSP2_file);
}
if(touchSettingSelectFlag == TSPPosition3)
{
// Update position 3 label with TSP filename (bold)
markup = g_markup_printf_escaped(formatBold, TSP3_file);
gtk_label_set_markup(GTK_LABEL(TSP3_Label), markup);
} else {
// Update position 3 label with TSP filename
gtk_label_set_markup(GTK_LABEL(TSP3_Label), TSP3_file);
}
}
break;
default:
break;
}
}
}
/**
* Change the menu lable when 38400bps is selected.
*
* @return none
*/
void BR_38400bps_Default_selected()
{
gtk_label_set_text(baudrateMenuLabel, "38400bps");
baudrateFlag = BR_38400_Default;
}
/**
* Change the menu label when 4800bps is selected.
*
* @return none
*/
void BR_4800bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "4800bps");
baudrateFlag = BR_4800;
}
/**
* Change the menu label when 9600bps is selected.
*
* @return none
*/
void BR_9600bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "9600bps");
baudrateFlag = BR_9600;
}
/**
* Change the menu label when 19200bps is selected.
*
* @return none
*/
void BR_19200bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "19200bps");
baudrateFlag = BR_19200;
}
/**
* Change the menu label when 38400bps is selected.
*
* @return none
*/
void BR_38400bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "38400bps");
baudrateFlag = BR_38400;
}
/**
* Change the menu label when 57600bps is selected.
*
* @return none
*/
void BR_57600bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "57600bps");
baudrateFlag = BR_57600;
}
/**
* Change the menu label when 115200bps is selected.
*
* @return none
*/
void BR_115200bps_selected()
{
gtk_label_set_text(baudrateMenuLabel, "115200bps");
baudrateFlag = BR_115200;
}
/**
* Change the menu label when "None" is selected.
*
* @return none
*/
void Parity_None_selected()
{
gtk_label_set_text(parityMenuLabel, "None");
parityFlag = parityNone;
}
/**
* Change the menu label when "Even" is selected.
*
* @return none
*/
void Parity_Even_selected()
{
gtk_label_set_text(parityMenuLabel, "Even");
parityFlag = parityEven;
}
/**
* Change the menu label when "Odd" is selected.
*
* @return none
*/
void Parity_Odd_selected()
{
gtk_label_set_text(parityMenuLabel, "Odd");
parityFlag = parityOdd;
}
/**
* Launch Touch Level Tool
*
* @return none
*/
void touchLevelToolButton_clicked_cb()
{
// Need to check if display is already connected and disconnect while tool is running.
if(isActive())
{
release_USB();
}
int status = system("sudo ./base2");
if(status == -1)
{
printf("Unable to launch Touch Level Tool.\n");
}
// Reconnect display after tool is closed.
if(!USB_start())
{
release_USB();
} else if(product_ID) {
// Notify user of failed connection.
gtk_dialog_run(ConnectFailedDialog);
// Reset connected display ID
product_ID = 0;
}
}
GTVP_controlcenter_instructions_V4_0.pdf 0000644 0001750 0001750 00004057514 14103044416 016525 0 ustar pi pi %PDF-1.5
%
1 0 obj
<>>>
endobj
2 0 obj
<>
endobj
3 0 obj
<>/ExtGState<>/XObject<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[ 0 0 612 792] /Contents 4 0 R/Group<>/Tabs/S/StructParents 0>>
endobj
4 0 obj
<>
stream
xZnH}7GjwEMr`Hvdƛ1 `$F&V&=oUآZ2U]]9]U=Wjt]U1]xke'UV1u:a>\^n#B0d'gȖΖ)j>}yeV%K٤ᏻ|>ÿ//n`7qG C39d~JB67t^El
{ָ--j\[F#7Qvqqr7erdB;hx_R.+B&fOb(fa
!%zbt0^!;=_Wa3[;6P\?Ԥ!ke(~WHUh,/g#?]y>K
Mۦ~8e/o>qS:eCJ.}Y5?`vb_yNA*u" Nl]PyAi8?&?ϼ~-8BhgppaQ{W
B7\\DP5-W>(f<c}U?%9V>i6p9*
n}|#CV'f-Z~UP
_($lk-#U7Fekد"[)r@C5 {[=Vҳ 8`*mE@=Z2
_Ft^<=
(HC:Jwc9,٪`1%ecJXF}dS{̝j`A_꿽i]45\cRxh@k'm/M?ghCKvy50!l/{NRN`t]얒 s&Xb'Mi[