From 4810ae34905d489eb3988eacd4913523392af4ea Mon Sep 17 00:00:00 2001 From: Dallas Strandell <41165864+argenate@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:15:31 -0800 Subject: [PATCH 1/6] Add RSA API and fix imports --- pkgs/flojoy/flojoy/__init__.py | 40 +- pkgs/flojoy/flojoy/instruments/__init__.py | 2 +- .../flojoy/instruments/tektronix/RSA_API.py | 509 ++++++++++++++++++ .../flojoy/instruments/tektronix/__init__.py | 3 +- .../flojoy/models/JobResults/__init__.py | 4 +- pkgs/flojoy/flojoy/models/__init__.py | 2 +- 6 files changed, 535 insertions(+), 25 deletions(-) create mode 100644 pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py diff --git a/pkgs/flojoy/flojoy/__init__.py b/pkgs/flojoy/flojoy/__init__.py index 2b61c5258..544dcc999 100644 --- a/pkgs/flojoy/flojoy/__init__.py +++ b/pkgs/flojoy/flojoy/__init__.py @@ -1,20 +1,20 @@ -from .data_container import * -from .flojoy_python import * -from .job_result_builder import * -from .flojoy_instruction import * -from .plotly_utils import * -from .module_scraper import * -from .job_result_utils import * -from .data_container import * -from .utils import * -from .parameter_types import * -from .small_memory import * -from .flojoy_node_venv import * -from .job_service import * -from .node_init import * -from .config import * -from .node_preflight import * -from .flojoy_cloud import * -from .instruments import * -from .models import * -from .connection_manager import * +from .data_container import * # noqa: F403 +from .flojoy_python import * # noqa: F403 +from .job_result_builder import * # noqa: F403 +from .flojoy_instruction import * # noqa: F403 +from .plotly_utils import * # noqa: F403 +from .module_scraper import * # noqa: F403 +from .job_result_utils import * # noqa: F403 +from .data_container import * # noqa: F403 +from .utils import * # noqa: F403 +from .parameter_types import * # noqa: F403 +from .small_memory import * # noqa: F403 +from .flojoy_node_venv import * # noqa: F403 +from .job_service import * # noqa: F403 +from .node_init import * # noqa: F403 +from .config import * # noqa: F403 +from .node_preflight import * # noqa: F403 +from .flojoy_cloud import * # noqa: F403 +from .instruments import * # noqa: F403 +from .models import * # noqa: F403 +from .connection_manager import * # noqa: F403 diff --git a/pkgs/flojoy/flojoy/instruments/__init__.py b/pkgs/flojoy/flojoy/instruments/__init__.py index ec819c0f4..4adaae25d 100644 --- a/pkgs/flojoy/flojoy/instruments/__init__.py +++ b/pkgs/flojoy/flojoy/instruments/__init__.py @@ -1 +1 @@ -from .tektronix import * +from .tektronix import * # noqa: F403 diff --git a/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py b/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py new file mode 100644 index 000000000..d6ce7a1aa --- /dev/null +++ b/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py @@ -0,0 +1,509 @@ +""" +Tektronix RSA_API .h file Python Conversion +Author: Morgan Allison +Date created: 5/17 +Date edited: 5/17 +Windows 7 64-bit +RSA API version 3.9.0029 +Python 3.6.0 64-bit (Anaconda 4.3.0) +Download Anaconda: http://continuum.io/downloads +Anaconda includes NumPy and MatPlotLib +Download the RSA_API: http://www.tek.com/model/rsa306-software +Download the RSA_API Documentation: +http://www.tek.com/spectrum-analyzer/rsa306-manual-6 + +YOU WILL NEED TO REFERENCE THE API DOCUMENTATION +""" + +from ctypes import * +from enum import Enum + +class RSAError(Exception): + pass + +class ReturnStatus(Enum): + noError = 0 + + # Connection + errorNotConnected = 101 + errorIncompatibleFirmware = 102 + errorBootLoaderNotRunning = 103 + errorTooManyBootLoadersConnected = 104 + errorRebootFailure = 105 + + # POST + errorPOSTFailureFPGALoad = 201 + errorPOSTFailureHiPower = 202 + errorPOSTFailureI2C = 203 + errorPOSTFailureGPIF = 204 + errorPOSTFailureUsbSpeed = 205 + errorPOSTDiagFailure = 206 + + # General Msmt + errorBufferAllocFailed = 301 + errorParameter = 302 + errorDataNotReady = 304 + + # Spectrum + errorParameterTraceLength = 1101 + errorMeasurementNotEnabled = 1102 + errorSpanIsLessThanRBW = 1103 + errorFrequencyOutOfRange = 1104 + + # IF streaming + errorStreamADCToDiskFileOpen = 1201 + errorStreamADCToDiskAlreadyStreaming = 1202 + errorStreamADCToDiskBadPath = 1203 + errorStreamADCToDiskThreadFailure = 1204 + errorStreamedFileInvalidHeader = 1205 + errorStreamedFileOpenFailure = 1206 + errorStreamingOperationNotSupported = 1207 + errorStreamingFastForwardTimeInvalid = 1208 + errorStreamingInvalidParameters = 1209 + errorStreamingEOF = 1210 + + # IQ streaming + errorIQStreamInvalidFileDataType = 1301 + errorIQStreamFileOpenFailed = 1302 + errorIQStreamBandwidthOutOfRange = 1303 + + # ----------------- + # Internal errors + # ----------------- + errorTimeout = 3001 + errorTransfer = 3002 + errorFileOpen = 3003 + errorFailed = 3004 + errorCRC = 3005 + errorChangeToFlashMode = 3006 + errorChangeToRunMode = 3007 + errorDSPLError = 3008 + errorLOLockFailure = 3009 + errorExternalReferenceNotEnabled = 3010 + errorLogFailure = 3011 + errorRegisterIO = 3012 + errorFileRead = 3013 + + errorDisconnectedDeviceRemoved = 3101 + errorDisconnectedDeviceNodeChangedAndRemoved = 3102 + errorDisconnectedTimeoutWaitingForADcData = 3103 + errorDisconnectedIOBeginTransfer = 3104 + errorOperationNotSupportedInSimMode = 3015 + + errorFPGAConfigureFailure = 3201 + errorCalCWNormFailure = 3202 + errorSystemAppDataDirectory = 3203 + errorFileCreateMRU = 3204 + errorDeleteUnsuitableCachePath = 3205 + errorUnableToSetFilePermissions = 3206 + errorCreateCachePath = 3207 + errorCreateCachePathBoost = 3208 + errorCreateCachePathStd = 3209 + errorCreateCachePathGen = 3210 + errorBufferLengthTooSmall = 3211 + errorRemoveCachePath = 3212 + errorGetCachingDirectoryBoost = 3213 + errorGetCachingDirectoryStd = 3214 + errorGetCachingDirectoryGen = 3215 + errorInconsistentFileSystem = 3216 + + errorWriteCalConfigHeader = 3301 + errorWriteCalConfigData = 3302 + errorReadCalConfigHeader = 3303 + errorReadCalConfigData = 3304 + errorEraseCalConfig = 3305 + errorCalConfigFileSize = 3306 + errorInvalidCalibConstantFileFormat = 3307 + errorMismatchCalibConstantsSize = 3308 + errorCalConfigInvalid = 3309 + + # flash + errorFlashFileSystemUnexpectedSize = 3401, + errorFlashFileSystemNotMounted = 3402 + errorFlashFileSystemOutOfRange = 3403 + errorFlashFileSystemIndexNotFound = 3404 + errorFlashFileSystemReadErrorCRC = 3405 + errorFlashFileSystemReadFileMissing = 3406 + errorFlashFileSystemCreateCacheIndex = 3407 + errorFlashFileSystemCreateCachedDataFile = 3408 + errorFlashFileSystemUnsupportedFileSize = 3409 + errorFlashFileSystemInsufficentSpace = 3410 + errorFlashFileSystemInconsistentState = 3411 + errorFlashFileSystemTooManyFiles = 3412 + errorFlashFileSystemImportFileNotFound = 3413 + errorFlashFileSystemImportFileReadError = 3414 + errorFlashFileSystemImportFileError = 3415 + errorFlashFileSystemFileNotFoundError = 3416 + errorFlashFileSystemReadBufferTooSmall = 3417 + errorFlashWriteFailure = 3418 + errorFlashReadFailure = 3419 + errorFlashFileSystemBadArgument = 3420 + errorFlashFileSystemCreateFile = 3421 + + # Aux monitoring + errorMonitoringNotSupported = 3501, + errorAuxDataNotAvailable = 3502 + + # battery + errorBatteryCommFailure = 3601 + errorBatteryChargerCommFailure = 3602 + errorBatteryNotPresent = 3603 + + # EST + errorESTOutputPathFile = 3701 + errorESTPathNotDirectory = 3702 + errorESTPathDoesntExist = 3703 + errorESTUnableToOpenLog = 3704 + errorESTUnableToOpenLimits = 3705 + + # Revision information + errorRevisionDataNotFound = 3801 + + # alignment + error112MHzAlignmentSignalLevelTooLow = 3901 + error10MHzAlignmentSignalLevelTooLow = 3902 + errorInvalidCalConstant = 3903 + errorNormalizationCacheInvalid = 3904 + errorInvalidAlignmentCache = 3905 + + # acq status + errorADCOverrange = 9000 # must not change the location of these error codes without coordinating with MFG TEST + errorOscUnlock = 9001 + + errorNotSupported = 9901 + + errorPlaceholder = 9999 + notImplemented = -1 + + +class Cplx32(Structure): + _fields_ = [('i', c_float), ('q', c_float)] + + +class CplxInt32(Structure): + _fields_ = [('i', c_int32), ('q', c_int32)] + + +class CplxInt16(Structure): + _fields_ = [('i', c_int16), ('q', c_int16)] + + +AcqDataStatus_ADC_OVERRANGE = 0x1 +AcqDataStatus_REF_OSC_UNLOCK = 0x2 +AcqDataStatus_LOW_SUPPLY_VOLTAGE = 0x10 +AcqDataStatus_ADC_DATA_LOST = 0x20 +AcqDataStatus_VALID_BITS_MASK = (AcqDataStatus_ADC_OVERRANGE or AcqDataStatus_REF_OSC_UNLOCK or AcqDataStatus_LOW_SUPPLY_VOLTAGE or AcqDataStatus_ADC_DATA_LOST) + + +class AcqDataStatus: + def __init__(self): + self.adcOverrange = 0x1 + self.refFreqUnlock = 0x2 + self.lo1Unlock = 0x4 + self.lo2Unlock = 0x8 + self.lowSupplyVoltage = 0x10 + self.adcDataLost = 0x20 + self.event1pps = 0x40 + self.eventTrig1 = 0x80 + self.eventTrig2 = 0x100 + + +DEVSRCH_MAX_NUM_DEVICES = 20 +DEVSRCH_SERIAL_MAX_STRLEN = 100 +DEVSRCH_TYPE_MAX_STRLEN = 20 +DEVINFO_MAX_STRLEN = 100 + + +class DEVICE_INFO(Structure): + _fields_ = [('nomenclature', c_char_p), + ('serialNum', c_char_p), + ('apiVersion', c_char_p), + ('fwVersion', c_char_p), + ('fpgaVersion', c_char_p), + ('hwVersion', c_char_p)] + + +class TriggerMode: + def __init__(self): + self.freeRun = c_int(0) + self.triggered = c_int(1) +TriggerMode = TriggerMode() + + +class TriggerSource: + def __init__(self): + self.TriggerSourceExternal = c_int(0) + self.TriggerSourceIFPowerLevel = c_int(1) +TriggerSource = TriggerSource() + + +class TriggerTransition: + def __init__(self): + self.TriggerTransitionLH = c_int(1) + self.TriggerTransitionHL = c_int(2) + self.TriggerTransitionEither = c_int(3) +TriggerTransition = TriggerTransition() + + +DEVEVENT_OVERRANGE = c_int(0) +DEVEVENT_TRIGGER = c_int(1) +DEVEVENT_1PPS = c_int(2) + + +class RunMode: + def __init__(self): + self.stopped = c_int(0) + self.running = c_int(1) +RunMode = RunMode() + + +IQBLK_STATUS_INPUT_OVERRANGE = (1 << 0) +IQBLK_STATUS_FREQREF_UNLOCKED = (1 << 1) +IQBLK_STATUS_ACQ_SYS_ERROR = (1 << 2) +IQBLK_STATUS_DATA_XFER_ERROR = (1 << 3) + + +class IQBLK_ACQINFO(Structure): + _fields_ = [('sample0Timestamp', c_uint64), + ('triggerSampleIndex', c_uint64), + ('triggerTimestamp', c_uint64), + ('acqStatus', c_uint32)] + + +class IQHeader(Structure): + _fields_ = [('acqDataStatus', c_uint16), + ('acquisitionTimestamp', c_uint64), + ('frameID', c_uint32), + ('trigger1Index', c_uint16), + ('trigger2Index', c_uint16), + ('timeSyncIndex', c_uint16)] + + +class SpectrumWindows: + def __init__(self): + self.SpectrumWindow_Kaiser = c_int(0) + self.SpectrumWindow_Mil6dB = c_int(1) + self.SpectrumWindow_BlackmanHarris = c_int(2) + self.SpectrumWindow_Rectangle = c_int(3) + self.SpectrumWindow_FlatTop = c_int(4) + self.SpectrumWindow_Hann = c_int(5) +SpectrumWindows = SpectrumWindows() + + +class SpectrumTraces: + def __init__(self): + self.SpectrumTrace1 = c_int(0) + self.SpectrumTrace2 = c_int(1) + self.SpectrumTrace3 = c_int(2) +SpectrumTraces = SpectrumTraces() + + +class SpectrumDetectors: + def __init__(self): + self.SpectrumDetector_PosPeak = c_int(0) + self.SpectrumDetector_NegPeak = c_int(1) + self.SpectrumDetector_AverageVRMS = c_int(2) + self.SpectrumDetector_Sample = c_int(3) +SpectrumDetectors = SpectrumDetectors() + + +class SpectrumVerticalUnits: + def __init__(self): + self.SpectrumVerticalUnit_dBm = c_int(0) + self.SpectrumVerticalUnit_Watt = c_int(1) + self.SpectrumVerticalUnit_Volt = c_int(2) + self.SpectrumVerticalUnit_Amp = c_int(3) + self.SpectrumVerticalUnit_dBmV = c_int(4) +SpectrumVerticalUnits = SpectrumVerticalUnits() + + +class Spectrum_Settings(Structure): + _fields_ = [('span', c_double), + ('rbw', c_double), + ('enableVBW', c_bool), + ('vbw', c_double), + ('traceLength', c_int), + ('window', c_int), + ('verticalUnit', c_int), + ('actualStartFreq', c_double), + ('actualStopFreq', c_double), + ('actualFreqStepSize', c_double), + ('actualRBW', c_double), + ('actualVBW', c_double), + ('actualNumIQSamples', c_double)] + + +class Spectrum_Limits(Structure): + _fields_ = [('maxSpan', c_double), + ('minSpan', c_double), + ('maxRBW', c_double), + ('minRBW', c_double), + ('maxVBW', c_double), + ('minVBW', c_double), + ('maxTraceLength', c_int), + ('minTraceLength', c_int)] + + +class Spectrum_TraceInfo(Structure): + _fields_ = [('timestamp', c_int64), + ('acqDataStatus', c_uint16)] + + +class DPX_FrameBuffer(Structure): + _fields_ = [('fftPerFrame', c_int32), + ('fftCount', c_int64), + ('frameCount', c_int64), + ('timestamp', c_double), + ('acqDataStatus', c_uint32), + ('minSigDuration', c_double), + ('minSigDurOutOfRange', c_bool), + ('spectrumBitmapWidth', c_int32), + ('spectrumBitmapHeight', c_int32), + ('spectrumBitmapSize', c_int32), + ('spectrumTraceLength', c_int32), + ('numSpectrumTraces', c_int32), + ('spectrumEnabled', c_bool), + ('spectrogramEnabled', c_bool), + ('spectrumBitmap', POINTER(c_float)), + ('spectrumTraces', POINTER(POINTER(c_float))), + ('sogramBitmapWidth', c_int32), + ('sogramBitmapHeight', c_int32), + ('sogramBitmapSize', c_int32), + ('sogramBitmapNumValidLines', c_int32), + ('sogramBitmap', POINTER(c_uint8)), + ('sogramBitmapTimestampArray', POINTER(c_double)), + ('sogramBitmapContainTriggerArray', POINTER(c_double))] + + +class DPX_SogramSettingStruct(Structure): + _fields_ = [('bitmapWidth', c_int32), + ('bitmapHeight', c_int32), + ('sogramTraceLineTime', c_double), + ('sogramBitmapLineTime', c_double)] + + +class DPX_SettingStruct(Structure): + _fields_ = [('enableSpectrum', c_bool), + ('enableSpectrogram', c_bool), + ('bitmapWidth', c_int32), + ('bitmapHeight', c_int32), + ('traceLength', c_int32), + ('decayFactor', c_float), + ('actualRBW', c_double)] + + +class TraceType: + def __init__(self): + self.TraceTypeAverage = c_int(0) + self.TraceTypeMax = c_int(1) + self.TraceTypeMaxHold = c_int(2) + self.TraceTypeMin = c_int(3) + self.TraceTypeMinHold = c_int(4) +TraceType = TraceType() + + +class VerticalUnitType: + def __init__(self): + self.VerticalUnit_dBm = c_int(0) + self.VerticalUnit_Watt = c_int(1) + self.VerticalUnit_Volt = c_int(2) + self.VerticalUnit_Amp = c_int(3) +VerticalUnitType = VerticalUnitType() + + +DPX_TRACEIDX_1 = c_int(0) +DPX_TRACEIDX_2 = c_int(1) +DPX_TRACEIDX_3 = c_int(2) + + +class AudioDemodMode: + def __init__(self): + self.ADM_FM_8KHZ = c_int(0) + self.ADM_FM_13KHZ = c_int(1) + self.ADM_FM_75KHZ = c_int(2) + self.ADM_FM_200KHZ = c_int(3) + self.ADM_AM_8KHZ = c_int(4) + self.ADM_NONE = c_int(5) # internal use only +AudioDemodMode = AudioDemodMode() + + +class StreamingMode: + def __init__(self): + self.StreamingModeRaw = c_int(0) + self.StreamingModeFormatted = c_int(1) +StreamingMode = StreamingMode() + + +class IQSOUTDEST: + def __init__(self): + self.IQSOD_CLIENT = c_int(0) + self.IQSOD_FILE_TIQ = c_int(1) + self.IQSOD_FILE_SIQ = c_int(2) + self.IQSOD_FILE_SIQ_SPLIT = c_int(3) +IQSOUTDEST = IQSOUTDEST() + + +class IQSOUTDTYPE: + def __init__(self): + self.IQSODT_SINGLE = c_int(0) + self.IQSODT_INT32 = c_int(1) + self.IQSODT_INT16 = c_int(2) +IQSOUTDTYPE = IQSOUTDTYPE() + + +IQSSDFN_SUFFIX_INCRINDEX_MIN = c_int(0) +IQSSDFN_SUFFIX_TIMESTAMP = c_int(-1) +IQSSDFN_SUFFIX_NONE = c_int(-2) + +IFSSDFN_SUFFIX_INCRINDEX_MIN = c_int(0) +IFSSDFN_SUFFIX_TIMESTAMP = c_int(-1) +IFSSDFN_SUFFIX_NONE = c_int(-2) + +IQSTRM_STATUS_OVERRANGE = (1 << 0) +IQSTRM_STATUS_XFER_DISCONTINUITY = (1 << 1) +IQSTRM_STATUS_IBUFF75PCT = (1 << 2) +IQSTRM_STATUS_IBUFFOVFLOW = (1 << 3) +IQSTRM_STATUS_OBUFF75PCT = (1 << 4) +IQSTRM_STATUS_OBUFFOVFLOW = (1 << 5) +IQSTRM_STATUS_NONSTICKY_SHIFT = 0 +IQSTRM_STATUS_STICKY_SHIFT = 16 + +IQSTRM_MAXTRIGGERS = 100 + + + +class IQSTRMIQINFO(Structure): + _fields_ = [('timestamp', c_uint64), + ('triggerCount', c_int), + ('triggerIndices', POINTER(c_int)), + ('scaleFactor', c_double), + ('acqStatus', c_uint32)] + + +class IQSTREAM_File_Info(Structure): + _fields_ = [('numberSamples', c_uint64), + ('sample0Timestamp', c_uint64), + ('triggerSampleIndex', c_uint64), + ('triggerTimestamp', c_uint64), + ('acqStatus', c_uint32), + ('filenames', c_wchar_p)] + + +class GNSS_SATSYS: + def __init__(self): + self.GNSS_NOSYS = c_int(0) + self.GNSS_GPS_GLONASS = c_int(1) + self.GNSS_GPS_BEIDOU = c_int(2) + self.GNSS_GPS = c_int(3) + self.GNSS_GLONASS = c_int(4) + self.GNSS_BEIDOU = c_int(5) +GNSS_SATSYS = GNSS_SATSYS() + + +class POWER_INFO(Structure): + _fields_ = [('externalPowerPresent', c_bool), + ('batteryPresent', c_bool), + ('batteryChargeLevel', c_double), + ('batteryCharging', c_bool), + ('batteryOverTemperature', c_bool), + ('batteryHardwareError', c_bool)] diff --git a/pkgs/flojoy/flojoy/instruments/tektronix/__init__.py b/pkgs/flojoy/flojoy/instruments/tektronix/__init__.py index 22da094dd..7227a0a54 100644 --- a/pkgs/flojoy/flojoy/instruments/tektronix/__init__.py +++ b/pkgs/flojoy/flojoy/instruments/tektronix/__init__.py @@ -1 +1,2 @@ -from .MDO30xx import * +from .MDO30xx import * # noqa: F403 +from .RSA_API import * # noqa: F403 diff --git a/pkgs/flojoy/flojoy/models/JobResults/__init__.py b/pkgs/flojoy/flojoy/models/JobResults/__init__.py index 24b06ac39..5712b43c4 100644 --- a/pkgs/flojoy/flojoy/models/JobResults/__init__.py +++ b/pkgs/flojoy/flojoy/models/JobResults/__init__.py @@ -1,2 +1,2 @@ -from .JobFailure import * -from .JobSuccess import * +from .JobFailure import * # noqa: F403 +from .JobSuccess import * # noqa: F403 diff --git a/pkgs/flojoy/flojoy/models/__init__.py b/pkgs/flojoy/flojoy/models/__init__.py index 989292723..73a964ae9 100644 --- a/pkgs/flojoy/flojoy/models/__init__.py +++ b/pkgs/flojoy/flojoy/models/__init__.py @@ -1 +1 @@ -from .JobResults import * +from .JobResults import * # noqa: F403 From 7df4f422de21a88c07467c991c12c3f6cd17d07e Mon Sep 17 00:00:00 2001 From: Dallas Strandell <41165864+argenate@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:20:46 -0800 Subject: [PATCH 2/6] imports --- .../flojoy/instruments/tektronix/RSA_API.py | 275 +++++++++++------- 1 file changed, 167 insertions(+), 108 deletions(-) diff --git a/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py b/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py index d6ce7a1aa..1242370c3 100644 --- a/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py +++ b/pkgs/flojoy/flojoy/instruments/tektronix/RSA_API.py @@ -15,12 +15,16 @@ YOU WILL NEED TO REFERENCE THE API DOCUMENTATION """ -from ctypes import * +from ctypes import c_char_p, c_float, c_int16, c_int32, c_int, c_uint64 +from ctypes import c_int64, c_double, c_bool, POINTER, c_uint32, c_uint16 +from ctypes import c_wchar_p, Structure, c_uint8 from enum import Enum + class RSAError(Exception): pass + class ReturnStatus(Enum): noError = 0 @@ -118,7 +122,7 @@ class ReturnStatus(Enum): errorCalConfigInvalid = 3309 # flash - errorFlashFileSystemUnexpectedSize = 3401, + errorFlashFileSystemUnexpectedSize = (3401,) errorFlashFileSystemNotMounted = 3402 errorFlashFileSystemOutOfRange = 3403 errorFlashFileSystemIndexNotFound = 3404 @@ -141,7 +145,7 @@ class ReturnStatus(Enum): errorFlashFileSystemCreateFile = 3421 # Aux monitoring - errorMonitoringNotSupported = 3501, + errorMonitoringNotSupported = (3501,) errorAuxDataNotAvailable = 3502 # battery @@ -177,22 +181,27 @@ class ReturnStatus(Enum): class Cplx32(Structure): - _fields_ = [('i', c_float), ('q', c_float)] + _fields_ = [("i", c_float), ("q", c_float)] class CplxInt32(Structure): - _fields_ = [('i', c_int32), ('q', c_int32)] + _fields_ = [("i", c_int32), ("q", c_int32)] class CplxInt16(Structure): - _fields_ = [('i', c_int16), ('q', c_int16)] + _fields_ = [("i", c_int16), ("q", c_int16)] AcqDataStatus_ADC_OVERRANGE = 0x1 AcqDataStatus_REF_OSC_UNLOCK = 0x2 AcqDataStatus_LOW_SUPPLY_VOLTAGE = 0x10 AcqDataStatus_ADC_DATA_LOST = 0x20 -AcqDataStatus_VALID_BITS_MASK = (AcqDataStatus_ADC_OVERRANGE or AcqDataStatus_REF_OSC_UNLOCK or AcqDataStatus_LOW_SUPPLY_VOLTAGE or AcqDataStatus_ADC_DATA_LOST) +AcqDataStatus_VALID_BITS_MASK = ( + AcqDataStatus_ADC_OVERRANGE + or AcqDataStatus_REF_OSC_UNLOCK + or AcqDataStatus_LOW_SUPPLY_VOLTAGE + or AcqDataStatus_ADC_DATA_LOST +) class AcqDataStatus: @@ -215,18 +224,22 @@ def __init__(self): class DEVICE_INFO(Structure): - _fields_ = [('nomenclature', c_char_p), - ('serialNum', c_char_p), - ('apiVersion', c_char_p), - ('fwVersion', c_char_p), - ('fpgaVersion', c_char_p), - ('hwVersion', c_char_p)] + _fields_ = [ + ("nomenclature", c_char_p), + ("serialNum", c_char_p), + ("apiVersion", c_char_p), + ("fwVersion", c_char_p), + ("fpgaVersion", c_char_p), + ("hwVersion", c_char_p), + ] class TriggerMode: def __init__(self): self.freeRun = c_int(0) self.triggered = c_int(1) + + TriggerMode = TriggerMode() @@ -234,6 +247,8 @@ class TriggerSource: def __init__(self): self.TriggerSourceExternal = c_int(0) self.TriggerSourceIFPowerLevel = c_int(1) + + TriggerSource = TriggerSource() @@ -242,6 +257,8 @@ def __init__(self): self.TriggerTransitionLH = c_int(1) self.TriggerTransitionHL = c_int(2) self.TriggerTransitionEither = c_int(3) + + TriggerTransition = TriggerTransition() @@ -254,29 +271,35 @@ class RunMode: def __init__(self): self.stopped = c_int(0) self.running = c_int(1) + + RunMode = RunMode() -IQBLK_STATUS_INPUT_OVERRANGE = (1 << 0) -IQBLK_STATUS_FREQREF_UNLOCKED = (1 << 1) -IQBLK_STATUS_ACQ_SYS_ERROR = (1 << 2) -IQBLK_STATUS_DATA_XFER_ERROR = (1 << 3) +IQBLK_STATUS_INPUT_OVERRANGE = 1 << 0 +IQBLK_STATUS_FREQREF_UNLOCKED = 1 << 1 +IQBLK_STATUS_ACQ_SYS_ERROR = 1 << 2 +IQBLK_STATUS_DATA_XFER_ERROR = 1 << 3 class IQBLK_ACQINFO(Structure): - _fields_ = [('sample0Timestamp', c_uint64), - ('triggerSampleIndex', c_uint64), - ('triggerTimestamp', c_uint64), - ('acqStatus', c_uint32)] + _fields_ = [ + ("sample0Timestamp", c_uint64), + ("triggerSampleIndex", c_uint64), + ("triggerTimestamp", c_uint64), + ("acqStatus", c_uint32), + ] class IQHeader(Structure): - _fields_ = [('acqDataStatus', c_uint16), - ('acquisitionTimestamp', c_uint64), - ('frameID', c_uint32), - ('trigger1Index', c_uint16), - ('trigger2Index', c_uint16), - ('timeSyncIndex', c_uint16)] + _fields_ = [ + ("acqDataStatus", c_uint16), + ("acquisitionTimestamp", c_uint64), + ("frameID", c_uint32), + ("trigger1Index", c_uint16), + ("trigger2Index", c_uint16), + ("timeSyncIndex", c_uint16), + ] class SpectrumWindows: @@ -287,6 +310,8 @@ def __init__(self): self.SpectrumWindow_Rectangle = c_int(3) self.SpectrumWindow_FlatTop = c_int(4) self.SpectrumWindow_Hann = c_int(5) + + SpectrumWindows = SpectrumWindows() @@ -295,6 +320,8 @@ def __init__(self): self.SpectrumTrace1 = c_int(0) self.SpectrumTrace2 = c_int(1) self.SpectrumTrace3 = c_int(2) + + SpectrumTraces = SpectrumTraces() @@ -304,6 +331,8 @@ def __init__(self): self.SpectrumDetector_NegPeak = c_int(1) self.SpectrumDetector_AverageVRMS = c_int(2) self.SpectrumDetector_Sample = c_int(3) + + SpectrumDetectors = SpectrumDetectors() @@ -314,82 +343,93 @@ def __init__(self): self.SpectrumVerticalUnit_Volt = c_int(2) self.SpectrumVerticalUnit_Amp = c_int(3) self.SpectrumVerticalUnit_dBmV = c_int(4) + + SpectrumVerticalUnits = SpectrumVerticalUnits() class Spectrum_Settings(Structure): - _fields_ = [('span', c_double), - ('rbw', c_double), - ('enableVBW', c_bool), - ('vbw', c_double), - ('traceLength', c_int), - ('window', c_int), - ('verticalUnit', c_int), - ('actualStartFreq', c_double), - ('actualStopFreq', c_double), - ('actualFreqStepSize', c_double), - ('actualRBW', c_double), - ('actualVBW', c_double), - ('actualNumIQSamples', c_double)] + _fields_ = [ + ("span", c_double), + ("rbw", c_double), + ("enableVBW", c_bool), + ("vbw", c_double), + ("traceLength", c_int), + ("window", c_int), + ("verticalUnit", c_int), + ("actualStartFreq", c_double), + ("actualStopFreq", c_double), + ("actualFreqStepSize", c_double), + ("actualRBW", c_double), + ("actualVBW", c_double), + ("actualNumIQSamples", c_double), + ] class Spectrum_Limits(Structure): - _fields_ = [('maxSpan', c_double), - ('minSpan', c_double), - ('maxRBW', c_double), - ('minRBW', c_double), - ('maxVBW', c_double), - ('minVBW', c_double), - ('maxTraceLength', c_int), - ('minTraceLength', c_int)] + _fields_ = [ + ("maxSpan", c_double), + ("minSpan", c_double), + ("maxRBW", c_double), + ("minRBW", c_double), + ("maxVBW", c_double), + ("minVBW", c_double), + ("maxTraceLength", c_int), + ("minTraceLength", c_int), + ] class Spectrum_TraceInfo(Structure): - _fields_ = [('timestamp', c_int64), - ('acqDataStatus', c_uint16)] + _fields_ = [("timestamp", c_int64), ("acqDataStatus", c_uint16)] class DPX_FrameBuffer(Structure): - _fields_ = [('fftPerFrame', c_int32), - ('fftCount', c_int64), - ('frameCount', c_int64), - ('timestamp', c_double), - ('acqDataStatus', c_uint32), - ('minSigDuration', c_double), - ('minSigDurOutOfRange', c_bool), - ('spectrumBitmapWidth', c_int32), - ('spectrumBitmapHeight', c_int32), - ('spectrumBitmapSize', c_int32), - ('spectrumTraceLength', c_int32), - ('numSpectrumTraces', c_int32), - ('spectrumEnabled', c_bool), - ('spectrogramEnabled', c_bool), - ('spectrumBitmap', POINTER(c_float)), - ('spectrumTraces', POINTER(POINTER(c_float))), - ('sogramBitmapWidth', c_int32), - ('sogramBitmapHeight', c_int32), - ('sogramBitmapSize', c_int32), - ('sogramBitmapNumValidLines', c_int32), - ('sogramBitmap', POINTER(c_uint8)), - ('sogramBitmapTimestampArray', POINTER(c_double)), - ('sogramBitmapContainTriggerArray', POINTER(c_double))] + _fields_ = [ + ("fftPerFrame", c_int32), + ("fftCount", c_int64), + ("frameCount", c_int64), + ("timestamp", c_double), + ("acqDataStatus", c_uint32), + ("minSigDuration", c_double), + ("minSigDurOutOfRange", c_bool), + ("spectrumBitmapWidth", c_int32), + ("spectrumBitmapHeight", c_int32), + ("spectrumBitmapSize", c_int32), + ("spectrumTraceLength", c_int32), + ("numSpectrumTraces", c_int32), + ("spectrumEnabled", c_bool), + ("spectrogramEnabled", c_bool), + ("spectrumBitmap", POINTER(c_float)), + ("spectrumTraces", POINTER(POINTER(c_float))), + ("sogramBitmapWidth", c_int32), + ("sogramBitmapHeight", c_int32), + ("sogramBitmapSize", c_int32), + ("sogramBitmapNumValidLines", c_int32), + ("sogramBitmap", POINTER(c_uint8)), + ("sogramBitmapTimestampArray", POINTER(c_double)), + ("sogramBitmapContainTriggerArray", POINTER(c_double)), + ] class DPX_SogramSettingStruct(Structure): - _fields_ = [('bitmapWidth', c_int32), - ('bitmapHeight', c_int32), - ('sogramTraceLineTime', c_double), - ('sogramBitmapLineTime', c_double)] + _fields_ = [ + ("bitmapWidth", c_int32), + ("bitmapHeight", c_int32), + ("sogramTraceLineTime", c_double), + ("sogramBitmapLineTime", c_double), + ] class DPX_SettingStruct(Structure): - _fields_ = [('enableSpectrum', c_bool), - ('enableSpectrogram', c_bool), - ('bitmapWidth', c_int32), - ('bitmapHeight', c_int32), - ('traceLength', c_int32), - ('decayFactor', c_float), - ('actualRBW', c_double)] + _fields_ = [ + ("enableSpectrum", c_bool), + ("enableSpectrogram", c_bool), + ("bitmapWidth", c_int32), + ("bitmapHeight", c_int32), + ("traceLength", c_int32), + ("decayFactor", c_float), + ("actualRBW", c_double), + ] class TraceType: @@ -399,6 +439,8 @@ def __init__(self): self.TraceTypeMaxHold = c_int(2) self.TraceTypeMin = c_int(3) self.TraceTypeMinHold = c_int(4) + + TraceType = TraceType() @@ -408,6 +450,8 @@ def __init__(self): self.VerticalUnit_Watt = c_int(1) self.VerticalUnit_Volt = c_int(2) self.VerticalUnit_Amp = c_int(3) + + VerticalUnitType = VerticalUnitType() @@ -424,6 +468,8 @@ def __init__(self): self.ADM_FM_200KHZ = c_int(3) self.ADM_AM_8KHZ = c_int(4) self.ADM_NONE = c_int(5) # internal use only + + AudioDemodMode = AudioDemodMode() @@ -431,6 +477,8 @@ class StreamingMode: def __init__(self): self.StreamingModeRaw = c_int(0) self.StreamingModeFormatted = c_int(1) + + StreamingMode = StreamingMode() @@ -440,6 +488,8 @@ def __init__(self): self.IQSOD_FILE_TIQ = c_int(1) self.IQSOD_FILE_SIQ = c_int(2) self.IQSOD_FILE_SIQ_SPLIT = c_int(3) + + IQSOUTDEST = IQSOUTDEST() @@ -448,6 +498,8 @@ def __init__(self): self.IQSODT_SINGLE = c_int(0) self.IQSODT_INT32 = c_int(1) self.IQSODT_INT16 = c_int(2) + + IQSOUTDTYPE = IQSOUTDTYPE() @@ -459,34 +511,37 @@ def __init__(self): IFSSDFN_SUFFIX_TIMESTAMP = c_int(-1) IFSSDFN_SUFFIX_NONE = c_int(-2) -IQSTRM_STATUS_OVERRANGE = (1 << 0) -IQSTRM_STATUS_XFER_DISCONTINUITY = (1 << 1) -IQSTRM_STATUS_IBUFF75PCT = (1 << 2) -IQSTRM_STATUS_IBUFFOVFLOW = (1 << 3) -IQSTRM_STATUS_OBUFF75PCT = (1 << 4) -IQSTRM_STATUS_OBUFFOVFLOW = (1 << 5) +IQSTRM_STATUS_OVERRANGE = 1 << 0 +IQSTRM_STATUS_XFER_DISCONTINUITY = 1 << 1 +IQSTRM_STATUS_IBUFF75PCT = 1 << 2 +IQSTRM_STATUS_IBUFFOVFLOW = 1 << 3 +IQSTRM_STATUS_OBUFF75PCT = 1 << 4 +IQSTRM_STATUS_OBUFFOVFLOW = 1 << 5 IQSTRM_STATUS_NONSTICKY_SHIFT = 0 IQSTRM_STATUS_STICKY_SHIFT = 16 IQSTRM_MAXTRIGGERS = 100 - class IQSTRMIQINFO(Structure): - _fields_ = [('timestamp', c_uint64), - ('triggerCount', c_int), - ('triggerIndices', POINTER(c_int)), - ('scaleFactor', c_double), - ('acqStatus', c_uint32)] + _fields_ = [ + ("timestamp", c_uint64), + ("triggerCount", c_int), + ("triggerIndices", POINTER(c_int)), + ("scaleFactor", c_double), + ("acqStatus", c_uint32), + ] class IQSTREAM_File_Info(Structure): - _fields_ = [('numberSamples', c_uint64), - ('sample0Timestamp', c_uint64), - ('triggerSampleIndex', c_uint64), - ('triggerTimestamp', c_uint64), - ('acqStatus', c_uint32), - ('filenames', c_wchar_p)] + _fields_ = [ + ("numberSamples", c_uint64), + ("sample0Timestamp", c_uint64), + ("triggerSampleIndex", c_uint64), + ("triggerTimestamp", c_uint64), + ("acqStatus", c_uint32), + ("filenames", c_wchar_p), + ] class GNSS_SATSYS: @@ -497,13 +552,17 @@ def __init__(self): self.GNSS_GPS = c_int(3) self.GNSS_GLONASS = c_int(4) self.GNSS_BEIDOU = c_int(5) + + GNSS_SATSYS = GNSS_SATSYS() class POWER_INFO(Structure): - _fields_ = [('externalPowerPresent', c_bool), - ('batteryPresent', c_bool), - ('batteryChargeLevel', c_double), - ('batteryCharging', c_bool), - ('batteryOverTemperature', c_bool), - ('batteryHardwareError', c_bool)] + _fields_ = [ + ("externalPowerPresent", c_bool), + ("batteryPresent", c_bool), + ("batteryChargeLevel", c_double), + ("batteryCharging", c_bool), + ("batteryOverTemperature", c_bool), + ("batteryHardwareError", c_bool), + ] From 7113311a8a46029f91fd16f3f8f72f5ca15aff8b Mon Sep 17 00:00:00 2001 From: Dallas Strandell <41165864+argenate@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:25:18 -0800 Subject: [PATCH 3/6] imports 2 --- pkgs/flojoy/flojoy/__init__.pyi | 35 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/pkgs/flojoy/flojoy/__init__.pyi b/pkgs/flojoy/flojoy/__init__.pyi index 7c7db35a2..97e3eafe9 100644 --- a/pkgs/flojoy/flojoy/__init__.pyi +++ b/pkgs/flojoy/flojoy/__init__.pyi @@ -1,22 +1,21 @@ from typing import Optional, Any, TypedDict -from .data_container import * -from .flojoy_python import * -from .job_result_builder import * -from .flojoy_instruction import * -from .plotly_utils import * -from .module_scraper import * -from .job_result_utils import * -from .utils import * -from .parameter_types import * -from .small_memory import * -from .flojoy_node_venv import * -from .job_service import * -from .node_init import * -from .node_preflight import * -from .data_container import * -from .config import * -from .flojoy_cloud import * -from .models import * +from .data_container import * # noqa: F403 +from .flojoy_python import * # noqa: F403 +from .job_result_builder import * # noqa: F403 +from .flojoy_instruction import * # noqa: F403 +from .plotly_utils import * # noqa: F403 +from .module_scraper import * # noqa: F403 +from .job_result_utils import * # noqa: F403 +from .utils import * # noqa: F403 +from .parameter_types import * # noqa: F403 +from .small_memory import * # noqa: F403 +from .flojoy_node_venv import * # noqa: F403 +from .job_service import * # noqa: F403 +from .node_init import * # noqa: F403 +from .node_preflight import * # noqa: F403 +from .config import * # noqa: F403 +from .flojoy_cloud import * # noqa: F403 +from .models import * # noqa: F403 def flojoy( original_function: Callable[..., DataContainer | dict[str, Any] | TypedDict | None] From 792b53f0837284d60e4737468f8caf73b97546ee Mon Sep 17 00:00:00 2001 From: Dallas Strandell <41165864+argenate@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:26:05 -0800 Subject: [PATCH 4/6] imports 3 --- pkgs/flojoy/flojoy/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/flojoy/flojoy/__init__.pyi b/pkgs/flojoy/flojoy/__init__.pyi index 97e3eafe9..4c7e1c1fe 100644 --- a/pkgs/flojoy/flojoy/__init__.pyi +++ b/pkgs/flojoy/flojoy/__init__.pyi @@ -18,11 +18,11 @@ from .flojoy_cloud import * # noqa: F403 from .models import * # noqa: F403 def flojoy( - original_function: Callable[..., DataContainer | dict[str, Any] | TypedDict | None] + original_function: Callable[..., DataContainer | dict[str, Any] | TypedDict | None] # noqa: F405 | None = None, *, node_type: Optional[str] = None, deps: Optional[list[str]] = None, inject_node_metadata: bool = False, inject_connection: bool = False, -) -> Callable[..., DataContainer | dict[str, Any] | None]: ... +) -> Callable[..., DataContainer | dict[str, Any] | None]: ... # noqa: F405 From 501927a33b3e077ad18c4a8f4665cf508c758cdd Mon Sep 17 00:00:00 2001 From: Dallas Strandell <41165864+argenate@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:41:32 -0800 Subject: [PATCH 5/6] remove cloud app and fix images --- src/renderer/data/apps/images.json | 514 ++++++++++++++-------------- src/renderer/data/apps/index.ts | 2 +- src/renderer/utils/GalleryLoader.ts | 26 +- 3 files changed, 280 insertions(+), 262 deletions(-) diff --git a/src/renderer/data/apps/images.json b/src/renderer/data/apps/images.json index 5751bc1a4..59bc2f4bd 100644 --- a/src/renderer/data/apps/images.json +++ b/src/renderer/data/apps/images.json @@ -1,261 +1,279 @@ { - "name": "Intro to images", - "rfInstance": { - "nodes": [ - { - "width": 380, - "height": 293, - "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "type": "VISUALIZERS", - "data": { - "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "label": "IMAGE", - "func": "IMAGE", - "type": "VISUALIZERS", - "ctrls": {}, - "inputs": [ + "name": "Intro to Images", + "rfInstance": { + "nodes": [ { - "name": "default", - "id": "default", - "type": "Image", - "multiple": false - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Plotly" - } - ], - "path": "PYTHON/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.py", - "selected": false - }, - "position": { - "x": 1045.9840067988252, - "y": 152.56873926010599 - }, - "selected": false, - "positionAbsolute": { - "x": 1045.9840067988252, - "y": 152.56873926010599 - }, - "dragging": true - }, - { - "width": 380, - "height": 293, - "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "type": "VISUALIZERS", - "data": { - "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "label": "IMAGE 1", - "func": "IMAGE", - "type": "VISUALIZERS", - "ctrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "Image", - "multiple": false - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Plotly" - } - ], - "path": "PYTHON/nodes/VISUALIZERS/PLOTLY/IMAGE/IMAGE.py", - "selected": false - }, - "position": { - "x": 662.8988425018024, - "y": 513.5775685841171 - }, - "selected": false, - "positionAbsolute": { - "x": 662.8988425018024, - "y": 513.5775685841171 - }, - "dragging": true - }, - { - "width": 160, - "height": 160, - "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "type": "LOADERS", - "data": { - "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "label": "LOCAL FILE", - "func": "LOCAL_FILE", - "type": "LOADERS", - "ctrls": { - "file_path": { - "type": "str", - "default": null, - "desc": "path to the file to be loaded", - "functionName": "LOCAL_FILE", - "param": "file_path", - "value": "" - }, - "file_type": { - "type": "select", - "default": "Image", - "options": ["Image", "Grayscale", "JSON", "CSV", "Excel", "XML"], - "desc": "type of file to load, default = image", - "functionName": "LOCAL_FILE", - "param": "file_type", - "value": "Image" - } - }, - "initCtrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "String", - "multiple": false, - "desc": "If this input node is connected, the filename will be taken from\nthe output of the connected node. To be used in conjunction with batch processing" - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Image|DataFrame", - "desc": "Image for file_type 'image'\nDataFrame for file_type 'json', 'csv', 'excel', 'xml'" - } - ], - "pip_dependencies": [ - { - "name": "xlrd", - "v": "2.0.1" + "width": 380, + "height": 293, + "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "type": "VISUALIZERS", + "data": { + "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "label": "IMAGE", + "func": "IMAGE", + "type": "VISUALIZERS", + "ctrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Image|Grayscale", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Image visualization of the input image" + } + ], + "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", + "selected": false + }, + "position": { + "x": 1045.9840067988252, + "y": 152.56873926010599 + }, + "selected": false, + "positionAbsolute": { + "x": 1045.9840067988252, + "y": 152.56873926010599 + }, + "dragging": true }, { - "name": "lxml", - "v": "4.9.2" + "width": 380, + "height": 293, + "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "type": "VISUALIZERS", + "data": { + "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "label": "IMAGE 1", + "func": "IMAGE", + "type": "VISUALIZERS", + "ctrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Image|Grayscale", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Image visualization of the input image" + } + ], + "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", + "selected": false + }, + "position": { + "x": 662.8988425018024, + "y": 513.5775685841171 + }, + "selected": false, + "positionAbsolute": { + "x": 662.8988425018024, + "y": 513.5775685841171 + }, + "dragging": true }, { - "name": "openpyxl", - "v": "3.0.10" + "width": 160, + "height": 160, + "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "type": "LOADERS", + "data": { + "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "label": "LOCAL FILE", + "func": "LOCAL_FILE", + "type": "LOADERS", + "ctrls": { + "file_path": { + "type": "str", + "default": null, + "desc": "The path to the file to be loaded. This can be either an absolute path or\na path relative to the \"nodes\" directory.", + "functionName": "LOCAL_FILE", + "param": "file_path", + "value": "", + "overload": null + }, + "file_type": { + "type": "select", + "default": "Image", + "options": [ + "Image", + "Grayscale", + "JSON", + "CSV" + ], + "desc": "Type of file to load, default = image.\nIf both 'file_path' and 'default' are not specified when 'file_type=\"Image\"',\na default image will be loaded.\nIf the file path is not specified and the default input is not connected,\na ValueError is raised.", + "functionName": "LOCAL_FILE", + "param": "file_type", + "value": "Image", + "overload": null + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "String", + "multiple": false, + "desc": "If this input node is connected, the file name will be taken from\nthe output of the connected node.\nTo be used in conjunction with batch processing." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Image|DataFrame|Grayscale", + "desc": "Image for file_type 'image'.\nGrayscale from file_type 'Grayscale'.\nDataFrame for file_type 'json', 'csv'." + } + ], + "pip_dependencies": [ + { + "name": "xlrd", + "v": "2.0.1" + }, + { + "name": "lxml", + "v": "4.9.2" + }, + { + "name": "openpyxl", + "v": "3.0.10" + }, + { + "name": "scikit-image", + "v": "0.21.0" + } + ], + "path": "ETL/LOAD/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.py", + "selected": false + }, + "position": { + "x": 343.70355652854136, + "y": 302.735725612874 + }, + "selected": false, + "positionAbsolute": { + "x": 343.70355652854136, + "y": 302.735725612874 + }, + "dragging": true }, { - "name": "scikit-image", - "v": "0.21.0" - } - ], - "path": "PYTHON/nodes/LOADERS/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.py", - "selected": false - }, - "position": { - "x": 343.70355652854136, - "y": 302.735725612874 - }, - "selected": false, - "positionAbsolute": { - "x": 343.70355652854136, - "y": 302.735725612874 - }, - "dragging": true - }, - { - "width": 189, - "height": 160, - "id": "IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2c", - "type": "TRANSFORMERS", - "data": { - "id": "IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2c", - "label": "IMAGE SMOOTHING", - "func": "IMAGE_SMOOTHING", - "type": "TRANSFORMERS", - "ctrls": { - "kernel": { - "type": "int", - "default": 5, - "desc": "The strength of the smoothing (larger = stronger smoothing).", - "functionName": "IMAGE_SMOOTHING", - "param": "kernel", - "value": 5 - }, - "smoothing_type": { - "type": "select", - "default": "average", - "options": ["average", "gaussian", "median", "bilateral"], - "desc": "The type of smoothing function to use.", - "functionName": "IMAGE_SMOOTHING", - "param": "smoothing_type", - "value": "average" + "width": 150, + "height": 180, + "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "type": "COMPUTER_VISION", + "data": { + "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "label": "IMAGE SMOOTHING", + "func": "IMAGE_SMOOTHING", + "type": "COMPUTER_VISION", + "ctrls": { + "kernel": { + "type": "int", + "default": 5, + "desc": "The strength of the smoothing (larger = stronger smoothing).", + "overload": null, + "functionName": "IMAGE_SMOOTHING", + "param": "kernel", + "value": 10 + }, + "smoothing_type": { + "type": "select", + "options": [ + "average", + "gaussian", + "median", + "bilateral" + ], + "default": "average", + "desc": "The type of smoothing function to use.", + "overload": null, + "functionName": "IMAGE_SMOOTHING", + "param": "smoothing_type", + "value": "average" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Image", + "multiple": false, + "desc": "The input image to apply smoothing to." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Image", + "desc": "The smoothed image." + } + ], + "pip_dependencies": [ + { + "name": "opencv-python-headless", + "v": "4.8.1.78" + } + ], + "path": "COMPUTER_VISION/IMAGE_SMOOTHING/IMAGE_SMOOTHING.py" + }, + "position": { + "x": 716.1329930780284, + "y": 184.36374527852246 + }, + "selected": false, + "positionAbsolute": { + "x": 716.1329930780284, + "y": 184.36374527852246 + }, + "dragging": true } - }, - "initCtrls": {}, - "inputs": [ + ], + "edges": [ { - "name": "default", - "id": "default", - "type": "Image", - "multiple": false, - "desc": "The input image to apply smoothing to." - } - ], - "outputs": [ + "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "sourceHandle": "default", + "target": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "targetHandle": "default", + "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94cdefault" + }, { - "name": "default", - "id": "default", - "type": "Image", - "desc": "The smoothed image." - } - ], - "pip_dependencies": [ + "source": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "sourceHandle": "default", + "target": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "targetHandle": "default", + "id": "reactflow__edge-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default-IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181default" + }, { - "name": "opencv-python", - "v": "4.8.0.76" + "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "sourceHandle": "default", + "target": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "targetHandle": "default", + "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default" } - ], - "path": "PYTHON/nodes/TRANSFORMERS/IMAGE_PROCESSING/IMAGE_SMOOTHING/IMAGE_SMOOTHING.py", - "selected": false - }, - "position": { - "x": 729.1384081129287, - "y": 180.79333305981027 - }, - "selected": false, - "positionAbsolute": { - "x": 729.1384081129287, - "y": 180.79333305981027 - }, - "dragging": true - } - ], - "edges": [ - { - "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "sourceHandle": "default", - "target": "IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2c", - "targetHandle": "default", - "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2cdefault" - }, - { - "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "sourceHandle": "default", - "target": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "targetHandle": "default", - "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94cdefault" - }, - { - "source": "IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2c", - "sourceHandle": "default", - "target": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "targetHandle": "default", - "id": "reactflow__edge-IMAGE_SMOOTHING-9f184b61-e8a5-4202-9d9d-709da0673f2cdefault-IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181default" - } - ], - "viewport": { - "x": 0, - "y": 0, - "zoom": 1 - } - } -} + ], + "viewport": { + "x": 0, + "y": 0, + "zoom": 1 + } + }, + "textNodes": [] +} \ No newline at end of file diff --git a/src/renderer/data/apps/index.ts b/src/renderer/data/apps/index.ts index 083e70158..83208542b 100644 --- a/src/renderer/data/apps/index.ts +++ b/src/renderer/data/apps/index.ts @@ -1,6 +1,6 @@ export { default as arduino } from "./arduino.json"; export { default as butterworth } from "./butterworth.json"; -export { default as cloud } from "./cloud.json"; +// export { default as cloud } from "./cloud.json"; export { default as fft } from "./fft.json"; export { default as fir } from "./fir.json"; export { default as flojoy } from "./flojoy.json"; diff --git a/src/renderer/utils/GalleryLoader.ts b/src/renderer/utils/GalleryLoader.ts index dfcbff824..39868826f 100644 --- a/src/renderer/utils/GalleryLoader.ts +++ b/src/renderer/utils/GalleryLoader.ts @@ -36,19 +36,19 @@ const data: GalleryData = { ], cloudDemoEnabled: true, }, - { - title: "Stream to Flojoy Cloud", - description: "Stream data to your Flojoy Cloud account", - imagePath: "assets/appGallery/flojoyCloud.png", - appPath: "cloud", - relevantNodes: [ - { - name: "FLOJOY_CLOUD_UPLOAD", - docs: "https://docs.flojoy.ai/nodes/LOADERS/CLOUD_DATABASE/FLOJOY_CLOUD_UPLOAD/", - }, - ], - cloudDemoEnabled: false, - }, + // { + // title: "Stream to Flojoy Cloud", + // description: "Stream data to your Flojoy Cloud account", + // imagePath: "assets/appGallery/flojoyCloud.png", + // appPath: "cloud", + // relevantNodes: [ + // { + // name: "FLOJOY_CLOUD_UPLOAD", + // docs: "https://docs.flojoy.ai/nodes/LOADERS/CLOUD_DATABASE/FLOJOY_CLOUD_UPLOAD/", + // }, + // ], + // cloudDemoEnabled: false, + // }, ], AI: [ { From 1b5329d6b07f79a4ffb26d2d18bc2b3ac19d0361 Mon Sep 17 00:00:00 2001 From: JeffDotPng Date: Tue, 5 Dec 2023 14:14:37 -0500 Subject: [PATCH 6/6] format --- src/renderer/context/socket.context.tsx | 20 +- src/renderer/data/apps/images.json | 522 +++++++++--------- .../routes/flow_chart/FlowChartTabView.tsx | 11 +- .../node-edit-menu/DeviceSelect.tsx | 1 - src/renderer/utils/NodeUtils.ts | 44 +- 5 files changed, 302 insertions(+), 296 deletions(-) diff --git a/src/renderer/context/socket.context.tsx b/src/renderer/context/socket.context.tsx index 9ca175515..747a0963d 100644 --- a/src/renderer/context/socket.context.tsx +++ b/src/renderer/context/socket.context.tsx @@ -60,12 +60,12 @@ export const SocketContextProvider = ({ const handleStateChange = (state: keyof States) => - (value: string | number | Record | IServerStatus) => { - setStates((prev) => ({ - ...prev, - [state]: value, - })); - }; + (value: string | number | Record | IServerStatus) => { + setStates((prev) => ({ + ...prev, + [state]: value, + })); + }; useEffect(() => { if (!socket) { @@ -97,7 +97,13 @@ export const SocketContextProvider = ({ }); setSocket(ws); } - }, [fetchManifest, fetchMetadata, hardwareRefetch, socket, setManifestChanged]); + }, [ + fetchManifest, + fetchMetadata, + hardwareRefetch, + socket, + setManifestChanged, + ]); const values = useMemo( () => ({ states: { diff --git a/src/renderer/data/apps/images.json b/src/renderer/data/apps/images.json index 59bc2f4bd..8ffb69f8f 100644 --- a/src/renderer/data/apps/images.json +++ b/src/renderer/data/apps/images.json @@ -1,279 +1,269 @@ { - "name": "Intro to Images", - "rfInstance": { - "nodes": [ + "name": "Intro to Images", + "rfInstance": { + "nodes": [ + { + "width": 380, + "height": 293, + "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "type": "VISUALIZERS", + "data": { + "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "label": "IMAGE", + "func": "IMAGE", + "type": "VISUALIZERS", + "ctrls": {}, + "inputs": [ { - "width": 380, - "height": 293, - "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "type": "VISUALIZERS", - "data": { - "id": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "label": "IMAGE", - "func": "IMAGE", - "type": "VISUALIZERS", - "ctrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "Image|Grayscale", - "multiple": false, - "desc": "the DataContainer to be visualized" - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Plotly", - "desc": "the DataContainer containing the Plotly Image visualization of the input image" - } - ], - "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", - "selected": false - }, - "position": { - "x": 1045.9840067988252, - "y": 152.56873926010599 - }, - "selected": false, - "positionAbsolute": { - "x": 1045.9840067988252, - "y": 152.56873926010599 - }, - "dragging": true - }, + "name": "default", + "id": "default", + "type": "Image|Grayscale", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ { - "width": 380, - "height": 293, - "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "type": "VISUALIZERS", - "data": { - "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "label": "IMAGE 1", - "func": "IMAGE", - "type": "VISUALIZERS", - "ctrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "Image|Grayscale", - "multiple": false, - "desc": "the DataContainer to be visualized" - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Plotly", - "desc": "the DataContainer containing the Plotly Image visualization of the input image" - } - ], - "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", - "selected": false - }, - "position": { - "x": 662.8988425018024, - "y": 513.5775685841171 - }, - "selected": false, - "positionAbsolute": { - "x": 662.8988425018024, - "y": 513.5775685841171 - }, - "dragging": true - }, + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Image visualization of the input image" + } + ], + "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", + "selected": false + }, + "position": { + "x": 1045.9840067988252, + "y": 152.56873926010599 + }, + "selected": false, + "positionAbsolute": { + "x": 1045.9840067988252, + "y": 152.56873926010599 + }, + "dragging": true + }, + { + "width": 380, + "height": 293, + "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "type": "VISUALIZERS", + "data": { + "id": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "label": "IMAGE 1", + "func": "IMAGE", + "type": "VISUALIZERS", + "ctrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Image|Grayscale", + "multiple": false, + "desc": "the DataContainer to be visualized" + } + ], + "outputs": [ { - "width": 160, - "height": 160, - "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "type": "LOADERS", - "data": { - "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "label": "LOCAL FILE", - "func": "LOCAL_FILE", - "type": "LOADERS", - "ctrls": { - "file_path": { - "type": "str", - "default": null, - "desc": "The path to the file to be loaded. This can be either an absolute path or\na path relative to the \"nodes\" directory.", - "functionName": "LOCAL_FILE", - "param": "file_path", - "value": "", - "overload": null - }, - "file_type": { - "type": "select", - "default": "Image", - "options": [ - "Image", - "Grayscale", - "JSON", - "CSV" - ], - "desc": "Type of file to load, default = image.\nIf both 'file_path' and 'default' are not specified when 'file_type=\"Image\"',\na default image will be loaded.\nIf the file path is not specified and the default input is not connected,\na ValueError is raised.", - "functionName": "LOCAL_FILE", - "param": "file_type", - "value": "Image", - "overload": null - } - }, - "initCtrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "String", - "multiple": false, - "desc": "If this input node is connected, the file name will be taken from\nthe output of the connected node.\nTo be used in conjunction with batch processing." - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Image|DataFrame|Grayscale", - "desc": "Image for file_type 'image'.\nGrayscale from file_type 'Grayscale'.\nDataFrame for file_type 'json', 'csv'." - } - ], - "pip_dependencies": [ - { - "name": "xlrd", - "v": "2.0.1" - }, - { - "name": "lxml", - "v": "4.9.2" - }, - { - "name": "openpyxl", - "v": "3.0.10" - }, - { - "name": "scikit-image", - "v": "0.21.0" - } - ], - "path": "ETL/LOAD/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.py", - "selected": false - }, - "position": { - "x": 343.70355652854136, - "y": 302.735725612874 - }, - "selected": false, - "positionAbsolute": { - "x": 343.70355652854136, - "y": 302.735725612874 - }, - "dragging": true + "name": "default", + "id": "default", + "type": "Plotly", + "desc": "the DataContainer containing the Plotly Image visualization of the input image" + } + ], + "path": "DATA/VISUALIZATION/PLOTLY/IMAGE/IMAGE.py", + "selected": false + }, + "position": { + "x": 662.8988425018024, + "y": 513.5775685841171 + }, + "selected": false, + "positionAbsolute": { + "x": 662.8988425018024, + "y": 513.5775685841171 + }, + "dragging": true + }, + { + "width": 160, + "height": 160, + "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "type": "LOADERS", + "data": { + "id": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "label": "LOCAL FILE", + "func": "LOCAL_FILE", + "type": "LOADERS", + "ctrls": { + "file_path": { + "type": "str", + "default": null, + "desc": "The path to the file to be loaded. This can be either an absolute path or\na path relative to the \"nodes\" directory.", + "functionName": "LOCAL_FILE", + "param": "file_path", + "value": "", + "overload": null }, + "file_type": { + "type": "select", + "default": "Image", + "options": ["Image", "Grayscale", "JSON", "CSV"], + "desc": "Type of file to load, default = image.\nIf both 'file_path' and 'default' are not specified when 'file_type=\"Image\"',\na default image will be loaded.\nIf the file path is not specified and the default input is not connected,\na ValueError is raised.", + "functionName": "LOCAL_FILE", + "param": "file_type", + "value": "Image", + "overload": null + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "String", + "multiple": false, + "desc": "If this input node is connected, the file name will be taken from\nthe output of the connected node.\nTo be used in conjunction with batch processing." + } + ], + "outputs": [ { - "width": 150, - "height": 180, - "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", - "type": "COMPUTER_VISION", - "data": { - "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", - "label": "IMAGE SMOOTHING", - "func": "IMAGE_SMOOTHING", - "type": "COMPUTER_VISION", - "ctrls": { - "kernel": { - "type": "int", - "default": 5, - "desc": "The strength of the smoothing (larger = stronger smoothing).", - "overload": null, - "functionName": "IMAGE_SMOOTHING", - "param": "kernel", - "value": 10 - }, - "smoothing_type": { - "type": "select", - "options": [ - "average", - "gaussian", - "median", - "bilateral" - ], - "default": "average", - "desc": "The type of smoothing function to use.", - "overload": null, - "functionName": "IMAGE_SMOOTHING", - "param": "smoothing_type", - "value": "average" - } - }, - "initCtrls": {}, - "inputs": [ - { - "name": "default", - "id": "default", - "type": "Image", - "multiple": false, - "desc": "The input image to apply smoothing to." - } - ], - "outputs": [ - { - "name": "default", - "id": "default", - "type": "Image", - "desc": "The smoothed image." - } - ], - "pip_dependencies": [ - { - "name": "opencv-python-headless", - "v": "4.8.1.78" - } - ], - "path": "COMPUTER_VISION/IMAGE_SMOOTHING/IMAGE_SMOOTHING.py" - }, - "position": { - "x": 716.1329930780284, - "y": 184.36374527852246 - }, - "selected": false, - "positionAbsolute": { - "x": 716.1329930780284, - "y": 184.36374527852246 - }, - "dragging": true + "name": "default", + "id": "default", + "type": "Image|DataFrame|Grayscale", + "desc": "Image for file_type 'image'.\nGrayscale from file_type 'Grayscale'.\nDataFrame for file_type 'json', 'csv'." } - ], - "edges": [ + ], + "pip_dependencies": [ { - "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "sourceHandle": "default", - "target": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", - "targetHandle": "default", - "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94cdefault" + "name": "xlrd", + "v": "2.0.1" }, { - "source": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", - "sourceHandle": "default", - "target": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", - "targetHandle": "default", - "id": "reactflow__edge-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default-IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181default" + "name": "lxml", + "v": "4.9.2" }, { - "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", - "sourceHandle": "default", - "target": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", - "targetHandle": "default", - "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default" + "name": "openpyxl", + "v": "3.0.10" + }, + { + "name": "scikit-image", + "v": "0.21.0" + } + ], + "path": "ETL/LOAD/LOCAL_FILE_SYSTEM/LOCAL_FILE/LOCAL_FILE.py", + "selected": false + }, + "position": { + "x": 343.70355652854136, + "y": 302.735725612874 + }, + "selected": false, + "positionAbsolute": { + "x": 343.70355652854136, + "y": 302.735725612874 + }, + "dragging": true + }, + { + "width": 150, + "height": 180, + "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "type": "COMPUTER_VISION", + "data": { + "id": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "label": "IMAGE SMOOTHING", + "func": "IMAGE_SMOOTHING", + "type": "COMPUTER_VISION", + "ctrls": { + "kernel": { + "type": "int", + "default": 5, + "desc": "The strength of the smoothing (larger = stronger smoothing).", + "overload": null, + "functionName": "IMAGE_SMOOTHING", + "param": "kernel", + "value": 10 + }, + "smoothing_type": { + "type": "select", + "options": ["average", "gaussian", "median", "bilateral"], + "default": "average", + "desc": "The type of smoothing function to use.", + "overload": null, + "functionName": "IMAGE_SMOOTHING", + "param": "smoothing_type", + "value": "average" + } + }, + "initCtrls": {}, + "inputs": [ + { + "name": "default", + "id": "default", + "type": "Image", + "multiple": false, + "desc": "The input image to apply smoothing to." + } + ], + "outputs": [ + { + "name": "default", + "id": "default", + "type": "Image", + "desc": "The smoothed image." + } + ], + "pip_dependencies": [ + { + "name": "opencv-python-headless", + "v": "4.8.1.78" } - ], - "viewport": { - "x": 0, - "y": 0, - "zoom": 1 - } - }, - "textNodes": [] -} \ No newline at end of file + ], + "path": "COMPUTER_VISION/IMAGE_SMOOTHING/IMAGE_SMOOTHING.py" + }, + "position": { + "x": 716.1329930780284, + "y": 184.36374527852246 + }, + "selected": false, + "positionAbsolute": { + "x": 716.1329930780284, + "y": 184.36374527852246 + }, + "dragging": true + } + ], + "edges": [ + { + "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "sourceHandle": "default", + "target": "IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94c", + "targetHandle": "default", + "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE-0b7bb803-8dba-43eb-a9bf-4073b3fda94cdefault" + }, + { + "source": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "sourceHandle": "default", + "target": "IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181", + "targetHandle": "default", + "id": "reactflow__edge-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default-IMAGE-7aacbaca-2652-4c99-babe-5779ba0ce181default" + }, + { + "source": "LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aac", + "sourceHandle": "default", + "target": "IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559", + "targetHandle": "default", + "id": "reactflow__edge-LOCAL_FILE-7e9953b7-3ab4-425f-80aa-2178c3508aacdefault-IMAGE_SMOOTHING-6d4d6f9d-941e-4cbd-9c45-0e8a8c5f7559default" + } + ], + "viewport": { + "x": 0, + "y": 0, + "zoom": 1 + } + }, + "textNodes": [] +} diff --git a/src/renderer/routes/flow_chart/FlowChartTabView.tsx b/src/renderer/routes/flow_chart/FlowChartTabView.tsx index dd996e78a..e68cdf0f9 100644 --- a/src/renderer/routes/flow_chart/FlowChartTabView.tsx +++ b/src/renderer/routes/flow_chart/FlowChartTabView.tsx @@ -55,7 +55,11 @@ import { TooltipProvider, TooltipTrigger, } from "@src/components/ui/tooltip"; -import { manifestChangedAtom, useManifest, useNodesMetadata } from "@src/hooks/useManifest"; +import { + manifestChangedAtom, + useManifest, + useNodesMetadata, +} from "@src/hooks/useManifest"; import { ElementsData } from "@src/types"; import { createNodeId, createNodeLabel } from "@src/utils/NodeUtils"; import useKeyboardShortcut from "@src/hooks/useKeyboardShortcut"; @@ -417,8 +421,9 @@ const FlowChartTab = () => {
({ ? nameSelector(selectedDevice) : undefined; - return (