コード例 #1
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    AutoShuntCalResult WirelessNode_Impl::autoShuntCal(const ChannelMask& mask, const ShuntCalCmdInfo& commandInfo)
    {
        //verify the node supports this operation
        if(!features().supportsAutoShuntCal())
        {
            throw Error_NotSupported("AutoShuntCal is not supported by this Node.");
        }

        //verify the channel mask supports this operation
        if(!features().supportsChannelSetting(WirelessTypes::chSetting_autoShuntCal, mask))
        {
            throw Error_NotSupported("AutoShuntCal is not supported by the provided channel(s).");
        }

        uint8 channel = mask.lastChEnabled();
        WirelessTypes::ChannelType chType = features().channelType(channel);

        AutoShuntCalResult result;
        bool success = m_baseStation.node_autoShuntCal(m_address, commandInfo, channel, model(), chType, result);

        if(!success)
        {
            throw Error_NodeCommunication(m_address, "AutoShuntCal has failed.");
        }

        return result;
    }
コード例 #2
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    AutoCalResult_shmLink WirelessNode_Impl::autoCal_shmLink()
    {
        WirelessModels::NodeModel nodeModel = features().m_nodeInfo.model();

        //verify the node supports autocal
        if(!features().supportsAutoCal())
        {
            throw Error_NotSupported("AutoCal is not supported by this Node.");
        }

        //verify the node is the correct model
        if(nodeModel != WirelessModels::node_shmLink2 &&
           nodeModel != WirelessModels::node_shmLink2_cust1)
        {
            throw Error_NotSupported("autoCal_shmLink is not supported by this Node's model.");
        }

        //perform the autocal command by the base station
        AutoCalResult_shmLink result;
        bool success = m_baseStation.node_autocal_shm(m_address, result);

        if(!success)
        {
            throw Error_NodeCommunication(m_address, "AutoCal has failed.");
        }

        return result;
    }
コード例 #3
0
    std::unique_ptr<BaseStationFeatures> BaseStationFeatures::create(BaseStationInfo& info)
    {
        switch(info.model())
        {
            case WirelessModels::base_wsdaBase_104_usb:
                return std::unique_ptr<BaseStationFeatures>(new BaseStationFeatures_usb(info));

            case WirelessModels::base_wsdaBase_101_analog:
                return std::unique_ptr<BaseStationFeatures>(new BaseStationFeatures_analog(info));

            case WirelessModels::base_wsdaBase_102_rs232:
                return std::unique_ptr<BaseStationFeatures>(new BaseStationFeatures_rs232(info));

            case WirelessModels::base_wsdaBase_oem:
                return std::unique_ptr<BaseStationFeatures>(new BaseStationFeatures_oem(info));

            case WirelessModels::base_wsda_1000:
            case WirelessModels::base_wsda_1500:
            case WirelessModels::base_wsda_2000:
                return std::unique_ptr<BaseStationFeatures>(new BaseStationFeatures_wsda(info));

            default:
                //we don't know anything about this node, throw an exception
                throw Error_NotSupported("The BaseStation model (" + Utils::toStr(info.model()) + ") is not supported by MSCL.");
        }
    }
コード例 #4
0
    const WirelessTypes::WirelessSampleRates NodeFeatures_vlink200::sampleRates(WirelessTypes::SamplingMode samplingMode, WirelessTypes::DataCollectionMethod dataCollectionMethod) const
    {
        //the list of sample rates varies for each sampling mode
        switch(samplingMode)
        {
        case WirelessTypes::samplingMode_nonSync:
            if(dataCollectionMethod == WirelessTypes::collectionMethod_logOnly)
            {
                return AvailableSampleRates::continuous_log_gen2;
            }
            else
            {
                return AvailableSampleRates::continuous_nonSync_gen2;
            }

        case WirelessTypes::samplingMode_sync:
            if(dataCollectionMethod == WirelessTypes::collectionMethod_logOnly) 
            {
                return AvailableSampleRates::continuous_log_gen2;
            }
            else
            {
                return AvailableSampleRates::continuous_sync_gen2;
            }

        case WirelessTypes::samplingMode_syncBurst:
        case WirelessTypes::samplingMode_syncEvent:
            return AvailableSampleRates::burst_gen2;

        default:
            throw Error_NotSupported("The sampling mode is not supported by this Node");
        }
    }
コード例 #5
0
 void BaseStationEepromHelper::checkAnalogPairingSupported() const
 {
     //check analog pairing is supported
     if(!m_baseStation->features().supportsAnalogPairing())
     {
         throw Error_NotSupported("Analog Pairing is not supported by this BaseStation.");
     }
 }
