Руководство пользователя — программа TMCGROUT (TMCGROUT.exe)

Пакет TMC Suite. Это руководство написано простым языком и рассчитано на пользователя, который видит программу впервые. Все названия пунктов меню и кнопок приведены так, как они выглядят в программе (интерфейс — английский), а рядом дан перевод и пояснение.


1. Назначение программы

TMCGROUT (исполняемый файл TMCGROUT.exe) — это программа для просмотра графиков характеристик рассеяния в частотной области. Проще говоря, она строит графики, у которых:

  • по горизонтальной оси (X) отложена частота (по умолчанию в ГГц);
  • по вертикальной оси (Y) отложена выбранная характеристика элемента матрицы рассеяния (S-матрицы) — например, модуль |S|, фаза в градусах или радианах, потери в децибелах или КСВН.

Матрица рассеяния (S-матрица) описывает, как устройство (например, планарная структура, рассчитанная счётным ядром tmc_rth или tmc_rtx) отражает и пропускает сигнал в зависимости от частоты. TMCGROUT берёт результат расчёта — файл S-матрицы — и рисует его в виде наглядного графика.

Что умеет программа:

  • открывать готовые документы-графики (файлы .soc) или напрямую файлы матрицы рассеяния (.s);
  • показывать сразу несколько кривых на одном поле (например, разные элементы S-матрицы или результаты из разных файлов);
  • менять масштаб (увеличение/уменьшение, автоподбор по осям), сдвигать видимую область;
  • настраивать цвета фона, сетки, осей и самих кривых, а также шрифт подписей;
  • печатать график и сохранять настройки оформления в самом документе .soc.

Обратите внимание: TMCGROUT только показывает уже посчитанные данные. Сам расчёт выполняют счётные ядра пакета (tmc_rth для H-поляризации, tmc_rtx для X-моды). Как получить файл .s, описано в разделе 7.

Главное окно программы TMCGROUT с графиком
Главное окно программы TMCGROUT с графиком

2. Запуск и открытие данных

Как запустить программу

  1. Найдите файл TMCGROUT.exe (после сборки он лежит в каталоге dist/win32/bin или dist/win64/bin).
  2. Запустите его двойным щелчком.
  3. При первом запуске программа разворачивается на весь экран. Если ранее уже открывались какие-либо файлы, TMCGROUT попытается автоматически открыть последний из них (список «недавних файлов» хранится в реестре Windows).

Какой файл открывать

TMCGROUT работает с двумя типами файлов (подробно — в разделе 7):

Файл Что это Когда открывать
.soc Документ TMCGROUT: текстовый файл с настройками графиков и ссылкой на файл(ы) .s Обычный способ. Сохраняет цвета, масштаб, список кривых
.s Файл матрицы рассеяния (результат расчётного ядра) Если хотите быстро посмотреть «сырой» результат. Программа сама создаст для него документ .soc

Чтобы открыть файл:

  1. Меню File → Open… (Файл → Открыть), либо нажмите кнопку «Открыть» на панели инструментов, либо клавиши Ctrl+O.
  2. В диалоге выберите нужный .soc или .s файл.
  3. График появится в окне документа.

Если вы открываете .s-файл, рядом с ним будет создан документ .soc с тем же именем (он хранит настройки отображения). В дальнейшем удобнее открывать именно .soc.


3. Главное окно

Главное окно — это многодокументное окно (MDI): внутри него могут быть открыты сразу несколько окон с разными графиками.

Главное окно с выделенными зонами
Главное окно с выделенными зонами

Окно состоит из четырёх зон:

  1. Строка меню (вверху) — все команды программы, сгруппированные по разделам (File, Edit, View, Config, Window, Help). Подробно — раздел 5.
  2. Панель инструментов (тулбар) — ряд кнопок-значков для самых частых действий. Подробно — раздел 4.
  3. Область графика (центр) — здесь рисуются оси, координатная сетка и сами кривые. По этой области работает мышь: можно выделить прямоугольник для увеличения (zoom), а двойной щелчок подгоняет масштаб.
  4. Строка состояния (статусбар) (внизу) — две панели: - левая — координаты точки под курсором мыши (значение частоты по X и значение характеристики по Y); - правая — название текущего типа характеристики (что отложено по оси Y: модуль, фаза, потери или КСВН).

4. Панель инструментов

Панель инструментов дублирует самые частые команды меню в виде кнопок. Если панель не видна, включите её через View → Toolbar.

Панель инструментов целиком, все кнопки подписаны
Панель инструментов целиком, все кнопки подписаны

Кнопки идут слева направо. Ниже — назначение каждой.

