本文整理汇总了C#中Profile.WriteValue方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.WriteValue方法的具体用法?C# Profile.WriteValue怎么用?C# Profile.WriteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile.WriteValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetTempOffset
public void SetTempOffset(double offset)
{
// Verify valid parameters
if (offset < -10 || offset > 10)
throw new ApplicationException("SetTempOffset requires a number between -10 and 10." + offset + " was received.");
Profile p = new Profile();
p.DeviceType = "Focuser";
p.WriteValue(Gemini.SharedResources.SharedProfileDriverID, "Focuser Temp Offset", offset.ToString());
TempOffset = offset;
}
示例2: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Dome";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, comPortProfileName, comPort.ToString());
}
}
示例3: SetTempCoeffName
public void SetTempCoeffName(char mode, string newName)
{
// Verify valid parameters
if (mode < 'A' || mode > 'E')
throw new ApplicationException("SetTempCoeffName requires a mode parameter between 'A' and 'E'. " + mode + " was received.");
Profile p = new Profile();
p.DeviceType = "Focuser";
p.WriteValue(Gemini.SharedResources.SharedProfileDriverID, "Focuser Temp Coeff Name " + mode, newName);
}
示例4: cmdOK_Click
// OK button event handler
private void cmdOK_Click(object sender, EventArgs e)
{
// Place any validation constraint checks here
if(!CheckTelescopeRegistration())
{
throw new Exception("Telescope not chosen");
}
using (ASCOM.Utilities.Profile p = new Profile())
{
p.DeviceType = "Dome";
p.WriteValue(Dome.driverID, "comPort", (string)DomeCOMcomboBox.SelectedItem);
}
Dispose();
//if(DomeCOMcomboBox.SelectedItem.ToString().Contains("COM"))
//{
// Dome.comPort=(string)DomeCOMcomboBox.SelectedItem;
// try
// {
// Dome.Connected.set(true);
// }
// catch(Exception ex)
// {
// throw ex;
// }
//}
//Dome.comPort = DomeCOMTextBox.Text; // Update the state variables with results from the dialogue
//Dome.traceState = chkTrace.Checked;
}
示例5: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Camera";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, gainStateProfileName, gainState.ToString());
driverProfile.WriteValue(driverID, offsetStateProfileName, offsetState.ToString());
driverProfile.WriteValue(driverID, onTopStateProfileName, onTopState.ToString());
driverProfile.WriteValue(driverID, coolerEnabledStateProfileName, coolerEnabledState.ToString());
driverProfile.WriteValue(driverID, coolerComPortStateProfileName, coolerComPortState.ToString());
driverProfile.WriteValue(driverID, baudrateAdjustStateProfileName, baudrateAdjustState.ToString());
}
}
示例6: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Telescope";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, comPortProfileName, comPort.ToString());
driverProfile.CreateSubKey(driverID, "Capabilities");
}
}
示例7: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = this.deviceType;
driverProfile.WriteValue(this.driverId, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(this.driverId, tcpPortProfileName, tcpPort.ToString());
}
}
示例8: HubFocuserRev2
static HubFocuserRev2()
{
// Get the connections settings from profile.
EventLogger.LogMessage("Constructing STATIC HubFocuser class.", System.Diagnostics.TraceLevel.Info);
Profile p = new Profile();
p.DeviceType = "Focuser";
PopulateFocuserTypes();
connectionMethod = (ConnectionMethods)Enum.Parse(typeof(ConnectionMethods),
p.GetValue(pDriverID, pConnMeth, "", ConnectionMethods.Serial.ToString()));
// Add note to inform users that the second profile item is not used to hold settings...
string msg = "This profile item is not used to store any settings. It's only purpose is to link " +
" the FocusLynx Focuser 2, shown in the chooser, to a ProgID used for COM object creation.";
p.WriteValue(pUnusedDriverID, "Note:", msg);
// Initialize the hubFocusers
instance1 = new HubFocuserRev2(FOCUSER_NUMBER.ONE);
instance2 = new HubFocuserRev2(FOCUSER_NUMBER.TWO);
setupFocuserCommunicator();
}
示例9: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Telescope";
driverProfile.WriteValue(driverID, "traceState", traceState.ToString());
driverProfile.WriteValue(driverID, "comPort", comPort.ToString());
driverProfile.WriteValue(driverID, "rightAscensionSideralRatePlus", rightAscensionSideralRatePlus.ToString());
driverProfile.WriteValue(driverID, "rightAscensionSideralRateMinus", rightAscensionSideralRateMinus.ToString());
driverProfile.WriteValue(driverID, "declinationSideralRatePlus", declinationSideralRatePlus.ToString());
driverProfile.WriteValue(driverID, "declinationSideralRateMinus", declinationSideralRateMinus.ToString());
}
}
示例10: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Video";
driverProfile.WriteValue(m_driverID, m_traceStateProfileName, m_traceState.ToString());
driverProfile.WriteValue(m_driverID, m_ccdDriverProgIdProfileName, m_ccdDriverProgId.ToString());
}
}
示例11: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Camera";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, gainStateProfileName, gainState.ToString());
driverProfile.WriteValue(driverID, offsetStateProfileName, offsetState.ToString());
driverProfile.WriteValue(driverID, onTopStateProfileName, onTopState.ToString());
driverProfile.WriteValue(driverID, slowCoolingEnabledProfileName, slowCoolingEnabledState.ToString());
driverProfile.WriteValue(driverID, slowCoolingSpeedProfileName, slowCoolingSpeedState.ToString());
}
}
示例12: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Focuser";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, comPortProfileName, comPort.ToString());
driverProfile.WriteValue(driverID, TempCoeffProfileName, TempCoeff.ToString());
driverProfile.WriteValue(driverID, TempCompEnabledProfileName, TempCompEnabled.ToString());
driverProfile.WriteValue(driverID, MaxVelProfileName, MaxVel.ToString());
driverProfile.WriteValue(driverID, AccelProfileName, Accel.ToString());
driverProfile.WriteValue(driverID, IdleOffProfileName, IdleOff.ToString());
driverProfile.WriteValue(driverID, ReverseProfileName, Reverse.ToString());
driverProfile.WriteValue(driverID, HomeProfileName, Home.ToString());
driverProfile.WriteValue(driverID, InvertHomeProfileName, InvertHome.ToString());
driverProfile.WriteValue(driverID, HomeDirectionProfileName, HomeDirection.ToString());
driverProfile.WriteValue(driverID, HomeVelProfileName, HomeVel.ToString());
driverProfile.WriteValue(driverID, HomeUseSwitchProfileName, HomeUseSwitch.ToString());
driverProfile.WriteValue(driverID, HomeDistanceProfileName, HomeDistance.ToString());
driverProfile.WriteValue(driverID, HomePositionProfileName, HomePosition.ToString());
}
}
示例13: writeSettings
/// <summary>
/// Write settings to ASCOM profile storage
/// </summary>
public void writeSettings()
{
tl.LogMessage("Switch_writeSettings", "Enter");
using (Profile p = new Profile())
{
p.DeviceType = "Switch";
p.WriteValue(IP9212_switch_id, ip_addr_profilename, ip_addr);
p.WriteValue(IP9212_switch_id, ip_port_profilename, ip_port);
p.WriteValue(IP9212_switch_id, ip_login_profilename, ip_login);
p.WriteValue(IP9212_switch_id, ip_pass_profilename, ip_pass);
p.WriteValue(IP9212_switch_id, switch_port_profilename, switch_roof_port.ToString());
p.WriteValue(IP9212_switch_id, opened_port_profilename, opened_sensor_port.ToString());
p.WriteValue(IP9212_switch_id, closed_port_profilename, closed_sensor_port.ToString());
p.WriteValue(IP9212_switch_id, telescope_power_port_profilename, telescope_power_port.ToString());
p.WriteValue(IP9212_switch_id, focuser_power_port_profilename, focuser_power_port.ToString());
p.WriteValue(IP9212_switch_id, heating_port_profilename, heating_port.ToString());
p.WriteValue(IP9212_switch_id, roof_power_port_profilename, roofpower_port.ToString());
p.WriteValue(IP9212_switch_id, telescope_power_port_state_type_profilename, telescope_power_port_state_type.ToString());
p.WriteValue(IP9212_switch_id, focuser_power_port_state_type_profilename, focuser_power_port_state_type.ToString());
p.WriteValue(IP9212_switch_id, heating_port_state_type_profilename, heating_port_state_type.ToString());
p.WriteValue(IP9212_switch_id, roof_power_port_state_type_profilename, roofpower_port_state_type.ToString());
p.WriteValue(IP9212_switch_id, traceStateProfileName, traceState.ToString());
}
tl.LogMessage("Switch_writeSettings", "Exit");
}
示例14: WriteProfile
/// <summary>
/// Write the device configuration to the ASCOM Profile store
/// </summary>
internal void WriteProfile()
{
tl.LogMessage("WriteProfile", "Enter");
using (Profile driverProfile = new Profile())
{
driverProfile.DeviceType = "Dome";
driverProfile.WriteValue(driverID, traceStateProfileName, traceState.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.ip_addr_profilename, IP9212_switch_class.ip_addr);
driverProfile.WriteValue(driverID, IP9212_switch_class.ip_port_profilename, IP9212_switch_class.ip_port);
driverProfile.WriteValue(driverID, IP9212_switch_class.ip_login_profilename, IP9212_switch_class.ip_login);
driverProfile.WriteValue(driverID, IP9212_switch_class.ip_pass_profilename, IP9212_switch_class.ip_pass);
driverProfile.WriteValue(driverID, IP9212_switch_class.switch_port_profilename, IP9212_switch_class.switch_roof_port.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.opened_port_profilename, IP9212_switch_class.opened_sensor_port.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.closed_port_profilename, IP9212_switch_class.closed_sensor_port.ToString());
driverProfile.WriteValue(driverID, MyWebClient.NETWORK_TIMEOUT_profilename, MyWebClient.NETWORK_TIMEOUT.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.CACHE_CHECKCONNECTED_INTERVAL_profilename, IP9212_switch_class.CACHE_CHECKCONNECTED_INTERVAL.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.CACHE_SHUTTERSTATUS_INTERVAL_NORMAL_profilename, IP9212_switch_class.CACHE_SHUTTERSTATUS_INTERVAL_NORMAL.ToString());
driverProfile.WriteValue(driverID, IP9212_switch_class.CACHE_SHUTTERSTATUS_INTERVAL_REDUCED_profilename, IP9212_switch_class.CACHE_SHUTTERSTATUS_INTERVAL_REDUCED.ToString());
}
tl.LogMessage("Switch_writeSettings", "Exit");
tl.LogMessage("WriteProfile", "Exit");
}