コード例 #6
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    uint16 WirelessNode_Impl::getDiagnosticInterval() const
    {
        if(!features().supportsDiagnosticInfo())
        {
            throw Error_NotSupported("Diagnostic Info is not supported by this Node.");
        }

        return m_eepromHelper->read_diagnosticInterval();
    }
コード例 #7
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    uint32 WirelessNode_Impl::getSensorDelay() const
    {
        if(!features().supportsSensorDelayConfig())
        {
            throw Error_NotSupported("Sensor Delay is not supported by this Node.");
        }

        return m_eepromHelper->read_sensorDelay();
    }
コード例 #8
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    uint32 WirelessNode_Impl::getNumSweeps() const
    {
        //if the node doesn't support limited number of sweeps
        if(!features().supportsLimitedDuration())
        {
            throw Error_NotSupported("The Number of Sweeps is not supported by this Ndoe.");
        }

        return m_eepromHelper->read_numSweeps();
    }
コード例 #9
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    uint16 WirelessNode_Impl::getLostBeaconTimeout() const
    {
        //if the node doesn't support lost beacon timeout
        if(!features().supportsLostBeaconTimeout())
        {
            throw Error_NotSupported("Lost Beacon Timeout is not supported by this Node.");
        }

        return m_eepromHelper->read_lostBeaconTimeout();
    }
コード例 #10
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    TimeSpan WirelessNode_Impl::getTimeBetweenBursts() const
    {
        //if the node doesn't support burst mode
        if(!features().supportsSamplingMode(WirelessTypes::samplingMode_syncBurst))
        {
            throw Error_NotSupported("Burst Sampling is not supported by this Node.");
        }

        return m_eepromHelper->read_timeBetweenBursts();
    }
コード例 #11
0
ファイル: ChannelGroup.cpp プロジェクト: estump/MSCL
	const EepromLocation& ChannelGroup::getSettingEeprom(WirelessTypes::ChannelGroupSetting setting) const
	{
		try
		{
			return m_settingsMap.at(setting);
		}
		catch(std::out_of_range&)
		{
			throw Error_NotSupported("The requested setting is not supported for this ChannelGroup.");
		}
	}
コード例 #12
0
const WirelessTypes::WirelessSampleRates NodeFeatures_cfBearing::sampleRates(WirelessTypes::SamplingMode samplingMode, WirelessTypes::DataCollectionMethod dataCollectionMethod) const
{
    //the list of sample rates varies for each sampling mode
    switch(samplingMode)
    {
    case WirelessTypes::samplingMode_nonSync:
        return AvailableSampleRates::continuous_cfBearing;

    default:
        throw Error_NotSupported("The sampling mode is not supported by this Node");
    }
}
コード例 #13
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    EventTriggerOptions WirelessNode_Impl::getEventTriggerOptions() const
    {
        //if the node doesn't support event trigger options
        if(!features().supportsEventTrigger())
        {
            throw Error_NotSupported("Event Trigger is not supported by this Node.");
        }

        EventTriggerOptions result;
        m_eepromHelper->read_eventTriggerOptions(result);
        return result;
    }
コード例 #14
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    ActivitySense WirelessNode_Impl::getActivitySense() const
    {
        //if the node doesn't support activity sense options
        if(!features().supportsActivitySense())
        {
            throw Error_NotSupported("ActivitySense configuration is not supported by this Node.");
        }

        ActivitySense result;
        m_eepromHelper->read_activitySense(result);
        return result;
    }
コード例 #15
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    HistogramOptions WirelessNode_Impl::getHistogramOptions() const
    {
        //if the node doesn't support histogram options
        if(!features().supportsHistogramConfig())
        {
            throw Error_NotSupported("HistogramOptions configuration is not supported by this Node.");
        }

        HistogramOptions result;
        m_eepromHelper->read_histogramOptions(result);
        return result;
    }
コード例 #16
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    FatigueOptions WirelessNode_Impl::getFatigueOptions() const
    {
        //if the node doesn't support fatigue options
        if(!features().supportsFatigueConfig())
        {
            throw Error_NotSupported("FatigueOptions configuration is not supported by this Node.");
        }

        FatigueOptions result;
        m_eepromHelper->read_fatigueOptions(result);
        return result;
    }
