Implement a Python function called calculate_string_length that calculates the total length of string needed to enclose a set of circles, considering overlaps between the circles.
Functionality Requirements:
The function takes two parameters:
An integer n representing the number of circles.
A list of tuples circles, where each tuple contains three float values (x, y, r) representing the x-coordinate, y-coordinate, and radius of a circle respectively.
The function must compute and return a float value representing the total length of string required to enclose the circles, accounting for overlaps such that overlapping parts do not contribute additional length.
Input/Output Requirements:
Input:
n (0 ≤ n ≤ 1000): the number of circles.
circles: a list of tuples. Each tuple is formatted as (x, y, r) where:
x (float): the x-coordinate of the circle's center.
y (float): the y-coordinate of the circle's center.
r (float): the radius of the circle (0 < r ≤ 1000).
Output:
A float representing the total length of string needed.
The solution must be encapsulated in a file called /app/solution.py.
Ensure to handle edge cases such as when n is 0 (return 0.0).
Utilize mathematical calculations involving trigonometry and complex numbers, as necessary, to determine overlaps correctly.
You are required to provide robust and efficient implementation of the calculate_string_length function that conforms to the specifications outlined above.