Кнопка Название (англ./рус.) Что делает
1 Открыть Open / Открыть файл Открывает файл .soc или .s (то же, что File → Open)
2 Добавить Add characteristics / Добавить характеристику Добавляет в текущий документ ещё одну кривую из выбранного .s-файла
3 Таблица графиков Characteristics / Таблица графиков Открывает таблицу со списком всех кривых документа (имена, входы/моды, флаги показа)
4 Параметры окна Viewport / Параметры окна Открывает диалог настройки отображения: пределы по осям, единицы, тип характеристики, формат подписей, точки
5 Перерисовать Redraw data / Перечитать и перерисовать Заново читает данные из файлов и перерисовывает график
6 Подогнать вьюпорт Resize viewport / Подогнать вьюпорт Подгоняет область рисования под размер окна
7 Увеличить Zoom + / Увеличить Увеличивает масштаб по обеим осям
8 Увеличить по X Zoom +X / Увеличить по X Увеличивает масштаб только по горизонтали (частоте)
9 Увеличить по Y Zoom +Y / Увеличить по Y Увеличивает масштаб только по вертикали
10 Уменьшить Zoom − / Уменьшить Уменьшает масштаб по обеим осям
11 Уменьшить по X Zoom −X / Уменьшить по X Уменьшает масштаб только по горизонтали
12 Уменьшить по Y Zoom −Y / Уменьшить по Y Уменьшает масштаб только по вертикали
13 Подогнать окно данных Resize window / Подогнать окно данных Подгоняет вещественные пределы (окно данных)
14 Авто-X Auto X size / Авто-масштаб X Автоматически подбирает пределы по оси X (частоте) под данные
15 Авто-Y Auto Y size / Авто-масштаб Y Автоматически подбирает пределы по оси Y под данные
16 Xmin авто Xmin авто / автоподбор левой границы X Подгоняет нижнюю границу по X под данные
17 Xmax авто Xmax авто / автоподбор правой границы X Подгоняет верхнюю границу по X под данные
18 Сдвиг по X влево Сдвиг по X влево Сдвигает видимую область по частоте влево
19 Сдвиг по X вправо Сдвиг по X вправо Сдвигает видимую область по частоте вправо
20 Сдвиг по Y вниз Сдвиг по Y вниз Сдвигает видимую область вниз
21 Сдвиг по Y вверх Сдвиг по Y вверх Сдвигает видимую область вверх
22 Печать Print / Печать Печатает текущий график (то же, что File → Print)
23 О программе About / О программе Показывает окно «О программе»

5. Меню

Ниже разобран каждый пункт каждого меню: что он делает, какая у него горячая клавиша и что происходит после выбора.

5.1. Меню File (Файл)

Меню File
Меню File
Пункт Горячая клавиша Что делает
New (Создать) Ctrl+N Создаёт новый пустой документ-график
Open… (Открыть) Ctrl+O Открывает существующий .soc или .s файл
Close (Закрыть) Закрывает текущее окно документа
Save (Сохранить) Ctrl+S Сохраняет текущий документ (.soc) вместе со всеми настройками оформления
Save As… (Сохранить как) Сохраняет документ под новым именем
Print… (Печать) Ctrl+P Печатает график
Print Preview (Предпросмотр печати) Показывает, как график будет выглядеть на бумаге
Print Setup… (Параметры печати) Настройки принтера и страницы
Список последних файлов (1–9) Быстрое открытие недавно использованных документов
Exit (Выход) Закрывает программу

При сохранении настройки оформления (цвета, шрифт, типы линий) дополнительно запоминаются в реестре Windows и используются как значения по умолчанию для новых документов.

5.2. Меню Edit (Правка)

Меню Edit
Меню Edit
Пункт Горячая клавиша Что делает
Characteristics (Характеристики / таблица графиков) Ctrl+D Открывает таблицу содержимого документа: список всех кривых (до 20). Для каждой видно имя графика, имя S-файла, входы/моды и флаг «показывать/не показывать»
Add characteristics (Добавить характеристику) Ctrl+A Открывает диалог выбора .s-файла и добавляет из него новую кривую в текущий документ
Editor (Внешний редактор) Alt+F7 Открывает файл документа во внешнем текстовом редакторе (по умолчанию winword.exe) — для ручного редактирования .soc

5.3. Меню View (Вид)

Меню View
Меню View
Пункт Горячая клавиша Что делает
Viewport (Параметры окна) Ctrl+H Открывает диалог настройки отображения: пределы Xmin/Xmax/Ymin/Ymax, авто-масштаб, единица оси X, тип характеристики Y, формат подписей, показ точек-маркеров
Redraw data (Перечитать и перерисовать) Ctrl+W Заново читает данные из файлов и перерисовывает график. Полезно, если файл .s пересчитан заново
Zoom ► (Масштаб) Подменю масштабирования (см. ниже)
Translate ► (Сдвиг) Подменю сдвига границ области (см. ниже)
Status Bar (Строка состояния) Включает/выключает нижнюю строку состояния
Toolbar (Панель инструментов) Включает/выключает панель инструментов

Подменю View → Zoom (Масштаб)

Подменю Zoom
Подменю Zoom
Пункт Горячая клавиша Что делает
ReSize viewport (Подогнать область) Ctrl+R Подгоняет область рисования под текущее окно
Zoom + (Увеличить) Увеличивает масштаб по обеим осям
Zoom +X (Увеличить по X) Увеличивает масштаб только по частоте
Zoom +Y (Увеличить по Y) Увеличивает масштаб только по вертикали
Zoom − (Уменьшить) Уменьшает масштаб по обеим осям
Zoom −X (Уменьшить по X) Shift+X Уменьшает масштаб по частоте
Zoom −Y (Уменьшить по Y) Shift+Y Уменьшает масштаб по вертикали
Resize window (Подогнать окно данных) Ctrl+T Изменяет вещественные пределы окна данных
Auto X size (Авто-масштаб X) Alt+X Включает автоматический подбор пределов по X. В меню появляется галочка
Auto Y size (Авто-масштаб Y) Alt+Y Включает автоматический подбор пределов по Y. В меню появляется галочка

При включённом авто-масштабе по оси программа сама подбирает пределы под минимум/максимум данных, и ручные пределы по этой оси игнорируются (поля Xmin/Xmax или Ymin/Ymax в диалоге Viewport становятся недоступны).

Подменю View → Translate (Сдвиг)

Подменю Translate
Подменю Translate
Пункт Что делает
Change Xmax, Xmin ► Вложенное подменю: сдвинуть/изменить верхнюю и нижнюю границы по X (частоте). Сдвиг выполняется шагами (порядка 10 % диапазона)
Change Ymax, Ymin ► Вложенное подменю: сдвинуть/изменить верхнюю и нижнюю границы по Y. Сдвиг шагами (порядка 10 % диапазона)