コード例 #17
0
    const WirelessTypes::WirelessSampleRates NodeFeatures_iepeLink::sampleRates(WirelessTypes::SamplingMode samplingMode, WirelessTypes::DataCollectionMethod dataCollectionMethod) const
    {
        //the list of sample rates varies for each sampling mode
        switch(samplingMode)
        {        
        case WirelessTypes::samplingMode_syncBurst:
            return AvailableSampleRates::burst_iepeLink;

        default:
            throw Error_NotSupported("The sampling mode is not supported by this Node");
        }
    }
コード例 #18
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    void WirelessNode_Impl::clearHistogram()
    {
        //if the node doesn't support histogram options
        if(!features().supportsHistogramConfig())
        {
            throw Error_NotSupported("Histogram configuration is not supported by this Node.");
        }

        m_eepromHelper->clearHistogram();

        //must cycle power for the clearing to take affect
        cyclePower();
    }
コード例 #19
0
ファイル: InputRange.cpp プロジェクト: LORD-MicroStrain/MSCL
    uint16 InputRange::inputRangeToEepromVal(WirelessTypes::InputRange range, WirelessModels::NodeModel nodeType, WirelessTypes::ChannelType channelType)
    {
        const InputRangeMap& ranges = getRangeMap(nodeType, channelType);

        for(auto& r : ranges)
        {
            if(r.second == range)
            {
                return r.first;
            }
        }

        throw Error_NotSupported("Invalid Input Range Value");
    }
コード例 #20
0
    BaseStationButton BaseStationEepromHelper::read_button(uint8 buttonNumber, BaseStationButton::UserAction action) const
    {
        //check buttons are supported
        if(!m_baseStation->features().supportsButtons())
        {
            throw Error_NotSupported("Button Configuration is not supported by this BaseStation.");
        }

        //find the eeprom locations to read from
        EepromLocation funcEeprom = BaseStationEepromMap::buttonFuncEeprom(buttonNumber, action);
        EepromLocation nodeEeprom = BaseStationEepromMap::buttonNodeEeprom(buttonNumber, action);

        //read the function and node and build a button
        return BaseStationButton(static_cast<BaseStationButton::Command>(read(funcEeprom).as_uint16()), read(nodeEeprom).as_uint16());
    }
コード例 #21
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    void WirelessNode_Impl::getDiagnosticInfo(ChannelData& result)
    {
        //verify the node supports this operation
        if(!features().supportsGetDiagnosticInfo())
        {
            throw Error_NotSupported("The Get Diagnostic Info command is not supported by this Node.");
        }

        bool success = m_baseStation.node_getDiagnosticInfo(m_address, result);

        if(!success)
        {
            throw Error_NodeCommunication(m_address, "Get Diagnostic Info has failed.");
        }
    }
コード例 #22
0
ファイル: WirelessNode_Impl.cpp プロジェクト: crosvera/MSCL
    WirelessTypes::StorageLimitMode WirelessNode_Impl::getStorageLimitMode() const
    {
        if(!features().supportsLoggedData())
        {
            throw Error_NotSupported("Datalogging is not supported by this Node.");
        }

        if(!features().supportsStorageLimitModeConfig())
        {
            //legacy nodes don't support this eeprom, but are
            //hard coded to stop when the storage limit is reached.
            return WirelessTypes::storageLimit_stop;
        }

        return m_eepromHelper->read_storageLimitMode();
    }
コード例 #23
0
    void BaseStationEepromHelper::write_button(uint8 buttonNumber, BaseStationButton::UserAction action, const BaseStationButton& btn)
    {
        //check buttons are supported
        if(!m_baseStation->features().supportsButtons())
        {
            throw Error_NotSupported("Button Configuration is not supported by this BaseStation.");
        }

        //find the eeprom locations to write to
        EepromLocation funcEeprom = BaseStationEepromMap::buttonFuncEeprom(buttonNumber, action);
        EepromLocation nodeEeprom = BaseStationEepromMap::buttonNodeEeprom(buttonNumber, action);

        //write the button's function/command
        write(funcEeprom, Value::UINT16(static_cast<uint16>(btn.command())));

        //write the button's node address
        write(nodeEeprom, Value::UINT16(btn.nodeAddress()));
    }
コード例 #24
0
    const WirelessTypes::WirelessSampleRates NodeFeatures_vlink_legacy::sampleRates(WirelessTypes::SamplingMode samplingMode, WirelessTypes::DataCollectionMethod dataCollectionMethod) const
    {
        //the list of sample rates varies for each sampling mode
        switch(samplingMode)
        {
        case WirelessTypes::samplingMode_nonSync:
        case WirelessTypes::samplingMode_sync:
            return AvailableSampleRates::continuous;
        
        case WirelessTypes::samplingMode_syncBurst:
            return AvailableSampleRates::burst;

        case WirelessTypes::samplingMode_armedDatalog:
            return AvailableSampleRates::armedDatalog;

        default:
            throw Error_NotSupported("The sampling mode is not supported by this Node");
        }
    }
