To solve this optimization problem, we need to define the decision variables, objective function, and constraints. Let's denote:

- $x$ as the number of bulletproof glass panes produced.
- $y$ as the number of fire-rated glass panes produced.

The objective is to maximize profit. The profit per pane of bulletproof glass is $12, and the profit per pane of fire-rated glass is $9.5. Therefore, the total profit can be represented as $12x + 9.5y$.

There are constraints based on the time available for the heating and cooling machines:

1. Heating machine constraint: $4x + 7y \leq 350$ (since it takes 4 minutes to make one bulletproof glass pane and 7 minutes to make one fire-rated glass pane, and there are 350 minutes available).
2. Cooling machine constraint: $6x + 9y \leq 350$ (since it takes 6 minutes to make one bulletproof glass pane and 9 minutes to make one fire-rated glass pane, and there are 350 minutes available).

Additionally, the number of panes produced cannot be negative:

3. Non-negativity constraints: $x \geq 0$, $y \geq 0$.

Now, let's translate this into Gurobi code in Python:

```python
from gurobipy import *

# Create a model
m = Model("Glass_Production")

# Define decision variables
x = m.addVar(lb=0, name="bulletproof_glass_panes")
y = m.addVar(lb=0, name="fire_rated_glass_panes")

# Objective function: Maximize profit
m.setObjective(12*x + 9.5*y, GRB.MAXIMIZE)

# Constraints
m.addConstr(4*x + 7*y <= 350, name="heating_machine_constraint")
m.addConstr(6*x + 9*y <= 350, name="cooling_machine_constraint")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Bulletproof glass panes: {x.x}")
    print(f"Fire-rated glass panes: {y.x}")
    print(f"Maximum profit: ${m.objVal:.2f}")
else:
    print("No optimal solution found")
```