Сдвиг удобен, когда нужно «прокрутить» график влево/вправо/вверх/вниз, не меняя масштаб.

5.4. Меню Config (Настройки)

Меню Config
Меню Config
Пункт Что делает
Editor (Редактор) Задаёт путь к внешнему текстовому редактору для .soc-файлов (по умолчанию winword.exe)
Color ► (Цвет) Подменю выбора цветов элементов графика (см. ниже)
Font (Шрифт) Открывает стандартный диалог выбора шрифта подписей осей и сетки (по умолчанию Times New Roman)

Подменю Config → Color (Цвет)

Подменю Color
Подменю Color
Пункт Что меняет
Background (Фон) Цвет фона области графика (по умолчанию белый)
Grid (Сетка) Цвет координатной сетки
Axies (Оси) Цвет осей координат
Point (Точки) Цвет точек-маркеров на кривых
Graphics (Графики) Открывает диалог цветов/типов/толщины линий сразу для 16 кривых — здесь же можно задать индивидуальный цвет каждой кривой

Пункт Graphics открывает таблицу из 16 образцов линий. Нажав на нужный образец, вы выбираете цвет, стиль (сплошная, пунктир, точки) и толщину этой линии.

5.5. Меню Window (Окно)

Меню Window
Меню Window
Пункт Что делает
New Window (Новое окно) Открывает ещё одно окно для того же документа (полезно для разных масштабов одного графика)
Cascade (Каскад) Располагает окна каскадом
Tile (Мозаика) Располагает окна плиткой (рядом)
Arrange Icons (Упорядочить значки) Выравнивает свёрнутые окна-значки
Список окон Переключение между открытыми окнами документов

5.6. Меню Help (Справка)

Меню Help
Меню Help
Пункт Что делает
About TMCGROUT… (О программе) Показывает окно с названием и версией программы
Окно «О программе»
Окно «О программе»

6. Типовые сценарии работы

Ниже — пошаговые инструкции для самых частых задач.

6.1. Открыть документ .soc

  1. Меню File → Open… (или Ctrl+O, или кнопка «Открыть» на панели).
  2. Выберите файл с расширением .soc (например, rths25.soc).
  3. График построится автоматически. Если кривая «уехала» за пределы окна — нажмите кнопки авто-масштаба Auto X size и Auto Y size.

6.2. Добавить ещё одну характеристику (Add characteristics)

  1. Откройте документ (см. 6.1).
  2. Меню Edit → Add characteristics (Ctrl+A) или кнопка «Добавить характеристику».
  3. В диалоге выберите нужный .s-файл.
  4. Новая кривая добавится в документ. Чтобы посмотреть/настроить список всех кривых, откройте Edit → Characteristics (Ctrl+D).
  5. В таблице можно включать и выключать показ каждой кривой (флаг вывода), а также задавать входы/моды нужного элемента S-матрицы.
Диалог Characteristics — таблица графиков документа
Диалог Characteristics — таблица графиков документа

6.3. Настроить масштаб (Zoom / Auto X / Auto Y)

Есть три способа изменить масштаб:

  • Мышью — зажмите левую кнопку и обведите прямоугольником интересующую область графика; при отпускании кнопки программа увеличит выделенное. Двойной щелчок в области графика подгоняет масштаб обратно.
  • Кнопками панели — Zoom + / Zoom − (обе оси), Zoom +X/−X, Zoom +Y/−Y (по одной оси).
  • Авто-масштабView → Zoom → Auto X size (Alt+X) и Auto Y size (Alt+Y). Программа сама подберёт пределы так, чтобы видеть всю кривую. Это самый быстрый способ «вписать» график в окно.

6.4. Сдвинуть график (Translate)

  1. Меню View → Translate.
  2. Выберите Change Xmax, Xmin (сдвиг по частоте) или Change Ymax, Ymin (сдвиг по вертикали).
  3. Во вложенном подменю выберите увеличение или уменьшение нужной границы. График сдвинется шагом порядка 10 % диапазона.

Тот же эффект дают кнопки сдвига на панели инструментов (№18–21).

Сдвиг работает только при выключенном авто-масштабе по соответствующей оси: при включённом авто-масштабе пределы определяются автоматически по данным.

6.5. Сменить цвета и тип характеристики

Цвет фона / сетки / осей / точек: 1. Меню Config → Color → Background / Grid / Axies / Point. 2. В стандартном диалоге выберите цвет → OK.

Стандартный диалог выбора цвета
Стандартный диалог выбора цвета

Цвет, стиль и толщина кривых: 1. Меню Config → Color → Graphics. 2. В открывшейся таблице нажмите образец нужной кривой. 3. Выберите цвет, стиль линии (сплошная/пунктир/точки) и толщину → OK.

Диалог Graphics — таблица из 16 образцов линий
Диалог Graphics — таблица из 16 образцов линий

Что отложено по оси Y (модуль, фаза, потери, КСВН) и единицы оси X: 1. Меню View → Viewport (Ctrl+H) или кнопка «Параметры окна». 2. В диалоге выберите тип характеристики Y и единицу оси X (Гц/кГц/МГц/ГГц), при желании задайте пределы и формат подписей → OK.

Диалог Viewport — параметры отображения графика
Диалог Viewport — параметры отображения графика

6.6. Напечатать график

  1. Сначала настройте масштаб и оформление так, как хотите видеть на бумаге.
  2. (По желанию) Меню File → Print Preview — проверьте, как график ляжет на страницу.
  3. Меню File → Print… (Ctrl+P) или кнопка «Печать».
  4. Выберите принтер и нажмите OK.

7. Форматы входных данных

TMCGROUT работает с двумя форматами файлов: документ .soc и файл матрицы рассеяния .s.

7.1. Файл документа .soc