コード例 #25
0
    DatalogDownloader::DatalogDownloader(const WirelessNode& node):
        m_node(node),
        m_foundFirstTrigger(false),
        m_outOfMemory(false),
        m_sweepCount(0)
    {
        //verify the node supports logged data
        if(!node.features().supportsLoggedData())
        {
            throw Error_NotSupported("Logging is not supported by this Node.");
        }

        m_datalogDownloadVersion = m_node.features().datalogDownloadVersion();

        if(m_datalogDownloadVersion == 1)
        {
            //get the datalogging information from the Node
            uint16 logPage = m_node.eepromHelper().read_logPage();
            uint16 pageOffset = m_node.eepromHelper().read_logPageOffset();

            //create the NodeMemory object (v1)
            m_nodeMemory.reset(new NodeMemory_v1(m_node, logPage, pageOffset));
        }
        else
        {
            //get the datalogging session info
            DatalogSessionInfoResult dlInfo;
            if(!m_node.getBaseStation().node_getDatalogSessionInfo(node.protocol(), node.nodeAddress(), dlInfo))
            {
                throw Error_NodeCommunication(m_node.nodeAddress(), "Failed to get the Datalog Session Info");
            }

            //get the FlashInfo
            FlashInfo flashInfo = m_node.eepromHelper().read_flashInfo();

            //create the Node Memory object (v2)
            m_nodeMemory.reset(new NodeMemory_v2(m_node, flashInfo, dlInfo.startAddress, dlInfo.maxLoggedBytes));
        }
    }
コード例 #26
0
ファイル: InputRange.cpp プロジェクト: LORD-MicroStrain/MSCL
    const InputRange::InputRangeMap& InputRange::getRangeMap(WirelessModels::NodeModel nodeType, WirelessTypes::ChannelType channelType)
    {
        switch(nodeType)
        {
            case WirelessModels::node_sgLink:
                return RANGES_SGLINK;

            case WirelessModels::node_sgLink_oem:
            case WirelessModels::node_sgLink_oem_S:
            case WirelessModels::node_sgLink_micro:
            case WirelessModels::node_torqueLink:
                return RANGES_SGLINK_OEM;

            case WirelessModels::node_sgLink_herm:
            case WirelessModels::node_sgLink_herm_2600:
            case WirelessModels::node_sgLink_herm_2700:
            case WirelessModels::node_sgLink_herm_2800:
                return RANGES_SGLINK_HERMETIC;

            case WirelessModels::node_sgLink_rgd:
                return RANGES_SGLINK_RGD;

            case WirelessModels::node_shmLink:
                return RANGES_SHMLINK;

            case WirelessModels::node_vLink:
            case WirelessModels::node_vLink_legacy:
                return RANGES_VLINK;

            case WirelessModels::node_vLink200:
            case WirelessModels::node_vLink200_qbridge_1K:
            case WirelessModels::node_vLink200_qbridge_120:
            case WirelessModels::node_vLink200_qbridge_350:
            case WirelessModels::node_vLink200_hbridge_1K:
            case WirelessModels::node_vLink200_hbridge_120:
            case WirelessModels::node_vLink200_hbridge_350:
                if(channelType == WirelessTypes::chType_fullDifferential)
                {
                    return RANGES_VLINK200_FULLDIFF_CHS;
                }
                else if(channelType == WirelessTypes::chType_singleEnded)
                {
                    return RANGES_VLINK200_SINGLEENDED_CHS;
                }

            case WirelessModels::node_tcLink_1ch:
            case WirelessModels::node_tcLink_3ch:
            case WirelessModels::node_tcLink_6ch:
            case WirelessModels::node_tcLink_6ch_ip67:
            case WirelessModels::node_tcLink_6ch_ip67_rht:
            case WirelessModels::node_envLink_mini:
            case WirelessModels::node_rtdLink:
                return RANGES_TCLINK;

            case WirelessModels::node_envLink_pro:
                if(channelType == WirelessTypes::chType_diffTemperature)
                {
                    return RANGES_ENVLINK_PRO_TEMPERATURE_CHS;
                }
                else if(channelType == WirelessTypes::chType_voltage)
                {
                    return RANGES_ENVLINK_PRO_VOLTAGE_CHS;
                }

            case WirelessModels::node_mvPerVLink:
                return RANGES_MVPVLINK;
        }

        throw Error_NotSupported("Invalid Node Type");
    }