Skip to content

Commit

Permalink
Moving static enums in json file
Browse files Browse the repository at this point in the history
  • Loading branch information
jharajeev55 committed Dec 4, 2024
1 parent f5b6fd6 commit 882f48e
Show file tree
Hide file tree
Showing 129 changed files with 1,463 additions and 3,612 deletions.
5 changes: 4 additions & 1 deletion Configuration.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Folder path of webhelp file
import os

class Confiurations:
class Configuration:
HELP_FILE_FOLDER_PATH = ""

MANUALLY_EXTRACTED_COMMANDS = {}
PARAMS_TYPES_DETAILS = {}

# model number
MODEL_NUMBER = ""

Expand Down
26 changes: 4 additions & 22 deletions Json_parser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ static void parse_commands_josn(string base_lib_dir, string json_file_path)

var triggerModelLoadCommands = cmdList.Where(cmd => cmd.name.Contains("trigger.model.load()")).ToList(); // get trigger.model.load() commands

var bufferMathCommand = cmdList.Where(cmd => cmd.name.Contains("buffer.math()")).ToList();

var triggerBlockConstenets = cmdList.Where(cmd => cmd.name.Contains("trigger.BLOCK_")).ToList();
cmdList = cmdList.Except(triggerBlockConstenets).ToList();

Expand All @@ -80,8 +78,7 @@ static void parse_commands_josn(string base_lib_dir, string json_file_path)

cmdList = cmdList.Except(triggerModelLoadCommands).ToList(); // remove all trigger.model.load() commands and handle it speratley

cmdList = cmdList.Except(bufferMathCommand).ToList(); // remove "buffer.math()" commands and handle it speratley


foreach (var cmd in cmdList)
{
string s = cmd.name;
Expand Down Expand Up @@ -116,7 +113,8 @@ static void parse_commands_josn(string base_lib_dir, string json_file_path)
outStr += Utility.PrintFields(MAX_DEPT, file_name, instrTable, false);
foreach (var cmd in directFunctioncommands)
{
//Utility.HelpContent(cmd, file_name, bool direct_function);
var cmd_info = new KeyValuePair<string, CommandInfo>(cmd.name, cmd);
outStr += Utility.HelpContent(cmd_info, file_name, "", true);
}

if (triggerModelLoadCommands.Count > 0)
Expand All @@ -140,19 +138,6 @@ static void parse_commands_josn(string base_lib_dir, string json_file_path)

}

if (bufferMathCommand.Count > 0)
{
var alias = Utility.create_tspLinkNode_enum_alias_type(bufferMathCommand[0].param_info[1]);
var header = Utility.get_command_header(bufferMathCommand[0], file_name);

outStr += alias + header;
tsplinkStr += alias + header;

Utility.append_buffermath_signature(ref outStr);
Utility.append_buffermath_signature(ref tsplinkStr);

}


if (file_name.Contains("26"))
{
Expand All @@ -168,16 +153,13 @@ static void parse_commands_josn(string base_lib_dir, string json_file_path)

}


var node_class_name = Regex.Replace(file_name, @"[^a-zA-Z0-9_]", "");

Directory.CreateDirectory(Path.Combine(base_lib_dir, model));
Directory.CreateDirectory(Path.Combine(base_lib_dir, model, "tspLinkSupportedCommands"));
Directory.CreateDirectory(Path.Combine(base_lib_dir, model, "AllTspCommands"));
Directory.CreateDirectory(Path.Combine(base_lib_dir, model, "Helper"));


var AllTspCommandsFilePath = $"{base_lib_dir}/{model}/AllTspCommands/definitions.lua";
var AllTspCommandsFilePath = $"{base_lib_dir}/{model}/AllTspCommands/definitions.lua";
var tspLinkSupportedCommandsFilePath = $"{base_lib_dir}/{model}/tspLinkSupportedCommands/definitions.txt";

var static_folder_Path = Path.Combine(base_lib_dir, model, "Helper");
Expand Down
8 changes: 8 additions & 0 deletions Json_parser/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"jsonToLuaParser": {
"commandName": "Project",
"commandLineArgs": "C:\\Users\\rjha\\source\\repos\\GitHub\\tsp-toolkit-webhelp-to-json\\data"
}
}
}
10 changes: 0 additions & 10 deletions Json_parser/StaticLuaDefinations/2450/bufferCustomUnit.lua

This file was deleted.

61 changes: 0 additions & 61 deletions Json_parser/StaticLuaDefinations/2450/bufferFileSaveDetails.lua

This file was deleted.

21 changes: 0 additions & 21 deletions Json_parser/StaticLuaDefinations/2450/bufferVarstatuses.lua

This file was deleted.

13 changes: 0 additions & 13 deletions Json_parser/StaticLuaDefinations/2450/buttonPressAlias.lua

This file was deleted.

16 changes: 0 additions & 16 deletions Json_parser/StaticLuaDefinations/2450/channelMatchType.lua

This file was deleted.

8 changes: 0 additions & 8 deletions Json_parser/StaticLuaDefinations/2450/displayText.lua

This file was deleted.

25 changes: 0 additions & 25 deletions Json_parser/StaticLuaDefinations/2450/display_BUTTON_OPTIONs.lua

This file was deleted.

10 changes: 5 additions & 5 deletions Json_parser/StaticLuaDefinations/2450/functionality.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---@meta
channel = {}
digio = {}
gpib = {}
serial = {}
tsplink = {}
local channel = {}
local digio = {}
local gpib = {}
local serial = {}
local tsplink = {}
---@alias functionality
---| `channel`
---| `digio`
Expand Down
32 changes: 0 additions & 32 deletions Json_parser/StaticLuaDefinations/2450/mathExpressAlias.lua

This file was deleted.

22 changes: 0 additions & 22 deletions Json_parser/StaticLuaDefinations/2450/readingStatus.lua

This file was deleted.

26 changes: 0 additions & 26 deletions Json_parser/StaticLuaDefinations/2450/setblockalias.lua

This file was deleted.

Loading

0 comments on commit 882f48e

Please sign in to comment.