.soc — это текстовый файл-документ TMCGROUT. Его можно открыть любым текстовым редактором. Он хранит настройки оформления и список кривых, но не хранит сами данные — данные берутся из файлов .s, на которые ссылается документ.

Структура файла (на примере реального файла samples/SAMPLE_R/TEST_MET/EPS4/rths25.soc):

#TMCGROUT
!Graphics parameters
#dXAxiesUnit 0
#dXAxiesName
#PointDrawFlag 1; 1;
#nXType 0
#nYType 2
#Xmin 40
#Xmax 49.8
#Ymin -0.0011383
#Ymax 0.00128368
#nAFlagX 1
#nAFlagY 1
#EditorFileName  winword.exe
#sDrawTextFont Times New Roman;-37;0;0;0;400;0;0;0;1;
#sDrawTextColor 0;
#sDrawBckgrdColor 16777215;
#sDrawAxiesColor 0;
#sDrawGridColor 0;
#sDrawPointColor 0; 16711680; 0; 75; ...
!Graphics data
!file name : E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.soc
!Data file for draw S-matrix graphics
!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s rths25.s 1 1 1 2 1

Разбор по строкам:

Строка Назначение
#TMCGROUT Сигнатура — обязательная первая строка. По ней программа узнаёт «свой» файл
Строки, начинающиеся с ! Комментарии — программа их игнорирует (включая авто-сгенерированный путь и подсказку по столбцам)
Строки #Ключ значение Параметры оформления (см. таблицу ниже)
Последние строки (без #) Описания кривых — по одной строке на кривую

Параметры оформления (#Ключ):

Ключ Что задаёт Значения
#dXAxiesUnit Множитель пользовательской единицы оси X число (для пользовательской единицы)
#dXAxiesName Имя пользовательской единицы оси X текст
#PointDrawFlag Рисовать ли маркеры точек на кривых 0 — нет, 1 — да
#nXType Тип оси X (единица частоты) 0 — ГГц, 1 — МГц, 2 — кГц, 3 — Гц, 4 — пользовательская
#nYType Тип оси Y (характеристика) 0 — КСВН, 1 — потери (дБ), 2 — модуль \|S\|, 3 — фаза (рад), 4 — фаза (град)
#Xmin, #Xmax Пределы по оси X числа в выбранной единице частоты
#Ymin, #Ymax Пределы по оси Y числа
#nAFlagX Авто-масштаб по X 0 — выкл, 1 — вкл
#nAFlagY Авто-масштаб по Y 0 — выкл, 1 — вкл
#EditorFileName Внешний редактор документа путь к .exe
#sDrawTextFont Шрифт подписей параметры шрифта (имя, размер и т.д.)
#sDrawTextColor Цвет текста подписей число COLORREF
#sDrawBckgrdColor Цвет фона число COLORREF (16777215 = белый)
#sDrawAxiesColor Цвет осей число COLORREF (0 = чёрный)
#sDrawGridColor Цвет сетки число COLORREF
#sDrawPointColor Цвета/параметры маркеров для 16 кривых список чисел

Единицы измерения. В примере rths25.soc стоит #nXType 0 — значит, ось X в ГГц, а пределы #Xmin 40, #Xmax 49.8 означают диапазон 40…49.8 ГГц. Параметр #nYType 2 означает, что по Y отложен модуль |S|.

Описание кривой (строка данных). Формат столбцов указан в комментарии выше неё:

!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s   rths25.s     1        1      1    2      1
Столбец Значение в примере Назначение
SFileName rths25.s Имя файла матрицы рассеяния (обычно относительный путь рядом с .soc)
GraphicsName rths25.s Подпись кривой в легенде
DrawFlag 1 Показывать кривую: 1 — да, 0 — нет
Input1 1 Номер первого входа элемента S-матрицы
Mod1 1 Номер моды первого входа
Input2 2 Номер второго входа
Mod2 1 Номер моды второго входа

То есть в примере строится элемент S-матрицы, связывающий вход 1 (мода 1) и вход 2 (мода 1) — это «проходная» характеристика (передача между двумя входами).

Для сравнения — простой документ samples/SAMPLE_R/horns.soc:

#TMCGROUT
...
#nXType 0
#nYType 1
#Xmin -3.40282e+038
#Xmax -3.40282e+038
...
#nAFlagX 0
#nAFlagY 0
...
horns.s horns.s 1 1 1 1 1

Здесь #nYType 1 — по оси Y потери в дБ; пределы заданы как -3.40282e+038 (это «не задано»/минимально возможное число float); элемент S-матрицы — вход 1 (мода 1) вход 1 (мода 1), то есть отражение от первого входа.

Если выражение имени файла заключено в фигурные скобки {...}, это означает не одиночный файл, а график-выражение (расчёт кривой по формуле над несколькими .s-файлами). Это продвинутая возможность; подробности — в API-документации (docs/api/viewers/tmcgrout.md, класс CTMCGrExpression).

7.2. Файл матрицы рассеяния .s

.s — это файл с самими данными матрицы рассеяния: для набора частот хранятся комплексные значения элементов S-матрицы. Это результат работы счётного ядра (tmc_rth или tmc_rtx).

По структуре файл смешанный — текстовый заголовок плюс числовые данные. Начало файла (пример rths25.s):

SMT 102

 TAMIC-RTH V 2.00
2 TAMIC_soft group. TAMIC Rt-H Planar Analyzer. 2000

 Tamic Output Signal Viewer
. E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.s
Элемент Что это
SMT 102 Метка файла S-матрицы и число точек/параметр (102)
TAMIC-RTH V 2.00 Версия программы-генератора (счётного ядра)
Строка TAMIC_soft group… Подпись разработчика
. <путь> Исходный путь к файлу
Далее Блок частот и блок комплексных значений S-параметров (для каждой частоты — значения элементов матрицы)

7.3. Как получить файлы .s и .soc

Файл .s создаётся счётным ядром при расчёте планарной структуры. Кратко (подробно — в docs/api/kernels/planar_rt_h.md и руководствах по ядрам):

  1. Подготовьте входной файл-шаблон .tpl (топология структуры, параметры, секция вывода). В секции OUTPUT должен быть включён вывод S-матрицы (флаг SMATRIX) и задано имя выходного файла.
  2. Запустите счётное ядро: tmc_rth.exe (для H-поляризации) или tmc_rtx.exe (для X-моды), откройте в нём .tpl и выполните расчёт (Run All).
  3. По завершении ядро запишет файл .s с матрицей рассеяния (имя задаётся в секции вывода).
  4. Откройте полученный .s в TMCGROUT — программа автоматически создаст рядом документ .soc. Дальше настройте оформление и сохраните (Ctrl+S).

Готовые примеры для тренировки лежат в samples/SAMPLE_R/ (например, TEST_MET/EPS4/rths25.s + rths25.soc).


8. Возможные проблемы и их решение

Симптом Причина Что делать
В легенде/области графика надпись Error_when_read… Файл .s не найден, пуст или повреждён Проверьте, существует ли .s-файл по указанному в .soc пути; пересчитайте его ядром заново
График пустой или кривая не видна Включён неудачный масштаб, либо данные вне окна Нажмите Auto X size и Auto Y size (Alt+X, Alt+Y), чтобы вписать кривую в окно
Кривая есть, но «уезжает» за край Заданы ручные пределы Xmin/Xmax/Ymin/Ymax Откройте View → Viewport и проверьте пределы, либо включите авто-масштаб
После пересчёта .s график не обновился TMCGROUT показывает старые данные Нажмите View → Redraw data (Ctrl+W) или кнопку «Перечитать»
Кривая одного цвета с фоном/её плохо видно Совпали цвета Config → Color → Graphics — задайте контрастный цвет линии
Открыли .sсоздался лишний файл .soc (или .$OC) Это нормально: документ для .s создаётся автоматически (если .soc уже занят, используется .$OC) Сохраните настройки в нужный .soc через File → Save As…
Не открывается файл — сообщение про «не тот формат» Первая строка файла не #TMCGROUT (для .soc) Убедитесь, что открываете корректный документ; первая строка должна быть #TMCGROUT

User manual — the TMCGROUT program (TMCGROUT.exe)

TMC Suite package. This manual is written in plain language and is intended for a user seeing the program for the first time. All menu and button names are given as they appear in the program (the interface is in English), with a translation and explanation next to them.


1. Purpose of the program

TMCGROUT (the executable TMCGROUT.exe) is a program for viewing graphs of scattering characteristics in the frequency domain. In simple terms, it builds graphs where:

  • the horizontal axis (X) shows the frequency (GHz by default);
  • the vertical axis (Y) shows a selected characteristic of an element of the scattering matrix (S-matrix) — for example, the magnitude |S|, the phase in degrees or radians, the losses in decibels, or the VSWR.

The scattering matrix (S-matrix) describes how a device (for example, a planar structure computed by the kernel tmc_rth or tmc_rtx) reflects and transmits a signal as a function of frequency. TMCGROUT takes the computation result — an S-matrix file — and draws it as a clear graph.

What the program can do:

  • open ready-made graph documents (.soc files) or scattering-matrix files (.s) directly;
  • show several curves at once on one field (for example, different S-matrix elements or results from different files);
  • change the scale (zoom in/out, auto-fit by axes), shift the visible area;
  • configure the colors of the background, grid, axes and the curves themselves, as well as the label font;
  • print the graph and save the display settings in the .soc document itself.

Note: TMCGROUT only displays already-computed data. The computation itself is performed by the package's compute kernels (tmc_rth for H-polarization, tmc_rtx for X-mode). How to obtain a .s file is described in section 7.

The main window of TMCGROUT with a graph
The main window of TMCGROUT with a graph

2. Launching and opening data

How to launch the program

  1. Find the file TMCGROUT.exe (after the build it is in dist/win32/bin or dist/win64/bin).
  2. Launch it with a double click.
  3. On the first launch the program maximizes to full screen. If any files were opened before, TMCGROUT will try to automatically open the last of them (the "recent files" list is stored in the Windows registry).

Which file to open

TMCGROUT works with two file types (details in section 7):

File What it is When to open
.soc TMCGROUT document: a text file with graph settings and a reference to the .s file(s) The usual way. Saves colors, scale, list of curves
.s Scattering-matrix file (the result of a compute kernel) If you want to quickly view the "raw" result. The program will create a .soc document for it itself

To open a file:

  1. Menu File → Open…, or click the "Open" button on the toolbar, or press Ctrl+O.
  2. In the dialog select the desired .soc or .s file.
  3. The graph appears in the document window.

If you open a .s file, a .soc document with the same name will be created next to it (it stores the display settings). In the future it is more convenient to open the .soc.


3. The main window

The main window is a multiple-document window (MDI): several windows with different graphs can be open inside it at once.

The main window with highlighted zones
The main window with highlighted zones

The window consists of four zones:

  1. Menu bar (top) — all program commands, grouped into sections (File, Edit, View, Config, Window, Help). Details in section 5.
  2. Toolbar — a row of icon buttons for the most frequent actions. Details in section 4.
  3. Graph area (center) — here the axes, the coordinate grid and the curves themselves are drawn. The mouse works over this area: you can select a rectangle to zoom in, and a double click fits the scale.
  4. Status bar (bottom) — two panels: - the left one — the coordinates of the point under the mouse cursor (the frequency value on X and the characteristic value on Y); - the right one — the name of the current characteristic type (what is plotted on the Y axis: magnitude, phase, losses or VSWR).

4. The toolbar

The toolbar duplicates the most frequent menu commands as buttons. If the toolbar is not visible, enable it via View → Toolbar.

The full toolbar with all buttons labeled
The full toolbar with all buttons labeled

The buttons go from left to right. Below is the purpose of each.

# Button Name (Eng.) What it does
1 Open Open Opens a .soc or .s file (same as File → Open)
2 Add Add characteristics Adds one more curve from a selected .s file to the current document
3 Graph table Characteristics Opens a table listing all curves of the document (names, inputs/modes, display flags)
4 Window parameters Viewport Opens the display-settings dialog: axis limits, units, characteristic type, label format, points
5 Redraw Redraw data Re-reads the data from the files and redraws the graph
6 Fit viewport Resize viewport Fits the drawing area to the window size
7 Zoom in Zoom + Zooms in on both axes
8 Zoom in X Zoom +X Zooms in only horizontally (frequency)
9 Zoom in Y Zoom +Y Zooms in only vertically
10 Zoom out Zoom − Zooms out on both axes
11 Zoom out X Zoom −X Zooms out only horizontally
12 Zoom out Y Zoom −Y Zooms out only vertically
13 Fit data window Resize window Fits the real limits (the data window)
14 Auto X Auto X size Automatically fits the X-axis (frequency) limits to the data
15 Auto Y Auto Y size Automatically fits the Y-axis limits to the data
16 Xmin auto Xmin auto Fits the lower X limit to the data
17 Xmax auto Xmax auto Fits the upper X limit to the data
18 Shift X left Shift X left Shifts the visible area left along the frequency
19 Shift X right Shift X right Shifts the visible area right along the frequency
20 Shift Y down Shift Y down Shifts the visible area down
21 Shift Y up Shift Y up Shifts the visible area up
22 Print Print Prints the current graph (same as File → Print)
23 About About Shows the "About" window

5. The menus

Below, every item of every menu is explained: what it does, its keyboard shortcut, and what happens after you select it.

5.1. The File menu

The File menu
The File menu
Item Shortcut What it does
New Ctrl+N Creates a new empty graph document
Open… Ctrl+O Opens an existing .soc or .s file
Close Closes the current document window
Save Ctrl+S Saves the current document (.soc) together with all display settings
Save As… Saves the document under a new name
Print… Ctrl+P Prints the graph
Print Preview Shows how the graph will look on paper
Print Setup… Printer and page settings
Recent files list (1–9) Quick opening of recently used documents
Exit Closes the program

When saving, the display settings (colors, font, line types) are additionally remembered in the Windows registry and used as defaults for new documents.

5.2. The Edit menu

The Edit menu
The Edit menu
Item Shortcut What it does
Characteristics (graph table) Ctrl+D Opens the table of the document's contents: a list of all curves (up to 20). For each you can see the graph name, the S-file name, the inputs/modes and the "show/hide" flag
Add characteristics Ctrl+A Opens a .s-file selection dialog and adds a new curve from it to the current document
Editor (external editor) Alt+F7 Opens the document file in an external text editor (by default winword.exe) — for manual editing of the .soc

"Inputs" and "modes" (Input1/Mod1, Input2/Mod2) are the address of an S-matrix element: which input with which mode is connected to which output. Details in section 7.

5.3. The View menu

The View menu
The View menu
Item Shortcut What it does
Viewport Ctrl+H Opens the display-settings dialog: limits Xmin/Xmax/Ymin/Ymax, auto-scale, X-axis unit, Y characteristic type, label format, showing point markers
Redraw data Ctrl+W Re-reads the data from the files and redraws the graph. Useful if the .s file was recomputed
Zoom ► Zoom submenu (see below)
Translate ► Submenu for shifting the area limits (see below)
Status Bar Toggles the bottom status bar
Toolbar Toggles the toolbar

The View → Zoom submenu

The Zoom submenu
The Zoom submenu
Item Shortcut What it does
ReSize viewport Ctrl+R Fits the drawing area to the current window
Zoom + Zooms in on both axes
Zoom +X Zooms in only on the frequency
Zoom +Y Zooms in only vertically
Zoom − Zooms out on both axes
Zoom −X Shift+X Zooms out on the frequency
Zoom −Y Shift+Y Zooms out vertically
Resize window Ctrl+T Changes the real limits of the data window
Auto X size Alt+X Enables automatic fitting of the X limits. A check mark appears in the menu
Auto Y size Alt+Y Enables automatic fitting of the Y limits. A check mark appears in the menu

With auto-scale enabled on an axis, the program fits the limits to the minimum/maximum of the data itself, and manual limits on that axis are ignored (the Xmin/Xmax or Ymin/Ymax fields in the Viewport dialog become unavailable).

The View → Translate submenu

The Translate submenu
The Translate submenu
Item What it does
Change Xmax, Xmin ► Nested submenu: shift/change the upper and lower X (frequency) limits. The shift is performed in steps (about 10% of the range)
Change Ymax, Ymin ► Nested submenu: shift/change the upper and lower Y limits. Shift in steps (about 10% of the range)

Shifting is convenient when you need to "scroll" the graph left/right/up/down without changing the scale.

5.4. The Config menu

The Config menu
The Config menu
Item What it does
Editor Sets the path to the external text editor for .soc files (by default winword.exe)
Color ► Submenu for choosing the colors of the graph elements (see below)
Font Opens the standard dialog for choosing the font of the axis and grid labels (by default Times New Roman)

The Config → Color submenu

The Color submenu
The Color submenu
Item What it changes
Background The background color of the graph area (white by default)
Grid The color of the coordinate grid
Axies The color of the coordinate axes
Point The color of the point markers on the curves
Graphics Opens a dialog with colors/types/thicknesses of lines for 16 curves at once — here you can also set an individual color for each curve

The Graphics item opens a table of 16 line samples. By clicking the desired sample, you choose the color, the style (solid, dashed, dotted) and the thickness of that line.

5.5. The Window menu

The Window menu
The Window menu
Item What it does
New Window Opens another window for the same document (useful for different scales of one graph)
Cascade Arranges the windows in a cascade
Tile Arranges the windows tiled (side by side)
Arrange Icons Aligns the minimized window icons
Windows list Switches between the open document windows

5.6. The Help menu

The Help menu
The Help menu
Item What it does
About TMCGROUT… Shows a window with the program name and version
The "About" window
The &quot;About&quot; window

6. Typical workflows

Below are step-by-step instructions for the most frequent tasks.

6.1. Open a .soc document

  1. Menu File → Open… (or Ctrl+O, or the "Open" button on the toolbar).
  2. Select a file with the .soc extension (for example, rths25.soc).
  3. The graph is built automatically. If the curve has "run off" beyond the window, press the auto-scale buttons Auto X size and Auto Y size.

6.2. Add another characteristic (Add characteristics)

  1. Open a document (see 6.1).
  2. Menu Edit → Add characteristics (Ctrl+A) or the "Add characteristic" button.
  3. In the dialog select the desired .s file.
  4. The new curve is added to the document. To view/configure the list of all curves, open Edit → Characteristics (Ctrl+D).
  5. In the table you can turn the display of each curve on and off (the output flag), and set the inputs/modes of the desired S-matrix element.
The Characteristics dialog — the document's graph table
The Characteristics dialog — the document's graph table

6.3. Adjust the scale (Zoom / Auto X / Auto Y)

There are three ways to change the scale:

  • With the mouse — hold the left button and draw a rectangle around the graph area of interest; when you release the button the program zooms in on the selection. A double click in the graph area fits the scale back.
  • With the toolbar buttons — Zoom + / Zoom − (both axes), Zoom +X/−X, Zoom +Y/−Y (one axis).
  • Auto-scaleView → Zoom → Auto X size (Alt+X) and Auto Y size (Alt+Y). The program fits the limits so that the whole curve is visible. This is the fastest way to "fit" the graph into the window.

6.4. Shift the graph (Translate)

  1. Menu View → Translate.
  2. Select Change Xmax, Xmin (shift along the frequency) or Change Ymax, Ymin (shift vertically).
  3. In the nested submenu, choose to increase or decrease the desired limit. The graph shifts by a step of about 10% of the range.

The same effect is produced by the shift buttons on the toolbar (#18–21).

The shift only works with auto-scale disabled on the corresponding axis: with auto-scale enabled, the limits are determined automatically from the data.

6.5. Change the colors and the characteristic type

Background / grid / axes / point color: 1. Menu Config → Color → Background / Grid / Axies / Point. 2. In the standard dialog select the color → OK.

The standard color-selection dialog
The standard color-selection dialog

Curve color, style and thickness: 1. Menu Config → Color → Graphics. 2. In the opened table click the sample of the desired curve. 3. Select the color, the line style (solid/dashed/dotted) and the thickness → OK.

The Graphics dialog — a table of 16 line samples
The Graphics dialog — a table of 16 line samples

What is plotted on the Y axis (magnitude, phase, losses, VSWR) and the X-axis units: 1. Menu View → Viewport (Ctrl+H) or the "Window parameters" button. 2. In the dialog select the Y characteristic type and the X-axis unit (Hz/kHz/MHz/GHz), optionally set the limits and the label format → OK.

The Viewport dialog — graph display parameters
The Viewport dialog — graph display parameters

6.6. Print the graph

  1. First set the scale and appearance the way you want to see them on paper.
  2. (Optional) Menu File → Print Preview — check how the graph will fit on the page.
  3. Menu File → Print… (Ctrl+P) or the "Print" button.
  4. Select the printer and click OK.

7. Input data formats

TMCGROUT works with two file formats: the .soc document and the .s scattering-matrix file.

7.1. The .soc document file

.soc is a text TMCGROUT document file. It can be opened with any text editor. It stores the display settings and the list of curves, but does not store the data itself — the data is taken from the .s files referenced by the document.

File structure (using the real file samples/SAMPLE_R/TEST_MET/EPS4/rths25.soc):

#TMCGROUT
!Graphics parameters
#dXAxiesUnit 0
#dXAxiesName
#PointDrawFlag 1; 1;
#nXType 0
#nYType 2
#Xmin 40
#Xmax 49.8
#Ymin -0.0011383
#Ymax 0.00128368
#nAFlagX 1
#nAFlagY 1
#EditorFileName  winword.exe
#sDrawTextFont Times New Roman;-37;0;0;0;400;0;0;0;1;
#sDrawTextColor 0;
#sDrawBckgrdColor 16777215;
#sDrawAxiesColor 0;
#sDrawGridColor 0;
#sDrawPointColor 0; 16711680; 0; 75; ...
!Graphics data
!file name : E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.soc
!Data file for draw S-matrix graphics
!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s rths25.s 1 1 1 2 1

Line-by-line breakdown:

Line Purpose
#TMCGROUT Signature — the mandatory first line. The program recognizes "its" file by it
Lines starting with ! Comments — the program ignores them (including the auto-generated path and the column hint)
#Key value lines Display parameters (see the table below)
The last lines (without #) Curve descriptions — one line per curve

Display parameters (#Key):

Key What it sets Values
#dXAxiesUnit The multiplier of the custom X-axis unit number (for the custom unit)
#dXAxiesName The name of the custom X-axis unit text
#PointDrawFlag Whether to draw point markers on the curves 0 — no, 1 — yes
#nXType X-axis type (frequency unit) 0 — GHz, 1 — MHz, 2 — kHz, 3 — Hz, 4 — custom
#nYType Y-axis type (characteristic) 0 — VSWR, 1 — losses (dB), 2 — magnitude \|S\|, 3 — phase (rad), 4 — phase (deg)
#Xmin, #Xmax X-axis limits numbers in the chosen frequency unit
#Ymin, #Ymax Y-axis limits numbers
#nAFlagX Auto-scale on X 0 — off, 1 — on
#nAFlagY Auto-scale on Y 0 — off, 1 — on
#EditorFileName The external document editor path to an .exe
#sDrawTextFont The label font font parameters (name, size, etc.)
#sDrawTextColor The label text color a COLORREF number
#sDrawBckgrdColor The background color a COLORREF number (16777215 = white)
#sDrawAxiesColor The axis color a COLORREF number (0 = black)
#sDrawGridColor The grid color a COLORREF number
#sDrawPointColor Marker colors/parameters for 16 curves a list of numbers

Units. In the example rths25.soc there is #nXType 0 — meaning the X axis is in GHz, and the limits #Xmin 40, #Xmax 49.8 mean the range 40…49.8 GHz. The parameter #nYType 2 means the Y axis plots the magnitude |S|.

Curve description (a data line). The column format is given in the comment above it:

!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s   rths25.s     1        1      1    2      1
Column Value in the example Purpose
SFileName rths25.s The scattering-matrix file name (usually a relative path next to the .soc)
GraphicsName rths25.s The curve caption in the legend
DrawFlag 1 Show the curve: 1 — yes, 0 — no
Input1 1 The number of the first input of the S-matrix element
Mod1 1 The mode number of the first input
Input2 2 The number of the second input
Mod2 1 The mode number of the second input

So in the example an S-matrix element is built that links input 1 (mode 1) and input 2 (mode 1) — this is a "transmission" characteristic (transfer between two inputs).

For comparison — a simple document samples/SAMPLE_R/horns.soc:

#TMCGROUT
...
#nXType 0
#nYType 1
#Xmin -3.40282e+038
#Xmax -3.40282e+038
...
#nAFlagX 0
#nAFlagY 0
...
horns.s horns.s 1 1 1 1 1

Here #nYType 1 — the Y axis is losses in dB; the limits are set as -3.40282e+038 (this is "not set" / the smallest possible float number); the S-matrix element is input 1 (mode 1) input 1 (mode 1), that is, reflection from the first input.

If the file-name expression is enclosed in curly braces {...}, it means not a single file but an expression graph (computation of a curve by a formula over several .s files). This is an advanced feature; details are in the API documentation (docs/api/viewers/tmcgrout.md, the CTMCGrExpression class).

7.2. The .s scattering-matrix file

.s is a file with the scattering-matrix data itself: for a set of frequencies it stores complex values of the S-matrix elements. This is the result of a compute kernel (tmc_rth or tmc_rtx).

By structure the file is mixed — a text header plus numeric data. The beginning of the file (example rths25.s):

SMT 102

 TAMIC-RTH V 2.00
2 TAMIC_soft group. TAMIC Rt-H Planar Analyzer. 2000

 Tamic Output Signal Viewer
. E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.s
Element What it is
SMT 102 The S-matrix file marker and a point count/parameter (102)
TAMIC-RTH V 2.00 The version of the generating program (the compute kernel)
The TAMIC_soft group… line The developer's signature
. <path> The original path to the file
Then A block of frequencies and a block of complex S-parameter values (for each frequency — the values of the matrix elements)

The .s file is not meant for manual editing — it contains numbers written in binary. It should be opened through TMCGROUT, not a text editor.

7.3. How to obtain .s and .soc files

A .s file is created by a compute kernel when computing a planar structure. In brief (details are in docs/api/kernels/planar_rt_h.md and the kernel manuals):

  1. Prepare an input template file .tpl (the structure topology, parameters, the output section). In the OUTPUT section, output of the S-matrix must be enabled (the SMATRIX flag) and the output file name set.
  2. Launch a compute kernel: tmc_rth.exe (for H-polarization) or tmc_rtx.exe (for X-mode), open the .tpl in it and run the computation (Run All).
  3. On completion the kernel writes a .s file with the scattering matrix (the name is set in the output section).
  4. Open the resulting .s in TMCGROUT — the program will automatically create a .soc document next to it. Then configure the appearance and save (Ctrl+S).

Ready-made examples for practice are in samples/SAMPLE_R/ (for example, TEST_MET/EPS4/rths25.s + rths25.soc).


8. Possible problems and their solutions

Symptom Cause What to do
The caption Error_when_read… in the legend / graph area The .s file is not found, is empty or corrupted Check whether the .s file exists at the path given in the .soc; recompute it with the kernel
The graph is empty or the curve is not visible An unlucky scale is set, or the data is outside the window Press Auto X size and Auto Y size (Alt+X, Alt+Y) to fit the curve into the window
The curve is there but "runs off" the edge Manual limits Xmin/Xmax/Ymin/Ymax are set Open View → Viewport and check the limits, or enable auto-scale
After recomputing .s the graph did not update TMCGROUT shows the old data Press View → Redraw data (Ctrl+W) or the "Redraw" button
The curve is the same color as the background / hard to see The colors coincide Config → Color → Graphics — set a contrasting line color
Opened a .san extra .soc file was created (or .$OC) This is normal: a document for the .s is created automatically (if the .soc is already taken, .$OC is used) Save the settings into the desired .soc via File → Save As…
The file does not open — a message about "wrong format" The first line of the file is not #TMCGROUT (for a .soc) Make sure you are opening a correct document; the first line must be #TMCGROUT